rman全備資料庫
1:建立備份
修改備份策略
[oracle@oracle ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on 星期二 12月 24 17:39:23 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1362763236)
RMAN> show all
2> ;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default -----保留最後近一次備份,根據要求修改
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
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 COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl.f'; # default
Recovery Manager: Release 11.2.0.1.0 - Production on 星期二 12月 24 17:39:23 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1362763236)
RMAN> show all
2> ;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default -----保留最後近一次備份,根據要求修改
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
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 COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl.f'; # default
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON; -------設定為ON,表示rman每次備份資料庫時,同時備份controlfile
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/app/oracle/backup/control/%F'; --路徑
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/app/oracle/backup/control/%F';
new RMAN configuration parameters are successfully stored
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/app/oracle/backup/control/%F'; --路徑
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/app/oracle/backup/control/%F';
new RMAN configuration parameters are successfully stored
備份資料庫
全備資料庫指令碼
run {
allocate channel c1 device type disk;
allocate channel c2 device type disk;
allocate channel c3 device type disk;
allocate channel c4 device type disk;
allocate channel c5 device type disk;
crosscheck backup;
sql 'alter system archive log current';
backup database format '/u01/app/oracle/backup/data/db_%d_%T_%U';
sql 'alter system archive log current';
backup archivelog all format '/u01/app/oracle/backup/archivelog/arc_%t_%s' delete all input;
crosscheck archivelog all;
delete noprompt expired backup;
delete noprompt obsolete;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
}
allocate channel c1 device type disk;
allocate channel c2 device type disk;
allocate channel c3 device type disk;
allocate channel c4 device type disk;
allocate channel c5 device type disk;
crosscheck backup;
sql 'alter system archive log current';
backup database format '/u01/app/oracle/backup/data/db_%d_%T_%U';
sql 'alter system archive log current';
backup archivelog all format '/u01/app/oracle/backup/archivelog/arc_%t_%s' delete all input;
crosscheck archivelog all;
delete noprompt expired backup;
delete noprompt obsolete;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
}
關於通道的設定,本文中設定了5個通道,請根據自己的實際情況進行設定,--通過設定過多會影響系統系能。
此次備份,備份了資料庫的 datafile 、archivelog、controlfile、spfile,關於controlfile和spfile的備份,是有上面的策略決定( CONFIGURE CONTROLFILE AUTOBACKUP ON;),他將controlfile和spfile備份到control備份集中。
檢視備份資訊
RMAN> list backup of database;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
5 Full 1.03M DISK 00:00:01 2013-12-24 18:42:58
BP Key: 5 Status: AVAILABLE Compressed: NO Tag: TAG20131224T184256
Piece Name: /u01/app/oracle/backup/data/db_ORCL_20131224_08osb9ph_1_1
List of Datafiles in backup set 5
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ------------------- ----
4 Full 798228 2013-12-24 18:42:57 /u01/app/oracle/oradata/orcl/users01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
6 Full 2.41M DISK 00:00:50 2013-12-24 18:43:47
BP Key: 6 Status: AVAILABLE Compressed: NO Tag: TAG20131224T184256
Piece Name: /u01/app/oracle/backup/data/db_ORCL_20131224_07osb9ph_1_1
List of Datafiles in backup set 6
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ------------------- ----
3 Full 798227 2013-12-24 18:42:57 /u01/app/oracle/oradata/orcl/undotbs01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
7 Full 378.75M DISK 00:01:25 2013-12-24 18:44:21
BP Key: 7 Status: AVAILABLE Compressed: NO Tag: TAG20131224T184256
Piece Name: /u01/app/oracle/backup/data/db_ORCL_20131224_06osb9pg_1_1
List of Datafiles in backup set 7
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ------------------- ----
2 Full 798226 2013-12-24 18:42:57 /u01/app/oracle/oradata/orcl/sysaux01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
8 Full 586.55M DISK 00:01:34 2013-12-24 18:44:30
BP Key: 8 Status: AVAILABLE Compressed: NO Tag: TAG20131224T184256
Piece Name: /u01/app/oracle/backup/data/db_ORCL_20131224_05osb9pg_1_1
List of Datafiles in backup set 8
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ------------------- ----
1 Full 798225 2013-12-24 18:42:56 /u01/app/oracle/oradata/orcl/system01.dbf
RMAN> list backup of archivelog all;
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ -------------------
11 11.50K DISK 00:00:00 2013-12-24 18:44:35
BP Key: 11 Status: AVAILABLE Compressed: NO Tag: TAG20131224T184435
Piece Name: /u01/app/oracle/backup/archivelog/arc_835037075_11
List of Archived Logs in backup set 11
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ------------------- ---------- ---------
1 75 798218 2013-12-24 18:42:56 798286 2013-12-24 18:44:34
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ -------------------
12 2.00K DISK 00:00:00 2013-12-24 18:44:35
BP Key: 12 Status: AVAILABLE Compressed: NO Tag: TAG20131224T184435
Piece Name: /u01/app/oracle/backup/archivelog/arc_835037075_12
List of Archived Logs in backup set 12
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ------------------- ---------- ---------
1 76 798286 2013-12-24 18:44:34 798294 2013-12-24 18:44:34
RMAN> list backup of controlfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
13 Full 9.36M DISK 00:00:01 2013-12-24 18:44:36
BP Key: 13 Status: AVAILABLE Compressed: NO Tag: TAG20131224T184435
Piece Name: /u01/app/oracle/backup/control/c-1362763236-20131224-03
Control File Included: Ckp SCN: 798309 Ckp time: 2013-12-24 18:44:35
RMAN> list backup of spfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
13 Full 9.36M DISK 00:00:01 2013-12-24 18:44:36
BP Key: 13 Status: AVAILABLE Compressed: NO Tag: TAG20131224T184435
Piece Name: /u01/app/oracle/backup/control/c-1362763236-20131224-03
SPFILE Included: Modification time: 2013-12-24 18:35:57
SPFILE db_unique_name: ORCL
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
5 Full 1.03M DISK 00:00:01 2013-12-24 18:42:58
BP Key: 5 Status: AVAILABLE Compressed: NO Tag: TAG20131224T184256
Piece Name: /u01/app/oracle/backup/data/db_ORCL_20131224_08osb9ph_1_1
List of Datafiles in backup set 5
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ------------------- ----
4 Full 798228 2013-12-24 18:42:57 /u01/app/oracle/oradata/orcl/users01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
6 Full 2.41M DISK 00:00:50 2013-12-24 18:43:47
BP Key: 6 Status: AVAILABLE Compressed: NO Tag: TAG20131224T184256
Piece Name: /u01/app/oracle/backup/data/db_ORCL_20131224_07osb9ph_1_1
List of Datafiles in backup set 6
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ------------------- ----
3 Full 798227 2013-12-24 18:42:57 /u01/app/oracle/oradata/orcl/undotbs01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
7 Full 378.75M DISK 00:01:25 2013-12-24 18:44:21
BP Key: 7 Status: AVAILABLE Compressed: NO Tag: TAG20131224T184256
Piece Name: /u01/app/oracle/backup/data/db_ORCL_20131224_06osb9pg_1_1
List of Datafiles in backup set 7
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ------------------- ----
2 Full 798226 2013-12-24 18:42:57 /u01/app/oracle/oradata/orcl/sysaux01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
8 Full 586.55M DISK 00:01:34 2013-12-24 18:44:30
BP Key: 8 Status: AVAILABLE Compressed: NO Tag: TAG20131224T184256
Piece Name: /u01/app/oracle/backup/data/db_ORCL_20131224_05osb9pg_1_1
List of Datafiles in backup set 8
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ------------------- ----
1 Full 798225 2013-12-24 18:42:56 /u01/app/oracle/oradata/orcl/system01.dbf
RMAN> list backup of archivelog all;
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ -------------------
11 11.50K DISK 00:00:00 2013-12-24 18:44:35
BP Key: 11 Status: AVAILABLE Compressed: NO Tag: TAG20131224T184435
Piece Name: /u01/app/oracle/backup/archivelog/arc_835037075_11
List of Archived Logs in backup set 11
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ------------------- ---------- ---------
1 75 798218 2013-12-24 18:42:56 798286 2013-12-24 18:44:34
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ -------------------
12 2.00K DISK 00:00:00 2013-12-24 18:44:35
BP Key: 12 Status: AVAILABLE Compressed: NO Tag: TAG20131224T184435
Piece Name: /u01/app/oracle/backup/archivelog/arc_835037075_12
List of Archived Logs in backup set 12
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ------------------- ---------- ---------
1 76 798286 2013-12-24 18:44:34 798294 2013-12-24 18:44:34
RMAN> list backup of controlfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
13 Full 9.36M DISK 00:00:01 2013-12-24 18:44:36
BP Key: 13 Status: AVAILABLE Compressed: NO Tag: TAG20131224T184435
Piece Name: /u01/app/oracle/backup/control/c-1362763236-20131224-03
Control File Included: Ckp SCN: 798309 Ckp time: 2013-12-24 18:44:35
RMAN> list backup of spfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
13 Full 9.36M DISK 00:00:01 2013-12-24 18:44:36
BP Key: 13 Status: AVAILABLE Compressed: NO Tag: TAG20131224T184435
Piece Name: /u01/app/oracle/backup/control/c-1362763236-20131224-03
SPFILE Included: Modification time: 2013-12-24 18:35:57
SPFILE db_unique_name: ORCL
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28698327/viewspace-1065456/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- rman資料庫全庫備份與恢復資料庫
- 透過rman全庫備份遷移資料庫資料庫
- rman 備份 全庫
- 利用rman全備恢復刪除的資料庫資料庫
- rman 全庫恢復asm資料庫ASM資料庫
- RMAN全庫備份指令碼指令碼
- RMAN定時全備份資料庫之簡單例項資料庫單例
- 使用RMAN備份資料庫資料庫
- 利用RMAN備份重建資料庫資料庫
- oracle rman備用資料庫(一)Oracle資料庫
- 利用RMAN建立備用資料庫資料庫
- 資料庫全備指令碼資料庫指令碼
- 用10.2.0.1RMAN全備恢復10.2.0.4資料庫,透過資料庫
- RMAN備份 建立catalog資料庫資料庫
- 非歸檔資料庫RMAN備份資料庫
- 資料庫全備份指令碼資料庫指令碼
- 使用RMAN建立資料庫備份庫(筆記)資料庫筆記
- RMAN說,我能備份(3)--RMAN全庫備份和表空間備份
- 【RMAN】使用增量備份更新資料庫備份映象資料庫
- Rman-ORACLE資料庫RMAN實現自動備份Oracle資料庫
- oracle資料庫使用rman備份指令碼Oracle資料庫指令碼
- 【RMAN】利用備份片還原資料庫資料庫
- rman全庫備份備份歸檔日誌檔案
- RMAN 全庫備份和 0級備份的區別
- 【原】Oracle學習系列—資料庫備份—RMAN備份Oracle資料庫
- sqlserver 使用全備和增備 還原資料庫SQLServer資料庫
- 有整庫備份的情況rman恢復全庫
- RMAN備份恢復典型案例——資料庫卡頓資料庫
- 非RMAN熱備份資料庫和恢復資料庫
- linux下自動備份oracle資料庫-rmanLinuxOracle資料庫
- 【RMAN】利用備份片還原資料庫(上)資料庫
- Oracle資料庫備份與恢復之RMANOracle資料庫
- 使用RMAN增量備份前滾STANDBY資料庫資料庫
- 【RMAN】利用備份片還原資料庫(中)資料庫
- 【RMAN】利用備份片還原資料庫(下)資料庫
- Oracle資料庫RMAN小結之備份部分Oracle資料庫
- 利用rman生成備用資料庫操作文件資料庫
- 完整的全庫備份(供資料庫遷移用)資料庫