Q

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' 
parms="ENV=(NB_ORA_CLASS={$NB_ORA_CLASS}, 
NB_ORA_CLIENT={$NB_ORA_CLIENT}, 
NB_ORA_SCHED={$NB_ORA_SCHED})"; 
! 

This was first published in October 2003
This Content Component encountered an error

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

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.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close