一、查看数据库表空间是否自动存储管理
$ db2pd -d tankdb -tablespace
Tablespace Autoresize Statistics:
Address Id AS AR InitSize IncSize IIP MaxSize LastResize LRF
0x00002B71F55F5A80 0 Yes Yes 33554432 -1 No None None No
0x00002B71F55F7200 1 Yes No 0 0 No 0 None No
0x00002B71F55FA940 2 Yes Yes 33554432 -1 No None None No
0x00002B71F55FC0C0 3 Yes Yes 33554432 -1 No None None No
0x00002B71F55FD840 4 Yes Yes 33554432 -1 No None None No
0x00002B71F55FEFC0 5 Yes Yes 33554432 -1 No None None No
0x00002B71F5600740 6 Yes Yes 33554432 -1 No None None No
0x00002B71F5601EC0 7 Yes No 0 0 No 0 None No
二、备份tankdb 测试库
[db2inst2@localhost ~]$ db2 backup db tankdb to /backup/db2inst2/
三、自动存储管理由于DB2数据库自动管理无法重定向表空间
[db2inst2@localhost ~]$ db2 restore db tankdb from /backup/db2inst2/ taken at 20150929064944 into tank123 without rolling forward
DB20000I RESTORE DATABASE 命令成功完成。
[db2inst2@localhost ~]$ db2 connect to tank123
数据库连接信息
数据库服务器 = DB2/LINUXX8664 9.7.5
SQL 授权标识 = DB2INST2
本地数据库别名 = TANK123
[db2inst2@localhost ~]$ db2 "select count(*) from testtb"
1
-----------
40
阅读(1601) | 评论(0) | 转发(0) |