DB2數(shù)據(jù)庫備份測試的操作步驟
作者:佚名
今天主要向大家描述的是實現(xiàn)DB2數(shù)據(jù)庫備份測試的操作步驟,以及對其在實際操作中要用到的實際操作代碼的描述。
以下的文章主要描述的是DB2數(shù)據(jù)庫備份測試的操作步驟,以及在其實際操作中的值得大家注意的事項與其代碼的描述,以下就是文章的主要內(nèi)容的詳細(xì)描述,望大家在瀏覽之后會對其有更深的了解。
開始備份【實例講解】
DB2, DB2備份
1、做一個在線全備操作:
- [db2inst1@db2 ~]$ db2 backup db sample online to /tmp/db2inst1/sample/off_back include logs
- Backup successful. The timestamp for this backup image is : 20090917061921
2、創(chuàng)建一個表,并插入數(shù)據(jù):
- db2 => connect to sample
- Database Connection Information
- Database server
- = DB2/LINUX 9.1.3
- SQL authorization ID
- = DB2INST1
- Local database alias
- = SAMPLE
- db2 => insert into sales1 select * from sales
- DB20000I
- The SQL command completed successfully.
- db2 => insert into sales1 select * from sales1
- DB20000I
- The SQL command completed successfully.
- db2 => insert into sales1 select * from sales1
- DB20000I
- The SQL command completed successfully
- db2 => select * from sales1
- SALES_DATE SALES_PERSON
- REGION
- SALES
- 12/31/2005 LUCCHESSI
- Ontario-South
- 1
- 12/31/2005 LEE
- Ontario-South
- 3
- 12/31/2005 LEE
- Quebec
- 1
- 12/31/2005 LEE
- Manitoba
- 2
- 12/31/2005 GOUNOT
- Quebec
- 1
- 03/29/2006 LUCCHESSI
- Ontario-South
- 3
- 03/29/2006 LUCCHESSI
- Quebec
- 。。。。。。。。。。。
3、做增量DB2數(shù)據(jù)庫備份:
- [db2inst1@db2 ~]$ db2 backup db sample online incremental to /tmp/db2inst1/sample/off_back include logs
- Backup successful. The timestamp for this backup image is : 20090917062532
4、刪除表操作:
- [db2inst1@db2 off_back]$ db2stop force
- 09/17/2009 06:26:47
- 0
- 0
- SQL1064N
- DB2STOP processing was successful.
- SQL1064N
- DB2STOP processing was successful.
- [db2inst1@db2 off_back]$ db2start
- 09/17/2009 06:26:57
- 0
- 0
- SQL1063N
- DB2START processing was successful.
- SQL1063N
- DB2START processing was successful.
- db2 => connect to sample
- Database Connection Information
- Database server
- = DB2/LINUX 9.1.3
- SQL authorization ID
- = DB2INST1
- Local database alias
- = SAMPLE
- db2 => drop table sales1
- DB20000I
- The SQL command completed successfully.
- db2 => select * from sales1
- SQL0204N
- "DB2INST1.SALES1" is an undefined name.
- SQLSTATE=42704
以上的相關(guān)內(nèi)容就是對DB2數(shù)據(jù)庫備份測試的介紹,望你能有所收獲。
【編輯推薦】
- 初學(xué)者必看的DB2數(shù)據(jù)庫的一些經(jīng)驗總結(jié)
- 對DB2日志設(shè)置參數(shù)正確用法的描述
- DB2 9打開打開通往 XML 之門的鑰匙
- DB2 Cube View元數(shù)據(jù)橋的正確構(gòu)建方案
- DB2數(shù)據(jù)庫和PostgreSQL在開發(fā)的異同點有哪些?
責(zé)任編輯:佚名
來源:
環(huán)球企業(yè)家