首先建立表空間 數據庫
create tablespace rc_tbs datafile ‘/u01/Identify/database/oradata/rc_data.dbf’
size 200m autoextend on next 10m; oracle
再建立用戶 app
create user rcowner identified by oracle
temporary tablespace temp default tablespace rc_tbs quota unlimited on rc_tbs; ide
給用戶權限 spa
grant recovery_catalog_owner to rcowner; 命令行
找到你的tnsname.ora文件位置 ip
我在這列出個人位置/u01/app/oracle/product/11.2.0/db_1/network/admin get
more tnsmane.ora 同步
這是個人tnsname.ora文件中內容 it
BUSDEV =
(DESCRIPTION =
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = busdev)
)
)
cat /etc/hosts ##查看hosts文件中內容
#public IP
10.8.234.35 YKT-DB-SRV3
10.8.234.36 YKT-DB-SRV4
#VIP
10.8.234.37 YKT-DB-SRV3-vip
10.8.234.38 YKT-DB-SRV4-vip
#private IP
1.1.1.3 YKT-DB-SRV3-pvt
1.1.1.4 YKT-DB-SRV4-pvt
10.8.234.40 BUS-DB-scan
接下來配置tnsname.ora
將上面的內容加入到目的數據庫上的tnsname.ora文件中
注意:將(ADDRESS = (PROTOCOL = TCP)(HOST =
BUS-DB-scan)(PORT = 1521))這一行中的(HOST = BUS-DB-scan)中的BUS-DB-scan改成恢復數據庫/etc/hosts文件中對應的IP地址
個人tnsname.ora修改以後是這樣的
YKTDEV =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =
HSYKT_TEST_DEV_APP_03)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = yktdev)
)
)
BUSDEV =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.234.40)(PORT
= 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = busdev)
)
)
接下來就在目的數據上用oracle用戶在命令行輸入
rman target / catalog rcowner/oracle@busdev
RMAN> register database;
出現以上三行信息,說明你註冊成功了
在目的數據庫物理結構發生變化以後,首先鏈接目的數據庫和恢復編錄
rman target / catalog rcowner/oracle@busdev
starting full resync of recovery catalog
full resync complete
同步完成!