{"id":6086,"date":"2024-11-14T10:25:19","date_gmt":"2024-11-14T02:25:19","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6086\/"},"modified":"2024-11-14T10:25:19","modified_gmt":"2024-11-14T02:25:19","slug":"oracle%e5%a6%82%e4%bd%95%e6%9f%a5%e8%a1%a8%e7%a9%ba%e9%97%b4%e5%a4%a7%e5%b0%8f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6086\/","title":{"rendered":"oracle\u5982\u4f55\u67e5\u8868\u7a7a\u95f4\u5927\u5c0f"},"content":{"rendered":"<blockquote><p>\n  \u8981\u67e5\u8be2 oracle \u8868\u7a7a\u95f4\u5927\u5c0f\uff0c\u8bf7\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u786e\u5b9a\u8868\u7a7a\u95f4\u540d\u79f0\uff0c\u65b9\u6cd5\u662f\u8fd0\u884c\u67e5\u8be2\uff1aselect tablespace_name from dba_tablespaces;\u67e5\u8be2\u8868\u7a7a\u95f4\u5927\u5c0f\uff0c\u65b9\u6cd5\u662f\u8fd0\u884c\u67e5\u8be2\uff1aselect sum(bytes) as total_size, sum(bytes_free) as available_space, sum(bytes) &#8211; sum(bytes_free) as used_space from dba_data_files where tablespace_\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/12\/2024061222092139599.jpg\" class=\"aligncenter\" title=\"oracle\u5982\u4f55\u67e5\u8868\u7a7a\u95f4\u5927\u5c0f\u63d2\u56fe\" alt=\"oracle\u5982\u4f55\u67e5\u8868\u7a7a\u95f4\u5927\u5c0f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u67e5\u8be2 Oracle \u8868\u7a7a\u95f4\u5927\u5c0f<\/strong><\/p>\n<p>\u67e5\u8be2 Oracle \u8868\u7a7a\u95f4\u5927\u5c0f\u662f\u4e00\u4e2a\u5e38\u89c1\u7684\u6570\u636e\u5e93\u7ba1\u7406\u4efb\u52a1\u3002\u4ee5\u4e0b\u6b65\u9aa4\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 SQL \u67e5\u8be2\u8868\u7a7a\u95f4\u5927\u5c0f\uff1a<\/p>\n<p><strong>1. \u786e\u5b9a\u8868\u7a7a\u95f4\u7684\u540d\u79f0<\/strong><\/p>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u786e\u5b9a\u8981\u67e5\u8be2\u5927\u5c0f\u7684\u8868\u7a7a\u95f4\u7684\u540d\u79f0\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b SQL \u8bed\u53e5\uff1a<\/p>\n<pre>SELECT tablespace_name FROM dba_tablespaces;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>2. \u67e5\u8be2\u8868\u7a7a\u95f4\u5927\u5c0f<\/strong><\/p>\n<p>\u4e00\u65e6\u60a8\u786e\u5b9a\u4e86\u8868\u7a7a\u95f4\u7684\u540d\u79f0\uff0c\u53ef\u4ee5\u4f7f\u7528 DBA_DATA_FILES \u89c6\u56fe\u67e5\u8be2\u5176\u5927\u5c0f\u3002\u4ee5\u4e0b SQL \u8bed\u53e5\u5c06\u8fd4\u56de\u8868\u7a7a\u95f4\u7684\u603b\u5927\u5c0f\u3001\u53ef\u7528\u7a7a\u95f4\u548c\u6b63\u5728\u4f7f\u7528\u7684\u7a7a\u95f4\uff1a<\/p>\n<pre>SELECT sum(bytes) AS total_size,\n       sum(bytes_free) AS available_space,\n       sum(bytes) - sum(bytes_free) AS used_space\nFROM dba_data_files\nWHERE tablespace_name = '&lt;table_space_name&gt;';<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d\uff0c \u5e94\u66ff\u6362\u4e3a\u8981\u67e5\u8be2\u7684\u8868\u7a7a\u95f4\u7684\u540d\u79f0\u3002 <\/p>\n<p><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n<p>\u4ee5\u4e0b\u793a\u4f8b\u67e5\u8be2\u540d\u4e3a USERS \u7684\u8868\u7a7a\u95f4\u7684\u5927\u5c0f\uff1a<\/p>\n<pre>SELECT sum(bytes) AS total_size,\n       sum(bytes_free) AS available_space,\n       sum(bytes) - sum(bytes_free) AS used_space\nFROM dba_data_files\nWHERE tablespace_name = 'USERS';<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u7ed3\u679c\uff1a<\/strong><\/p>\n<p>\u67e5\u8be2\u5c06\u8fd4\u56de\u8868\u7a7a\u95f4\u7684\u603b\u5927\u5c0f\u3001\u53ef\u7528\u7a7a\u95f4\u548c\u6b63\u5728\u4f7f\u7528\u7684\u7a7a\u95f4\uff0c\u5355\u4f4d\u4e3a\u5b57\u8282\u3002\u60a8\u9700\u8981\u5c06\u5b57\u8282\u5927\u5c0f\u8f6c\u6362\u4e3a\u66f4\u53ef\u8bfb\u7684\u683c\u5f0f\uff0c\u4f8b\u5982\u5343\u5146\u5b57\u8282 (GB) \u6216\u592a\u5b57\u8282 (TB)\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u67e5\u8868\u7a7a\u95f4\u5927\u5c0f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8981\u67e5\u8be2 oracle \u8868\u7a7a\u95f4\u5927\u5c0f\uff0c\u8bf7\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u786e\u5b9a\u8868\u7a7a\u95f4\u540d\u79f0\uff0c\u65b9\u6cd5\u662f\u8fd0\u884c\u67e5\u8be2\uff1aselect tablespace_name from dba_tablespaces;\u67e5\u8be2\u8868\u7a7a\u95f4\u5927\u5c0f\uff0c\u65b9\u6cd5\u662f\u8fd0\u884c\u67e5\u8be2\uff1aselect sum(bytes) as total_size, sum(bytes_free) as available_space, sum(bytes) &#8211; sum(bytes_free) as used_space from dba_data_files where tablespace_ \u5982\u4f55\u67e5\u8be2 Oracle \u8868\u7a7a\u95f4\u5927\u5c0f \u67e5\u8be2 Oracle \u8868\u7a7a\u95f4\u5927\u5c0f\u662f\u4e00\u4e2a\u5e38\u89c1\u7684\u6570\u636e\u5e93\u7ba1\u7406\u4efb\u52a1\u3002\u4ee5\u4e0b\u6b65\u9aa4\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 SQL \u67e5\u8be2\u8868\u7a7a\u95f4\u5927\u5c0f\uff1a 1. \u786e\u5b9a\u8868\u7a7a\u95f4\u7684\u540d\u79f0 \u9996\u5148\uff0c\u60a8\u9700\u8981\u786e\u5b9a\u8981\u67e5\u8be2\u5927\u5c0f\u7684\u8868\u7a7a\u95f4\u7684\u540d\u79f0\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b SQL \u8bed\u53e5\uff1a SELECT tablespace_name FROM dba_tablespaces; \u767b\u5f55\u540e\u590d\u5236 2. \u67e5\u8be2\u8868\u7a7a\u95f4\u5927\u5c0f \u4e00\u65e6\u60a8\u786e\u5b9a\u4e86\u8868\u7a7a\u95f4\u7684\u540d\u79f0\uff0c\u53ef\u4ee5\u4f7f\u7528 DBA_DATA_FILES \u89c6\u56fe\u67e5\u8be2\u5176\u5927\u5c0f\u3002\u4ee5\u4e0b SQL \u8bed\u53e5\u5c06\u8fd4\u56de\u8868\u7a7a\u95f4\u7684\u603b\u5927\u5c0f\u3001\u53ef\u7528\u7a7a\u95f4\u548c\u6b63\u5728\u4f7f\u7528\u7684\u7a7a\u95f4\uff1a SELECT sum(bytes) AS total_size, sum(bytes_free) AS available_space, sum(bytes) &#8211; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-6086","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6086","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=6086"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6086\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6086"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6086"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6086"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}