使用RMAN恢復目錄(catalog)解析
首先理解什麼是catalog 恢復目錄,實際上就是把資料庫的一部分分出來作為catalog,來長時間存備份資訊,在實際生產中,有時候會遇到要恢復資料庫到一年或是更長時間之前的狀態,我們知道控制檔案存在很多重要的資料庫結構資訊,但是你的控制檔案早已經被覆蓋,你就不能完成任務,而catalog就不一樣了,它可以儲存很長時間,當然它也不只是可以存控制檔案,也可以存別的備份副本,你可以把它簡單的理解成儲存時間長的控制檔案,已經在控制檔案清除的資訊,重新載入回來。
Tablespace created.
1,建立恢復目錄所有者預設表空間
SYS@ENMOEDU> create tablespace ts_catalog datafile '/u01/app/oracle/oradata/ENMOEDU/ts_catalog.dbf' size 15m;
2,建立恢復目錄所有者
SYS@ENMOEDU> grant connect,resource ,recovery_catalog_owner to rcower;
Grant succeeded.
Grant succeeded.
3.建立恢復目錄
[oracle@ENMOEDU ~]$ rman catalog rcower/oracle@ENMOEDU #catalog庫連線到另一個目標資料庫的的網路服務名(就是tnsname.ora 中開頭的名字)為ENMOEDU
Recovery Manager: Release 11.2.0.3.0 - Production on Fri Aug 15 00:37:55 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to recovery catalog database
RMAN> create catalog; #自動建立了恢復目錄相關的表,
recovery catalog created
Recovery Manager: Release 11.2.0.3.0 - Production on Fri Aug 15 00:37:55 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to recovery catalog database
RMAN> create catalog; #自動建立了恢復目錄相關的表,
recovery catalog created
註冊目標資料庫 註冊之後目標資料庫原檔案會同步到catalog
[oracle@ENMOEDU ~]$ rman target sys/oracle@ENMOEDU catalog rcower/oracle@ENMOEDU;
Recovery Manager: Release 11.2.0.3.0 - Production on Fri Aug 15 00:47:57 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ENMOEDU (DBID=87396644)
connected to recovery catalog database
Recovery Manager: Release 11.2.0.3.0 - Production on Fri Aug 15 00:47:57 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ENMOEDU (DBID=87396644)
connected to recovery catalog database
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
檢視已經註冊的目標庫
[oracle@ENMOEDU ~]$ sqlplus rcower/oracle@ENMOEDU
SQL*Plus: Release 11.2.0.3.0 Production on Fri Aug 15 00:51:27 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
RCOWER@ENMOEDU> SELECT * FROM RC_DATABASE;
DB_KEY DBINC_KEY DBID NAME RESETLOGS_CHANGE# RESETLOGS
---------- ---------- ---------- -------- ----------------- ---------
1 2 87396644 ENMOEDU 1 07-OCT-13
SQL*Plus: Release 11.2.0.3.0 Production on Fri Aug 15 00:51:27 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
RCOWER@ENMOEDU> SELECT * FROM RC_DATABASE;
DB_KEY DBINC_KEY DBID NAME RESETLOGS_CHANGE# RESETLOGS
---------- ---------- ---------- -------- ----------------- ---------
1 2 87396644 ENMOEDU 1 07-OCT-13
從恢復目錄中登出目標資料庫
oracle@ENMOEDU ~]$ rman target sys/oracle@ENMOEDU catalog rcower/oracle@ENMOEDU; #目標庫和catalog庫可以為同一個庫,但是實際上是沒有意義的,因為你庫打不開時,是無法使用catalog的
Recovery Manager: Release 11.2.0.3.0 - Production on Fri Aug 15 00:47:57 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ENMOEDU (DBID=87396644)
connected to recovery catalog database
Recovery Manager: Release 11.2.0.3.0 - Production on Fri Aug 15 00:47:57 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ENMOEDU (DBID=87396644)
connected to recovery catalog database
RMAN> unregister database;
將其他備份副本匯入到恢復目錄,
Recovery Manager: Release 11.2.0.3.0 - Production on Fri Aug 15 00:47:57 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ENMOEDU (DBID=87396644)
connected to recovery catalog database
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ENMOEDU (DBID=87396644)
connected to recovery catalog database
將一個檔案匯入恢復目錄
RMAN> catalog backuppiece '/u01/app/oracle/fast_recovery_area/ENMOEDU/backupset/2014_08_16/o1_mf_nnndf_TAG20140816T113253_9yxn76sb_.bkp';
using target database control file instead of recovery catalog
cataloged backup piece
backup piece handle=/u01/app/oracle/fast_recovery_area/ENMOEDU/backupset/2014_08_16/o1_mf_nnndf_TAG20140816T113253_9yxn76sb_.bkp RECID=26 STAMP=855748159
如果使用了快速恢復區,可以這樣一次性匯入。
RMAN> catalog recovery area noprompt;
searching for all files in the recovery area
no files found to be unknown to the database
List of files in Recovery Area not managed by the database
==========================================================
File Name: /u01/app/oracle/fast_recovery_area/ENMOEDU/control02.ctl
RMAN-07526: Reason: File is not an Oracle Managed File
number of files not managed by recovery area is 1, totaling 9.38MB
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29734436/viewspace-1255842/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 備份恢復篇之RMAN catalogOracle
- 備份恢復Lesson 04.Using the RMAN Recovery Catalog
- 透過搭建恢復目錄實現RMAN異地備份和恢復
- RMAN增量恢復
- RMAN恢復實踐
- RMAN深入解析之--Incarnation應用(不完全恢復)
- RMAN恢復之RMAN-06555處理
- 12 使用RMAN備份和恢復檔案
- rman 增量備份恢復
- Oracle RMAN恢復測試Oracle
- RMAN備份恢復技巧
- 查詢RMAN恢復進度
- Oracle RMAN 表空間恢復Oracle
- RMAN備份異機恢復
- RMAN備份恢復典型案例——異機恢復未知DBID
- dg丟失歸檔,使用rman增量備份恢復
- RMAN備份恢復效能優化優化
- 在rman恢復中incarnation的概念
- RMAN備份與恢復測試
- RAC安裝目錄許可權快速恢復
- Oracle 目錄許可權丟失故障恢復Oracle
- 揭秘ORACLE備份之----RMAN之五(CATALOG)Oracle
- ORACLE DG從庫 Rman備份恢復Oracle
- rman備份異機恢復(原創)
- RMAN備份恢復典型案例——RMAN備份&系統變慢
- 12C PDB使用RMAN的4種完全恢復場景
- 【RMAN】Oracle12c以後rman 備份恢復命令參考Oracle
- 【RMAN】在多租戶環境下的RMAN備份及恢復
- Oracle 12C新特性-RMAN恢復表Oracle
- RMAN備份恢復典型案例——ORA-00245
- 【資料庫資料恢復】mdb_catalog.wt檔案丟失的MongoDB資料恢復案例資料庫資料恢復MongoDB
- Oracle Rman Catalog的建立方法和備份原理Oracle
- [20190718]12c rman新特性 表恢復.txt
- CentOS8中恢復根目錄為預設許可權CentOS
- OBServer啟動恢復解析Server
- 透過RMAN備份standby database成功恢復還原Database
- oracle ORA-01180 ORA-01110(rman恢復問題)Oracle
- rman恢復控制檔案的一個小錯誤
- ORACLE 11.2.0.4 RAC RMAN異機恢復之ORA-15001Oracle