ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 自己整理的学习资料——DB2 V8数据库基础(二十四)

自己整理的学习资料——DB2 V8数据库基础(二十四)

原创 Linux操作系统 作者:rheet1978 时间:2008-10-23 14:58:25 0 删除 编辑

 

接前面的表格。

状态

十六进制状态值

描述

示例

Quiesced Share

0x1

当调用表空间静默(quiesce)功能的应用程序和并发应用程序都可以读(但不能写)访问表空间时,该表空间就处于这种状态。您可以通过执行一条 QUIESCE TABLESPACES FOR TABLE 命令,将表空间显式地置于 Quiesced Share 状态。

在将表空间设置为 Quiesced Share 之前,要确保它处于 Normal状态。
connect to sample;
quiesce tablespaces for table staff reset;
quiesce tablespaces for table staff share;
connect reset;
从另一会话执行下列脚本:
connect to sample;
select * from staff where id=40;
update staff set salary=50000 where id=40;
list tablespaces;
connect reset;
USERSPACE1
返回的信息显示,该表空间处于 Quiesced Share 状态。

Quiesced Update

0x2

当调用表空间静默(quiesce)功能的应用程序独占写访问表空间时,该表空间就处于这种状态。您可以通过执行一条 QUIESCE TABLESPACES FOR TABLE 命令,将表空间显式地置于 Quiesced Update 状态。

在将表空间设置为 Quiesced Update 之前,要确保它处于 Normal状态。
connect to sample;
quiesce tablespaces for table staff reset;
quiesce tablespaces for table staff intent to update;
connect reset;
从另一会话执行下列脚本:
connect to sample;
select * from staff where id=50;
update staff set salary=50000 where id=50;
list tablespaces;
connect reset;
USERSPACE1
返回的信息显示,该表空间处于 Quiesced Update 状态。

Reorg in Progress

0x400

这是一种只在进行重组(reorg)操作期间才有效的临时状态。

执行一条 REORG TABLE 命令:
connect to sample;
reorg table staff;
connect reset;
在执行重组操作时,从另一会话执行下列脚本:
connect to sample;
1.list tablespaces show detail;
或者
2.get snapshot for tablespaces on sample;
connect reset;
USERSPACE1
返回的信息显示,该表空间处于 Reorg in Progress 状态。注意:涉及 SAMPLE 数据库的表重组操作很可能在极短的时间内就可以完成,因此,使用这种方法来观察 Reorg in Progress 状态可能比较困难。

Restore Pending

0x100

在执行了重定向恢复操作的第一部分之后(即在发出 SET TABLESPACE CONTAINERS 命令之前),数据库的表空间就处于这种状态。在使用表空间之前,必须恢复表空间(或者是整个数据库)。直到成功完成恢复操作,您才可以连接到数据库,此时, restore_pending信息数据库配置参数的值被设为 NO。

当处于 Storage May be Defined中的重定向恢复操作的第一部分完成时,所有的表空间都将处于 Restore Pending 状态。

Restore in Progress

0x2000

这是一种只在执行恢复操作期间才有效的临时状态。

update db cfg for sample using logretain recovery;
backup db sample;
backup db sample tablespace (userspace1);
该备份映像的时间戳为:20040611174124
restore db sample tablespace (userspace1) online taken at 20040611174124;
在执行恢复操作时,从另一会话执行下列脚本:
connect to sample;
1.list tablespaces show detail;
或者
2.get snapshot for tablespaces on sample;
connect reset;
USERSPACE1
返回的信息显示,该表空间处于 Restore in Progress 状态。

Roll Forward Pending

0x80

在对可恢复的数据库执行恢复操作之后,表空间就处于这种状态。在使用表空间之前,必须前滚该表空间(或是整个数据库)。如果 logretain数据库配置参数被设为 RECOVERY,或者 userexit数据库配置参数被设为 YES,那么该数据库是可恢复的。直到前滚操作成功完成,您才可以激活或连接到该数据库,此时, rollfwd_pending信息数据库配置参数被设为 NO。

当处于 Restore in Progress中的在线表空间完成恢复操作时,表空间 USERSPACE1 处于 Roll Forward Pending 状态。

Roll Forward in Progress

0x40

这是一种只在执行前滚操作期间才有效的临时状态。

