您好,登錄后才能下訂單哦!
Oracle RMAN備份深入解析--聯機備份
RMAN> backup database plus archivelog;
此命令將觸發以下操作:
1、首先,進程使用alter system archivelog current命令完成了日志切換操作。
2、進程將現存所有歸檔重做日志備份
3、開始執行實際的數據庫備份操作,此時會發生一次日志切換(alter system archivelog current),同時RMAN備份剩余的歸檔重做日志(使用backup archivelog all命令)。
4、執行控制文件和服務器參數文件的自動備份操作。
案例:
1、查看備份前的日志信息
17:13:50 SYS@ prod>select group#,sequence#,thread#,status from v$log; GROUP# SEQUENCE# THREAD# STATUS ---------- ---------- ---------- ---------------- 1 16 1 CURRENT 2 14 1 INACTIVE 3 15 1 INACTIVE Elapsed: 00:00:00.05
2、執行備份
RMAN> backup database plus archivelog; Starting backup at 03-JUL-14 current log archived using channel ORA_DISK_1 channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=13 RECID=41 STAMP=851966028 input archived log thread=1 sequence=14 RECID=42 STAMP=851966028 input archived log thread=1 sequence=15 RECID=43 STAMP=851966030 input archived log thread=1 sequence=16 RECID=44 STAMP=851966141 channel ORA_DISK_1: starting piece 1 at 03-JUL-14 channel ORA_DISK_1: finished piece 1 at 03-JUL-14 piece handle=/u01/app/oracle/product/11.2.0/db_1/dbs/0kpcfu5t_1_1 tag=TAG20140703T171541 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04 Finished backup at 03-JUL-14 Starting backup at 03-JUL-14 using channel ORA_DISK_1 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00001 name=/u01/app/oracle/oradata/prod/system01.dbf input datafile file number=00002 name=/u01/app/oracle/oradata/prod/sysaux01.dbf input datafile file number=00008 name=/u01/app/oracle/oradata/prod/perftbs01.dbf input datafile file number=00004 name=/u01/app/oracle/oradata/prod/users01.dbf input datafile file number=00005 name=/u01/app/oracle/oradata/prod/example01.dbf input datafile file number=00007 name=/u01/app/oracle/oradata/prod/undotbs2.dbf input datafile file number=00006 name=/u01/app/oracle/oradata/prod/tbs1.dbf input datafile file number=00003 name=/u01/app/oracle/oradata/prod/undotbs1.dbf channel ORA_DISK_1: starting piece 1 at 03-JUL-14 channel ORA_DISK_1: finished piece 1 at 03-JUL-14 piece handle=/u01/app/oracle/product/11.2.0/db_1/dbs/0lpcfu61_1_1 tag=TAG20140703T171545 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:01:26 Finished backup at 03-JUL-14 Starting backup at 03-JUL-14 current log archived using channel ORA_DISK_1 channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=17 RECID=45 STAMP=851966231 channel ORA_DISK_1: starting piece 1 at 03-JUL-14 channel ORA_DISK_1: finished piece 1 at 03-JUL-14 piece handle=/u01/app/oracle/product/11.2.0/db_1/dbs/0mpcfu8o_1_1 tag=TAG20140703T171712 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 03-JUL-14 Starting Control File and SPFILE Autobackup at 03-JUL-14 piece handle=/u01/app/oracle/product/11.2.0/db_1/dbs/c-239333010-20140703-00 comment=NONE Finished Control File and SPFILE Autobackup at 03-JUL-14
3、查看告警日志
[oracle@rh7 ~]$ tail -f /u01/app/oracle/diag/rdbms/prod/prod/trace/alert_prod.log
Current log# 1 seq# 16 mem# 1: /dsk2/oradata/prod/redo01b.log
Thu Jul 03 17:13:50 2014
Archived Log entry 43 added for thread 1 sequence 15 ID 0xfaf1e60 dest 2:
Thu Jul 03 17:15:41 2014
ALTER SYSTEM ARCHIVE LOG
Thu Jul 03 17:15:41 2014
Thread 1 advanced to log sequence 17 (LGWR switch)
Current log# 2 seq# 17 mem# 0: /dsk1/oradata/prod/redo02a.log
Current log# 2 seq# 17 mem# 1: /dsk2/oradata/prod/redo02b.log
Archived Log entry 44 added for thread 1 sequence 16 ID 0xfaf1e60 dest 2:
Thu Jul 03 17:17:11 2014
ALTER SYSTEM ARCHIVE LOG
Thu Jul 03 17:17:11 2014
Thread 1 advanced to log sequence 18 (LGWR switch)
Current log# 3 seq# 18 mem# 0: /dsk1/oradata/prod/redo03a.log
Current log# 3 seq# 18 mem# 1: /dsk2/oradata/prod/redo03b.log
Archived Log entry 45 added for thread 1 sequence 17 ID 0xfaf1e60 dest 2:
4、備份后的日志切換信息
17:13:56 SYS@ prod>select group#,sequence#,thread#,status from v$log; GROUP# SEQUENCE# THREAD# STATUS ---------- ---------- ---------- ---------------- 1 16 1 INACTIVE 2 17 1 ACTIVE 3 18 1 CURRENT Elapsed: 00:00:00.01
5、查看備份信息
RMAN> list backup of database; List of Backup Sets =================== BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 17 Full 1.13G DISK 00:01:21 03-JUL-14 BP Key: 17 Status: AVAILABLE Compressed: NO Tag: TAG20140703T171545 Piece Name: /u01/app/oracle/product/11.2.0/db_1/dbs/0lpcfu61_1_1 List of Datafiles in backup set 17 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 Full 2066885 03-JUL-14 /u01/app/oracle/oradata/prod/system01.dbf 2 Full 2066885 03-JUL-14 /u01/app/oracle/oradata/prod/sysaux01.dbf 3 Full 2066885 03-JUL-14 /u01/app/oracle/oradata/prod/undotbs1.dbf 4 Full 2066885 03-JUL-14 /u01/app/oracle/oradata/prod/users01.dbf 5 Full 2066885 03-JUL-14 /u01/app/oracle/oradata/prod/example01.dbf 6 Full 2066885 03-JUL-14 /u01/app/oracle/oradata/prod/tbs1.dbf 7 Full 2066885 03-JUL-14 /u01/app/oracle/oradata/prod/undotbs2.dbf 8 Full 2066885 03-JUL-14 /u01/app/oracle/oradata/prod/perftbs01.dbf RMAN> list backup of archivelog all; List of Backup Sets =================== BS Key Size Device Type Elapsed Time Completion Time ------- ---------- ----------- ------------ --------------- 16 31.11M DISK 00:00:01 03-JUL-14 BP Key: 16 Status: AVAILABLE Compressed: NO Tag: TAG20140703T171541 Piece Name: /u01/app/oracle/product/11.2.0/db_1/dbs/0kpcfu5t_1_1 List of Archived Logs in backup set 16 Thrd Seq Low SCN Low Time Next SCN Next Time ---- ------- ---------- --------- ---------- --------- 1 13 2051289 03-JUL-14 2066660 03-JUL-14 1 14 2066660 03-JUL-14 2066663 03-JUL-14 1 15 2066663 03-JUL-14 2066666 03-JUL-14 1 16 2066666 03-JUL-14 2066878 03-JUL-14 BS Key Size Device Type Elapsed Time Completion Time ------- ---------- ----------- ------------ --------------- 18 104.00K DISK 00:00:00 03-JUL-14 BP Key: 18 Status: AVAILABLE Compressed: NO Tag: TAG20140703T171712 Piece Name: /u01/app/oracle/product/11.2.0/db_1/dbs/0mpcfu8o_1_1 List of Archived Logs in backup set 18 Thrd Seq Low SCN Low Time Next SCN Next Time ---- ------- ---------- --------- ---------- --------- 1 17 2066878 03-JUL-14 2066956 03-JUL-14
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。