{"id":15903,"date":"2023-12-04T23:51:29","date_gmt":"2023-12-04T15:51:29","guid":{"rendered":"https:\/\/wx.kaifamiao.info\/?p=15903"},"modified":"2023-12-04T23:57:37","modified_gmt":"2023-12-04T15:57:37","slug":"oracle-zhong-ju-chu-liang-ge-pan-duan-ddl-gai-dong","status":"publish","type":"post","link":"http:\/\/wx.kaifamiao.info\/index.php\/2023\/12\/04\/oracle-zhong-ju-chu-liang-ge-pan-duan-ddl-gai-dong\/","title":{"rendered":"Oracle \u4e2d\u4e3e\u51fa\u4e24\u4e2a\u5224\u65ad DDL \u6539\u52a8\u7684\u65b9\u6cd5\uff1f"},"content":{"rendered":"<p>\u5728 Oracle \u6570\u636e\u5e93\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4e24\u4e2a\u65b9\u6cd5\u6765\u5224\u65ad DDL\uff08Data Definition Language\uff09\u6539\u52a8\uff1a<\/p>\n<ol>\n<li><strong>\u4f7f\u7528\u6570\u636e\u5b57\u5178\u89c6\u56fe\uff1a<\/strong>\n<ul>\n<li>Oracle \u63d0\u4f9b\u4e86\u4e00\u7cfb\u5217\u7684\u6570\u636e\u5b57\u5178\u89c6\u56fe\uff0c\u7528\u4e8e\u67e5\u8be2\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u5143\u6570\u636e\u4fe1\u606f\u3002\u5176\u4e2d\uff0c<code>DBA_OBJECTS<\/code> \u89c6\u56fe\u662f\u4e00\u4e2a\u5e38\u7528\u7684\u89c6\u56fe\uff0c\u5305\u542b\u4e86\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u5bf9\u8c61\u4fe1\u606f\u3002\u901a\u8fc7\u67e5\u8be2\u8be5\u89c6\u56fe\uff0c\u53ef\u4ee5\u83b7\u53d6\u6709\u5173\u5bf9\u8c61\u7684\u4fe1\u606f\uff0c\u5305\u62ec\u5bf9\u8c61\u7684\u521b\u5efa\u65f6\u95f4\u3001\u4fee\u6539\u65f6\u95f4\u7b49\u3002<\/li>\n<li>\u793a\u4f8b\u67e5\u8be2\uff1a<br \/>\n<code>sql<br \/>\nSELECT object_name, object_type, created, last_ddl_time<br \/>\nFROM dba_objects<br \/>\nWHERE object_type = 'TABLE';<\/code><\/li>\n<li>\u4e0a\u8ff0\u67e5\u8be2\u4f1a\u5217\u51fa\u6240\u6709\u8868\u7684\u540d\u79f0\u3001\u7c7b\u578b\u4ee5\u53ca\u521b\u5efa\u65f6\u95f4\u548c\u6700\u540e\u4e00\u6b21 DDL \u6539\u52a8\u7684\u65f6\u95f4\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u4f7f\u7528\u5ba1\u8ba1\u529f\u80fd\uff1a<\/strong>\n<ul>\n<li>Oracle \u63d0\u4f9b\u4e86\u5ba1\u8ba1\u529f\u80fd\uff0c\u53ef\u4ee5\u542f\u7528\u5bf9 DDL \u8bed\u53e5\u7684\u5ba1\u8ba1\uff0c\u8bb0\u5f55\u6709\u5173\u6570\u636e\u5e93\u5bf9\u8c61\u53d8\u66f4\u7684\u4fe1\u606f\u3002\u5ba1\u8ba1\u4fe1\u606f\u53ef\u4ee5\u5199\u5165\u5ba1\u8ba1\u65e5\u5fd7\u6587\u4ef6\u6216\u6570\u636e\u5e93\u8868\u3002<\/li>\n<li>\u793a\u4f8b\u542f\u7528\u5ba1\u8ba1\uff1a<br \/>\n<code>sql<br \/>\nAUDIT ALL ON SCHEMA BY ACCESS;<\/code><br \/>\n\u8fd9\u5c06\u542f\u7528\u5bf9\u6a21\u5f0f\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u6240\u6709\u64cd\u4f5c\u7684\u5ba1\u8ba1\u8bb0\u5f55\u3002<\/li>\n<li>\u67e5\u8be2\u5ba1\u8ba1\u8bb0\u5f55\uff1a<br \/>\n<code>sql<br \/>\nSELECT * FROM dba_audit_trail WHERE action_name LIKE 'ALTER%';<\/code><br \/>\n\u4e0a\u8ff0\u67e5\u8be2\u4f1a\u5217\u51fa\u6240\u6709\u6267\u884c\u8fc7 ALTER \u64cd\u4f5c\u7684\u5ba1\u8ba1\u8bb0\u5f55\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u4e24\u79cd\u65b9\u5f0f\uff0c\u53ef\u4ee5\u76d1\u6d4b\u548c\u8ffd\u8e2a\u6570\u636e\u5e93\u4e2d\u53d1\u751f\u7684 DDL \u6539\u52a8\u3002\u5ba1\u8ba1\u529f\u80fd\u63d0\u4f9b\u4e86\u66f4\u8be6\u7ec6\u7684\u8bb0\u5f55\uff0c\u800c\u6570\u636e\u5b57\u5178\u89c6\u56fe\u5219\u63d0\u4f9b\u4e86\u4e00\u79cd\u66f4\u76f4\u63a5\u7684\u67e5\u8be2\u65b9\u5f0f\u3002\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u53d6\u51b3\u4e8e\u5177\u4f53\u7684\u9700\u6c42\u548c\u73af\u5883\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 Oracle \u6570\u636e\u5e93\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4e24\u4e2a\u65b9\u6cd5\u6765\u5224\u65ad DDL\uff08Data Definition Languag [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[120],"tags":[],"class_list":["post-15903","post","type-post","status-publish","format-standard","hentry","category-oracel"],"_links":{"self":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/15903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/comments?post=15903"}],"version-history":[{"count":1,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/15903\/revisions"}],"predecessor-version":[{"id":15904,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/15903\/revisions\/15904"}],"wp:attachment":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/media?parent=15903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/categories?post=15903"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/tags?post=15903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}