Oracle 12c Multi-tenant CDB and PDB backup

Source: Internet
Author: User

First, CDB backup

1.1 Backup CDB only

To back up the CDB database only requires a user with SYSDBA or sysbackup permissions to connect to the CDB root environment, perform the backupdatabase root command to complete a backup of CDB, as follows:
[[email protected] ~]$ Rman target/
[Email protected] ~]$ 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 is backed up in Noarchivelog mode.
Note: Backing up CDB only requires the database to set the data to archive mode in the archive environment.
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. Back up the entire CDB and all the PDB below it
Backing up the entire CDB database and all of its following PDB are similar to non-CDB database methods, using the SYSDBA or Sysbackup permissions user to connect to the CDB root environment, and then execute the backupdatabase command to complete the backup of the entire CDB. Here's how:
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

Second, backup PDB

1.1. Backing up single and multiple PDB
Allow backup of one or more PDB databases in CDB (if you are backing up multiple PDB, just follow the backup command with the names of the PDB instances you want to back up, as follows, backup pluggable database pdb1,pdb2; ), backing up a PDB database can be backed up in one of the following two ways:
Note: If the archive mode is not turned on, separate backup CDB or PDB will be reported ora-19602:cannot backup or copy active file in Noarchivelog mode
Mode one: Use the Backup pluggable Database command to back up one or more PDB databases at CDB root (root).
[[email protected] ~]$ 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
The backup is in the Flashback recovery area by default.

Method Two: Use Backup database in the PDB to back up the currently connected PDB database, provided that the Tnsnames.ora file is configured properly.
[Email protected] ~]$ Rman target Sys/[email protected]: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

Oracle 12c Multi-tenant CDB and PDB backup

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.