|
1. 配置:
2. 脚本:
- Daily Script:
- run {
- allocate channel oem_disk_backup1 type disk ;
- allocate channel oem_disk_backup2 type disk ;
- allocate channel oem_disk_backup3 type disk ;
- allocate channel oem_disk_backup4 type disk ;
- allocate channel oem_disk_backup5 type disk ;
- allocate channel oem_disk_backup6 type disk ;
- allocate channel oem_disk_backup7 type disk ;
- allocate channel oem_disk_backup8 type disk ;
- recover copy of database with tag 'ORA$OEM_LEVEL_0';
- backup incremental level 1 copies=1 for recover of copy with tag 'ORA$OEM_LEVEL_0' database;
- release channel oem_disk_backup1;
- release channel oem_disk_backup2;
- release channel oem_disk_backup3;
- release channel oem_disk_backup4;
- release channel oem_disk_backup5;
- release channel oem_disk_backup6;
- release channel oem_disk_backup7;
- release channel oem_disk_backup8;
- allocate channel oem_sbt_backup1 type 'SBT_TAPE' format '%d_%U' parms "ENV=(OB_MEDIA_FAMILY=classroom)";
- allocate channel oem_sbt_backup2 type 'SBT_TAPE' format '%d_%U' parms "ENV=(OB_MEDIA_FAMILY=classroom)";
- backup archivelog all not backed up;
- }
- allocate channel for maintenance device type 'SBT_TAPE' parms "ENV=(OB_MEDIA_FAMILY=classroom)";
- delete noprompt obsolete recovery window of 31 days device type 'SBT_TAPE';
- Weekly Script:
- run {
- allocate channel oem_disk_backup1 type disk ;
- allocate channel oem_disk_backup2 type disk ;
- allocate channel oem_disk_backup3 type disk ;
- allocate channel oem_disk_backup4 type disk ;
- allocate channel oem_disk_backup5 type disk ;
- allocate channel oem_disk_backup6 type disk ;
- allocate channel oem_disk_backup7 type disk ;
- allocate channel oem_disk_backup8 type disk ;
- recover copy of database with tag 'ORA$OEM_LEVEL_0';
- backup incremental level 1 copies=1 for recover of copy with tag 'ORA$OEM_LEVEL_0' database;
- release channel oem_disk_backup1;
- release channel oem_disk_backup2;
- release channel oem_disk_backup3;
- release channel oem_disk_backup4;
- release channel oem_disk_backup5;
- release channel oem_disk_backup6;
- release channel oem_disk_backup7;
- release channel oem_disk_backup8;
- allocate channel oem_sbt_backup1 type 'SBT_TAPE' format '%d_%U' parms "ENV=(OB_MEDIA_FAMILY=classroom)";
- allocate channel oem_sbt_backup2 type 'SBT_TAPE' format '%d_%U' parms "ENV=(OB_MEDIA_FAMILY=classroom)";
- backup recovery area;
- }
- allocate channel for maintenance device type 'SBT_TAPE' parms "ENV=(OB_MEDIA_FAMILY=classroom)";
- delete noprompt obsolete recovery window of 31 days device type 'SBT_TAPE';
复制代码 3. 运行输出:
- [oracle@classroom ~]$ rman target / catalog urcat/oracle_4U@rcat cmdfile=day1.rcv
- Recovery Manager: Release 12.1.0.2.0 - Production on 星期日 11月 15 14:34:47 2020
- Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
- connected to target database: ORCL (DBID=1574592120)
- connected to recovery catalog database
- RMAN> run {
- 2> allocate channel oem_disk_backup1 type disk ;
- 3> allocate channel oem_disk_backup2 type disk ;
- 4> allocate channel oem_disk_backup3 type disk ;
- 5> allocate channel oem_disk_backup4 type disk ;
- 6> allocate channel oem_disk_backup5 type disk ;
- 7> allocate channel oem_disk_backup6 type disk ;
- 8> allocate channel oem_disk_backup7 type disk ;
- 9> allocate channel oem_disk_backup8 type disk ;
- 10> recover copy of database with tag 'ORAOEM_LEVEL_0';
- 11> backup incremental level 1 copies=1 for recover of copy with tag 'ORAOEM_LEVEL_0' database;
- 12> release channel oem_disk_backup1;
- 13> release channel oem_disk_backup2;
- 14> release channel oem_disk_backup3;
- 15> release channel oem_disk_backup4;
- 16> release channel oem_disk_backup5;
- 17> release channel oem_disk_backup6;
- 18> release channel oem_disk_backup7;
- 19> release channel oem_disk_backup8;
- 20> allocate channel oem_sbt_backup1 type 'SBT_TAPE' format '%d_%U' parms "ENV=(OB_MEDIA_FAMILY=classroom)";
- 21> allocate channel oem_sbt_backup2 type 'SBT_TAPE' format '%d_%U' parms "ENV=(OB_MEDIA_FAMILY=classroom)";
- 22> backup archivelog all not backed up;
- 23> }
- 24> allocate channel for maintenance device type 'SBT_TAPE' parms "ENV=(OB_MEDIA_FAMILY=classroom)";
- 25> delete noprompt obsolete recovery window of 31 days device type 'SBT_TAPE';
- 26>
- 27>
- 28>
- starting full resync of recovery catalog
- full resync complete
- allocated channel: oem_disk_backup1
- channel oem_disk_backup1: SID=135 device type=DISK
- allocated channel: oem_disk_backup2
- channel oem_disk_backup2: SID=137 device type=DISK
- allocated channel: oem_disk_backup3
- channel oem_disk_backup3: SID=255 device type=DISK
- allocated channel: oem_disk_backup4
- channel oem_disk_backup4: SID=14 device type=DISK
- allocated channel: oem_disk_backup5
- channel oem_disk_backup5: SID=257 device type=DISK
- allocated channel: oem_disk_backup6
- channel oem_disk_backup6: SID=374 device type=DISK
- allocated channel: oem_disk_backup7
- channel oem_disk_backup7: SID=18 device type=DISK
- allocated channel: oem_disk_backup8
- channel oem_disk_backup8: SID=124 device type=DISK
- Starting recover at 15-11月-20
- no copy of datafile 1 found to recover
- no copy of datafile 2 found to recover
- no copy of datafile 3 found to recover
- no copy of datafile 4 found to recover
- no copy of datafile 5 found to recover
- no copy of datafile 6 found to recover
- no copy of datafile 7 found to recover
- no copy of datafile 8 found to recover
- no copy of datafile 9 found to recover
- no copy of datafile 10 found to recover
- no copy of datafile 11 found to recover
- no copy of datafile 12 found to recover
- no copy of datafile 13 found to recover
- no copy of datafile 14 found to recover
- no copy of datafile 15 found to recover
- no copy of datafile 16 found to recover
- Finished recover at 15-11月-20
- Starting backup at 15-11月-20
- no parent backup or copy of datafile 5 found
- no parent backup or copy of datafile 2 found
- no parent backup or copy of datafile 3 found
- no parent backup or copy of datafile 1 found
- no parent backup or copy of datafile 4 found
- no parent backup or copy of datafile 6 found
- no parent backup or copy of datafile 10 found
- no parent backup or copy of datafile 8 found
- no parent backup or copy of datafile 7 found
- no parent backup or copy of datafile 11 found
- no parent backup or copy of datafile 12 found
- no parent backup or copy of datafile 14 found
- no parent backup or copy of datafile 15 found
- no parent backup or copy of datafile 16 found
- no parent backup or copy of datafile 9 found
- no parent backup or copy of datafile 13 found
- channel oem_disk_backup1: starting datafile copy
- input datafile file number=00005 name=+DATA/ORCL/DATAFILE/example.279.1054329825
- channel oem_disk_backup2: starting datafile copy
- input datafile file number=00002 name=+DATA/ORCL/DATAFILE/sysaux.282.1054329823
- channel oem_disk_backup3: starting datafile copy
- input datafile file number=00003 name=+DATA/ORCL/DATAFILE/undotbs1.286.1054329823
- channel oem_disk_backup4: starting datafile copy
- input datafile file number=00001 name=+DATA/ORCL/DATAFILE/system.263.1054329825
- channel oem_disk_backup5: starting datafile copy
- input datafile file number=00004 name=+DATA/orcl/DATAFILE/users.262.1054329889
- channel oem_disk_backup6: starting datafile copy
- input datafile file number=00006 name=+DATA/ORCL/DATAFILE/tbs1.287.1050417229
- channel oem_disk_backup7: starting datafile copy
- input datafile file number=00010 name=+DATA/ORCL/DATAFILE/tbsuniform.278.1054763341
- channel oem_disk_backup8: starting datafile copy
- input datafile file number=00008 name=+DATA/ORCL/DATAFILE/tbs3.289.1050418001
- output file name=+FRA/ORCL/DATAFILE/tbs1.434.1056551709 tag=ORAOEM_LEVEL_0 RECID=1 STAMP=1056551712
- channel oem_disk_backup6: datafile copy complete, elapsed time: 00:00:05
- channel oem_disk_backup6: starting datafile copy
- input datafile file number=00007 name=+DATA/ORCL/DATAFILE/tbs2.288.1050417617
- output file name=+FRA/ORCL/DATAFILE/users.391.1056551707 tag=ORAOEM_LEVEL_0 RECID=2 STAMP=1056551714
- channel oem_disk_backup5: datafile copy complete, elapsed time: 00:00:10
- channel oem_disk_backup5: starting datafile copy
- input datafile file number=00011 name=+DATA/ORCL/DATAFILE/tbsbig.280.1054764585
- output file name=+FRA/ORCL/DATAFILE/tbsuniform.390.1056551711 tag=ORAOEM_LEVEL_0 RECID=3 STAMP=1056551714
- channel oem_disk_backup7: datafile copy complete, elapsed time: 00:00:09
- channel oem_disk_backup7: starting datafile copy
- input datafile file number=00012 name=+DATA/ORCL/DATAFILE/tbsuniform.277.1054764627
- output file name=+FRA/ORCL/DATAFILE/tbs2.432.1056551717 tag=ORAOEM_LEVEL_0 RECID=5 STAMP=1056551719
- channel oem_disk_backup6: datafile copy complete, elapsed time: 00:00:05
- channel oem_disk_backup6: starting datafile copy
- input datafile file number=00014 name=+DATA/ORCL/DATAFILE/tbs_nocompression.291.1054936255
- output file name=+FRA/ORCL/DATAFILE/tbs3.433.1056551713 tag=ORAOEM_LEVEL_0 RECID=4 STAMP=1056551716
- channel oem_disk_backup8: datafile copy complete, elapsed time: 00:00:11
- channel oem_disk_backup8: starting datafile copy
- input datafile file number=00015 name=+DATA/ORCL/DATAFILE/tbs_basic.292.1054936269
- output file name=+FRA/ORCL/DATAFILE/tbsbig.431.1056551719 tag=ORAOEM_LEVEL_0 RECID=6 STAMP=1056551721
- channel oem_disk_backup5: datafile copy complete, elapsed time: 00:00:07
- channel oem_disk_backup5: starting datafile copy
- input datafile file number=00016 name=+DATA/ORCL/DATAFILE/tbs_oltp.293.1054936567
- output file name=+FRA/ORCL/DATAFILE/tbsuniform.420.1056551723 tag=ORAOEM_LEVEL_0 RECID=7 STAMP=1056551724
- channel oem_disk_backup7: datafile copy complete, elapsed time: 00:00:07
- channel oem_disk_backup7: starting incremental level 1 datafile backup set
- channel oem_disk_backup7: specifying datafile(s) in backup set
- output file name=+FRA/ORCL/DATAFILE/tbs_nocompression.437.1056551725 tag=ORAOEM_LEVEL_0 RECID=8 STAMP=1056551725
- channel oem_disk_backup6: datafile copy complete, elapsed time: 00:00:06
- channel oem_disk_backup6: starting datafile copy
- input datafile file number=00009 name=+DATA/ORCL/DATAFILE/tbsocp05_test.284.1054152837
- output file name=+FRA/ORCL/DATAFILE/sysaux.338.1056551705 tag=ORAOEM_LEVEL_0 RECID=10 STAMP=1056551729
- channel oem_disk_backup2: datafile copy complete, elapsed time: 00:00:26
- channel oem_disk_backup2: starting datafile copy
- input datafile file number=00013 name=+DATA/ORCL/DATAFILE/tbs32k.259.1054931811
- output file name=+FRA/ORCL/DATAFILE/undotbs1.257.1056551705 tag=ORAOEM_LEVEL_0 RECID=11 STAMP=1056551729
- channel oem_disk_backup3: datafile copy complete, elapsed time: 00:00:26
- channel oem_disk_backup3: starting incremental level 1 datafile backup set
- channel oem_disk_backup3: specifying datafile(s) in backup set
- including current SPFILE in backup set
- channel oem_disk_backup3: starting piece 1 at 15-11月-20
- output file name=+FRA/ORCL/DATAFILE/tbs_basic.419.1056551727 tag=ORAOEM_LEVEL_0 RECID=9 STAMP=1056551728
- channel oem_disk_backup8: datafile copy complete, elapsed time: 00:00:08
- output file name=+FRA/ORCL/DATAFILE/system.389.1056551707 tag=ORAOEM_LEVEL_0 RECID=13 STAMP=1056551730
- channel oem_disk_backup4: datafile copy complete, elapsed time: 00:00:27
- output file name=+FRA/ORCL/DATAFILE/tbs_oltp.414.1056551729 tag=ORAOEM_LEVEL_0 RECID=12 STAMP=1056551729
- channel oem_disk_backup5: datafile copy complete, elapsed time: 00:00:06
- output file name=+FRA/ORCL/DATAFILE/tbsocp05_test.372.1056551731 tag=ORAOEM_LEVEL_0 RECID=14 STAMP=1056551731
- channel oem_disk_backup6: datafile copy complete, elapsed time: 00:00:02
- including current control file in backup set
- channel oem_disk_backup7: starting piece 1 at 15-11月-20
- output file name=+FRA/ORCL/DATAFILE/tbs32k.371.1056551731 tag=ORAOEM_LEVEL_0 RECID=15 STAMP=1056551732
- channel oem_disk_backup2: datafile copy complete, elapsed time: 00:00:02
- channel oem_disk_backup3: finished piece 1 at 15-11月-20
- piece handle=+FRA/ORCL/BACKUPSET/2020_11_15/nnsnn1_oraoem_level_0_0.418.1056551733 tag=ORAOEM_LEVEL_0 comment=NONE
- channel oem_disk_backup3: backup set complete, elapsed time: 00:00:02
- output file name=+FRA/ORCL/DATAFILE/example.395.1056551705 tag=ORAOEM_LEVEL_0 RECID=16 STAMP=1056551733
- channel oem_disk_backup1: datafile copy complete, elapsed time: 00:00:30
- channel oem_disk_backup7: finished piece 1 at 15-11月-20
- piece handle=+FRA/ORCL/BACKUPSET/2020_11_15/ncnnn1_oraoem_level_0_0.373.1056551733 tag=ORAOEM_LEVEL_0 comment=NONE
- channel oem_disk_backup7: backup set complete, elapsed time: 00:00:02
- Finished backup at 15-11月-20
- released channel: oem_disk_backup1
- released channel: oem_disk_backup2
- released channel: oem_disk_backup3
- released channel: oem_disk_backup4
- released channel: oem_disk_backup5
- released channel: oem_disk_backup6
- released channel: oem_disk_backup7
- released channel: oem_disk_backup8
- allocated channel: oem_sbt_backup1
- channel oem_sbt_backup1: SID=135 device type=SBT_TAPE
- channel oem_sbt_backup1: Oracle Secure Backup
- allocated channel: oem_sbt_backup2
- channel oem_sbt_backup2: SID=137 device type=SBT_TAPE
- channel oem_sbt_backup2: Oracle Secure Backup
- Starting backup at 15-11月-20
- current log archived
- channel oem_sbt_backup1: starting archived log backup set
- channel oem_sbt_backup1: specifying archived log(s) in backup set
- input archived log thread=1 sequence=16 RECID=5 STAMP=1056146653
- channel oem_sbt_backup1: starting piece 1 at 15-11月-20
- channel oem_sbt_backup2: starting archived log backup set
- channel oem_sbt_backup2: specifying archived log(s) in backup set
- input archived log thread=1 sequence=17 RECID=6 STAMP=1056550481
- input archived log thread=1 sequence=18 RECID=7 STAMP=1056551753
- channel oem_sbt_backup2: starting piece 1 at 15-11月-20
- channel oem_sbt_backup1: finished piece 1 at 15-11月-20
- piece handle=ORCL_0jvfjcqb_1_1 tag=TAG20201115T143555 comment=API Version 2.0,MMS Version 12.1.0.2
- channel oem_sbt_backup1: backup set complete, elapsed time: 00:00:26
- channel oem_sbt_backup2: finished piece 1 at 15-11月-20
- piece handle=ORCL_0kvfjcqc_1_1 tag=TAG20201115T143555 comment=API Version 2.0,MMS Version 12.1.0.2
- channel oem_sbt_backup2: backup set complete, elapsed time: 00:00:25
- Finished backup at 15-11月-20
- released channel: oem_sbt_backup1
- released channel: oem_sbt_backup2
- allocated channel: ORA_MAINT_SBT_TAPE_1
- channel ORA_MAINT_SBT_TAPE_1: SID=135 device type=SBT_TAPE
- channel ORA_MAINT_SBT_TAPE_1: Oracle Secure Backup
- no obsolete backups found
- Recovery Manager complete.
- [oracle@classroom ~]$
复制代码- [oracle@classroom ~]$ crontab -l
- ORACLE_BASE=/u01/app/oracle
- ORACLE_SID=orcl
- ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_2
- 50 14 * * * /u01/app/oracle/product/12.1.0/dbhome_2/bin/rman target / cmdfile=/home/oracle/day1.rcv
复制代码- [root@classroom log]# tail -n 30 -f cron
- Nov 15 10:14:03 classroom run-parts[13422]: (/etc/cron.daily) finished logrotate
- Nov 15 10:14:03 classroom run-parts[13422]: (/etc/cron.daily) starting rhsmd
- Nov 15 10:14:03 classroom run-parts[13422]: (/etc/cron.daily) finished rhsmd
- Nov 15 10:14:03 classroom anacron[12552]: Job `cron.daily' terminated
- Nov 15 10:14:03 classroom anacron[12552]: Normal exit (1 job run)
- Nov 15 10:20:01 classroom CROND[13843]: (root) CMD (test -f /var/lock/subsys/ods-enforcerd && kill -s SIGHUP `cat /var/run/opendnssec/enforcerd.pid` > /dev/null 2> /dev/null)
- Nov 15 10:50:01 classroom CROND[15395]: (root) CMD (test -f /var/lock/subsys/ods-enforcerd && kill -s SIGHUP `cat /var/run/opendnssec/enforcerd.pid` > /dev/null 2> /dev/null)
- Nov 15 11:01:01 classroom CROND[15946]: (root) CMD (run-parts /etc/cron.hourly)
- Nov 15 11:01:01 classroom run-parts[15946]: (/etc/cron.hourly) starting 0anacron
- Nov 15 11:01:01 classroom run-parts[15946]: (/etc/cron.hourly) finished 0anacron
- Nov 15 11:20:01 classroom CROND[16701]: (root) CMD (test -f /var/lock/subsys/ods-enforcerd && kill -s SIGHUP `cat /var/run/opendnssec/enforcerd.pid` > /dev/null 2> /dev/null)
- Nov 15 11:50:01 classroom CROND[19042]: (root) CMD (test -f /var/lock/subsys/ods-enforcerd && kill -s SIGHUP `cat /var/run/opendnssec/enforcerd.pid` > /dev/null 2> /dev/null)
- Nov 15 12:01:01 classroom CROND[19824]: (root) CMD (run-parts /etc/cron.hourly)
- Nov 15 12:01:01 classroom run-parts[19824]: (/etc/cron.hourly) starting 0anacron
- Nov 15 12:01:01 classroom run-parts[19824]: (/etc/cron.hourly) finished 0anacron
- Nov 15 14:20:01 classroom CROND[27058]: (root) CMD (test -f /var/lock/subsys/ods-enforcerd && kill -s SIGHUP `cat /var/run/opendnssec/enforcerd.pid` > /dev/null 2> /dev/null)
- Nov 15 14:39:41 classroom crontab[32139]: (oracle) BEGIN EDIT (oracle)
- Nov 15 14:41:23 classroom crontab[32139]: (oracle) REPLACE (oracle)
- Nov 15 14:41:23 classroom crontab[32139]: (oracle) END EDIT (oracle)
- Nov 15 14:42:01 classroom crond[1269]: (root) BAD FILE MODE (/var/spool/cron/root)
- Nov 15 14:42:01 classroom crond[1269]: (oracle) RELOAD (/var/spool/cron/oracle)
- Nov 15 14:50:01 classroom CROND[1966]: (root) CMD (test -f /var/lock/subsys/ods-enforcerd && kill -s SIGHUP `cat /var/run/opendnssec/enforcerd.pid` > /dev/null 2> /dev/null)
- Nov 15 14:50:01 classroom CROND[1992]: (oracle) CMD (/u01/app/oracle/product/12.1.0/dbhome_2/bin/rman target / cmdfile=/home/oracle/day1.rcv)
- Nov 15 14:50:39 classroom crontab[2447]: (oracle) LIST (oracle)
复制代码
|
|