rman catalog是為數(shù)據(jù)備份恢復(fù)時(shí),使用恢復(fù)目錄catalog,與nocatalog的不同是,nocatalog將備份相關(guān)的信息記錄在了控制文件中,而catalog將備份信息記錄在了恢復(fù)目錄中。 本文做的實(shí)驗(yàn)是將恢復(fù)目錄創(chuàng)建在oracle 12c上,需要備份的數(shù)據(jù)庫(kù)在oracle 11g上。 STE
rman catalog是為數(shù)據(jù)備份恢復(fù)時(shí),使用恢復(fù)目錄catalog,與nocatalog的不同是,nocatalog將備份相關(guān)的信息記錄在了控制文件中,而catalog將備份信息記錄在了恢復(fù)目錄中。
本文做的實(shí)驗(yàn)是將恢復(fù)目錄創(chuàng)建在oracle 12c上,需要備份的數(shù)據(jù)庫(kù)在oracle 11g上。
STEP1:在恢復(fù)目錄catalog數(shù)據(jù)庫(kù)上創(chuàng)建專(zhuān)門(mén)用于恢復(fù)的的用戶(hù)c##rman,并賦予相關(guān)的權(quán)限(oracle 12c創(chuàng)建用戶(hù)前加c##, 可以參考http://blog.csdn.net/wenchu20/article/details/43196577)
--創(chuàng)建恢復(fù)目錄的表空間 SQL> create tablespace TBS_RMAN datafile '/u01/app/oradata/rman1.dbf' size 5M autoextend on next 2M; Tablespace created. --創(chuàng)建用戶(hù) SQL> create user c##rman identified by rman default tablespace tbs_rman temporary tablespace TEMP; User created. --對(duì)用戶(hù)rman賦權(quán) SQL> grant connect,resource,recovery_catalog_owner to rman; Grant succeeded.
STEP2:連接rman的target 和catalog
[oracle@REDHAT6 ~]$ rman target sys/oracle catalog rman/rman -- 或者使用下面的方式登錄 [oracle@REDHAT6 ~]$ rman Recovery Manager: Release 11.2.0.3.0 - Production on Wed Jan 28 00:27:14 2015 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. RMAN> connect target sys/oracle; connected to target database: ORCL (DBID=1396675707) RMAN> connect catalog rman/rman; connected to recovery catalog database RMAN>
RMAN> create catalog tablespace TBS_RMAN; recovery catalog created
STEP4:恢復(fù)目錄已經(jīng)創(chuàng)建了, 需要將 target 和 catalog關(guān)聯(lián)起來(lái),即注冊(cè)服務(wù)器(注冊(cè)服務(wù)器之前 DB表是空的,注冊(cè)后DB表中有數(shù)據(jù))
RMAN> register database; database registered in recovery catalog starting full resync of recovery catalog full resync complete
SQL> select * from db; DB_KEY DB_ID CURR_DBINC_KEY ---------- ---------- -------------- 1 1396675707 2
OK, catalog恢復(fù)目錄已經(jīng)創(chuàng)建完畢
本實(shí)驗(yàn),如果數(shù)據(jù)庫(kù)shutdown(或數(shù)據(jù)庫(kù)處于nomount, mount狀態(tài)),都將不能查看備份相關(guān)的信息,因?yàn)榛謴?fù)目錄catalog與目標(biāo)庫(kù)target在同一個(gè)實(shí)例上,數(shù)據(jù)庫(kù)沒(méi)有打開(kāi),所以無(wú)法獲取相關(guān)的信息。
如果有兩臺(tái)機(jī)器,target是一臺(tái)機(jī)器,catalog是一臺(tái)機(jī)器,target目標(biāo)庫(kù)停掉,也能連接catalog 。
聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問(wèn)題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com