RMAN commands can be entered at RMAN prompt or from OS command line.
For example you can schedule your backup through OS job control utility. You can create a text file and will write your RMAN command in it and invoke like,
$rman TARGET / CMDFILE=commandfile.txt LOG outfile.txt
CMDFILE is same as @
That is, rman target / cmdfile=/export/home/oracle/1.txt
and rman target / @/export/home/oracle/1.txt equivalent.
Directing RMAN Output to a Log File
-------------------------------------
When you run RMAN in command line mode, it sends the output to the terminal. If you specify the LOG option, then RMAN writes the output to a specified log file instead.
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).
Suppose if I use,
rman target / @/export/home/oracle/1.txt log=/export/home/oracle/2.txt
or,
rman target / cmdfile=/export/home/oracle/1.txt log=/export/home/oracle/2.txt
Then rman will not show output in command line rather it will write output to a file 2.txt.
Commands Valid Only in RUN Blocks
--------------------------------------------
The command ALLOCATE CHANNEL and SET NEWNAME FOR DATAFILE is only valid within RUN block.
Commands Not Valid in RUN Blocks
-------------------------------
CONNECT
CONFIGURE
CREATE CATALOG, DROP CATALOG, UPGRADE CATALOG
CREATE SCRIPT, DELETE SCRIPT, REPLACE SCRIPT
LIST
REPORT
Stored Scripts
----------------
A stored script is a block of RMAN job commands that is stored in the recovery catalog. The contents of a stored script are executed within a RUN block.
No comments:
Post a Comment