{"id":322,"date":"2013-01-12T17:00:49","date_gmt":"2013-01-12T09:00:49","guid":{"rendered":"http:\/\/www.yallonking.com\/?p=322"},"modified":"2013-01-12T18:06:54","modified_gmt":"2013-01-12T10:06:54","slug":"scripts%ef%bc%9a%e6%9f%a5%e7%9c%8b%e6%8c%87%e5%ae%9a%e5%af%b9%e8%b1%a1%e7%9a%84%e5%8e%86%e5%8f%b2%e5%a2%9e%e9%95%bf%e6%83%85%e5%86%b5","status":"publish","type":"post","link":"http:\/\/www.yallonking.com\/?p=322","title":{"rendered":"scripts:\u67e5\u770b\u6307\u5b9a\u5bf9\u8c61\u7684\u5386\u53f2\u589e\u957f\u60c5\u51b5"},"content":{"rendered":"<p>\u67e5\u770b\u6307\u5b9a\u5bf9\u8c61\u7684\u5386\u53f2\u589e\u957f\u60c5\u51b5<br \/>\n<coolcode lang=\"sql\"><br \/>\nset linesize 150<br \/>\ncolumn owner format a16<br \/>\ncolumn object_name format a30<br \/>\ncolumn start_day format a11<br \/>\ncolumn block_increase format 9999999999<br \/>\nPROMPT specify owner name as parameter owner_name:<br \/>\nDEFINE ownername = &owner_name<br \/>\nselect obj.owner,<br \/>\n       obj.object_name,<br \/>\n       to_char(sn.BEGIN_INTERVAL_TIME, 'YYYY-MM-DD') start_day,<br \/>\n       sum(a.space_used_delta) used_increase,<br \/>\n       sum(a.space_allocated_delta ) allocate_increase,<br \/>\n       sum(a.db_block_changes_delta) block_increase<br \/>\n  from dba_hist_seg_stat a, dba_hist_snapshot sn, dba_objects obj<br \/>\n where sn.snap_id = a.snap_id<br \/>\n   and obj.object_id = a.obj#<br \/>\n  and obj.owner not in ('SYS', 'SYSTEM')<br \/>\n   and end_interval_time >= to_timestamp((to_char(sysdate - 7,'YYYY-MM--DD')), 'YYYY-MM--DD')<br \/>\n   and obj.OWNER=UPPER('&ownername')<br \/>\n   and obj.OBJECT_NAME = UPPER('&segmentname')<br \/>\n group by obj.owner,<br \/>\n          obj.object_name,<br \/>\n          to_char(sn.BEGIN_INTERVAL_TIME, 'YYYY-MM-DD')<br \/>\n order by obj.owner, obj.object_name<br \/>\n\/<br \/>\n<\/coolcode><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u67e5\u770b\u6307\u5b9a\u5bf9\u8c61\u7684\u5386\u53f2\u589e\u957f\u60c5\u51b5 set linesize 150 column owner format a16  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9],"tags":[],"_links":{"self":[{"href":"http:\/\/www.yallonking.com\/index.php?rest_route=\/wp\/v2\/posts\/322"}],"collection":[{"href":"http:\/\/www.yallonking.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.yallonking.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.yallonking.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.yallonking.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=322"}],"version-history":[{"count":4,"href":"http:\/\/www.yallonking.com\/index.php?rest_route=\/wp\/v2\/posts\/322\/revisions"}],"predecessor-version":[{"id":373,"href":"http:\/\/www.yallonking.com\/index.php?rest_route=\/wp\/v2\/posts\/322\/revisions\/373"}],"wp:attachment":[{"href":"http:\/\/www.yallonking.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.yallonking.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=322"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.yallonking.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}