{"id":757,"date":"2013-03-15T10:46:31","date_gmt":"2013-03-15T02:46:31","guid":{"rendered":"http:\/\/j178.mtgbb.com\/?p=757"},"modified":"2013-03-15T11:06:28","modified_gmt":"2013-03-15T03:06:28","slug":"sql-%e6%9f%a5%e8%a9%a2-tablespace","status":"publish","type":"post","link":"https:\/\/j178.mtgbb.com\/?p=757","title":{"rendered":"SQL \u67e5\u8a62 tablespace"},"content":{"rendered":"<p>\u81ea\u5df1\u7d44 SQL \u4f86 monitor<\/p>\n<pre lang=\"oracle8\">\r\nSELECT df.tablespace_name tablespace,\r\n       df.max_space_gb max_space_gb,\r\n       df.total_space_gb total_space_gb,\r\n       (df.total_space_gb - fs.free_space_gb) used_space_gb,\r\n       fs.free_space_gb free_space_gb, round(100 * (fs.free_space_gb \/ df.total_space_gb), 2) pct_free,\r\n       round(100 - 100 * (df.total_space_gb - fs.free_space_gb) \/ df.max_space_gb, 2) pct_max_free\r\n  FROM (SELECT tablespace_name,\r\n               round(SUM(decode(autoextensible, 'YES', maxbytes, bytes)) \/ 1073741824, 2) max_space_gb,\r\n               round(SUM(bytes) \/ 1073741824, 2) total_space_gb\r\n          FROM dba_data_files\r\n         GROUP BY tablespace_name) df,\r\n       (SELECT tablespace_name,\r\n               round(SUM(bytes) \/ 1073741824, 3) free_space_gb\r\n          FROM dba_free_space\r\n         GROUP BY tablespace_name) fs\r\n WHERE df.tablespace_name = fs.tablespace_name(+)\r\n ORDER BY fs.tablespace_name;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u81ea\u5df1\u7d44 SQL \u4f86 monitor SELECT df.tablespace_name tablespace, &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[23],"class_list":["post-757","post","type-post","status-publish","format-standard","hentry","category-database","tag-oracle-db"],"_links":{"self":[{"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/posts\/757","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=757"}],"version-history":[{"count":0,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=\/wp\/v2\/posts\/757\/revisions"}],"wp:attachment":[{"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=757"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=757"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/j178.mtgbb.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=757"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}