1.错误现象
[oracle@localhost ~]$ rman target /
Recovery Manager: Release 12.2.0.1.0 - Production on Wed Mar 15 10:09:49 2017
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
connected to target database: CHARLES (DBID=1208806606)
RMAN> backup database charlespdb;
Starting backup at 15-MAR-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=65 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 03/15/2017 10:10:12
RMAN-06817: Pluggable Database CHARLESPDB cannot be backed up in NOARCHIVELOG mode.
RMAN> exit
2.解决步骤
因为只有cdb才有redo,所以非归档模式与归档模式也应该在cdb里修改
[oracle@localhost ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Wed Mar 15 10:24:17 2017
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> show con_name;
CON_NAME
------------------------------
CDB$ROOT
SQL>
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 771751936 bytes
Fixed Size 8797536 bytes
Variable Size 608174752 bytes
Database Buffers 46137344 bytes
Redo Buffers 3784704 bytes
In-Memory Area 104857600 bytes
Database mounted.
SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.
3.再次备份成功
RMAN> backup database charlespdb;
Starting backup at 15-MAR-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=63 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=00013 name=/u01/app/oralce/oradata/charles/charlespdb/test01.dbf
input datafile file number=00010 name=/u01/app/oralce/oradata/charles/charlespdb/sysaux01.dbf
input datafile file number=00009 name=/u01/app/oralce/oradata/charles/charlespdb/system01.dbf
input datafile file number=00011 name=/u01/app/oralce/oradata/charles/charlespdb/undotbs01.dbf
input datafile file number=00012 name=/u01/app/oralce/oradata/charles/charlespdb/users01.dbf
channel ORA_DISK_1: starting piece 1 at 15-MAR-17
channel ORA_DISK_1: finished piece 1 at 15-MAR-17
piece handle=/u01/app/oralce/product/12.2.0/dbhome_1/dbs/01rv6efs_1_1 tag=TAG20170315T102252 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 15-MAR-17
Starting Control File and SPFILE Autobackup at 15-MAR-17
piece handle=/u01/app/oralce/product/12.2.0/dbhome_1/dbs/c-1208806606-20170315-00 comment=NONE
Finished Control File and SPFILE Autobackup at 15-MAR-17