12c New Features:使用RMAN连接CDB


Making RMAN Connections to a CDB
本节描述在12c中如何使用RMAN客户端连接CDB和PDB。它包含以下主题:
  • 关于CDBs的备份和恢复
  • 限制连接到PDB(Restrictions When Connected to a PDB)
  • 连接Root为目标(Connecting as Target to the Root)
  • 连接PDB为目标(Connecting as Target to a PDB)
关于CDBs的备份和恢复
你可以对整个CDB、只有root、单个或多个PDB执行RMAN操作。你可以根据以下规则让RMAN连接CDBs:
  • 在整个CDB上执行操作(例如,备份整个CDB)你需要连接到root作为目标。
  • 只对root执行操作(例如,备份root)你需要连接到root作为目标。
  • 对单个PDB执行操作,你可以连接到root或直接的连接PDB作为目标
    • 如果你通过root连接,必须使用PLUGGABLE DATABASE语法使用RMAN命令。例如,备份一个PDB,可以用BACKUP PLUGGABLE DATABASE命令
    • 如果你是直接连接到一个PDB,你可以使用和连接到非CDB一样的命令。例如,备份一个PDB,你可以使用BACKUP DATABASE命令。
  • 通过一个命令在两个或更多的PDBs上执行操作,你需要连接到root作为目标。例如,备份sales和hr的PDB,你可以连接到root,然后提交以下命令:BACKUP PLUGGABLE DATABASE sales,hr;
注意:如果你连接CDB为目标是通过操作系统认证,你就是连接为root。
限制连接到PDB(Restrictions When Connected to a PDB)
当你是直接连接PDB为目标,以下操作是不允许:
  • 备份archive logs
  • 删除archive logs
  • 删除archive logs备份
  • 恢复归档日志(RMAN在media recovery期间需要恢复archived logs)
  • 时间点恢复 Point-in-time recovery (PITR)
  • 表空间时间点恢复(TSPITR,Tablespace Point-in-time Recovery)
  • 表恢复 Table recovery
  • 副本数据库 Duplicate database
  • 闪回操作 Flashback operations
  • 运行数据恢复指导 Running Data Recovery Advisor
  • Report/delete obsolete
  • Register database
  • Import catalog
  • Reset database
  • 配置RMAN环境(使用CONFIGURE命令)
注意:当你连接目录为PDB,你不能连接到恢复目录(recovery catalog)
连接Root为目标(Connecting as Target to the Root)
有多种方法可以连接到root作为目标,以下三个是最常见的方法:
  • 通过普通用户本地连接(Connecting locally as a common user)
  • 通过操作系统认证连接( Connecting with operating system authentication)
  • 普通用户通过Oracle Net Services使用网络服务名连接
在所有的情况下,你连接的用户必须要有SYSDBA货SYSBACKUP权限。
例1使用SYS用户在本地连接到root,这是一个常见的用户,建立连接使用的是SYSDBA权限
例1: Connecting Locally to the Root
[oracle@db12c ~]$ rman target sys
connected to target database: DB12C (DBID=1279217785)
RMAN>
例2: Connecting to the Root with Operating System Authentication
[oracle@db12c ~]$ rman target /
connected to target database: DB12C (DBID=1279217785)
例3:Connecting to the Root with a Net Service Name
rman target c##bkuser@sales
target database Password: password
connected to target database: CDB (DBID=659628168)
连接PDB为目标(Connecting as Target to a PDB)
连接到一个PDB作为目标,你必须:
  • 连接到一个网络服务名称必须解析PDB的数据库服务。
  • 连接到拥有SYSDBA权限的一个本地用户或公共用户
  • 你想要执行RMAN操作的PDB名称
  • 解析对应的网络服务名到对应的PDB数据库服务
  • 在hrpdb PDB上创建对应的local user hrbkup并且授予sysdba权限。
例4:Connecting As Target to a PDB
rman target hrbkup@hrpdb
target database Password: password
connected to target database: CDB (DBID=659628168)

发表评论

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据