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

DB2數(shù)據(jù)庫實用操作集錦

數(shù)據(jù)庫
DB2是IBM出口的一系列關(guān)系型數(shù)據(jù)庫管理系統(tǒng),分別在不同的操作系統(tǒng)平臺上服務(wù)。DB2數(shù)據(jù)庫在數(shù)據(jù)庫市場中雖然不是最好的,但也是很好用的,下文中就為大家?guī)鞤B2數(shù)據(jù)庫實用操作集錦。

DB2是IBM出口的一系列關(guān)系型數(shù)據(jù)庫管理系統(tǒng),分別在不同的操作系統(tǒng)平臺上服務(wù)。DB2數(shù)據(jù)庫在數(shù)據(jù)庫市場中雖然不是最好的,但也是很好用的,下文中就為大家?guī)鞤B2數(shù)據(jù)庫實用操作集錦。

1、Load 方法裝入數(shù)據(jù):

export to tempfile of del select * from TABLENAME where not 清理條件;

load from tempfile of del modified by delprioritychar replace into TABLENAME nonrecoverable;

說明:

在不相關(guān)的數(shù)據(jù)表export數(shù)據(jù)時,可以采取并發(fā)的形式,以提高效率;

TABLENAME指待清理table的名稱;

modified by delprioritychar防止數(shù)據(jù)庫記錄中存在換行符,導(dǎo)致數(shù)據(jù)無法裝入的情況;

replace into對現(xiàn)數(shù)據(jù)庫中的內(nèi)容進(jìn)行替換,即將現(xiàn)行的數(shù)據(jù)記錄清理,替換為數(shù)據(jù)文件內(nèi)容;

nonrecoverable無日志方式裝入;

2、查找當(dāng)前的應(yīng)用:db2 list application |grep BTPDBS;

3、刪除當(dāng)前正在使用的application:

db2 "force application (Id1,Id2,Id3)"

Id1,Id2,Id3 是List顯示的應(yīng)用號;

4、查看當(dāng)前應(yīng)用號的執(zhí)行狀態(tài):

db2 get snapshot for application agentid 299 |grep Row

5、查看數(shù)據(jù)庫參數(shù):

db2 get db cfg for //當(dāng)前數(shù)據(jù)庫可以省略

6、修改數(shù)據(jù)庫的Log數(shù)據(jù):

db2 update db cfg using <參數(shù)名> <參數(shù)值>

7、Db2Stop Force的用法:

在進(jìn)行Bind的時候出現(xiàn)如下錯誤:

SQL0082CAn error has occurred which has terminated processing.

SQL0092NNo package was created because of previous errors.

SQL0091NBinding was ended with "3" errors and "0" warnings.

主要是表文件被加鎖,不能繼續(xù)使用;

在進(jìn)行stop的時候報錯:db2stop

8/03/2005 21:46:530 0 SQL1025NThe database manager was not stopped because databases are still active.

SQL1025NThe database manager was not stopped because databases are still active.

需要使用如下命令可以解決這個問題: db2stop force

08/03/2005 21:47:49 0 0 SQL1064NDB2STOP processing was successful.

SQL1064NDB2STOP processing was successful.

然后啟動數(shù)據(jù)庫db2start,連接數(shù)據(jù)庫db2s后,重新進(jìn)行bind即可。

8、緩沖池參數(shù)修改:

db2 alter bufferpool ibmdefaultbp size 10240

查看本表的數(shù)據(jù)內(nèi)容如下:db2 "select * from syscat.bufferpools";

9、DB2 日志處理:

DB2日志是以文件的形式存放在文件系統(tǒng)中,分為兩種模式:循環(huán)日志和歸檔日志。當(dāng)創(chuàng)建新數(shù)據(jù)庫時,日志的缺省模式是循環(huán)日志。在這種模式下,只能實現(xiàn)數(shù)據(jù)庫的脫機(jī)備份和恢復(fù)。如果要實現(xiàn)聯(lián)機(jī)備份和恢復(fù),必須設(shè)為歸檔日志模式。

目前在綜合業(yè)務(wù)系統(tǒng)中,設(shè)置的均是歸檔日志模式;其它系統(tǒng)(如事后監(jiān)督、經(jīng)營決策、中間業(yè)務(wù)等)一般都設(shè)置為循環(huán)日志模式。至于采用何種模式,可以通過修改數(shù)據(jù)庫配置參數(shù)(LOGRETAIN)來實現(xiàn): 歸檔日志模式:db2 update db cfg for using logretain on 注:改為on后,查看數(shù)據(jù)庫配置參數(shù)logretain的值時,實際顯示的是recovery。改變此參數(shù)后,再次連接數(shù)據(jù)庫會顯示數(shù)據(jù)庫處于備份暫掛(BACKUP PENDING)狀態(tài)。這時,需要做一次對數(shù)據(jù)庫的脫機(jī)備份(db2 backup db ),才能使數(shù)據(jù)庫狀態(tài)變?yōu)檎!?/p>

循環(huán)日志模式:db2 update db cfg for using logretain off

10、Db2 日志處理

必須按照以下正確的步驟進(jìn)行操作:

要求必須使用DB2命令PRUNE進(jìn)行清理,不建議使用rm命令刪除。

刪除前應(yīng)保證應(yīng)用已停止(即聯(lián)機(jī)已下來)。

查看當(dāng)前使用的日志文件目錄及第一活動日志文件

 

用 “db2 get db cfg for ”命令查看日志文件目錄(Path to log files)參數(shù),確定數(shù)據(jù)庫當(dāng)前使用的日志文件目錄。 例如:Path to log files = /db2log/,說明DB2日志存放目錄是/db2log

用 “db2 get db cfg for ”命令查看第一活動日志文件(First active log file)參數(shù),該參數(shù)對應(yīng)的日志文件之前的日志文件均為歸檔日志文件,如果確認(rèn)沒有用,可以刪除。 例如:First active log file = S0015913.LOG,說明當(dāng)前第一活動日志文件是S0015913.LOG。

責(zé)任編輯:迎迎 來源: 電腦初學(xué)網(wǎng)
相關(guān)推薦

2010-09-07 16:45:58

DB2數(shù)據(jù)庫

2010-08-04 14:45:12

2010-08-09 16:51:24

DB2數(shù)據(jù)庫

2010-08-12 10:27:21

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

2009-07-06 00:36:19

DB2基本操作

2011-08-18 19:10:27

DB2數(shù)據(jù)庫命令

2010-08-16 13:25:41

DB2數(shù)據(jù)庫操作

2010-08-12 10:54:21

IBM DB2數(shù)據(jù)庫

2010-08-03 13:56:11

DB2表復(fù)制

2010-08-25 10:50:48

DB2數(shù)據(jù)庫

2011-03-11 16:02:03

DB2數(shù)據(jù)庫安裝

2010-08-26 16:15:25

DB2數(shù)據(jù)庫管理

2010-11-01 11:30:41

DB2數(shù)據(jù)庫權(quán)限

2010-09-30 11:49:21

DB2數(shù)據(jù)庫權(quán)限

2010-11-03 16:21:18

DB2數(shù)據(jù)庫授權(quán)

2010-08-09 12:56:11

2010-08-04 13:37:43

2010-08-18 11:06:23

連接DB2數(shù)據(jù)庫

2010-11-02 10:35:59

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

2009-07-06 17:34:26

遠(yuǎn)程復(fù)制DB2
點贊
收藏

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