已知载入的输入文件 staffdata.del 拥有大量数据(例如,20000 条或更多记录):
update db cfg for sample using logretain recovery;
backup db sample;
connect to sample;
create tablespace ts1 managed by database using (file '/home/melnyk/melnyk/NODE0000/SQL00001/ts1c1' 1024);
create table newstaff like staff in ts1;
connect reset;
backup db sample tablespace (ts1) online;
该备份映像的时间戳为:20040630000715
connect to sample;
load from staffdata.del of del insert into newstaff copy yes to /home/melnyk/backups;
connect reset;
restore db sample tablespace (ts1) online taken at 20040630000715;
rollforward db sample to end of logs and stop tablespace (ts1) online;
当执行前滚操作时,从另一会话执行下列脚本:
connect to sample;
1.list tablespaces show detail;
或者
2.get snapshot for tablespaces on sample;
connect reset;
TS1
返回的信息显示,该表空间处于 Roll Forward in Progress 状态。

Storage May be Defined

0x2000000

在执行了重定向恢复操作的第一部分之后(即在发出 SET TABLESPACE CONTAINERS 命令之前),数据库的表空间就处于这种状态。如果您愿意,这将允许您重新定义容器(请参阅 DB2 基础:使用重定向恢复克隆 DB2 数据库)。

backup db sample;
假定该备份映像的时间戳为:20040613204955
restore db sample taken at 20040613204955 redirect;
list tablespaces;
Information returned by the LIST TABLESPACES
命令返回的信息显示,所有的表空间都处于 Storage May be Defined 和 Restore Pending状态。

Storage Must be Defined

0x1000

在将恢复操作重定向到 新数据库期间,如果省略了设置表空间容器的阶段,或者,如果在设置表空间容器的阶段期间无法获得指定的容器,那么数据库的表空间就会处于这种状态。某些时候会出现后一种情况,例如,指定了无效的路径名,或者是磁盘空间不足。

backup db sample;
假定该备份映像的时间戳为:20040613204955。
restore db sample taken at 20040613204955 into mydb redirect;
set tablespace containers for 2 using (path 'ts2c1');
list tablespaces;
LIST TABLESPACES
命令返回的信息显示,表空间 SYSCATSPACE 和表空间 TEMPSPACE1 都处于 Storage Must be Defined、 Storage May be Defined和 Restore Pending状态。Storage Must be Defined 状态比 Storage May be Defined 状态更重要。

Table Space Creation in Progress

0x40000000

这是一种只在执行创建表空间的操作期间才有效的临时状态。

connect to sample;
create tablespace ts1 managed by database using (file '/home/melnyk/melnyk/NODE0000/SQL00001/tsc1' 1024);
create tablespace ts2 managed by database using (file '/home/melnyk/melnyk/NODE0000/SQL00001/tsc2' 1024);
create tablespace ts3 managed by database using (file '/home/melnyk/melnyk/NODE0000/SQL00001/tsc3' 1024);
在执行创建表空间的操作时,从另一会话执行下列脚本:
connect to sample;
1.list tablespaces show detail; or
2.get snapshot for tablespaces on sample;
connect reset;
TS1
、TS2 和 TS3 返回的信息显示,这些表空间处于 Table Space Creation in Progress 状态。

Table Space Deletion in Progress

0x20000000

这是一种只在执行删除表空间的操作期间才有效的临时状态。

connect to sample;
create tablespace ts1 managed by database using (file '/home/melnyk/melnyk/NODE0000/SQL00001/tsc1' 1024);
create tablespace ts2 managed by database using (file '/home/melnyk/melnyk/NODE0000/SQL00001/tsc2' 1024);
create tablespace ts3 managed by database using (file '/home/melnyk/melnyk/NODE0000/SQL00001/tsc3' 1024);
drop tablespace ts1;
drop tablespace ts2;
drop tablespace ts3;
在执行删除表空间的操作时,从另一会话执行下列脚本:
connect to sample;
1.list tablespaces show detail;
或者
2.get snapshot for tablespaces on sample;
connect reset;
TS1
、TS2 和 TS3 返回的信息显示,这些表空间处于 Table Space Deletion in Progress 状态。

 

表格完,本节未完。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9524210/viewspace-475075/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
暂无介绍

注册时间:2008-06-09

  • 博文量
    84
  • 访问量
    548247