Skip to main content

Backing up oracle database example

disk_rman.sh script uses disk_rman.txt that includes rman backup commands.

$ more disk_rman.sh 
#!/bin/bash
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
ORACLE_SID=orcl
LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_BASE
export ORACLE_HOME
export ORACLE_SID
export LD_LIBRARY_PATH
PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin:$ORACLE_HOME/OPatch
export PATH
rman target / @disk_rman.txt



$ more disk_rman.txt 
run
{
allocate channel t1 type disk format '/backup/%d_t%t_s%s_p%p';
backup database;
sql 'alter system switch logfile';
backup archivelog all;
delete archivelog all backed up 2 times to device type disk;
delete obsolete device type DISK;
release channel t1;
}

Comments

Popular posts from this blog