pdb数据库冷备恢复不需要完全关闭cdb数据库,只需要pdb数据库启动到mounted状态即可。
1.确保需要冷备的pdb1的open mode是mounted状态
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB READ WRITE NO
4 PDB1 MOUNTED
2.备份pdb1
[oracle@ora12c cdb]$ cp -r pdb1 pdb_bak
3.删除pdb1
[oracle@ora12c cdb]$ rm -rf pdb1
4.把pdb1数据库open
SQL> alter pluggable database pdb1 open;
alter pluggable database pdb1 open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 44 - see DBWR trace file
ORA-01110: data file 44: '/u01/app/oracle/oradata/cdb/pdb1/pdb_users01.dbf'
5.利用冷备还原
[oracle@ora12c cdb]$ mv pdb_bak pdb1
6.重新把pdb1数据库open。
SQL> alter pluggable database pdb1 open;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB READ WRITE NO
4 PDB1 READ WRITE NO
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29502549/viewspace-1853460/,如需转载,请注明出处,否则将追究法律责任。