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備份重建資料庫資料庫
- oracle資料庫使用rman備份指令碼Oracle資料庫指令碼
- RMAN備份恢復典型案例——資料庫卡頓資料庫
- 【RMAN】在備庫執行rman備份時報錯RMAN-06820 ORA-17629
- 用rman遷移資料庫資料庫
- BMMySQL定時備份資料庫(全庫備份)的實現meuMySql資料庫
- 3.1.1.2 使用RMAN啟動資料庫資料庫
- 在DG備庫備份資料庫並恢復到一個主機上,報錯RMAN-06820資料庫
- 使用RMAN複製資料庫 active database資料庫Database
- 【RMAN】RMAN備份至ASMASM
- Oracle 11G RAC複製備庫RMAN-03002 RMAN-05501 RMAN-03015 RMAN-03009 RMAN-10038Oracle
- ORACLE DG從庫 Rman備份恢復Oracle
- [20211020]改變備庫的rman配置.txt
- RMAN備份恢復典型案例——快速檢查資料庫一致性資料庫
- Oracle RMAN 連線資料庫認證方法Oracle資料庫
- 【RMAN】RMAN的備份保留策略
- 如何恢復在全備後新增了資料檔案的資料庫資料庫
- 資料庫備份資料庫
- 全網資料備份方案
- rman如何在備庫執行一致性備份
- oracle 備份資料庫,匯出資料庫Oracle資料庫
- RMAN備份概述
- 【RMAN】Oracle使用rman將11.2.0.4資料庫遷移至Oracle12c命令參考Oracle資料庫
- mysql 資料庫 備份MySql資料庫
- 資料庫的災備資料庫
- 資料庫備份策略資料庫
- MongoDB資料庫備份MongoDB資料庫
- RMAN備份恢復典型案例——資料檔案存在壞快
- RMAN備份恢復典型案例——RMAN備份&系統變慢
- RMAN備份整庫和歸檔日誌的方法
- RMAN備份進度
- rman 備份指令碼指令碼
- RMAN的備份原理
- XtraBackup工具詳解 Part 5 使用innobackupex對資料庫進行全備資料庫
- mongodb資料庫備份與恢復(資料庫資料遷移)MongoDB資料庫
- RMAN資料庫恢復異常報錯ORA-01180資料庫
- 資料庫備份恢復資料庫
- SQL資料庫備份管理SQL資料庫