- 1、本文档共18页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
DB2表空间管理及查看脚本(SHELL)等(国外英语资料)
DB2表空间管理及查看脚本(SHELL)等(国外英语资料)
Task management:
1. Sh file
#! / bin/sh
The # tablespace management job, please do not delete, the operating system has been called normally
# call time, 17:00 every day
# crontab - e opens, editable
/ home/db2app /.profile
The # script deletes the table that is created at 22 days or the total number greater than 400 * 0.5, ensuring that the amount of data cannot be greater than 50% of the total space and the creation date cannot be greater than 22 days
Db2 connect to esopdb;
Res = tbopres. TXT
SQL =
With a as
(
The select
Rownumber () over (order by npages desc) as od,
DB2INFO. | | tabname,
Decimal (sum (npages) * 1.00 * 32768 / (1024 * 1024 * 1024), 4, 2) GUSAGE,
Create_time ct
The from syscat.tables tables
Where tbspace = TBS_DW_USER and type = T
And OWNER = DB2APP and TABSCHEMA = DB2INFO
The and
(
The tabname not like DIM % and tabname not like % LOG % and tabname not like % and tabname not like %
And tabname not like % and tabname not like %
)
Group by tabname, npages has, create_time
The order by GUSAGE desc
),
B the as
(
Select a_s. od, a_s. tabname, a_s. gusage,
Case a_s. Od
1 then the when a_s gusage
(a) from a as a_d.
A_s. Ct
From the as a a_s
The order by a_s. Od
)
Select cast ( alter table | |, |, | | | activate not logged with empty table; drop table )
| | b. t abname | | replace (; - od: | | cast (b.o. d as char (3)) | |, gusage: | | cast (b.g usage as char (10), total:
| | cast (b.t as decimal (5, 2)) as char (10)) | | , percent: | | cast (cast (b.t. ot / 400 as decimal (5, 2)) as char (10)
| | , created before | | cast (days (current_date) - days (ct) as char (2)) | | days | -, , 00, 0.) as varchar (300)) as SQL
The from b
Where b.t ot = 400 * 0.5 or days (current_date) -days (ct) = 22
Order by b.o. d, days (current_date) -days (b.c t) desc
# execution does not have the content of the title class
Db2 - x $SQL $res
Branch # and read each line
Tr ; \ n ${res} | while read line
The do
Echo ` date + % % m Y H: % d % %
您可能关注的文档
- 2012广东省WORD全国计算机等级考试二级VB试题及答案(国外英语资料).doc
- 2012年贵州省电大考试试题(国外英语资料).doc
- 2012年德国柏林消费电子展(国外英语资料).doc
- 2012春福师《高级英语(一)》在线作业二(国外英语资料).doc
- 2012山西省WORD全国计算机等级考试二级VB一点通科目一(国外英语资料).doc
- 2012山西省全国计算机等级考试二级笔试试卷VB考试技巧重点(国外英语资料).doc
- 2012秋小学部国旗下讲话(四2班主持《弯弯腰,捡起一片文明》(国外英语资料).doc
- 2012海南省专业技术人员计算机应用能力考试(国外英语资料).doc
- 2012消失的诺基亚(国外英语资料).doc
- 2012广东省计算机等级考试试题 二级C试题(必备资料)(国外英语资料).doc
文档评论(0)