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

DB2備份所有表的方法

數(shù)據(jù)庫
在我們進(jìn)行數(shù)據(jù)庫備份的時(shí)候,如果需要備份DB2數(shù)據(jù)庫中的所有表數(shù)據(jù),應(yīng)該怎么做呢?閱讀下文,您就可以找到答案。

下面為您介紹的備份方法用于實(shí)現(xiàn)DB2備份所有表數(shù)據(jù),如果您在DB2備份所有表方面遇到過類似的問題,不妨一看。

  1. ###cr by fubs  
  2. clear;  
  3. db2 connect to abbs>/tmp/null;  
  4. tbname=`db2 "list tables"|grep -v "record"|awk '{if(length($1)>0 && NR>3)print $1}'`;  
  5. ##聲明變量  
  6. s_date=`date +%Y-%m-%d,%H:%M:%S`  
  7. v_date=`date +%Y%m%d`  
  8. bkpath=$HOME/personal/fubs/bak/$v_date;  
  9. if [ ! -d $bkpath ];then  
  10. mkdir $bkpath;  
  11. echo "備份所有數(shù)據(jù),確認(rèn)嗎?\c"  
  12. else  
  13. echo "當(dāng)天已備份,是否覆蓋?\c";  
  14. fi  
  15. read yn;  
  16. if [ -z "$yn" -o ! "$yn" = "y" ];then  
  17. echo "放棄操作!";  
  18. exit 0;  
  19. fi  
  20. cd $bkpath;  
  21. num=0;  
  22. for i in $tbname  
  23. do  
  24. db2 "Export to $i.del of del select * from $i";  
  25. num=`expr $num + 1`;  
  26. done  
  27. db2 connect reset>/tmp/null;  
  28. db2 terminate>/tmp/null;  
  29. echo "備份數(shù)據(jù)成功,共備份[$num]個(gè)庫表!"  

 

 

 

 

【編輯推薦】

教您如何實(shí)現(xiàn)DB2行轉(zhuǎn)列

DB2離線備份測試實(shí)例

DB2刪除重復(fù)數(shù)據(jù)的實(shí)現(xiàn)

非正常情況下的DB2卸載方法

四種刪除DB2數(shù)據(jù)的方法

責(zé)任編輯:段燃 來源: 互聯(lián)網(wǎng)
相關(guān)推薦

2010-09-01 11:17:29

DB2備份

2010-11-03 14:16:29

DB2增量備份

2010-11-03 14:10:23

DB2在線備份

2010-09-01 14:00:01

DB2表空間

2010-11-02 14:37:58

DB2臨時(shí)表定義

2010-09-30 14:48:26

DB2查詢

2010-11-03 15:49:32

DB2刪除表

2010-11-01 16:54:09

DB2表空間

2010-09-30 11:44:40

DB2表快速清空

2010-09-30 10:04:06

DB2創(chuàng)建表空間

2010-11-03 14:05:58

DB2離線備份

2010-11-01 12:11:43

DB2表空間

2010-11-01 11:13:57

DB2表管理

2010-11-01 16:07:22

DB2表空間

2010-08-17 09:55:33

DB2備份測試

2010-11-02 14:08:29

DB2創(chuàng)建用戶

2010-09-01 14:07:33

DB2映射

2010-09-30 11:36:31

DB2表空間

2010-11-03 09:34:39

DB2臨時(shí)表

2010-11-03 11:36:53

訪問DB2表
點(diǎn)贊
收藏

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