點(diǎn)擊上方“IT那活兒”,關(guān)注后了解更多內(nèi)容,不管IT什么活兒,干就完了!!!
一
表空間backup-pending
copy on
copy yes
nonrecoverable
[db2i97@localhost ~]$ db2 connect to sample
[db2i97@localhost ~]$ db2 "create tablespace ts1"
[db2i97@localhost ~]$ db2 "create table t3 (id int,name char(20)) in ts1"
[db2i97@localhost ~]$ mkdir /home/db2i97/archlog
[db2i97@localhost ~]$ db2 update db cfg for sample using LOGARCHMETH1 disk:/home/db2i97/archlog
[db2i97@localhost ~]$ db2 backup db sample to /dev/null
[db2i97@localhost ~]$ db2 "load from t3.del of del insert into t3"
[db2i97@localhost ~]$ db2 "update t3 set name=newcc where id=3"
[db2i97@localhost ~]$ db2 list tablespaces show detail
Tablespace ID = 7
Name = TS1
Type = Database managed space
Contents = All permanent data. Large table space.
State = 0x0020
[db2i97@localhost ~]$ db2 backup db sample tablespace ts1 online to /dev/null
Tablespace ID = 7
Name = TS1
Type = Database managed space
Contents = All permanent data. Large table space.
State = 0x0000
Detailed explanation:
Normal
[db2i97@localhost ~]$ db2 "update t3 set name=newcc where id=3"
DB20000I The SQL command completed successfully.
[db2i97@localhost ~]$ db2 "load from t3.del of del insert into t3 nonrecoverable"
[db2i97@localhost ~]$ db2 list tablespaces show detail
Tablespace ID = 7
Name = TS1
Type = Database managed space
Contents = All permanent data. Large table space.
State = 0x0000
二
表load pending
[root@localhost ~]# mkdir /data1
[root@localhost ~]# chown db2i97:db2i97 /data1
[db2i97@localhost ~]$ db2 "create tablespace ts3 pagesize 8k managed by database using (file /data1/ts2 256) bufferpool bp8k"
[db2i97@localhost ~]$ db2 "create table t1 (id int, name char(50), desc char(150)) in ts1"
編寫一個(gè)存儲腳本sp_insert.sql:
[db2i97@localhost ~]$ vi sp_insert.sql
CREATE PROCEDURE sp_insert (IN count int)
LANGUAGE SQL
BEGIN
DECLARE i INTEGER DEFAULT 0;
while i do
insert into t1 values( i, abcdefghixxxxxxxxxx || char(i), bbbbbbbbbbbbbbbbbbbb|| char(i) );
set i=i+1;
end while;
END
@
[db2i97@localhost ~]$ db2 -td@ -f sp_insert.sql
DB20000I The SQL command completed successfully.
[db2i97@localhost ~]$ db2 "call sp_insert(6500)"
Return Status = 0
[db2i97@localhost ~]$ db2 "export to t1.del of del select * from t1"
SQL3104N The Export utility is beginning to export data to file "t1.del".
SQL3105N The Export utility has finished exporting "6500" rows.
Number of rows exported: 6500
重建一個(gè)大小為232頁的表空間,將t1.del數(shù)據(jù)加載,由于無法分配新頁,引起load出現(xiàn)異常。
[db2i97@localhost ~]$db2 "create tablespace ts1 pagesize 8k managed by database using (file /data1/ts1 232) bufferpool bp8k"
[db2i97@localhost ~]$ db2 "create table t1 (id int, name char(50), desc char(50) ) in ts1"
[db2i97@localhost ~]$db2 "load from t1.del of del insert into t1"
[db2i97@localhost ~]$db2 load query table t1
db2 "SELECT TABSCHEMA, TABNAME, LOAD_STATUS FROM
SYSIBMADM.ADMINTABINFO where load_status = PENDING"
db2 "call sysproc.admin_cmd(Load from /dev/null of del terminate into db2i97.t1)"
END
文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請注明本文地址:http://systransis.cn/yun/129510.html
摘要:面試,是跳槽后第一個(gè)需要面對的問題而且不同公司面試的著重點(diǎn)不同但是卻有一個(gè)共同點(diǎn)基礎(chǔ)是必考的。對自動(dòng)災(zāi)難恢復(fù)有要求的表。 貌似這一點(diǎn)適應(yīng)的行業(yè)最廣,但是我可以很肯定的說:當(dāng)你從事Java一年后,重新找工作時(shí),才會真實(shí)的感受到這句話。 工作第一年,往往是什么都充滿新鮮感,什么都學(xué)習(xí),沖勁十足的一年;WEB行業(yè)知識更新特別快,今天一個(gè)框架的新版本,明天又是另一個(gè)新框架,有時(shí)往往根據(jù)項(xiàng)目的需...
摘要:面試,是跳槽后第一個(gè)需要面對的問題而且不同公司面試的著重點(diǎn)不同但是卻有一個(gè)共同點(diǎn)基礎(chǔ)是必考的。對自動(dòng)災(zāi)難恢復(fù)有要求的表。 貌似這一點(diǎn)適應(yīng)的行業(yè)最廣,但是我可以很肯定的說:當(dāng)你從事Java一年后,重新找工作時(shí),才會真實(shí)的感受到這句話。 工作第一年,往往是什么都充滿新鮮感,什么都學(xué)習(xí),沖勁十足的一年;WEB行業(yè)知識更新特別快,今天一個(gè)框架的新版本,明天又是另一個(gè)新框架,有時(shí)往往根據(jù)項(xiàng)目的需...
摘要:本文將介紹網(wǎng)易云基礎(chǔ)服務(wù)蜂巢實(shí)例遷移功能的實(shí)現(xiàn),并探討如何高效完成實(shí)例遷移任務(wù)。網(wǎng)易云基礎(chǔ)服務(wù)蜂巢提供了負(fù)載監(jiān)控閾值選項(xiàng),在業(yè)務(wù)負(fù)載超過該閾值時(shí),會暫停遷移操作,直到負(fù)載重新低于閾值。 歡迎訪問網(wǎng)易云社區(qū),了解更多網(wǎng)易技術(shù)產(chǎn)品運(yùn)營經(jīng)驗(yàn)。 我們把數(shù)據(jù)庫里部分或全部 Schema和數(shù)據(jù)遷移到另一個(gè)實(shí)例的行為稱為實(shí)例遷移,將導(dǎo)出數(shù)據(jù)的實(shí)例稱為源實(shí)例,導(dǎo)入數(shù)據(jù)的實(shí)例稱為目標(biāo)實(shí)例。 根據(jù)遷移數(shù)...
閱讀 1357·2023-01-11 13:20
閱讀 1707·2023-01-11 13:20
閱讀 1215·2023-01-11 13:20
閱讀 1906·2023-01-11 13:20
閱讀 4165·2023-01-11 13:20
閱讀 2757·2023-01-11 13:20
閱讀 1402·2023-01-11 13:20
閱讀 3672·2023-01-11 13:20