|
$rman target / Recovery Manager: Release 10.2.0.4.0 - Production on Wed Feb 9 17:00:50 2011Copyright (c) 1982, 2007, Oracle. All rights reserved. connected to target database: TESTDB2 (DBID=1024880953) RMAN> show all; using target database control file instead of recovery catalog RMAN configuration parameters are: CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default CONFIGURE BACKUP OPTIMIZATION OFF; # default CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default CONFIGURE CONTROLFILE AUTOBACKUP ON; CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/oracle/database/backup/rman/testdb2/ctl_%F'; CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE MAXSETSIZE TO UNLIMITED; # default CONFIGURE ENCRYPTION FOR DATABASE OFF; # default CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/database/product/10.2.0/db_1/dbs/snapcf_testdb2.f'; # default RMAN> |
|
$cat rman_testdb2_full.sh #!/bin/bash export ORACLE_BASE=/oracle/database export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1 export PATH=$PATH:$ORACLE_HOME/bin export ORACLE_SID=testdb2 rman_backup_script=/home/oracle/db_script/rman/testdb2/ rman_backup_dir=/oracle/database/backup/rman/testdb2/ dt=`date +%F` rman target / >>$rman_backup_script/rman_${ORACLE_SID}_full_${dt}.log < } run{ crosscheck backup; crosscheck backupset; delete noprompt expired backup; delete noprompt obsolete; } exit EOF |
|
$cat rman_testdb2_level0.sh #!/bin/bash export ORACLE_BASE=/oracle/database export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1 export PATH=$PATH:$ORACLE_HOME/bin export ORACLE_SID=testdb2 rman_backup_script=/home/oracle/db_script/rman/testdb2/ rman_backup_dir=/oracle/database/backup/rman/testdb2/ dt=`date +%F` rman target / >>$rman_backup_script/rman_${ORACLE_SID}_level0_${dt}.log < } run{ crosscheck backup; crosscheck backupset; delete noprompt expired backup; delete noprompt obsolete; } exit EOF |
|
RMAN> show all; RMAN configuration parameters are: CONFIGURE RETENTION POLICY TO REDUNDANCY 1; CONFIGURE BACKUP OPTIMIZATION OFF; # default CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default CONFIGURE CONTROLFILE AUTOBACKUP ON; CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/oracle/backup/ccit1/rmanbackup/ctl_%F'; CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE MAXSETSIZE TO UNLIMITED; # default CONFIGURE ENCRYPTION FOR DATABASE OFF; # default CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/database/10.2.0/db_1/dbs/snapcf_ccit11.f'; |
|
$cat ccit1_level0.sh #!/bin/bash export ORACLE_SID=ccit11 export ORACLE_BASE=/oracle/database export ORACLE_HOME=$ORACLE_BASE/10.2.0/db_1 export ORA_CRS_HOME=$ORACLE_BASE/10.2.0/crs_1 export LD_LIBRARY_PATH=$ORACLE_HOME/lib export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin dt=`date +%m%d` rman target / >> /home/oracle/db_script/rman/ccit1_level0_$dt.log << EOF run{ allocate channel ch1 type disk connect sys/system08ccit1@ccit11; allocate channel ch2 type disk connect sys/system08ccit1@ccit12; backup as compressed backupset incremental level 0 database format '/oracle/backup/ccit1/rmanbackup/db_%d_%T_%s_%p_%t' plus archivelog format='/oracle/backup/ccit1/rmanbackup/arch_%d_%T_%s_%p_%t' delete all input; backup spfile format '/oracle/backup/ccit1/rmanbackup/spf_%d_%T_%s_%c'; release channel ch1; release channel ch2; } run{ allocate channel ch1 type disk connect sys/system08ccit1@ccit11; allocate channel ch2 type disk connect sys/system08ccit1@ccit12; crosscheck backup; delete noprompt expired backup; delete noprompt obsolete; release channel ch1; release channel ch2; } exit EOF |
|
$ cat /home/oracle/db_script/rman/ccit1_archive.sh #this is a script. of backup oracle archive log per hours export ORACLE_SID=ccit11 export ORACLE_BASE=/oracle/database export ORACLE_HOME=$ORACLE_BASE/10.2.0/db_1 export ORA_CRS_HOME=$ORACLE_BASE/10.2.0/crs_1 export LD_LIBRARY_PATH=$ORACLE_HOME/lib export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin dt=`date +%m%d` rman target / >> /home/oracle/db_script/rman/ccit1_archive_$dt.log << EOF run{ allocate channel ch1 type disk connect sys/system08ccit1@ccit11; allocate channel ch2 type disk connect sys/system08ccit1@ccit12; backup as compressed backupset archivelog all format='/oracle/backup/ccit1/rmanbackup/arch_%d_%T_%s_%p_%t' delete all input; release channel ch1; release channel ch2; } exit EOF |
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/11780477/viewspace-705066/ ,如需转载,请注明出处,否则将追究法律责任。