Obtaining datetime from RMAN
I am currently using RMAN8i to backup several databases in our environment. I want to have filenames to include server name, database name and current datetime. It appears that Oracle RMAN does not have filename parameters for datetime but does allow the use of environmental variables. Can I dynamically use an environmental variable inside an RMAN script to obtain the current datetime?
The Recovery Manager Reference Guide (available via the TechNet site at technet.oracle.com
or at tahiti.oracle.com
) can provide you with some information on this subject. The specific link to this guide is here
, but you will not be able to access it without an account id (which is free to set up).
Here's some basic information:
The only system-independent, legal environment variables in RMAN quoted strings are ? for the Oracle home and @ for the SID. However, you can use operating system specific environment variables on the target system within quoted strings. The environment variables are interpreted by the database server and not the RMAN client.
Check out the PARMS clause with the ENV option to see if you can't get what you need there. The following brief example comes from MetaLink:
rman << !
allocate channel t1 type 'SBT_TAPE'
This was first published in October 2003