【文章內(nèi)容簡介】
connect ,resource , RECOVERY_CATALOG_OWNER to rman.4. 連接到目標(biāo)數(shù)據(jù)庫和CATALOG數(shù)據(jù)庫rman target system/manager@target_tnsname rcvcat rman/rman@catalog_tnsname 5. 創(chuàng)建CATALOG用戶的表:rmancreate catalog6. 登記目標(biāo)數(shù)據(jù)庫:rmanregister database這樣就可以利用該RMAN數(shù)據(jù)庫來備份目標(biāo)數(shù)據(jù)庫了。解除登記數(shù)據(jù)庫啟動(dòng)rman并連接到目標(biāo)數(shù)據(jù)庫。% rman target sys/change_on_install@prod1 nocatalog RMAN06005: connected to target database: RMAN (DBID=1231209694) List the copies and backup sets recorded in the control file and then issue change ... delete statements to delete them from the O/S. See Generating Lists and Deleting Backups and Copies and Updating Their Status in the RMAN Metadata. Use SQL*Plus to connect to your recovery catalog database and execute the following query in the recovery catalog to find the correct row of the DB table, setting DB_ID equal to the value you obtained from step 1. For example, enter: SQL SELECT db_key, db_id FROM db WHERE db_id = 1231209694。 This query should return exactly one row. DB_KEY DB_ID 1 1237603294 1 row selected. While still connected to the recovery catalog, enter the following, where DB_KEY and DB_ID are the corresponding columns from the row you got from the query in step 2: SQL EXECUTE (db_key, db_id) For example, enter: SQL EXECUTE (1 , 1237603294)磁帶接口當(dāng)使用專用的磁帶管理工具時(shí),必須配置數(shù)據(jù)庫與磁帶的接口,一般是管理工具提供一個(gè)動(dòng)態(tài)連接庫與數(shù)據(jù)庫進(jìn)行連接。以下是一個(gè)測(cè)試的RMAN腳本:run {allocate channel 39。dev139。 type diskresync catalog。backup format ‘/archive/ctl%u_%p_%c ‘ current controlfile。release channel dev1。}多級(jí)備份策略采用多級(jí)備份是為了減少了恢復(fù)所需要的時(shí)間和減少每天備份所需要的時(shí)間,而又保證系統(tǒng)有很好的恢復(fù)性。但是在恢復(fù)時(shí)間和備份時(shí)間要有一個(gè)權(quán)衡。比如只要開始的一個(gè)全備份和備份所有產(chǎn)生的歸檔文件就可以保證把數(shù)據(jù)庫恢復(fù)到最新的狀態(tài),但是一般來說實(shí)際上并不會(huì)這么進(jìn)行(因?yàn)樵诨謴?fù)時(shí)將需要很長很長的時(shí)間),多級(jí)備份就是為了解決這樣的問題。以下是一種建議的方案。每半年做一個(gè)數(shù)據(jù)庫的全備份(包含只讀表空間)每個(gè)月做一次零級(jí)備份(不包含只讀表空間)每個(gè)星期做一次一級(jí)備份每天做一個(gè)二級(jí)備份任何表空間改成只讀狀態(tài)后做一個(gè)該表空間的備份。當(dāng)需要時(shí)(如四個(gè)小時(shí)歸檔文件系統(tǒng)就要接近滿了)備份歸檔文件數(shù)據(jù)庫全備份腳本:run {allocate channel 39。dev139。 type disk 。