oracle 配置 catalog 成功恢复control file
再说catalog 的配置:
1: catalog 数据库上:
export oracle_sid=ezhoudg
1>在catalog数据库上创建一个表空间供catalog使用
create tablespace rman_ts datafile '/u02/ezhou/rman01.dbf' size 50m extent management local uniform size 126k;
2>在catalog数据库上创建用户并赋予权限
create user rman_user identified by rman_user default tablespace rman_ts quota unlimited on rman_ts;
grant recovery_catalog_owner to rman_user;
grant connect,resource to rman_user;
2: 在主数据库上ezhou:
vi tnsname.ora (这个文件是在ezhou 和ezhoudg)
[oracle@aoracle admin]$ vi tnsnames.ora
prd =
(description =
(address_list =
(address = (protocol = tcp)(host = 192.168.190.140)(port = 1521))
)
(connect_data =
(sid = ezhou)
)
)
catalog =
(description =
(address_list =
(address = (protocol = tcp)(host = 192.168.190.140)(port = 1521))
)
(connect_data =
(sid = ezhoudg)
)
)
启动监听lsnrctl start
在数据库上tnsping catalog
[oracle@aoracle ~]$ tnsping catalog
tns ping utility for linux: version 10.2.0.1.0 - production on 09-dec-2011 19:41:31
copyright (c) 1997, 2005, oracle. all rights reserved.
used parameter files:
used tnsnames adapter to resolve the alias
attempting to contact (description = (address_list = (address = (protocol = tcp)(host = 192.168.190.140)(port = 1521))) (connect_data = (sid = ezhoudg)))
ok (10 msec)
3: 在主数据库上:
export oracle_sid=ezhou
注册主数据库 到catalog
[oracle@aoracle ~]$ rman target / catalog rman_user/rman_user@catalog
recovery manager: release 10.2.0.1.0 - production on fri dec 9 19:45:32 2011
copyright (c) 1982, 2005, oracle. all rights reserved.
connected to target database (started)
connected to recovery catalog database
rman> create catalog tablespace rman_ts;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
=====================
下面进行测试一下:
[oracle@aoracle ~]$ rman target / catalog rman_user/rman_user@catalog
rman> run {
2> restore controlfile;
3> }
starting restore at 09-dec-11
allocated channel: ora_disk_1
channel ora_disk_1: sid=155 devtype=disk
channel ora_disk_1: starting datafile backupset restore
channel ora_disk_1: restoring control file
channel ora_disk_1: reading from backup piece /u02/rman/ctl_c-4046377924-20111209-00
channel ora_disk_1: restored backup piece 1
piece handle=/u02/rman/ctl_c-4046377924-20111209-00 tag=tag20111209t115410
channel ora_disk_1: restore complete, elapsed time: 00:00:04
output filename=/u02/ezhou/control01.ctl
output filename=/u02/ezhou/control02.ctl
output filename=/u02/ezhou/control03.ctl
finished restore at 09-dec-11
,