资深Oracle数据库专家 OCM认证大师 10年数据库相关服务及开发经验 各类数据库相关方案的编写,管理及实施 数据中心数据库日常运维、大型项目割接、性能优化等方面有丰富的实战经验 客户包括: 电信,银行,保险,航空,国网,汽车,烟草等 想要一起学习探讨数据安全技术的请加qq群 256041954
全部博文(163)
分类: Oracle
2016-04-22 22:26:35
由于12c有CDB和PDB的概念。rman在备份使用上会有点区别。
备份:
1.备份全部的数据库(包括CDB)
[oracle@ora12c ~]$ rman target / Recovery Manager: Release 12.1.0.1.0 - Production on Thu Jan 23 14:42:27 2014 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. connected to target database: ORADBCA (DBID=261209273) RMAN> BACKUP DATABASE;
2.只备份CDB
[oracle@ora12c ~]$ rman target / Recovery Manager: Release 12.1.0.1.0 - Production on Thu Jan 23 14:46:10 2014 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. connected to target database: ORADBCA (DBID=261209273) RMAN> BACKUP DATABASE ROOT;
3.只备份PDB(一个或多个)
单个CDB备份:
[oracle@ora12c ~]$ rman target=sys/oracle@pdb1 Recovery Manager: Release 12.1.0.1.0 - Production on Thu Jan 23 14:48:00 2014 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. connected to target database: ORADBCA (DBID=261209273) RMAN> BACKUP DATABASE;
或者
[oracle@ora12c ~]$ rman target / Recovery Manager: Release 12.1.0.1.0 - Production on Thu Jan 23 14:48:46 2014 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. connected to target database: ORADBCA (DBID=261209273) RMAN> BACKUP PLUGGABLE DATABASE pdb1;
多个CDB备份:
[oracle@ora12c ~]$ rman target / Recovery Manager: Release 12.1.0.1.0 - Production on Thu Jan 23 14:49:29 2014 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. connected to target database: ORADBCA (DBID=261209273) RMAN> BACKUP PLUGGABLE DATABASE pdb1,pdb2;
4.只备份其中的某一个表空间
这个和原来的没啥区别,只需要rman登入要备份那个数据库就行了。
[oracle@ora12c ~]$ rman target=sys/oracle@pdb1 Recovery Manager: Release 12.1.0.1.0 - Production on Thu Jan 23 14:53:54 2014 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. connected to target database: ORADBCA (DBID=261209273) RMAN> BACKUP TABLESPACE users;
还原:
1.全部数据库还原
[oracle@ora12c ~]$ rman target / Recovery Manager: Release 12.1.0.1.0 - Production on Thu Jan 23 15:11:23 2014 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. connected to target database: ORADBCA (DBID=261209273) RMAN> run 2> { 3> startup mount; 4> restore database; 5> recover database; 6> alter database open; 7> }
2.只CDB还原
[oracle@ora12c ~]$ rman target / Recovery Manager: Release 12.1.0.1.0 - Production on Thu Jan 23 15:12:41 2014 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. connected to target database: ORADBCA (DBID=261209273) RMAN> run 2> { 3> startup mount; 4> restore database root; 5> recover database root; 6> alter database open; 7> }
3.只PDB还原(一个或者多个)
[oracle@ora12c ~]$ rman target / Recovery Manager: Release 12.1.0.1.0 - Production on Thu Jan 23 15:20:14 2014 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. connected to target database: ORADBCA (DBID=261209273) RMAN> run 2> { 3> alter pluggable database pdb1, pdb2 close; 4> restore pluggable database pdb1, pdb2; 5> recover pluggable database pdb1, pdb2; 6> alterpluggable database pdb1, pdb2 open; 7> }