本篇內(nèi)容介紹了“Oracle閃回?cái)?shù)據(jù)庫測(cè)試方法是什么”的有關(guān)知識(shí),在實(shí)際案例的操作過程中,不少人都會(huì)遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!
創(chuàng)新互聯(lián)是一家集網(wǎng)站建設(shè),田林企業(yè)網(wǎng)站建設(shè),田林品牌網(wǎng)站建設(shè),網(wǎng)站定制,田林網(wǎng)站建設(shè)報(bào)價(jià),網(wǎng)絡(luò)營(yíng)銷,網(wǎng)絡(luò)優(yōu)化,田林網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強(qiáng)企業(yè)競(jìng)爭(zhēng)力??沙浞譂M足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時(shí)我們時(shí)刻保持專業(yè)、時(shí)尚、前沿,時(shí)刻以成就客戶成長(zhǎng)自我,堅(jiān)持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實(shí)用型網(wǎng)站。
1 設(shè)置閃回目錄和大小
SQL> show parameter recover SQL> alter system set db_recovery_file_dest_size=5g; SQL> alter system set db_recovery_file_dest='/fast_recovery'; SQL> show parameter recover NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_recovery_file_dest string /fast_recovery db_recovery_file_dest_size big integer 5G db_unrecoverable_scn_tracking boolean TRUE recovery_parallelism integer 0
2 啟用閃回
SQL> select flashback_on from v$database; FLASHBACK_ON ------------------ NO
SQL> alter database flashback on; Database altered. SQL> select flashback_on from v$database; FLASHBACK_ON ------------------ YES
3 查看時(shí)間
SQL> alter session set nls_date_format='yyyy-mm-dd hh34:mi:ss'; Session altered.
SQL> select oldest_flashback_scn,oldest_flashback_time from v$flashback_database_log; OLDEST_FLASHBACK_SCN OLDEST_FLASHBACK_TI -------------------- ------------------- 1114453 2020-06-24 08:30:49
4 創(chuàng)建測(cè)試數(shù)據(jù)
SQL> conn cjc/cjc SQL> create table test1 as select * from dba_objects; SQL> select count(*) from test1; COUNT(*) ---------- 87002
5 創(chuàng)建閃回點(diǎn)
SQL> create restore point test1; Restore point created.
6 查看閃回點(diǎn)
SQL> set line 200 SQL> col time for a50 SQL> col restore_point_time for a20 SQL> alter session set nls_date_format='yyyy-mm-dd hh34:mi:ss'; SQL> select scn,time,restore_point_time,name from v$restore_point; SCN TIME RESTORE_POINT_TIME NAME ---------- -------------------------------------------------- -------------------- ------------------------------ 1114756 24-JUN-20 08.36.20.000000000 AM TEST1
7 繼續(xù)插入數(shù)據(jù)
SQL> ho date Wed Jun 24 08:39:31 CST 2020 SQL> insert into test1 select * from test1; 87002 rows created. SQL> commit; Commit complete. SQL> select count(*) from test1; COUNT(*) ---------- 174004
8 刪除表
SQL> drop table test1 purge; Table dropped. SQL> select count(*) from cjc.test1; select count(*) from cjc.test1 * ERROR at line 1: ORA-00942: table or view does not exist
9 閃回?cái)?shù)據(jù)庫
---test1是之前設(shè)置的閃回點(diǎn)名稱
SQL> conn / as sysdba SQL> shutdown immediate SQL> startup mount SQL> flashback database to restore point test1; Flashback complete. SQL> alter database open resetlogs;
10 查看數(shù)據(jù),數(shù)據(jù)庫恢復(fù)到閃回點(diǎn)時(shí)刻
SQL> select count(*) from cjc.test1; COUNT(*) ---------- 87002
11 查看閃回?cái)?shù)據(jù)
[oracle@cjcos01 flashback]$ pwd /fast_recovery/CJCDB01/flashback [oracle@cjcos01 flashback]$ ll -rth total 101M -rw-r----- 1 oracle oinstall 51M Jun 24 08:30 o1_mf_hh67ow2w_.flb -rw-r----- 1 oracle oinstall 51M Jun 24 08:49 o1_mf_hh67osvt_.flb
12 關(guān)閉閃回,閃回日志自動(dòng)刪除
SQL> alter database flashback off; Database altered. SQL> select flashback_on from v$database; FLASHBACK_ON ------------------ NO [oracle@cjcos01 flashback]$ ls
“Oracle閃回?cái)?shù)據(jù)庫測(cè)試方法是什么”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識(shí)可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!