Help - Search - Members - Calendar
Full Version: Logical backup file name in script
Oracle DBA Forums > Oracle > Oracle Forum
DXBPP_DBA
Hi to All,

We are taking logical backup for database version oracle 8i(8.1.7.4) and its scheduled.I want to generate a file name with date to idnetified by unique date for each day for both LOG and DMP file.Can any one help on this.

Regards
DXBPP_DBA
SteveC
Look for %U %S %T and other variables that UNIX understands and will use to generate unique, threaded, time stamped file names. Oracle docs have it too. Recovery Manager area.
HAL9000
You can select SYSDATE into a variable name using the DUAL pseudo-table, and execute the name as part of the spool command:

sqlplus . . .
select 'invoice_'||to_char(sysdate, 'yymmdd') spoolname from dual
spool '&spoolname'
select stuff . . . .
spool off

Externally, you can easily add the date to a file name:

myfilename= report_`date`_bkup

Or use a format mask (There may be a %day for the day?):

FILENAME=report.`date '+%d%m%y'`
DXBPP_DBA
QUOTE (SteveC @ Jul 14 2008, 07:02 PM) *
Look for %U %S %T and other variables that UNIX understands and will use to generate unique, threaded, time stamped file names. Oracle docs have it too. Recovery Manager area.



Hi Stevec,

Thanks for you are response I need for windows environment.same kind of parameter not RMAN incremental backup but for logical backup..

Regards,
DXBPP_DBA
HAL9000
In Windows, you can add a date in DOS:

echo myfile_%DATE% > myparm.txt
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.