Chinaunix首页 | 论坛 | 博客
  • 博客访问: 679979
  • 博文数量: 163
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1625
  • 用 户 组: 普通用户
  • 注册时间: 2014-11-24 11:40
个人简介

资深Oracle数据库专家 OCM认证大师 10年数据库相关服务及开发经验 各类数据库相关方案的编写,管理及实施 数据中心数据库日常运维、大型项目割接、性能优化等方面有丰富的实战经验 客户包括: 电信,银行,保险,航空,国网,汽车,烟草等 想要一起学习探讨数据安全技术的请加qq群 256041954

文章分类

全部博文(163)

文章存档

2017年(2)

2016年(112)

2015年(38)

2014年(11)

我的朋友

分类: 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> }
阅读(4335) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~