點擊上方“IT那活兒”,關注后了解更多內容,不管IT什么活兒,干就完了?。。?/strong>
一
表空間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"
編寫一個存儲腳本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
重建一個大小為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
文章版權歸作者所有,未經(jīng)允許請勿轉載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉載請注明本文地址:http://www.ezyhdfw.cn/yun/129510.html
摘要:面試,是跳槽后第一個需要面對的問題而且不同公司面試的著重點不同但是卻有一個共同點基礎是必考的。對自動災難恢復有要求的表。 貌似這一點適應的行業(yè)最廣,但是我可以很肯定的說:當你從事Java一年后,重新找工作時,才會真實的感受到這句話。 工作第一年,往往是什么都充滿新鮮感,什么都學習,沖勁十足的一年;WEB行業(yè)知識更新特別快,今天一個框架的新版本,明天又是另一個新框架,有時往往根據(jù)項目的需...
摘要:面試,是跳槽后第一個需要面對的問題而且不同公司面試的著重點不同但是卻有一個共同點基礎是必考的。對自動災難恢復有要求的表。 貌似這一點適應的行業(yè)最廣,但是我可以很肯定的說:當你從事Java一年后,重新找工作時,才會真實的感受到這句話。 工作第一年,往往是什么都充滿新鮮感,什么都學習,沖勁十足的一年;WEB行業(yè)知識更新特別快,今天一個框架的新版本,明天又是另一個新框架,有時往往根據(jù)項目的需...
摘要:本文將介紹網(wǎng)易云基礎服務蜂巢實例遷移功能的實現(xiàn),并探討如何高效完成實例遷移任務。網(wǎng)易云基礎服務蜂巢提供了負載監(jiān)控閾值選項,在業(yè)務負載超過該閾值時,會暫停遷移操作,直到負載重新低于閾值。 歡迎訪問網(wǎng)易云社區(qū),了解更多網(wǎng)易技術產(chǎn)品運營經(jīng)驗。 我們把數(shù)據(jù)庫里部分或全部 Schema和數(shù)據(jù)遷移到另一個實例的行為稱為實例遷移,將導出數(shù)據(jù)的實例稱為源實例,導入數(shù)據(jù)的實例稱為目標實例。 根據(jù)遷移數(shù)...
閱讀 1493·2023-01-11 13:20
閱讀 1851·2023-01-11 13:20
閱讀 1289·2023-01-11 13:20
閱讀 2041·2023-01-11 13:20
閱讀 4241·2023-01-11 13:20
閱讀 2948·2023-01-11 13:20
閱讀 1580·2023-01-11 13:20
閱讀 3852·2023-01-11 13:20