建立恢復目錄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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- python標準庫目錄Python
- linux 壓縮目錄並排除某個目錄Linux
- RAC安裝目錄許可權快速恢復
- Oracle 目錄許可權丟失故障恢復Oracle
- Linux批量建立目錄Linux
- vscode markdown建立目錄VSCode
- 透過搭建恢復目錄實現RMAN異地備份和恢復
- Godot遍歷目錄下檔案,並建立按鈕Go
- nodejs建立多層目錄NodeJS
- 能否通過Enterprise Console建立目錄資料庫PW資料庫
- nginx目錄穿越漏洞復現Nginx
- 提取pdf目錄,並且分級
- CentOS8中恢復根目錄為預設許可權CentOS
- Linux建立目錄 mkdir 詳解(全)Linux
- 列出並排序檔案系統根目錄(/)下各個目錄的大小排序
- [AI開發]目標檢測之素材標註AI
- Linux 只複製目錄,不復制目錄下的資料檔案Linux
- 【MySQL 資料庫】MySQL目錄MySql資料庫
- Oracle 備份恢復篇之RMAN catalogOracle
- 在活動目錄裡面建立物件物件
- PPT怎麼設計圖示並列式目錄?PPT設計簡潔的圖示並列式目錄
- 目標檢測資料集,全部有標註
- extundelete工具恢復rm -rf 刪除的目錄(ext4、ext3)delete
- 【資料庫資料恢復】mdb_catalog.wt檔案丟失的MongoDB資料恢復案例資料庫資料恢復MongoDB
- git下載倉庫指定目錄Git
- 使用thin jar啟動並指定lib目錄JAR
- 遊戲目標的篩選、建立、強化遊戲
- python複製資料夾到一個目錄,或者按目錄層級建立複製Python
- IDEA建立maven-java工程無src目錄IdeaMavenJava
- Flask——安裝、建立目錄及初始化Flask
- python 根據時間戳建立目錄操作Python時間戳
- git 命令建立一個資料夾目錄Git
- VUE - 配置根目錄(用@代表src目錄)Vue
- 20181216目錄
- Leetcode目錄LeetCode
- 目錄操作
- 目錄管理
- scl目錄
- ~ 家目錄