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

實(shí)現(xiàn)DB2備份恢復(fù)的步驟與操作中的問(wèn)題

數(shù)據(jù)庫(kù)
以下的文章主要描述的是DB2備份恢復(fù)在實(shí)際操作中的有感有問(wèn),同時(shí)也包括了對(duì)實(shí)現(xiàn)DB2備份恢復(fù)的實(shí)際操作步驟的描述。

下面的文章主要介紹的是DB2備份恢復(fù)在實(shí)際操作中的有感有問(wèn),如果你對(duì)DB2備份恢復(fù)心存好奇的話,以下的文章將會(huì)揭開(kāi)它的神秘面紗,以下就是具體內(nèi)容的描述,希望在你今后的學(xué)習(xí)中會(huì)有所幫助。

 

練手DB2備份與恢復(fù),盲人摸象一般搗騰了好幾天,終于成功實(shí)現(xiàn)聯(lián)機(jī)DB2備份恢復(fù)了。

 

先講下我怎么做的

創(chuàng)建數(shù)據(jù)庫(kù)testdb

 

  1. db2 create database testdb using codeset UTF-8 territory US 

開(kāi)啟聯(lián)機(jī)備份

 

  1. db2 update db cfg for testdb using userexit on logretain on trackmod on 

創(chuàng)建備份目錄

 

  1. mkdir /backup/db2inst1  
  2. chown db2inst1:db2grp1 /backup/db2inst1 

重啟db2實(shí)例,進(jìn)行一次冷備,時(shí)間戳為20100224111110

 

  1. db2stop force  
  2. db2start  
  3. db2 backup db testdb to /backup/db2inst1 

創(chuàng)建數(shù)據(jù)庫(kù)表

 

  1. create table T(  
  2. a int,  
  3. b int,  
  4. c int  

在T表中插入100條數(shù)據(jù)0,0,0

 

進(jìn)行一次聯(lián)機(jī)備份,時(shí)間戳為20100224113029

  1. db2 backup db testdb online to /backup/db2inst1 

查看***活動(dòng)日志,為S00000001.LOG

  1. db2 get db cfg for testdb 

在T表中插入100條數(shù)據(jù)1,1,1

進(jìn)行一次聯(lián)機(jī)備份,時(shí)間戳為20100224113530

  1. db2 backup db testdb online to /backup/db2inst1 

查看***活動(dòng)日志,為S0000002.LOG

  1. db2 get db cfg for testdb 

在T表中刪除100條0,0,0

將活動(dòng)日志目錄SQLOGDIR下的所有歸檔日志和活動(dòng)日志都拷到/temp目錄下

將testdb整個(gè)刪除

 

  1. db2 drop db testdb 

DB2備份恢復(fù)到***一個(gè)備份點(diǎn)20100224113530

 

  1. db2 restore database testdb from /backup/db2inst1 taken at 20100224113530 

將所有歸檔日志和活動(dòng)日志都拷到SQLOGDIR下,并更改用戶和用戶組

 

  1. chown db2inst1:db2grp1 * 

日志回滾

 

因?yàn)閭浞莸臅r(shí)間戳日期和歸檔日志的時(shí)間似乎有點(diǎn)不同,我現(xiàn)在的做法只能是先執(zhí)行下面這句,得到一個(gè)時(shí)間,然后再rollforward到那個(gè)時(shí)間才能成功回滾

 

  1. db2 rollforward db testdb stop 

執(zhí)行上面語(yǔ)句以后提示以下內(nèi)容

 

  1. SQL1276N Database "TESTDB" cannot be brought out of rollforward pending state   
  2. until roll-forward has passed a point in time greater than or equal to   
  3. "2010-02-24-03.12.34.000000 UTC", because node "0" contains information later  

than the specified time.

 

根據(jù)這里的提示信息,得到時(shí)間2010-02-24-03.12.34.000000,再rollforward到這個(gè)時(shí)間

 

  1. db2 rollforward db testdb to 2010-02-24-03.12.34.000000 and stop 

不知道正常情況下高手們是怎么知道回滾到什么時(shí)間點(diǎn)的?特別請(qǐng)教一下。謝謝!

 

在做回滾的時(shí)候我還發(fā)現(xiàn)了一個(gè)情況:根據(jù)活動(dòng)日志可以DB2備份恢復(fù)到故障點(diǎn)到***一次備份點(diǎn)之間的數(shù)據(jù)。

 

在rollforward的時(shí)候?qū)r(shí)間點(diǎn)往后多寫(xiě)一點(diǎn)

 

  1. $ db2 rollforward db testdb to 2010-02-24-03.15.00 and stop  
  2. 然后他會(huì)提示SQL4970N Roll-forward recovery on database "TESTDB" cannot reach the   
  3. specified stop point (end-of-log or point-in-time) on database partition(s)   
  4. "0". Roll-forward recovery processing has halted on log file "S0000005.LOG". 

在這個(gè)時(shí)候數(shù)據(jù)庫(kù)依舊是pending狀態(tài),再執(zhí)行一次db2 rollforward db testdb stop就可以DB2備份恢復(fù)到刪除數(shù)據(jù)庫(kù)之前的狀態(tài)了

 

【編輯推薦】

  1. 選擇IBM DB2的5大理由是什么?
  2. 初學(xué)者必看的DB2數(shù)據(jù)庫(kù)的一些經(jīng)驗(yàn)總結(jié)
  3. DB2 9打開(kāi)打開(kāi)通往 XML 之門(mén)的鑰匙
  4. DB2編程的正確應(yīng)用程序
  5. DB2 Cube View元數(shù)據(jù)橋的正確構(gòu)建方案
責(zé)任編輯:佚名 來(lái)源: 博客園
相關(guān)推薦

2010-08-04 13:15:21

2011-05-11 13:01:07

DB2數(shù)據(jù)恢復(fù)數(shù)據(jù)備份

2010-08-03 09:44:42

DB2在線增量備份

2010-08-03 09:32:19

DB2在線備份

2010-08-18 15:14:08

DB2恢復(fù)命令

2009-06-25 11:47:59

DB2數(shù)據(jù)備份

2015-10-23 16:37:13

提高DB2數(shù)據(jù)備份

2010-08-03 13:18:15

DB2數(shù)據(jù)備份

2010-07-30 10:24:18

2010-08-13 17:54:14

DB2 dart恢復(fù)數(shù)

2010-08-17 09:18:29

DB2 備份

2010-08-12 17:14:25

DB2備份恢復(fù)數(shù)據(jù)庫(kù)步

2010-08-12 10:27:21

DB2數(shù)據(jù)庫(kù)備份

2010-07-27 10:57:27

2010-08-12 10:15:27

DB2 分區(qū)數(shù)據(jù)庫(kù)備份

2010-08-03 09:49:58

DB2恢復(fù)數(shù)據(jù)庫(kù)

2010-08-12 09:06:30

DB2數(shù)據(jù)庫(kù)自動(dòng)備份

2010-08-06 18:01:13

DB2數(shù)據(jù)備份

2009-03-25 17:43:09

備份DB2IBM

2010-08-17 09:55:33

DB2備份測(cè)試
點(diǎn)贊
收藏

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