Problem solve Get help with specific problems with your technologies, process and projects.

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 last published in October 2003

Dig Deeper on Oracle database backup and recovery

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.