Oracle 12c multi-tenant CDB and PDB backup ____oracle

Source: Internet
Author: User

First, CDB backup

1.1 Backup only CDB backup CDB database requires a user with SYSDBA or sysbackup permissions to connect to the CDB root environment, execute the backupdatabase root command to complete the backup of CDB, as follows:
[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 is backed up in Noarchivelog mode.
Note: Only backup CDB requires the database in the archive environment, the data set to the archive mode.
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 the PDB below it is similar to a non-CDB database method, using a user with SYSDBA or sysbackup permissions to connect to the CDB root environment, and then execute the backupdatabase command to complete the CDB backup. The method is as follows:
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. Back up single and multiple PDB
Allow backup of one or more PDB databases in CDB (if you are backing up multiple PDB, simply follow the name of the PDB instance you want to back up after the backup command, as the following backup pluggable database pdb1,pdb2; , backing up a PDB database can be backed up by two of the following ways:
Note: If archive mode is not turned on, separate backup CDB or PDB will report ora-19602:cannot Backup or copy active file in Noarchivelog mode
Mode one: Back up one or more PDB databases using the Backup pluggable Database command at CDB root (root).
[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
The backup defaults to the Flashback recovery area.

Mode two: Use Backup database in the PDB to back up the currently connected PDB databases, provided that the Tnsnames.ora files are configured.
[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

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.