Home » RDBMS Server » Backup & Recovery » backup script
backup script [message #483249] Fri, 19 November 2010 08:30 Go to next message
patdev
Messages: 59
Registered: August 2008
Member
Hi,

Please check the following is correct or not please:
I want to get log the detail of the outcome? (How can i do that?)
OS : Linux
DB : 10.2.0.4

setenv TNS_ADMIN "/opt/server/DB1/network/admin"
setenv ORACLE_HOME "/opt/server/DB1"
setenv TWO_TASK "DB1"
setenv ORACLE_SID "DB1"
rman @DB1_backup

-- DB1_backup script
run {
# Shutdown database for backups and put into MOUNT mode
shutdown immediate
startup mount
# Allocate channel. Important: This must be done after
# database has been mounted!!!
allocate channel t1 DEVICE TYPE DISK FORMAT '/data/DB1/%U';
# Perform full database backup
backup Database format '/data/DB1/%d_FULL_%U.bck';
# Open database after backup complete
sql 'alter database open';
backup current controlfile;
sql 'ALTER DATABASE BACKUP CONTROLFILE TO TRACE';
release channel t1;
}

[Updated on: Fri, 19 November 2010 08:31]

Report message to a moderator

Re: backup script [message #483250 is a reply to message #483249] Fri, 19 November 2010 08:36 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10694
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Look for rman option
msglog


Edit:
Also look for LOG option. Seems msglog is deprecated, still usable.
Still works with
rman msglog logfileanme <<EOF
allThingsRelatedtoRman
EOF

To use with cmdfile, use this

Quote:
@filename Equivalent to CMDFILE.
LOG = 'filename' Specifies the file where RMAN records its output, that is, the commands that were processed and their results. If you do not specify this argument, then RMAN writes its message log file to standard output. The RMAN output is also stored in the V$RMAN_OUTPUT view (a memory-only view for jobs in progress) and in V$RMAN_STATUS (a control file view for completed jobs and jobs in progress).

The LOG parameter does not cause RMAN to terminate if the specified file cannot be opened. Instead, RMAN writes to standard output.

http://download.oracle.com/docs/cd/B19306_01/backup.102/b14194/rcmsynta013.htm#i80108

[Updated on: Fri, 19 November 2010 08:47]

Report message to a moderator

Re: backup script [message #483274 is a reply to message #483250] Fri, 19 November 2010 11:07 Go to previous messageGo to next message
patdev
Messages: 59
Registered: August 2008
Member
That means if i don;t to spool to log it will write output in the v$rman_output?

Is the rest of the script correct cold backup using RMAN?

thanks
Re: backup script [message #483275 is a reply to message #483274] Fri, 19 November 2010 11:09 Go to previous messageGo to next message
BlackSwan
Messages: 26759
Registered: January 2009
Location: SoCal
Senior Member
>Is the rest of the script correct cold backup using RMAN?
It is OK, if & only if, you can actually restore a functioning database from it.
Re: backup script [message #483293 is a reply to message #483249] Fri, 19 November 2010 14:38 Go to previous message
John Watson
Messages: 8499
Registered: January 2010
Location: Global Village
Senior Member
Hi - is this for a live system, or for your own training purposes? Either way, a few things to think about:

Why are you doing a closed backup? Why not an open backup?
Why have you chosen to launch one channel? Why not two? Or twenty two?
How did you select the directory for the backup set?
Do you really want the entire datbase in one backup set?
When you backup the controlfile to trace, how are you going to identify the trace file? Why not "alter database backup controlfile to trace as 'give it a name' "?
Could you make the script simpler by using cofigured defaults for channel(s) and formats?

Just a few thoughts. Your script will work (and is nicely commented!) but can you justify every line in it?
Previous Topic: RMAN-06429: TARGET database is not compatible with this version of RMAN
Next Topic: Can I make rman inform/fail if there are offline datafiles?
Goto Forum:
  


Current Time: Sat Feb 27 01:44:42 CST 2021