建立恢復目錄catalog並註冊目標庫
建立恢復目錄,並註冊目標資料庫:
--目標庫A庫:ORA11GR2:target database: ORA11GR2 (DBID=238796283) ----目標資料庫
--客戶端B庫:OCMU: target database: ORA11GR2 (DBID=238796283) ----恢復目錄所有者
--建立表空間:
SQL> create tablespace tscatalog datafile '/u01/app/oracle/oradata/ORCL/tscatalog.dbf' size 15m;
Tablespace created.
--建立恢復目錄所有者並授權:
SQL> CREATE USER rcowner IDENTIFIED BY oracle
2 TEMPORARY TABLESPACE temp
3 DEFAULT TABLESPACE tscatalog
4 QUOTA UNLIMITED ON tscatalog;
User created.
SQL> GRANT recovery_catalog_owner TO rcowner;
Grant succeeded.
--配置指向本庫(目錄所有者所在)的tns檔案:
13 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.6)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORA11GR2)
)
)
--恢復目錄所有者連線本庫,建立恢復目錄:
[oracle@enmo ~]$ rman catalog rcowner/oracle@13
Recovery Manager: Release 11.2.0.4.0 - Production on Sun Oct 16 15:50:54 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to recovery catalog database
RMAN> create catalog;
recovery catalog created
恢復目錄建立成功。
--在恢復目錄中註冊目標資料庫(oracle虛擬機器上的ORA11GR2庫 ,ORA11GR2:target database: ORA11GR2 (DBID=238796283))
rman target sys/skysky@11 catalog rcowner/oracle@13
[oracle@enmo ~]$
[oracle@enmo ~]$ rman target sys/skysky@11 catalog rcowner/oracle@13
Recovery Manager: Release 11.2.0.4.0 - Production on Sun Oct 16 15:57:58 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORA11GR2 (DBID=238796283)
connected to recovery catalog database
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
目標庫A庫註冊成功。
--檢視註冊了的目標資料庫:
[oracle@enmo ~]$ sqlplus rcowner/oracle@13
SQL*Plus: Release 11.2.0.4.0 Production on Sun Oct 16 16:01:35 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 238796283 ORA11GR2 925702 10-SEP-16
--取消註冊目標庫:
SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@enmo ~]$
[oracle@enmo ~]$
[oracle@enmo ~]$
[oracle@enmo ~]$ rman target sys/skysky@11 catalog rcowner/oracle@13
Recovery Manager: Release 11.2.0.4.0 - Production on Sun Oct 16 16:04:59 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORA11GR2 (DBID=238796283)
connected to recovery catalog database
RMAN> unregister database;
database name is "ORA11GR2" and DBID is 238796283
Do you really want to unregister the database (enter YES or NO)? y
database unregistered from the recovery catalog
SQL> select * from RC_DATABASE;
no rows selected
登出成功。
--目標庫A庫:ORA11GR2:target database: ORA11GR2 (DBID=238796283) ----目標資料庫
--客戶端B庫:OCMU: target database: ORA11GR2 (DBID=238796283) ----恢復目錄所有者
--建立表空間:
SQL> create tablespace tscatalog datafile '/u01/app/oracle/oradata/ORCL/tscatalog.dbf' size 15m;
Tablespace created.
--建立恢復目錄所有者並授權:
SQL> CREATE USER rcowner IDENTIFIED BY oracle
2 TEMPORARY TABLESPACE temp
3 DEFAULT TABLESPACE tscatalog
4 QUOTA UNLIMITED ON tscatalog;
User created.
SQL> GRANT recovery_catalog_owner TO rcowner;
Grant succeeded.
--配置指向本庫(目錄所有者所在)的tns檔案:
13 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.6)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORA11GR2)
)
)
--恢復目錄所有者連線本庫,建立恢復目錄:
[oracle@enmo ~]$ rman catalog rcowner/oracle@13
Recovery Manager: Release 11.2.0.4.0 - Production on Sun Oct 16 15:50:54 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to recovery catalog database
RMAN> create catalog;
recovery catalog created
恢復目錄建立成功。
--在恢復目錄中註冊目標資料庫(oracle虛擬機器上的ORA11GR2庫 ,ORA11GR2:target database: ORA11GR2 (DBID=238796283))
rman target sys/skysky@11 catalog rcowner/oracle@13
[oracle@enmo ~]$
[oracle@enmo ~]$ rman target sys/skysky@11 catalog rcowner/oracle@13
Recovery Manager: Release 11.2.0.4.0 - Production on Sun Oct 16 15:57:58 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORA11GR2 (DBID=238796283)
connected to recovery catalog database
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
目標庫A庫註冊成功。
--檢視註冊了的目標資料庫:
[oracle@enmo ~]$ sqlplus rcowner/oracle@13
SQL*Plus: Release 11.2.0.4.0 Production on Sun Oct 16 16:01:35 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 238796283 ORA11GR2 925702 10-SEP-16
--取消註冊目標庫:
SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@enmo ~]$
[oracle@enmo ~]$
[oracle@enmo ~]$
[oracle@enmo ~]$ rman target sys/skysky@11 catalog rcowner/oracle@13
Recovery Manager: Release 11.2.0.4.0 - Production on Sun Oct 16 16:04:59 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORA11GR2 (DBID=238796283)
connected to recovery catalog database
RMAN> unregister database;
database name is "ORA11GR2" and DBID is 238796283
Do you really want to unregister the database (enter YES or NO)? y
database unregistered from the recovery catalog
SQL> select * from RC_DATABASE;
no rows selected
登出成功。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31392094/viewspace-2127106/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【備份恢復】之RMAN 恢復目錄庫(客戶端備份資訊註冊到目標庫恢復目錄中)客戶端
- 【RMAN】使用恢復目錄catalog備份目標資料庫的演示資料庫
- 【備份恢復】RMAN catalog 恢復目錄資料庫資料庫
- 在恢復目錄中註冊和登出資料庫資料庫
- 建立恢復目錄recover catalog(OCM複習總結)
- 使用RMAN恢復目錄(catalog)解析
- 【RMAN】資料庫到恢復目錄的註冊過程資料庫
- 建立catalog並註冊資料庫資料庫
- RMAN-在恢復目錄中註冊和取消資料庫資料庫
- 恢復目錄資料庫(Recovery Catalog)作用及演示例項資料庫
- rman之建立恢復目錄筆記筆記
- 把印章系統資料庫註冊到cwyy例項上的恢復目錄資料庫
- 玩轉恢復目錄資料庫(一)資料庫
- 玩轉恢復目錄資料庫(二)資料庫
- 玩轉恢復目錄資料庫(四)資料庫
- RMAN恢復目錄資料庫的搭建資料庫
- 恢復目錄資料庫備份指令碼資料庫指令碼
- rman不使用恢復目錄恢復資料庫示例及問題資料庫
- Oracle 11G 恢復目錄Oracle
- DB2建立catalog編目DB2
- python標準庫目錄Python
- ORACLE RMAN異機異目錄恢復Oracle
- ORACLE建立資料庫時無法建立目錄Oracle資料庫
- RAC安裝目錄許可權快速恢復
- Oracle 目錄許可權丟失故障恢復Oracle
- 恢復目錄比控制檔案的優勢
- linux 壓縮目錄並排除某個目錄Linux
- linux建立賬戶並自動生成主目錄和主目錄下的檔案Linux
- stream目標庫建立trigger無效
- 生產庫的恢復目錄被RMAN恢復出來的資料庫庫使用後出現的問題資料庫
- 透過搭建恢復目錄實現RMAN異地備份和恢復
- Godot遍歷目錄下檔案,並建立按鈕Go
- Oracle 10g使用RMAN恢復目錄筆記Oracle 10g筆記
- sun 的ufsrestore是恢復在當前目錄下REST
- 企業生產案例:批量建立目錄並移動帶日期檔案到相應目錄
- Linux批量建立目錄Linux
- linux建立目錄命令Linux
- oracle實驗記錄 (恢復-rman catalog)Oracle