自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Oracle 9i R2中的flashback功能巧妙利用

數(shù)據(jù)庫 Oracle
本文主要闡述的是如何利用Oracle 9i R2中的flashback功能恢復(fù)以下某表中的相關(guān)數(shù)據(jù)的實(shí)際操作步驟,以下就是相關(guān)內(nèi)容的描述。

本文主要介紹的是如何利用Oracle 9i R2中的flashback功能,恢復(fù)以下某表中的相關(guān)數(shù)據(jù)的實(shí)際操作步驟,我們首先以通過查詢v$archived_log視圖的方式來進(jìn)行,以下就是實(shí)際步驟的詳細(xì)介紹。

首先如果數(shù)據(jù)庫在歸檔模式下,我們可以通過查詢v$archived_log視圖來查看各個(gè)歸檔日志所屬的檢查點(diǎn):

  1. select name,first_change#,next_change#,first_time from v$archived_log; 

通過包dbms_flashback.get_system_change_number來獲得數(shù)據(jù)庫的SCN號(hào),當(dāng)然如果你的數(shù)據(jù)庫是10g的話,還可以查看v$database中的字段current_scn.

  1. select dbms_flashback.get_system_change_number from dual; 

select count(*) from student 看看我們的表中的數(shù)據(jù)有多少。

  1. create table student_recovery  
  2. as  
  3. select * from student where 1=0 

來創(chuàng)建恢復(fù)表的結(jié)構(gòu)。
 
開始我們的閃回查詢:
 
選擇一個(gè)前面的SCN進(jìn)行向前恢復(fù)

  1. select count(*) from student as of scn 3154835

嘗試多個(gè)scn來獲得我們所期望的結(jié)構(gòu)
 
***通過:

  1. insert into student_recovery select * from student as of scn3154835 commit; 

來恢復(fù)我們表中的數(shù)據(jù)。

還有一點(diǎn)需要我們注意的是什么呢?就是smon_scn_time這個(gè)表,這個(gè)表記錄了Oracle數(shù)據(jù)庫的系統(tǒng)表,用以進(jìn)行輔助的恢復(fù)等功能。這個(gè)表在9iR2的時(shí)候是每5分鐘刷新一次,而且smon_scn_time會(huì)記錄5天的數(shù)據(jù),也就是1440行記錄,因此在Oracle9iR2中,表屬性修改時(shí)間和flashback時(shí)間差至少應(yīng)為5分鐘,否則會(huì)報(bào)ora-01466的錯(cuò)誤。

上述的相關(guān)內(nèi)容就是對(duì)利用Oracle 9i R2的flashback功能來恢復(fù)一下某表中的數(shù)據(jù)的步驟的描述,希望會(huì)給你帶來一些幫助在此方面。

【編輯推薦】

  1. Oracle自增字段的實(shí)際應(yīng)用
  2. Oracle使用游標(biāo)觸發(fā)器存儲(chǔ)實(shí)操
  3. Oracle數(shù)據(jù)庫中表的不同的連接方式描述
  4. Oracle數(shù)據(jù)庫中表的連接方式的講解
  5. Oracle VARRAY的實(shí)際應(yīng)用簡介
責(zé)任編輯:佚名 來源: 博客園
相關(guān)推薦

2010-04-27 17:58:17

Oracle 9i

2011-05-17 15:41:51

oracle 9i卸載

2009-03-17 13:59:26

ORA-01578壞塊Oracle

2010-04-13 10:29:12

Oracle 9i

2010-04-14 09:25:08

Oracle 9i創(chuàng)建

2009-01-06 09:14:08

8i9ioracle

2010-04-16 14:30:13

Oracle 9i

2009-11-03 14:22:07

Oracle密碼

2010-04-13 11:31:02

Oracle 9i e

2010-04-14 09:16:39

Oracle 9i

2010-04-22 11:41:55

Oracle 9i

2010-04-19 13:12:36

Oracle 9i數(shù)據(jù)

2010-04-14 16:22:42

Oracle 9i

2010-08-11 11:05:49

2009-12-11 09:15:13

2010-04-30 15:53:20

2010-05-05 16:11:53

Oracle 9i

2013-08-13 09:44:20

Windows Ser功能列表

2017-07-17 08:39:10

Oracle 12c ADGswitchover

2011-02-13 14:18:17

Windows Sto
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)