国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

flashback 后 恢復(fù)現(xiàn)場

這篇具有很好參考價值的文章主要介紹了flashback 后 恢復(fù)現(xiàn)場。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報違法"按鈕提交疑問。

fix:

Since there is no undo command for a truncate, a recovery of the database is 
required to get the data back in the table. This document outlines the steps to 
follow to recover from the truncate command.


This document is intended to give a step by step guide for experienced
users.  It assumes that the some basic knowledge about backup and restore of an
Oracle database is available.


Step by Step solution
-----------------------------

*NOTE:  Always backup the database before starting to recover or restore old
        backups.


   1. Is there an export dump of the table which I can use to restore the data?
       a. yes -> import the file
       b. no  -> go to step 2.

   2. Is the database is archivelog mode ?
       a. yes -> go to step 3.
       b. no  -> go to step 4 
  
   3. The database is in archivelog mode.  This makes it possible to recover the
      database until a moment just before the truncate command.
       a. restore a backup of the database to another location.
       b. recover this database to a moment in time BEFORE the truncate command
          RECOVER DATABASE UNTIL TIME .....
       c. export the table data from this recovered database.
       d. import the data back into the original database
       e. remove the restored database.

   4. Since the database is not in archivelog mode, there is no way to recover
      the database to a time just before the truncate command.
      Contact Oracle Support to discuss the possible options left.

You can also use FLASHBACK to rollback a TRUNCATE


This scenario will show how we can use a combination of FLASHBACK database and also recovery to take a database back in time to undo a TRUNCATE operation and then roll forward the database after the flashback operation to bring it to the current point in time.
 
INSERT ROWS INTO TABLE MYOBJ – THIS WILL BE TRUNCATED
 SQL> insert into test.myobj select * from all_objects;

50496 rows created.

SQL> /

50496 rows created.

SQL> select count(*) from test.myobj;

  COUNT(*)
----------
    100992
 
OBTAIN THE CURRENT SCN – FLASHBACK WILL HAPPEN TO THIS SCN
 SQL> select current_scn from v$database;


          CURRENT_SCN
---------------------
          15633908021

TRUNCATE THE TABLE

SQL> truncate table test.myobj;

Table truncated.

SQL> select count(*) from test.myobj;

  COUNT(*)
----------
         0
 

AT THE SAME TIME OTHER CHANGES ARE HAPPENING IN THE DATABASE AND THESE CHANGES WILL BE RECOVERED AFTER THE FLASHBACK IS DONE
 
SQL> insert into test.myobj2 select * from test.myobj2;

356874 rows created.

SQL> /

713748 rows created.

SQL> commit;

Commit complete.
 
SHUTDOWN THE DATABASE AND PERFORM THE FLASHBACK TO THE SCN BEFORE THE TRUNCATE WAS DONE
 SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area  469762048 bytes
Fixed Size                  2084880 bytes
Variable Size             377491440 bytes
Database Buffers           83886080 bytes
Redo Buffers                6299648 bytes
Database mounted.



SQL> FLASHBACK DATABASE TO SCN 15633908021;

Flashback complete.

 
OPEN THE DATABASE IN READ ONLY MODE AND EXPORT THE TABLE THAT WAS TRUNCATED EARLIER. THIS TABLE WILL BE IMPORTED AFTER THE RECOVERY IS DONE
 SQL> alter database open read only;

Database altered.


SQL>  select count(*) from test.myobj;

  COUNT(*)
----------
         100992

SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
crashdb:/u03/oradata/crashdb/arch> exp file=test.dmp tables=myobj

Export: Release 10.2.0.4.0 - Production on Fri Feb 6 09:53:00 2009

Copyright (c) 1982, 2007, Oracle.  All rights reserved.


Username: test
Password:

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses WE8ISO8859P1 character set (possible charset conversion)

About to export specified tables via Conventional Path ...
. . exporting table                          MYOBJ          100992 rows exported
Export terminated successfully without warnings.
 
NOW SHUTDOWN THE DATABASE,STARTUP MOUNT AND PERFORM THE RECOVERY 
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.







SQL> startup mount;
ORACLE instance started.

Total System Global Area  696254464 bytes
Fixed Size                  2086616 bytes
Variable Size             184551720 bytes
Database Buffers          503316480 bytes
Redo Buffers                6299648 bytes
Database mounted.
SQL> recover database;-----contrilfile 不要動
Media recovery complete.
SQL> alter database open;

