一、环境说明:
1、catalog数据库
sid:catalog
username:rman
password:rman
2、备份数据库
sid:orcl
二、操作步骤
1、在catalog数据库上创建用户
]> export ORACLE_SID=catalog
]> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Mar 27 06:10:11 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
> create user rman identified by rman;
User created.
> alter user rman quota unlimited on users;
User altered.
> grant recovery_catalog_owner to rman;
Grant succeeded.
> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
2、编辑tnsnames.ora,增加catalog的tns
]> cd $ORACLE_HOME/network/admin
]> ls
samples shrept.lst sqlnet.ora tnsnames.ora
]> vi tnsnames.ora
catalog =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
(SID = catalog)
)
)
orcl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
(SID = orcl)
)
)
]> tnsping catalog
TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 27-MAR-2009 06:12:00
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
/oracle/app/10g/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))) (CONNECT_DATA = (SID = catalog)))
OK (10 msec)
3、创建catalog,并注册数据库
]> export ORACLE_SID=orcl
]> rman target / catalog
Recovery Manager: Release 10.2.0.1.0 - Production on Fri Mar 27 06:12:35 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: ORCL (DBID=1210313093)
connected to recovery catalog database
RMAN> create catalog tablespace users;
recovery catalog created
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN> exit
Recovery Manager complete.[@more@]