{"id":199772,"date":"2025-05-06T09:51:43","date_gmt":"2025-05-06T01:51:43","guid":{"rendered":"https:\/\/server.hk\/cnblog\/199772\/"},"modified":"2025-05-06T09:51:43","modified_gmt":"2025-05-06T01:51:43","slug":"%e8%af%a6%e7%bb%86%e8%a7%a3%e9%87%8a%e5%a6%82%e4%bd%95%e6%9f%a5%e8%af%a2oracle%e6%95%b0%e6%8d%ae%e5%ba%93%e4%b8%ad%e7%94%a8%e6%88%b7%e7%9a%84%e6%ad%a5%e9%aa%a4","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/199772\/","title":{"rendered":"\u8be6\u7ec6\u89e3\u91ca\u5982\u4f55\u67e5\u8be2Oracle\u6570\u636e\u5e93\u4e2d\u7528\u6237\u7684\u6b65\u9aa4"},"content":{"rendered":"<p><b><\/b> <\/p>\n<h1>\u8be6\u7ec6\u89e3\u91ca\u5982\u4f55\u67e5\u8be2Oracle\u6570\u636e\u5e93\u4e2d\u7528\u6237\u7684\u6b65\u9aa4<\/h1>\n<p>\u4e00\u5206\u8015\u8018\uff0c\u4e00\u5206\u6536\u83b7\uff01\u65e2\u7136\u6253\u5f00\u4e86\u8fd9\u7bc7\u6587\u7ae0\uff0c\u5c31\u575a\u6301\u770b\u4e0b\u53bb\u5427\uff01\u6587\u4e2d\u5185\u5bb9\u5305\u542b\u7b49\u7b49\u77e5\u8bc6\u70b9&#8230;\u5e0c\u671b\u4f60\u80fd\u5728\u9605\u8bfb\u672c\u6587\u540e\uff0c\u80fd\u771f\u771f\u5b9e\u5b9e\u5b66\u5230\u77e5\u8bc6\u6216\u8005\u5e2e\u4f60\u89e3\u51b3\u5fc3\u4e2d\u7684\u7591\u60d1\uff0c\u4e5f\u6b22\u8fce\u5927\u4f6c\u6216\u8005\u65b0\u4eba\u670b\u53cb\u4eec\u591a\u7559\u8a00\u8bc4\u8bba\uff0c\u591a\u7ed9\u5efa\u8bae\uff01\u8c22\u8c22\uff01<\/p>\n<p>Oracle\u6570\u636e\u5e93\uff1a\u521b\u5efa\u67e5\u8be2\u7528\u6237\u7684\u6b65\u9aa4\u8be6\u89e3<\/p>\n<p>\u5728Oracle\u6570\u636e\u5e93\u4e2d\uff0c\u7528\u6237\u662f\u6307\u5177\u6709\u6570\u636e\u5e93\u8bbf\u95ee\u6743\u9650\u7684\u5b9e\u4f53\u3002\u521b\u5efa\u67e5\u8be2\u7528\u6237\u662f\u6570\u636e\u5e93\u7ba1\u7406\u4e2d\u7684\u5e38\u89c1\u64cd\u4f5c\uff0c\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u521b\u5efa\u67e5\u8be2\u7528\u6237\u7684\u6b65\u9aa4\uff0c\u5e76\u63d0\u4f9b\u5177\u4f53\u7684\u4ee3\u7801\u793a\u4f8b\u4ee5\u4fbf\u8bfb\u8005\u53c2\u8003\u3002<\/p>\n<h3>\u6b65\u9aa4\u4e00\uff1a\u8fde\u63a5\u5230Oracle\u6570\u636e\u5e93<\/h3>\n<p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u4f7f\u7528sys\u6216\u8005\u5177\u6709\u76f8\u5e94\u6743\u9650\u7684\u7528\u6237\u8fde\u63a5\u5230Oracle\u6570\u636e\u5e93\u3002\u5728SQL*Plus\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5e76\u6309\u56de\u8f66\u952e\uff1a<\/p>\n<pre>sqlplus sys as sysdba<\/pre>\n<p>\u7136\u540e\u8f93\u5165sys\u7528\u6237\u7684\u5bc6\u7801\u8fdb\u884c\u767b\u5f55\u3002<\/p>\n<h3>\u6b65\u9aa4\u4e8c\uff1a\u521b\u5efa\u7528\u6237<\/h3>\n<p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u4f7f\u7528CREATE USER\u8bed\u53e5\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u7528\u6237\u3002\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre>CREATE USER username IDENTIFIED BY password;<\/pre>\n<p>\u5176\u4e2d\uff0cusername\u4e3a\u8981\u521b\u5efa\u7684\u7528\u6237\u7684\u7528\u6237\u540d\uff0cpassword\u4e3a\u7528\u6237\u7684\u5bc6\u7801\u3002\u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3atestuser\u7684\u7528\u6237\uff1a<\/p>\n<pre>CREATE USER testuser IDENTIFIED BY password;<\/pre>\n<h3>\u6b65\u9aa4\u4e09\uff1a\u6388\u4e88\u6743\u9650<\/h3>\n<p>\u521b\u5efa\u7528\u6237\u540e\uff0c\u6211\u4eec\u9700\u8981\u6388\u4e88\u7528\u6237\u5408\u9002\u7684\u6743\u9650\uff0c\u4ee5\u4fbf\u5176\u80fd\u591f\u6267\u884c\u67e5\u8be2\u64cd\u4f5c\u3002\u53ef\u4ee5\u4f7f\u7528GRANT\u8bed\u53e5\u6765\u5206\u914d\u6743\u9650\u3002\u4f8b\u5982\uff0c\u6388\u4e88testuser\u5bf9\u8868table1\u7684SELECT\u6743\u9650\uff1a<\/p>\n<pre>GRANT SELECT ON table1 TO testuser;<\/pre>\n<h3>\u6b65\u9aa4\u56db\uff1a\u9a8c\u8bc1\u7528\u6237<\/h3>\n<p>\u521b\u5efa\u7528\u6237\u548c\u6388\u4e88\u6743\u9650\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u65b0\u7528\u6237\u7684\u8eab\u4efd\u8fde\u63a5\u5230\u6570\u636e\u5e93\uff0c\u5e76\u6267\u884c\u67e5\u8be2\u64cd\u4f5c\u3002\u4f7f\u7528CONNECT\u8bed\u53e5\u8fde\u63a5\u5230testuser\uff1a<\/p>\n<pre>CONNECT testuser\/password;<\/pre>\n<p>\u7136\u540e\u53ef\u4ee5\u6267\u884c\u67e5\u8be2\u64cd\u4f5c\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>SELECT * FROM table1;<\/pre>\n<h3>\u6b65\u9aa4\u4e94\uff1a\u5220\u9664\u7528\u6237\uff08\u53ef\u9009\uff09<\/h3>\n<p>\u5982\u679c\u9700\u8981\u5220\u9664\u7528\u6237\uff0c\u53ef\u4ee5\u4f7f\u7528DROP USER\u8bed\u53e5\u3002\u4f8b\u5982\uff0c\u5220\u9664testuser\u7528\u6237\uff1a<\/p>\n<pre>DROP USER testuser CASCADE;<\/pre>\n<h3>\u7ed3\u675f\u8bed<\/h3>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u6211\u4eec\u53ef\u4ee5\u6210\u529f\u521b\u5efa\u4e00\u4e2a\u67e5\u8be2\u7528\u6237\uff0c\u5e76\u6388\u4e88\u5176\u76f8\u5e94\u7684\u6743\u9650\uff0c\u4f7f\u5176\u80fd\u591f\u6267\u884c\u67e5\u8be2\u64cd\u4f5c\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u521b\u5efa\u7528\u6237\u7684\u8fc7\u7a0b\u53ef\u80fd\u4f1a\u6d89\u53ca\u66f4\u591a\u7ec6\u8282\u548c\u590d\u6742\u6027\uff0c\u8bfb\u8005\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u9700\u6c42\u548c\u73af\u5883\u8fdb\u884c\u9002\u5f53\u8c03\u6574\u548c\u6269\u5c55\u3002\u5e0c\u671b\u672c\u6587\u80fd\u591f\u5e2e\u52a9\u8bfb\u8005\u66f4\u597d\u5730\u7406\u89e3\u5982\u4f55\u5728Oracle\u6570\u636e\u5e93\u4e2d\u521b\u5efa\u67e5\u8be2\u7528\u6237\u3002<\/p>\n<p>\uff08\u6ce8\uff1a\u4ee5\u4e0a\u4ec5\u4e3a\u793a\u4f8b\u4ee3\u7801\uff0c\u8bf7\u6839\u636e\u5b9e\u9645\u73af\u5883\u548c\u9700\u6c42\u8fdb\u884c\u4fee\u6539\u548c\u8c03\u6574\uff09<\/p>\n<p>\u672c\u7bc7\u5173\u4e8e\u300a\u8be6\u7ec6\u89e3\u91ca\u5982\u4f55\u67e5\u8be2Oracle\u6570\u636e\u5e93\u4e2d\u7528\u6237\u7684\u6b65\u9aa4\u300b\u7684\u4ecb\u7ecd\u5c31\u5230\u6b64\u7ed3\u675f\u5566\uff0c\u4f46\u662f\u5b66\u65e0\u6b62\u5883\uff0c\u60f3\u8981\u4e86\u89e3\u5b66\u4e60\u66f4\u591a\u5173\u4e8e\u6570\u636e\u5e93\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u8bf7\u5173\u6ce8\u4e3b\u673a\u5b9d\u8d1d\u516c\u4f17\u53f7\uff01<\/p>\n<dl>\n<dt>\n <\/dt>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u8be6\u7ec6\u89e3\u91ca\u5982\u4f55\u67e5\u8be2Oracle\u6570\u636e&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-199772","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199772","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=199772"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199772\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=199772"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=199772"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=199772"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}