We're here to help!

Dbvrep console output redirected to file is malformed

Follow
Problem Description

Dbvrep command ran against standard output looks following:

 


oracle@dbvlin818.dbvisit.co.nz:/u01/app/oracle/replicate28> ./start-console.sh list status
Initializing......done
DDC loaded from database (405 variables).
Dbvisit Replicate version 2.8.02_rc1
Copyright (C) Dbvisit Software Limited.  All rights reserved.
DDC file /u01/app/oracle/replicate28/replicate28-MINE.ddc loaded.
Status not available in cache; connecting to all processes to get current status.
MINE is running. Currently at plog 1758 and SCN 49450907 (11/01/2016 03:08:12).
Could not connect to APPLY process. Process not started or connection refused.
OK-0: Completed successfully.

 

When redirected to file, its output is malformed:


oracle@dbvlin818.dbvisit.co.nz:/u01/app/oracle/replicate28> ./start-console.sh list status > list_status.txt
oracle@dbvlin818.dbvisit.co.nz:/u01/app/oracle/replicate28> cat list_status.txt
Initializing......done
DDC loaded from database (405 variables).
Dbvisit Replicate version 2.8.02_rc1
Copyright (C) Dbvisit Software Limited.  All rights reserved.
DDC file /u01/app/oracle/replicate28/replicate28-MINE.ddc loaded.
Status not available in cache; connecting to all processes to get
current status.
MINE is running. Currently at plog 1758 and SCN 49452381 (11/01/2016
03:13:09).
Could not connect to APPLY process. Process not started or connection
refused.
OK-0: Completed successfully.

 

Solution

We are aware of this issue, and our developers are working on a fix. You can cheat the redirected output using following trick:


cat << EOF >/tmp/screenrc.$$
logfile $PWD/dbvout.txt
EOF
screen -c /tmp/screenrc.$$ -L ./start-console.sh --silent list status

oracle@dbvlin818.dbvisit.co.nz:/u01/app/oracle/replicate28> cat dbvout.txt Status not available in cache; connecting to all processes to get current status. MINE is running. Currently at plog 1758 and SCN 49462112 (11/01/2016 03:45:36). Could not connect to APPLY process. Process not started or connection refused. OK-0: Completed successfully.

 

If you need to run these commands from crontab, you should run it through script command:


#-----------------------------------------------------------------------
# Run dbvisit console via screen command to get output not to wrap.
# This was a work-around provided by dbvisit support
#-----------------------------------------------------------------------
screenCommand="screen -c ${outputDir}/dbvisitStatus.screenrc \
-L $DDC_DIR/start-console.sh \
--silent read ${outputDir}/dbvisitStatus.scr 1>/dev/null 2>&1 \
"

#-----------------------------------------------------------------------
# When run via cron, screen requires the script command to provide a
# terminal device
#-----------------------------------------------------------------------
script -f -q -c "${screenCommand}" /dev/null 1>/dev/null 2>&1
Have more questions? Submit a request

Comments