客户端test到另一个数据库(rhel2)的网络服务名是rhel2。在rhel2数据库上面创建恢复目录/恢复数据库。
test:
1.以用户sys的身份连接rhel2数据库
SQL> conn sys/oracle@rhel2 as sysdba
Connected.
2.创建表空间
SQL> create tablespace tbs_catalog
2 datafile '/u01/app/oracle/oradata/orcl/catalog.dbf' size 10M;
SQL> create user rman identified by oracle
2 temporary tablespace temp
3 default tablespace tbs_catalog
4 quota unlimited on tbs_catalog;
SQL> grant recovery_catalog_owner to rman;
[oracle@linux5 ~]$ rman
Recovery Manager: Release 10.2.0.1.0 - Production on Fri Jul 25 08:34:01 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
RMAN> connect catalog rman@rhel2
recovery catalog database Password:
RMAN> create catalog tablespace tbs_catalog;
SQL> connect rman/oracle@rhel2
Connected.
SQL> select table_name from user_tables;
TABLE_NAME
------------------------------
ROUT
RCVER
DB
NODE
CONF
DBINC
CKP
TS
TSATT
DF
DFATT
TABLE_NAME
------------------------------
TF
TFATT
OFFR
RR
RT
ORL
RLH
AL
BS
BP
BCF
TABLE_NAME
------------------------------
CCF
XCF
BSF
BDF
CDF
XDF
BRL
BCB
CCB
SCR
SCRL
TABLE_NAME
------------------------------
CONFIG
XAL
RSR
FB
37 rows selected.
有这些表说明恢复目录创建成功。
把数据库注册到恢复目录:
[oracle@linux5 ~]$ rman
Recovery Manager: Release 10.2.0.1.0 - Production on Fri Jul 25 08:48:29 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
连接到目标数据库:
RMAN> connect target system
target database Password:
connected to target database: ORCL (DBID=1368292794)
连接到恢复目录:
RMAN> connect catalog rman/oracle@rhel2
connected to recovery catalog database
把目标数据库的信息注册到恢复目录:
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN>
test:
1.以用户sys的身份连接rhel2数据库
SQL> conn sys/oracle@rhel2 as sysdba
Connected.
2.创建表空间
SQL> create tablespace tbs_catalog
2 datafile '/u01/app/oracle/oradata/orcl/catalog.dbf' size 10M;
Tablespace created.
SQL> create user rman identified by oracle
2 temporary tablespace temp
3 default tablespace tbs_catalog
4 quota unlimited on tbs_catalog;
User created.
SQL> grant recovery_catalog_owner to rman;
Grant succeeded.
[oracle@linux5 ~]$ rman
Recovery Manager: Release 10.2.0.1.0 - Production on Fri Jul 25 08:34:01 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
RMAN> connect catalog rman@rhel2
recovery catalog database Password:
connected to recovery catalog database
RMAN> create catalog tablespace tbs_catalog;
recovery catalog created
SQL> connect rman/oracle@rhel2
Connected.
SQL> select table_name from user_tables;
TABLE_NAME
------------------------------
ROUT
RCVER
DB
NODE
CONF
DBINC
CKP
TS
TSATT
DF
DFATT
TABLE_NAME
------------------------------
TF
TFATT
OFFR
RR
RT
ORL
RLH
AL
BS
BP
BCF
TABLE_NAME
------------------------------
CCF
XCF
BSF
BDF
CDF
XDF
BRL
BCB
CCB
SCR
SCRL
TABLE_NAME
------------------------------
CONFIG
XAL
RSR
FB
37 rows selected.
有这些表说明恢复目录创建成功。
把数据库注册到恢复目录:
[oracle@linux5 ~]$ rman
Recovery Manager: Release 10.2.0.1.0 - Production on Fri Jul 25 08:48:29 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
连接到目标数据库:
RMAN> connect target system
target database Password:
connected to target database: ORCL (DBID=1368292794)
连接到恢复目录:
RMAN> connect catalog rman/oracle@rhel2
connected to recovery catalog database
把目标数据库的信息注册到恢复目录:
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN>