小編給大家分享一下如何使用RMAN對PDB執(zhí)行閃回?cái)?shù)據(jù)庫操作,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!
創(chuàng)新互聯(lián)公司是專業(yè)的陽高網(wǎng)站建設(shè)公司,陽高接單;提供做網(wǎng)站、網(wǎng)站設(shè)計(jì),網(wǎng)頁設(shè)計(jì),網(wǎng)站設(shè)計(jì),建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進(jìn)行陽高網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴(kuò)展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團(tuán)隊(duì),希望更多企業(yè)前來合作!
可以對多租戶數(shù)據(jù)庫中的單個(gè)PDB執(zhí)行閃回操作。對特定的PDB執(zhí)行閃回?cái)?shù)據(jù)庫操作只會(huì)修改與這個(gè)PDB相關(guān)文件中的數(shù)據(jù)。CDB中的其它PDB不受影響處于可讀寫狀態(tài)。如果使用還原點(diǎn),在執(zhí)行閃回?cái)?shù)據(jù)庫操作時(shí)可以使用CDB還原點(diǎn),PDB還原點(diǎn),PDB清晰還原點(diǎn)或PDB受保證的還原點(diǎn)。對PDB執(zhí)行閃回?cái)?shù)據(jù)庫操作的步驟如下:
1.使用有sysdba或sysbackup權(quán)限的公共用戶連接到root容器
SQL> conn / as sysdba Connected.
2.確保CDB處于open狀態(tài)
SQL> SELECT open_mode from V$DATABASE; OPEN_MODE -------------------- READ WRITE
3.登錄PDB(jypdb)記錄當(dāng)前SCN號(hào),然后刪除表t1中的數(shù)據(jù)
SQL> conn jy/jy@jypdb Connected. SQL> SELECT CURRENT_SCN FROM V$DATABASE; CURRENT_SCN ----------- 6024220 SQL> select count(*) from t1; COUNT(*) ---------- 39 SQL> delete from t1; 39 rows deleted. SQL> commit; Commit complete. SQL> select count(*) from t1; COUNT(*) ---------- 0
4.確保要執(zhí)行閃回?cái)?shù)據(jù)庫的PDB(jypdb)處于close狀態(tài)。
SQL> conn / as sysdba Connected. SQL> alter pluggable database jypdb close immediate; Pluggable database altered. SQL> select name,open_mode from v$pdbs; NAME OPEN_MODE -------------------------------------------------------------------------------------------------------------------------------- ---------- PDB$SEED READ ONLY JYPDB MOUNTED TESTPDB READ WRITE
5.將PDB(jypdb)閃回到scn=6024220所在的狀態(tài)
RMAN> flashback pluggable database jypdb to scn 6024220; Starting flashback at 18-DEC-17 starting full resync of recovery catalog full resync complete allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=11 instance=jy1 device type=DISK starting media recovery media recovery complete, elapsed time: 00:00:03 Finished flashback at 18-DEC-17
6. 將CDB設(shè)置為只讀狀態(tài)
RMAN> alter pluggable database jypdb open read only; Statement processed
7.檢查閃回?cái)?shù)據(jù)庫操作的結(jié)果是否滿足要求
SQL> conn jy/jy@jypdb Connected. SQL> select count(*) from t1; COUNT(*) ---------- 39
8.如果閃回操作后滿足你所要求的結(jié)果,那么可以執(zhí)行以下兩個(gè)相互排斥的選項(xiàng):
.使用resetlogs選項(xiàng)將數(shù)據(jù)庫打開。如果當(dāng)前數(shù)據(jù)庫為只讀狀態(tài),那么使用SQL*Plus執(zhí)行以下命令:
alter pluggable database jypdb close immediate; alter pluggable database jypdb open resetlogs;
.使用Oracle Data Pump導(dǎo)出你所需要的對象,然后使用RMAN來恢復(fù)數(shù)據(jù)庫到當(dāng)前時(shí)間,通過對數(shù)據(jù)庫重新應(yīng)用重做日志中的所有改變來將
數(shù)據(jù)庫恢復(fù)到當(dāng)前時(shí)間點(diǎn)從而撤消閃回?cái)?shù)據(jù)庫所做的改變。
RMAN> recover pluggable database jypdb ; Starting recover at 18-DEC-17 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=11 instance=jy1 device type=DISK starting media recovery media recovery complete, elapsed time: 00:00:01 Finished recover at 18-DEC-17 RMAN> alter pluggable database jypdb open read write; Statement processed starting full resync of recovery catalog full resync complete
看完了這篇文章,相信你對“如何使用RMAN對PDB執(zhí)行閃回?cái)?shù)據(jù)庫操作”有了一定的了解,如果想了解更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!
本文題目:如何使用RMAN對PDB執(zhí)行閃回?cái)?shù)據(jù)庫操作
文章出自:http://www.rwnh.cn/article26/gcgecg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信公眾號(hào)、用戶體驗(yàn)、品牌網(wǎng)站建設(shè)、企業(yè)建站、軟件開發(fā)、動(dòng)態(tài)網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)