有时间了,玩玩rman.
网上很多rman的教程和实例,我也玩玩。先从创建开始。
 
我两台机器,每个机器上一个oracle 10g 库
1机器的ip:172.20.52.84
做为target库,我们从此机器上登陆
 
在此机器上配个tnsnames.ora用于连接另一台机器
连接符为catalog
 
2机器的ip:172.20.52.215
做为catalog库,在此机器上启监听。
 
上面是实验环境。
 
我们先来配2机器:
首先,我们先启监听:
[root@xn-test ~]# ps -aux|grep ora|grep lsnr
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
oracle    8621  0.0  0.5  42212  6028 ?        Ssl  13:48   0:02 /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr catalog -inherit
oracle    8627  0.0  0.4  18852  4216 pts/1    S+   13:48   0:00 lsnrctl
 
[root@xn-test ~]# cat /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
CATALOG =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 172.20.52.215)(PORT = 1521))
  )
 
接下来,我们建catalog相关内容
SQL> create tablespace sp_catalog datafile '/u01/app/oracle/oradata/orcl/spcatalog.dbf' size 300m;       
Tablespace created.
SQL> create user rman identified by rman default tablespace sp_catalog temporary tablespace temp;
User created.
SQL> grant connect,resource to rman;
Grant succeeded.
SQL> grant recovery_catalog_owner to rman;
Grant succeeded.
 
来到1机器上:
配个tns:
[oracle@xn-test admin]$ cat /u01/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
CATALOG =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.20.52.215)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )
 
[oracle@xn-test ~]$ rman target sys/oracle catalog rman/rman@catalog
连接库
从1上登陆的所以不用在1上启监听直接登陆就行
catalog rman/rman@catalog 这行是说明:去接远程的catalog库,通过本地的tnsnames.ora去连。连接符是catalog
 
RMAN> create catalog tablespace "SP_CATALOG";
recovery catalog created
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
 
建表和把库注册到catalog库