Database altered.

 
AS EXPECTED TABLE MYOBJ WHICH WAS TRUNCATED NOW AGAIN HAS 0 ROWS AFTER THE RECOVERY – WE CAN IMPORT THE DUMP WE TOOK AFTER THE FLASHBACK
 SQL> select count(*) from test.myobj;

  COUNT(*)
----------
         0
 
CONFIRM THAT OTHER COMMITTED CHANGES IN THE DATABASE HAVE BEEN RECOVERED 
SQL> select count(*) from test.myobj2;

  COUNT(*)
----------
  713748

RELATED DOCUMENTS
-----------------------------------
Oracle Server Backup and Recovery Guide

文章來源地址http://www.zghlxwxcb.cn/news/detail-683302.html

到了這里,關(guān)于flashback 后 恢復(fù)現(xiàn)場的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點(diǎn)擊違法舉報進(jìn)行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • 數(shù)據(jù)庫實驗7---數(shù)據(jù)庫的備份與恢復(fù)

    使用mysqldump命令備份數(shù)據(jù)庫studentsdb的所有表,存于D:下,文件名為all_tables.sql。 在MySQL服務(wù)器上創(chuàng)建數(shù)據(jù)庫student1,使用mysql命令將備份文件all_tables.sql恢復(fù)到數(shù)據(jù)庫student1中。 使用mysqldump命令備份數(shù)據(jù)庫studentsdb的所有表,存于D:下,文件名為s_c.sql。 在MySQL服務(wù)器上創(chuàng)建數(shù)據(jù)

    2024年02月09日
    瀏覽(17)
  • 數(shù)據(jù)庫第十章(數(shù)據(jù)庫恢復(fù)技術(shù))十一章(并發(fā)控制)

    數(shù)據(jù)庫第十章(數(shù)據(jù)庫恢復(fù)技術(shù))十一章(并發(fā)控制)

    目錄 1.事務(wù) 2.并發(fā)控制 1.事務(wù) 事務(wù)的特點(diǎn):ACID 原子性? ?atom 一致性? ?consistent 隔離性? ?isolation 持久性? ?durable 故障的種類 1.事務(wù)內(nèi)部故障 ? ? ? ? 措施:采取redo重做和undo撤銷技術(shù) 2.系統(tǒng)故障DBMS ? ? ? ? 措施:重啟 3.介質(zhì)故障 ? ? ? ? 硬件損壞 4.計算機(jī)病毒 ? 數(shù)據(jù)恢

    2024年02月09日
    瀏覽(22)
  • Oracle 數(shù)據(jù)庫恢復(fù)刪除的數(shù)據(jù)

    需求描述: 同事讓刪除臟數(shù)據(jù),結(jié)果刪錯了,需要恢復(fù)數(shù)據(jù) 思路: 利用閃回恢復(fù)數(shù)據(jù)只能恢復(fù)15分鐘之內(nèi)的,后面undo空間會被重寫,就恢復(fù)不了,所以刪除數(shù)據(jù)后,要謹(jǐn)慎再三確認(rèn),若發(fā)現(xiàn)不對,則利用閃回恢復(fù) 先查詢刪除時的時間節(jié)點(diǎn)的快照 查到時間戳之后 閃回恢復(fù)數(shù)

    2024年01月24日
    瀏覽(36)
  • 【數(shù)據(jù)庫數(shù)據(jù)恢復(fù)】SQL Server數(shù)據(jù)表結(jié)構(gòu)損壞的數(shù)據(jù)恢復(fù)案例

    【數(shù)據(jù)庫數(shù)據(jù)恢復(fù)】SQL Server數(shù)據(jù)表結(jié)構(gòu)損壞的數(shù)據(jù)恢復(fù)案例

    數(shù)據(jù)庫故障分析: SQL server數(shù)據(jù)庫數(shù)據(jù)無法讀取。 經(jīng)過初檢,發(fā)現(xiàn)SQL server數(shù)據(jù)庫文件無法被讀取的原因是因為底層File Record被截斷為0,無法找到文件開頭,數(shù)據(jù)表結(jié)構(gòu)損壞。鏡像文件的前面幾十M空間和中間一部分空間被覆蓋掉,系統(tǒng)表損壞,無法讀取??紤]用自動備份文件

    2024年02月11日
    瀏覽(41)
  • 數(shù)據(jù)庫運(yùn)維——備份恢復(fù)

    數(shù)據(jù)庫運(yùn)維——備份恢復(fù)

    數(shù)據(jù)庫備份,數(shù)據(jù)庫為school,素材如下 1.創(chuàng)建student和score表 CREATE? TABLE? student ( id? INT(10)? NOT NULL? UNIQUE? PRIMARY KEY? , name? VARCHAR(20)? NOT NULL , sex? VARCHAR(4)? , birth? YEAR, department? VARCHAR(20) , address? VARCHAR(50)? ); 創(chuàng)建score表。SQL代碼如下: CREATE? TABLE? score ( id? INT(10)? NOT NU

    2024年02月16日
    瀏覽(27)
  • 數(shù)據(jù)庫誤刪恢復(fù)

    數(shù)據(jù)庫誤刪恢復(fù)

    ? ? ? ?經(jīng)常聽說刪庫跑路這真的不只是一句玩笑話,若不小心刪除了數(shù)據(jù)庫,事情很嚴(yán)重。你一個不小心可能會給公司刪沒。建議研發(fā)不要直連生成環(huán)境,一般的話都會分配賬號權(quán)限,生產(chǎn)環(huán)境的賬號盡量是只讀,以防你一個不經(jīng)意給庫或表刪除。一定要備份,這很重要,

    2024年02月07日
    瀏覽(23)
  • 如何備份與恢復(fù)MySQL數(shù)據(jù)庫數(shù)據(jù)

    如何備份與恢復(fù)MySQL數(shù)據(jù)庫數(shù)據(jù)

    目錄 一、MySQL備份 備份方式 完全備份 差異備份 增量備份 二、常見的備份方法 物理冷備 專用備份工具 mysqldump 或 mysqlhotcopy 啟用二進(jìn)制日志進(jìn)行增量備份 第三方工具備份 三、MySQL完全備份 四、數(shù)據(jù)庫完全備份分類 物理冷備份與恢復(fù) mysqldump備份與恢復(fù) 五、物理冷備份與恢復(fù)

    2024年02月16日
    瀏覽(102)
  • MySQL數(shù)據(jù)庫備份與恢復(fù)

    MySQL數(shù)據(jù)庫備份與恢復(fù)

    在項目的開發(fā)過程中數(shù)據(jù)庫的備份是非常重要的,為了防止數(shù)據(jù)庫受到破壞,造成不可估量的損失,所以一定要進(jìn)行數(shù)據(jù)庫的備份,并且需要掌握數(shù)據(jù)庫恢復(fù)方法,在發(fā)生數(shù)據(jù)庫損壞的時候,能快速進(jìn)行數(shù)據(jù)庫恢復(fù)。 本文主要介紹MySQL數(shù)據(jù)表備份與恢復(fù)主要的三種方法,包括

    2024年02月12日
    瀏覽(859)
  • mysql數(shù)據(jù)庫備份和恢復(fù)

    數(shù)據(jù)備份可以分為三種, 熱備份。 數(shù)據(jù)庫處于運(yùn)行狀態(tài),此時依賴數(shù)據(jù)庫的日志文件進(jìn)行備份 溫備份。 進(jìn)行數(shù)據(jù)備份時數(shù)據(jù)庫服務(wù)正常進(jìn)行,但是數(shù)據(jù)智能度不能寫。 冷備份。數(shù)據(jù)庫處于關(guān)閉狀態(tài),能夠夠好的保證數(shù)據(jù)庫的完整性。 邏輯備份。使用軟件從數(shù)據(jù)庫中提取數(shù)

    2024年02月12日
    瀏覽(96)
  • mysal數(shù)據(jù)庫的日志恢復(fù)

    mysal數(shù)據(jù)庫的日志恢復(fù)

    目錄 一 物理冷備份 ?二?mysqldump 備份與恢復(fù)(溫備份) 三 mgsql中的增量備份需要借助mysql日志的二進(jìn)制來恢復(fù) ?小結(jié) 一 物理冷備份 systemctl stop mysqld yum -y install xz 壓縮備份 tar Jcvf /opt/mysql_all_$(date +%F).tar.xz /usr/local/mysql/data/ ?驗證刪數(shù)據(jù)庫或者登陸mysql刪除庫文件 ?二?mysql

    2024年02月16日
    瀏覽(18)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包