{"id":6084,"date":"2024-11-14T14:15:57","date_gmt":"2024-11-14T06:15:57","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6084\/"},"modified":"2024-11-14T14:15:57","modified_gmt":"2024-11-14T06:15:57","slug":"oracle%e5%a6%82%e4%bd%95%e8%ae%be%e7%bd%ae%e7%94%a8%e6%88%b7","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6084\/","title":{"rendered":"oracle\u5982\u4f55\u8bbe\u7f6e\u7528\u6237"},"content":{"rendered":"<blockquote><p>\n  \u5728 oracle \u4e2d\u521b\u5efa\u7528\u6237\u9700\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u4f7f\u7528 create user \u8bed\u53e5\u521b\u5efa\u65b0\u7528\u6237\u3002\u4f7f\u7528 grant \u8bed\u53e5\u6388\u4e88\u5fc5\u8981\u6743\u9650\u3002\u53ef\u9009\uff1a\u4f7f\u7528 resource \u8bed\u53e5\u8bbe\u7f6e\u914d\u989d\u3002\u914d\u7f6e\u5176\u4ed6\u9009\u9879\uff0c\u5982\u9ed8\u8ba4\u89d2\u8272\u548c\u4e34\u65f6\u8868\u7a7a\u95f4\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/12\/2024061221572181035.jpg\" class=\"aligncenter\" title=\"oracle\u5982\u4f55\u8bbe\u7f6e\u7528\u6237\u63d2\u56fe\" alt=\"oracle\u5982\u4f55\u8bbe\u7f6e\u7528\u6237\u63d2\u56fe\" \/><\/p>\n<p><strong>Oracle \u4e2d\u5982\u4f55\u521b\u5efa\u7528\u6237<\/strong><\/p>\n<p><strong>1. \u4f7f\u7528 CREATE USER \u8bed\u53e5<\/strong><\/p>\n<p>\u8981\u521b\u5efa\u65b0\u7528\u6237\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b CREATE USER \u8bed\u53e5\uff1a<\/p>\n<pre>CREATE USER &lt;\u7528\u6237\u540d&gt; IDENTIFIED BY &lt;\u5bc6\u7801&gt; [DEFAULT TABLESPACE &lt;\u8868\u7a7a\u95f4\u540d&gt;]<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre>CREATE USER newuser IDENTIFIED BY mypassword DEFAULT TABLESPACE userspace;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>2. \u6388\u4e88\u6743\u9650<\/strong><\/p>\n<p>\u521b\u5efa\u7528\u6237\u540e\uff0c\u9700\u8981\u6388\u4e88\u8be5\u7528\u6237\u5fc5\u8981\u7684\u6743\u9650\u624d\u80fd\u8bbf\u95ee\u548c\u64cd\u4f5c\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u53ef\u4ee5\u4f7f\u7528 GRANT \u8bed\u53e5\u6388\u4e88\u6743\u9650\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>GRANT &lt;\u6743\u9650&gt; ON &lt;\u5bf9\u8c61&gt; TO &lt;\u7528\u6237\u540d&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f8b\u5982\uff0c\u6388\u4e88 newuser \u5bf9 MYTABLE \u8868\u7684 SELECT \u6743\u9650\uff1a<\/p>\n<pre>GRANT SELECT ON MYTABLE TO newuser;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>3. \u53ef\u9009\uff1a\u8bbe\u7f6e\u914d\u989d<\/strong><\/p>\n<p>\u8fd8\u53ef\u4ee5\u4f7f\u7528 RESOURCE \u8bed\u53e5\u8bbe\u7f6e\u7528\u6237\u8d44\u6e90\u914d\u989d\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>ALTER USER &lt;\u7528\u6237\u540d&gt; QUOTA &lt;\u914d\u989d\u5927\u5c0f&gt; ON &lt;\u8d44\u6e90\u7c7b\u578b&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f8b\u5982\uff0c\u8bbe\u7f6e newuser \u7684 CPU \u4f7f\u7528\u914d\u989d\u4e3a 1 \u79d2\uff1a<\/p>\n<pre>ALTER USER newuser QUOTA 1 SECOND ON CPU;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>4. \u914d\u7f6e\u5176\u4ed6\u9009\u9879<\/strong><\/p>\n<p>\u60a8\u8fd8\u53ef\u4ee5\u914d\u7f6e\u5176\u4ed6\u7528\u6237\u9009\u9879\uff0c\u4f8b\u5982\uff1a<\/p>\n<ul>\n<li> <strong>PROFILE:<\/strong> \u6307\u5b9a\u7528\u6237\u7684\u9ed8\u8ba4\u8d44\u6e90\u9650\u5236\u3002<\/li>\n<li> <strong>TEMPORARY TABLESPACE:<\/strong> \u6307\u5b9a\u7528\u6237\u4e34\u65f6\u8868\u7684\u7a7a\u95f4\u3002<\/li>\n<li> <strong>DEFAULT ROLE:<\/strong> \u6307\u5b9a\u7528\u6237\u7684\u9ed8\u8ba4\u89d2\u8272\u3002<\/li>\n<\/ul>\n<p>\u4f8b\u5982\uff0c\u8bbe\u7f6e newuser \u7684\u9ed8\u8ba4\u89d2\u8272\u4e3a DBA\uff1a<\/p>\n<pre>ALTER USER newuser DEFAULT ROLE dba;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u63d0\u793a\uff1a<\/strong><\/p>\n<ul>\n<li>\u4f7f\u7528\u5f3a\u5bc6\u7801\u6765\u4fdd\u62a4\u7528\u6237\u5e10\u6237\u3002<\/li>\n<li>\u8c28\u614e\u6388\u4e88\u6743\u9650\uff0c\u4ec5\u6388\u4e88\u5fc5\u8981\u7684\u6743\u9650\u3002<\/li>\n<li>\u5b9a\u671f\u68c0\u67e5\u548c\u7ba1\u7406\u7528\u6237\u6743\u9650\u4ee5\u786e\u4fdd\u5b89\u5168\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u8bbe\u7f6e\u7528\u6237\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>\u5728 oracle \u4e2d\u521b\u5efa\u7528\u6237\u9700\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u4f7f\u7528 create user \u8bed\u53e5\u521b\u5efa\u65b0\u7528\u6237\u3002\u4f7f\u7528 grant \u8bed\u53e5\u6388\u4e88\u5fc5\u8981\u6743\u9650\u3002\u53ef\u9009\uff1a\u4f7f\u7528 resource \u8bed\u53e5\u8bbe\u7f6e\u914d\u989d\u3002\u914d\u7f6e\u5176\u4ed6\u9009\u9879\uff0c\u5982\u9ed8\u8ba4\u89d2\u8272\u548c\u4e34\u65f6\u8868\u7a7a\u95f4\u3002 Oracle \u4e2d\u5982\u4f55\u521b\u5efa\u7528\u6237 1. \u4f7f\u7528 CREATE USER \u8bed\u53e5 \u8981\u521b\u5efa\u65b0\u7528\u6237\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b CREATE USER \u8bed\u53e5\uff1a CREATE USER &lt;\u7528\u6237\u540d&gt; IDENTIFIED BY &lt;\u5bc6\u7801&gt; [DEFAULT TABLESPACE &lt;\u8868\u7a7a\u95f4\u540d&gt;] \u767b\u5f55\u540e\u590d\u5236 \u4f8b\u5982\uff1a CREATE USER newuser IDENTIFIED BY mypassword DEFAULT TABLESPACE userspace; \u767b\u5f55\u540e\u590d\u5236 2. \u6388\u4e88\u6743\u9650 \u521b\u5efa\u7528\u6237\u540e\uff0c\u9700\u8981\u6388\u4e88\u8be5\u7528\u6237\u5fc5\u8981\u7684\u6743\u9650\u624d\u80fd\u8bbf\u95ee\u548c\u64cd\u4f5c\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u53ef\u4ee5\u4f7f\u7528 GRANT \u8bed\u53e5\u6388\u4e88\u6743\u9650\uff0c\u4f8b\u5982\uff1a GRANT &lt;\u6743\u9650&gt; ON &lt;\u5bf9\u8c61&gt; TO &lt;\u7528\u6237\u540d&gt; \u767b\u5f55\u540e\u590d\u5236 \u4f8b\u5982\uff0c\u6388\u4e88 [&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-6084","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6084","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=6084"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6084\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6084"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6084"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6084"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}