【備份恢復】之RMAN 恢復目錄庫(客戶端備份資訊註冊到目標庫恢復目錄中)
描述:
在B庫建立恢復目錄,使用者名稱/密碼,rcadmin/oracle,建立成功後,註冊A庫至恢復目錄
答:
B庫:192.168.10.3
A庫:192.168.10.2
B庫操作:
1.建立恢復目錄所有者預設表空間:
[oracle@bing dbs]$ echo $ORACLE_SID
OCMU
[oracle@bing dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Mon Oct 10 15:26:02 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create tablespace ts_catalog datafile '/u01/app/oracle/oradata/OCMU/ts_catalog.dbf' size 15m;
Tablespace created.
2.建立恢復目錄所有者,並授予RECOVERY_CATALOG_OWNER角色
SQL> create user rcadmin identified by oracle temporary tablespace temp default tablespace ts_catalog quota unlimited on ts_catalog;
User created.
SQL> grant recovery_catalog_owner to rcadmin;
Grant succeeded.
3.配置本庫自己的tnsnames.ora及別名:(已配置好了)
[oracle@bing ~]$ cd /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/
[oracle@bing admin]$ ls
listener.ora samples shrept.lst tnsnames.ora
[oracle@bing admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
12 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.3)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORA11GR2 )
)
)
[oracle@bing admin]$
——驗證:
[oracle@bing admin]$ tnsping 12
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 10-OCT-2016 15:36:02
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.3)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORA11GR2)))
OK (10 msec)
4.建立恢復目錄:
[oracle@bing admin]$ rman catalog rcadmin/oracle@12
Recovery Manager: Release 11.2.0.4.0 - Production on Mon Oct 10 15:48:55 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to recovery catalog database
RMAN> create catalog;
recovery catalog created
注 :create catalog的動作是在rcadmin使用者下建立了恢復目錄相關的表,表的預設表空間使用的就是使用者的預設表空間,如果,相關表指定其他表空間,那麼在執行建立的時候加上指定表空間名稱
create catalogtablespacets_name;
5.註冊目標資料庫(在B庫上操作):
——建立對於A庫的tns
[oracle@bing admin]$ vi tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
12 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.3)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORA11GR2)
)
)
110 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.2)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORA11GR2)
)
)
~
"tnsnames.ora" 21L, 517C written
[oracle@bing admin]$
——測試;
[oracle@bing admin]$ tnsping 110
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 10-OCT-2016 16:08:19
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.2)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORA11GR2)))
OK (10 msec)
——在B庫的恢復目錄中註冊A庫
[oracle@bing admin]$ rman target sys/oracle@110 catalog rcadmin/oracle@12
Recovery Manager: Release 11.2.0.4.0 - Production on Mon Oct 10 16:10:15 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORA11GR2 (DBID=237843809)
connected to recovery catalog database
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
6.檢視已註冊的目標庫(B庫操作):
[oracle@bing admin]$ sqlplus rcadmin/oracle@12
SQL*Plus: Release 11.2.0.4.0 Production on Mon Oct 10 16:12:20 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select * from rc_database;
DB_KEY DBINC_KEY DBID NAME RESETLOGS_CHANGE# RESETLOGS
---------- ---------- ---------- -------- ----------------- ---------
1 2 237843809 ORA11GR2 1238936 10-OCT-16
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31397003/viewspace-2126515/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【備份恢復】RMAN catalog 恢復目錄資料庫資料庫
- 【RMAN】使用恢復目錄catalog備份目標資料庫的演示資料庫
- 恢復目錄資料庫備份指令碼資料庫指令碼
- 建立恢復目錄catalog並註冊目標庫
- 透過搭建恢復目錄實現RMAN異地備份和恢復
- 【RMAN】資料庫到恢復目錄的註冊過程資料庫
- RMAN說,我能備份(12)--RMAN中的恢復目錄和備份優化優化
- RMAN-在恢復目錄中註冊和取消資料庫資料庫
- 【備份恢復】利用 備份控制檔案到指定目錄下的控制檔案 恢復控制檔案
- 在恢復目錄中註冊和登出資料庫資料庫
- 【備份恢復】從備份恢復資料庫資料庫
- RMAN備份恢復——備份到帶庫的效能
- RMAN恢復目錄資料庫的搭建資料庫
- rman之建立恢復目錄筆記筆記
- rman不使用恢復目錄恢復資料庫示例及問題資料庫
- RMAN備份恢復整個庫
- RMAN備份恢復——備份到帶庫的效能(二)
- Oracle備份恢復之熱備份恢復及異機恢復Oracle
- RMAN備份與恢復之加密備份加密
- 備份與恢復:polardb資料庫備份與恢復資料庫
- ORACLE DG從庫 Rman備份恢復Oracle
- [記錄]oracle RMAN 備份恢復總結Oracle
- RMAN備份恢復原理
- Oracle資料庫備份與恢復之RMANOracle資料庫
- ORACLE RMAN異機異目錄恢復Oracle
- 使用RMAN恢復目錄(catalog)解析
- 【備份恢復】noarchive模式下使用增量備份恢復資料庫Hive模式資料庫
- RMAN備份恢復之控制檔案的恢復(三)
- RMAN備份恢復之控制檔案的恢復(二)
- RMAN備份恢復之控制檔案的恢復(一)
- rman備份恢復命令之switch
- RMAN備份恢復之NETBACKUP客戶端存在多個策略客戶端
- rman資料庫全庫備份與恢復資料庫
- 玩轉恢復目錄資料庫(一)資料庫
- 玩轉恢復目錄資料庫(二)資料庫
- 玩轉恢復目錄資料庫(四)資料庫
- 【管理篇備份恢復】備份恢復基礎
- oracle實驗記錄 (恢復-rman增量備份)Oracle