ram是oracle数据库备份里使用最多的热备方式,本文从结构上让操作者了解rman的备份机理,如何将目标数据库注册到rman数据库上
Target 数据库
| 应用数据库 ora815 NBU CLIENT Oracle agent for nbu Internal/oracle Internal/oracle@ora815 |
|
|
|
|
|
|
▼
Rman 数据库
| Rman Db orarman Rman catalog Rman /rman Rman/ramn@oraramn |
有关拓扑图的说明:
下面的命令$ rman target internal/oracle@ora815 catalog rman/rman@orarman ;
表示在Target 数据库上运行RMAN命令,先连接数据库本身,然后将Target 数据库本身同RMAN数据库关联起来.然后再注册.注意次序不要搞混,是主动注册到RMAN数据库.而不是RMAN数据库来联系.
一 RMAN数据库上:
------------------------------------------------------------]
1.创建RMAN用户的表空间
SVRMGR> create tablespace rmantable
2> datafile '/u01/oradata/ora815/rmantable.dbf' size
经验之谈:在oracle
-----------------------------------------------------------
------------------------------------------------------------
2.创建RMAN 用户.
SVRMGR> create user rman identified by rman
2> DEFAULT TABLESPACE rmantable
3> TEMPORARY TABLESPACE temp
4> QUOTA UNLIMITED ON rmantable;
Statement processed.
-------------------------------------------------------------
-------------------------------------------------------------
3.给RMAN用户授权.
SVRMGR> grant recovery_catalog_owner to rman;
语句已处理。
SVRMGR>grant connect,resource to rman;
Statement processed.
--------------------------------------------------------------
---------------------------------------------------------------
4.如果是8i:,则通过create catalog来实现。
$ rman catalog rman/rman;
Recovery Manager: Release
RMAN-06008: connected to recovery catalog database
RMAN-06428: recovery catalog is not installed
RMAN>connect catalog rman/rman@orarman
说明: rman/rman@orarman orarman表示rman所在的本身数据库的名称.
RMAN|>create catalog tablespace rmantable;
RMAN-06431: recovery catalog created
--------------------------------------------------------------
5.如果是
connect rman/rman;(注意必须以rman身份登录)
@../rdbms/admin/catrman.sql:
最后的执行结果是:
No errors for PACKAGE DBMS_RCVCAT
Statement processed.
No errors for PACKAGE BODY DBMS_RCVCAT
Statement processed.
No errors for PACKAGE DBMS_RCVMAN
Statement processed.
No errors for PACKAGE BODY DBMS_RCVMAN
----------------------------------------------
------------------------------------------------
二.在Target 数据库上将本身DB注册到RMAN 数据库上.
rman target internal/oracle@ora815 catalog rman/rman@orarman;
Recovery Manager: Release
RMAN-06005: connected to target database: ORA815 (DBID=1560757381)
RMAN-06008: connected to recovery catalog database
RMAN>
RMAN> register database;
RMAN-03022: compiling command: register
RMAN-03023: executing command: register
RMAN-08006: database registered in recovery catalog
RMAN-03023: executing command: full resync
RMAN-08029: snapshot controlfile name set to default value: ?/dbs/snapcf_@.f
RMAN-08002: starting full resync of recovery catalog
RMAN-08004: full resync complete