Home » RDBMS Server » Backup & Recovery » Script for Backup
Script for Backup [message #349355] Sat, 20 September 2008 12:42 Go to next message
Mimas
Messages: 40
Registered: September 2008
Location: Athens
Member
Hello all,
I am trying to create a script for taking a backup of the DB and the archive logs.
Up to now I have created the following 2 scripts (backup1&2):

[oracle@rater1 ~]$ more backup1
connect target sys/production
run {backup (Database);}
exit;

[oracle@rater1 ~]$ more backup2
/uoarbin/app/oracle/product/9.2/bin/rman @/home/oracle/backup1 >> /tmp/backup.log

crontab -e
0 3 * * * /home/oracle/backup2 >> /tmp/backup.log

Will I need anything else for these scripts to run?
For Oracle 10g I have seen a similar script and it contains the following extra information which I do not know how to find them for Oracle 9i:
export ORACLE_SID=rater
export ORACLE_HOME=/u02/app/oracle/product/10.2.0/db_1
export LD_LIBRARY_PATH=/u02/app/oracle/product/10.2.0/db_1/lib
export PATH=$PATH:/u02/app/oracle/product/10.2.0/db_1/bin
export NLS_LANG=AMERICAN_AMERICA.EL8ISO8859P7

Thnks in advance
Mimas
Re: Script for Backup [message #349357 is a reply to message #349355] Sat, 20 September 2008 12:58 Go to previous message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Those environment variables should be applied to your scripts as well (changing the paths to match your environment).

Also realize that your script ONLY backs up the database and NO archivelogs. At the very least, you should change your script to the following:

run {backup (Database) plus archivelog;}
Previous Topic: Checking block corruption, why in alert it is saying Error in trace file
Next Topic: ORA-01033 - Oracle Initialization in Progress
Goto Forum:
  


Current Time: Mon Nov 25 23:00:47 CST 2024