Oracle 12c 多租戶 CDB 與 PDB 備份
一、 CDB 備份
1.1 只備份CDB
只備份CDB資料庫需要具有SYSDBA或SYSBACKUP許可權使用者連線到CDB的root環境下,執行backupdatabase root命令即可完成對CDB的備份,方法如下:[oracle@12c01 ~]$ rman target /
[oracle@12c01 ~]$ mkdir /home/oracle/rmanback/
RMAN> backup database root format='/home/oracle/rmanback/db_%d_%U';
RMAN-03002: failure of backup command at 05/10/2017 23:14:58
RMAN-06817: Pluggable Database CDB$ROOT cannot be backed up in NOARCHIVELOG mode.
說明: 只備份 CDB 需要資料庫在歸檔環境下,自行把資料設定為歸檔模式。
RMAN> select name,log_mode from v$database;
NAME LOG_MODE
--------- ------------
ANDYCDB ARCHIVELOG
RMAN> backup database root format='/home/oracle/rmanback/db_%d_%U';
Starting backup at 10-MAY-17
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=/home/oracle/app/oracle/oradata/ANDYCDB/datafile/o1_mf_system_djsytx31_.dbf
input datafile file number=00003 name=/home/oracle/app/oracle/oradata/ANDYCDB/datafile/o1_mf_sysaux_djsyx1t8_.dbf
input datafile file number=00004 name=/home/oracle/app/oracle/oradata/ANDYCDB/datafile/o1_mf_undotbs1_djsyyjlk_.dbf
input datafile file number=00007 name=/home/oracle/app/oracle/oradata/ANDYCDB/datafile/o1_mf_users_djsyykpc_.dbf
channel ORA_DISK_1: starting piece 1 at 10-MAY-17
channel ORA_DISK_1: finished piece 1 at 10-MAY-17
piece handle=/home/oracle/rmanback/db_ANDYCDB_07s3u63n_1_1 tag=TAG20170510T233207 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:05
Finished backup at 10-MAY-17
Starting Control File and SPFILE Autobackup at 10-MAY-17
piece handle=/home/oracle/fast_recovery_area/ANDYCDB/autobackup/2017_05_10/o1_mf_s_943659193_dk6dosvv_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 10-MAY-17
1.2. 備份整個CDB及其下面的所有PDB
備份整個CDB資料庫及其下面的所有PDB類似於非CDB資料庫方法相同,使用具有SYSDBA或SYSBACKUP許可權使用者連線到CDB的root環境下面,然後執行backupdatabase命令即可完成整個CDB的備份,方法如下:
RMAN> backup database format='/home/oracle/rmanback/db_%d_%U';
Starting backup at 10-MAY-17
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=/home/oracle/app/oracle/oradata/ANDYCDB/datafile/o1_mf_system_djsytx31_.dbf
input datafile file number=00003 name=/home/oracle/app/oracle/oradata/ANDYCDB/datafile/o1_mf_sysaux_djsyx1t8_.dbf
input datafile file number=00004 name=/home/oracle/app/oracle/oradata/ANDYCDB/datafile/o1_mf_undotbs1_djsyyjlk_.dbf
input datafile file number=00007 name=/home/oracle/app/oracle/oradata/ANDYCDB/datafile/o1_mf_users_djsyykpc_.dbf
channel ORA_DISK_1: starting piece 1 at 10-MAY-17
channel ORA_DISK_1: finished piece 1 at 10-MAY-17
piece handle=/home/oracle/rmanback/db_ANDYCDB_09s3u69m_1_1 tag=TAG20170510T233517 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:17
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00022 name=/home/oracle/app/oracle/oradata/ANDYCDB/4ECF8621E3DA38EEE0531019640AA598/datafile/o1_mf_sysaux_dk5wmv11_.dbf
input datafile file number=00021 name=/home/oracle/app/oracle/oradata/ANDYCDB/4ECF8621E3DA38EEE0531019640AA598/datafile/o1_mf_system_dk5wmv0s_.dbf
input datafile file number=00024 name=/home/oracle/app/oracle/oradata/ANDYCDB/4ECF8621E3DA38EEE0531019640AA598/datafile/o1_mf_undo_1_dk5wmv13_.dbf
input datafile file number=00023 name=/home/oracle/app/oracle/oradata/ANDYCDB/4ECF8621E3DA38EEE0531019640AA598/datafile/o1_mf_users_dk5wmv12_.dbf
channel ORA_DISK_1: starting piece 1 at 10-MAY-17
channel ORA_DISK_1: finished piece 1 at 10-MAY-17
piece handle=/home/oracle/rmanback/db_ANDYCDB_0as3u6c3_1_1 tag=TAG20170510T233517 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:39
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/home/oracle/app/oracle/oradata/ANDYCDB/datafile/o1_mf_sysaux_djsz1z2x_.dbf
input datafile file number=00005 name=/home/oracle/app/oracle/oradata/ANDYCDB/datafile/o1_mf_system_djsz1z31_.dbf
input datafile file number=00008 name=/home/oracle/app/oracle/oradata/ANDYCDB/datafile/o1_mf_undotbs1_djsz1z34_.dbf
channel ORA_DISK_1: starting piece 1 at 10-MAY-17
channel ORA_DISK_1: finished piece 1 at 10-MAY-17
piece handle=/home/oracle/rmanback/db_ANDYCDB_0bs3u6da_1_1 tag=TAG20170510T233517 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:46
Finished backup at 10-MAY-17
Starting Control File and SPFILE Autobackup at 10-MAY-17
piece handle=/home/oracle/fast_recovery_area/ANDYCDB/autobackup/2017_05_10/o1_mf_s_943659480_dk6dyrlw_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 10-MAY-17
二、 備份 PDB
1.1. 備份單個和多個PDB在CDB中允許備份一個或多少PDB資料庫(如果要備份多個pdb,只需在備份命令後面跟上多個你想備份的pdb例項的名稱,如下backup pluggable database pdb1,pdb2; ),備份一個PDB資料庫可以透過以下兩個方式備份:
注意:如果沒有開啟歸檔模式,單獨備份 CDB 或者是 PDB 都會報ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode
方式一:在CDB根(root)使用BACKUP PLUGGABLE DATABASE命令備份一個或多個PDB資料庫。
[oracle@localhost ~]$ rman target /
RMAN> backup pluggable database pdb01;
Starting backup at 10-MAY-17
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=00022 name=/home/oracle/app/oracle/oradata/ANDYCDB/4ECF8621E3DA38EEE0531019640AA598/datafile/o1_mf_sysaux_dk5wmv11_.dbf
input datafile file number=00021 name=/home/oracle/app/oracle/oradata/ANDYCDB/4ECF8621E3DA38EEE0531019640AA598/datafile/o1_mf_system_dk5wmv0s_.dbf
input datafile file number=00024 name=/home/oracle/app/oracle/oradata/ANDYCDB/4ECF8621E3DA38EEE0531019640AA598/datafile/o1_mf_undo_1_dk5wmv13_.dbf
input datafile file number=00023 name=/home/oracle/app/oracle/oradata/ANDYCDB/4ECF8621E3DA38EEE0531019640AA598/datafile/o1_mf_users_dk5wmv12_.dbf
channel ORA_DISK_1: starting piece 1 at 10-MAY-17
channel ORA_DISK_1: finished piece 1 at 10-MAY-17
piece handle=/home/oracle/fast_recovery_area/ANDYCDB/4ECF8621E3DA38EEE0531019640AA598/backupset/2017_05_10/o1_mf_nnndf_TAG20170510T234055_dk6f47wq_.bkp tag=TAG20170510T234055 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:36
Finished backup at 10-MAY-17
Starting Control File and SPFILE Autobackup at 10-MAY-17
piece handle=/home/oracle/fast_recovery_area/ANDYCDB/autobackup/2017_05_10/o1_mf_s_943659691_dk6f5cpf_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 10-MAY-17
備份預設在 閃回恢復區裡。
方式二:在PDB中使用BACKUP DATABASE備份當前連線的PDB資料庫,前提條件是需要配置好TNSNAMES.ORA檔案。
[oracle@12c01 ~]$ rman target sys/oracle@10.100.25.16:1521/pdb01
connected to target database: ANDYCDB:PDB01 (DBID=2550500229)
RMAN> backup database format='/home/oracle/rmanback/db_%d_%U';
Starting backup at 10-MAY-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=60 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00022 name=/home/oracle/app/oracle/oradata/ANDYCDB/4ECF8621E3DA38EEE0531019640AA598/datafile/o1_mf_sysaux_dk5wmv11_.dbf
input datafile file number=00021 name=/home/oracle/app/oracle/oradata/ANDYCDB/4ECF8621E3DA38EEE0531019640AA598/datafile/o1_mf_system_dk5wmv0s_.dbf
input datafile file number=00024 name=/home/oracle/app/oracle/oradata/ANDYCDB/4ECF8621E3DA38EEE0531019640AA598/datafile/o1_mf_undo_1_dk5wmv13_.dbf
input datafile file number=00023 name=/home/oracle/app/oracle/oradata/ANDYCDB/4ECF8621E3DA38EEE0531019640AA598/datafile/o1_mf_users_dk5wmv12_.dbf
channel ORA_DISK_1: starting piece 1 at 10-MAY-17
channel ORA_DISK_1: finished piece 1 at 10-MAY-17
piece handle=/home/oracle/rmanback/db_ANDYCDB_0fs3u6tn_1_1 tag=TAG20170510T234559 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
Finished backup at 10-MAY-17
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31383567/viewspace-2138844/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【BAK_ORACLE】Oracle 12c之CDB與PDB的備份與恢復(三)CDB與PDB的備份方式Oracle
- 【ASK_ORACLE】Oracle 12c之CDB與PDB的備份與恢復(一)什麼是CDB與PDB?Oracle
- 12C多租戶關於CDB、PDB的常用SQL語句SQL
- 12C多租戶rman備份文件
- oracle 12c中CDB和PDB的備份還原實驗Oracle
- 【RECO_ORACLE】Oracle 12c之CDB與PDB的備份與恢復(四)PDB的幾種恢復方式Oracle
- oracle 12c rman備份pdbOracle
- 【ASK_ORACLE】Oracle 12c之CDB與PDB的備份與恢復(二)備份恢復之前你需要知道的Oracle
- 多租戶:在Oracle12.2中 從Non-CDB遷移到PDB,從PDB遷移另一個CDB中Oracle
- Oracle 12c 多租戶專題|CDB後設資料內幕Oracle
- Oracle多租戶管理員指南-CDB共性概念03Oracle
- oracle 12c 針對cdb的差異0備與對pdb進行恢復Oracle
- Part III PDB建立概述-Oracle多租戶管理員指南Oracle
- oracle 12c PDB隨CDB啟動和連結PDB的方式Oracle
- oracle 12c 多租戶體系結構概念Oracle
- Oracle 18c新特性:多租戶艦隊 CDB FleetOracle
- 【12c cdb pdb】實驗
- 【CDB】Oracle CDB/PDB常用管理命令Oracle
- Oracle 12c系列(七) | Non-CDB轉換為PDBOracle
- Oracle 12c系列(一)|多租戶容器資料庫Oracle資料庫
- Part II 建立和配置CDB-Oracle多租戶管理員指南Oracle
- Oracle 12c 備份與恢復Oracle
- Oracle 12C 中CDB和PDB的引數檔案管理Oracle
- Part I CDB中容器概述01-Oracle多租戶管理員指南Oracle
- Part I CDB中服務的概述04-Oracle多租戶管理員指南Oracle
- 12C針對cdb全備與 PDB執行不完全恢復(基於SCN)
- Oracle 12c 建立與刪除CDB、PDBsOracle
- Oracle 12c no-CDB轉換為CDBOracle
- 12C關於CDB、PDB的官方解釋
- Part I CDB中可用性的概述06-Oracle多租戶管理員指南Oracle
- Part I CDB中的Oracle資源管理器概述07-Oracle多租戶管理員指南Oracle
- 12c跨平臺完成PDB的備份遷移
- oracle 19c CDB vs pdb 建立Oracle
- Oracle 12c 手動建立CDB和非CDBOracle
- 多租戶解析與Demo
- Part II 配置和管理多租戶環境概述-Oracle多租戶管理員指南Oracle
- 【RMAN】在多租戶環境下的RMAN備份及恢復
- Oracle 12c CDB&PDBs管理Oracle
- oracle 12c non-cdb升級成cdb模式Oracle模式