DB2 自动存储表空间(Automatic Storage)增加和删除存储路径
来源:互联网 发布:pr软件图标 编辑:程序博客网 时间:2024/06/18 07:38
本文举例说明修改DB2自动存储表空间storage group的办法,如果您对storage group还不了解,请先参考链接。
原本storage group有path1和path2,目标增加一条路径path3,并删掉path2,测试如下:
查看修改操作会对哪些表空间产生影响:
增加path3, 删除path2,删除之后,path2被会置为drop pending,再次删除的话就会报错SQL2092N:
最后需要一个Rebalance操作
说明:如果是临时表空间,无法Rebalance, 需要删掉并重建临时表空间。
https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.sql.ref.doc/doc/r0058603.html
https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.admin.dbobj.doc/doc/r0054957.html
原本storage group有path1和path2,目标增加一条路径path3,并删掉path2,测试如下:
$ db2 "CREATE STOGROUP sg ON 'C:\test\path1', 'C:\test\path2' "$ db2 "create tablespace tbstest managed by automatic storage USING STOGROUP sg"$ db2 "create table t1(id int) in tbstest"$ db2 "insert into t1 values(100),(200)"
查看修改操作会对哪些表空间产生影响:
$ db2 "SELECT substr(TBSP_NAME,1,30) as TBSP_NAME FROM table (MON_GET_TABLESPACE('', -2)) WHERE TBSP_USING_AUTO_STORAGE = 1 AND TBSP_CONTENT_TYPE IN ('ANY','LARGE') AND STORAGE_GROUP_NAME = 'SG' ORDER BY TBSP_ID"TBSP_NAME------------------------------TBSTEST 1 record(s) selected.
增加path3, 删除path2,删除之后,path2被会置为drop pending,再次删除的话就会报错SQL2092N:
$ db2 "alter STOGROUP sg add 'C:\test\path3'"$ db2 "alter STOGROUP sg drop 'C:\test\path2' "SQL2095W Storage path "C:\test\path2" is in the drop pending state becauseone or more automatic storage table spaces reside on the path. SQLSTATE=01691$ db2 "alter STOGROUP sg drop 'C:\test\path2' "DB21034E The command was processed as an SQL statement because it was not avalid Command Line Processor command. During SQL processing it returned:SQL2092N Storage path "C:\test\path2" is in the drop pending state. Thecurrent request cannot be processed. SQLSTATE=55073
最后需要一个Rebalance操作
$ db2 "alter tablespace tbstest rebalance"$ db2 "alter STOGROUP sg drop 'C:\test\path2'"DB21034E The command was processed as an SQL statement because it was not avalid Command Line Processor command. During SQL processing it returned:SQL1051N The path "C:\test\path2" does not exist or is not valid.SQLSTATE=57019
说明:如果是临时表空间,无法Rebalance, 需要删掉并重建临时表空间。
https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.sql.ref.doc/doc/r0058603.html
https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.admin.dbobj.doc/doc/r0054957.html
0 0
- DB2 自动存储表空间(Automatic Storage)增加和删除存储路径
- DB2如何查看表空间是否为‘自动存储管理’(Automatic Storage)
- 命名空间存储配置(Namespace Storage Configuration)
- 表空间监控和自动添加数据文件存储过程
- oracle 修改表空间存储路径
- FastDFS增加存储路径配置
- Android 外部存储external storage和内部存储internal storage
- fastdfs storage和tracker节点增加删除
- linux下使用crontab和存储过程定期删除db2的表
- DB2支持的三种表空间SMS、DMS、DMS的自动存储
- Storage Classes(存储类型)
- Storage Options(数据存储)
- WINCE存储和程序空间的区分。CE memory division between "storage" & "program" memory
- Android 获取存储卡路径和空间使用情况
- H5存储(web Storage和web SQL)
- 修改表空间(改变大小,增加数据文件,修改自动扩展性,移动数据文件,重命名,删除)
- local storage 存储 json 和数组
- Web存储之Cookie和Web Storage
- override onMeasure()
- 基于Java EE新闻管理系统的设计与实现
- root用户和sudo使用root权限的区别
- POJ
- java中的正则表达式总结
- DB2 自动存储表空间(Automatic Storage)增加和删除存储路径
- angular 2.0 关于新版angular-cli的应用
- 用vs2015编译器写c语言程序提示“预编译头文件来自编译器的早期版本,或者预编译头为c++而在c中使用它(或相反)”
- 蓝桥杯入门训练:圆的面积
- 获得特定月份的天数-iOS
- 鸟哥的linux私房菜学习笔记《二十二》bash shell的操作环境
- 记一次too many open files
- js---运算符,语句
- HaDoop2.6下安装并配置Spark1.6.3