{"id":95642,"date":"2024-10-20T02:46:16","date_gmt":"2024-10-19T18:46:16","guid":{"rendered":"https:\/\/server.hk\/cnblog\/95642\/"},"modified":"2024-10-20T02:46:17","modified_gmt":"2024-10-19T18:46:17","slug":"oracle%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e4%b8%80%e4%ba%9b%e5%9f%ba%e6%9c%ac%e5%b8%b8%e8%ad%98","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/95642\/","title":{"rendered":"Oracle\u6578\u64da\u5eab\u7684\u4e00\u4e9b\u57fa\u672c\u5e38\u8b58"},"content":{"rendered":"<h1 id=\"oracle%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e4%b8%80%e4%ba%9b%e5%9f%ba%e6%9c%ac%e5%b8%b8%e8%ad%98-djACidhSkN\">Oracle\u6578\u64da\u5eab\u7684\u4e00\u4e9b\u57fa\u672c\u5e38\u8b58<\/h1>\n<p>Oracle\u6578\u64da\u5eab\u662f\u4e00\u7a2e\u95dc\u4fc2\u578b\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff08RDBMS\uff09\uff0c\u7531\u7f8e\u570b\u7532\u9aa8\u6587\u516c\u53f8\uff08Oracle Corporation\uff09\u958b\u767c\u3002\u5b83\u5ee3\u6cdb\u61c9\u7528\u65bc\u4f01\u696d\u7d1a\u61c9\u7528\u7a0b\u5e8f\u4e2d\uff0c\u56e0\u5176\u9ad8\u6548\u80fd\u3001\u7a69\u5b9a\u6027\u548c\u5b89\u5168\u6027\u800c\u53d7\u5230\u9752\u775e\u3002\u672c\u6587\u5c07\u4ecb\u7d39Oracle\u6578\u64da\u5eab\u7684\u4e00\u4e9b\u57fa\u672c\u6982\u5ff5\u548c\u7279\u6027\uff0c\u5e6b\u52a9\u8b80\u8005\u66f4\u597d\u5730\u7406\u89e3\u9019\u4e00\u5f37\u5927\u7684\u6578\u64da\u5eab\u7cfb\u7d71\u3002<\/p>\n<h2 id=\"1-oracle%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e6%9e%b6%e6%a7%8b-djACidhSkN\">1. Oracle\u6578\u64da\u5eab\u7684\u67b6\u69cb<\/h2>\n<p>Oracle\u6578\u64da\u5eab\u7684\u67b6\u69cb\u4e3b\u8981\u7531\u4ee5\u4e0b\u5e7e\u500b\u90e8\u5206\u7d44\u6210\uff1a<\/p>\n<ul>\n<li><strong>\u5be6\u4f8b\uff08Instance\uff09<\/strong>\uff1a\u5be6\u4f8b\u662fOracle\u6578\u64da\u5eab\u7684\u904b\u884c\u74b0\u5883\uff0c\u5305\u62ec\u4e00\u7d44\u5167\u5b58\u7d50\u69cb\u548c\u80cc\u666f\u9032\u7a0b\u3002\u6bcf\u500b\u5be6\u4f8b\u90fd\u53ef\u4ee5\u8a2a\u554f\u4e00\u500b\u6216\u591a\u500b\u6578\u64da\u5eab\u3002<\/li>\n<li><strong>\u6578\u64da\u5eab\uff08Database\uff09<\/strong>\uff1a\u6578\u64da\u5eab\u662f\u5b58\u5132\u6578\u64da\u7684\u5730\u65b9\uff0c\u5305\u542b\u6578\u64da\u6587\u4ef6\u3001\u63a7\u5236\u6587\u4ef6\u548c\u65e5\u8a8c\u6587\u4ef6\u7b49\u3002<\/li>\n<li><strong>\u8868\u7a7a\u9593\uff08Tablespace\uff09<\/strong>\uff1a\u8868\u7a7a\u9593\u662f\u6578\u64da\u5eab\u4e2d\u908f\u8f2f\u5b58\u5132\u7684\u55ae\u4f4d\uff0c\u7528\u65bc\u7d44\u7e54\u6578\u64da\u6587\u4ef6\u3002\u6bcf\u500b\u8868\u7a7a\u9593\u53ef\u4ee5\u5305\u542b\u591a\u500b\u6578\u64da\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<h2 id=\"2-oracle%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e6%95%b8%e6%93%9a%e9%a1%9e%e5%9e%8b-djACidhSkN\">2. Oracle\u6578\u64da\u5eab\u7684\u6578\u64da\u985e\u578b<\/h2>\n<p>Oracle\u6578\u64da\u5eab\u652f\u6301\u591a\u7a2e\u6578\u64da\u985e\u578b\uff0c\u4e3b\u8981\u5305\u62ec\uff1a<\/p>\n<ul>\n<li><strong>\u6578\u5b57\u985e\u578b<\/strong>\uff1a\u5982 NUMBER\u3001FLOAT \u7b49\uff0c\u7528\u65bc\u5b58\u5132\u6578\u5b57\u6578\u64da\u3002<\/li>\n<li><strong>\u5b57\u7b26\u985e\u578b<\/strong>\uff1a\u5982 CHAR\u3001VARCHAR2 \u7b49\uff0c\u7528\u65bc\u5b58\u5132\u5b57\u7b26\u4e32\u6578\u64da\u3002<\/li>\n<li><strong>\u65e5\u671f\u985e\u578b<\/strong>\uff1a\u5982 DATE\u3001TIMESTAMP \u7b49\uff0c\u7528\u65bc\u5b58\u5132\u65e5\u671f\u548c\u6642\u9593\u3002<\/li>\n<li><strong>LOB\u985e\u578b<\/strong>\uff1a\u5982 BLOB\u3001CLOB \u7b49\uff0c\u7528\u65bc\u5b58\u5132\u5927\u5c0d\u8c61\u6578\u64da\u3002<\/li>\n<\/ul>\n<h2 id=\"3-sql%e8%aa%9e%e8%a8%80%e8%88%87pl-sql-djACidhSkN\">3. SQL\u8a9e\u8a00\u8207PL\/SQL<\/h2>\n<p>Oracle\u6578\u64da\u5eab\u4f7f\u7528SQL\uff08\u7d50\u69cb\u5316\u67e5\u8a62\u8a9e\u8a00\uff09\u4f86\u9032\u884c\u6578\u64da\u64cd\u4f5c\u3002SQL\u8a9e\u8a00\u7684\u57fa\u672c\u64cd\u4f5c\u5305\u62ec\uff1a<\/p>\n<ul>\n<li><strong>\u67e5\u8a62\u6578\u64da<\/strong>\uff1a\u4f7f\u7528 SELECT \u8a9e\u53e5\u4f86\u67e5\u8a62\u6578\u64da\u3002<\/li>\n<li><strong>\u63d2\u5165\u6578\u64da<\/strong>\uff1a\u4f7f\u7528 INSERT \u8a9e\u53e5\u4f86\u63d2\u5165\u65b0\u6578\u64da\u3002<\/li>\n<li><strong>\u66f4\u65b0\u6578\u64da<\/strong>\uff1a\u4f7f\u7528 UPDATE \u8a9e\u53e5\u4f86\u4fee\u6539\u73fe\u6709\u6578\u64da\u3002<\/li>\n<li><strong>\u522a\u9664\u6578\u64da<\/strong>\uff1a\u4f7f\u7528 DELETE \u8a9e\u53e5\u4f86\u522a\u9664\u6578\u64da\u3002<\/li>\n<\/ul>\n<p>\u9664\u4e86SQL\uff0cOracle\u9084\u63d0\u4f9b\u4e86PL\/SQL\uff08Procedural Language\/SQL\uff09\uff0c\u9019\u662f\u4e00\u7a2e\u64f4\u5c55\u7684SQL\u8a9e\u8a00\uff0c\u652f\u6301\u7a0b\u5e8f\u5316\u7684\u6578\u64da\u64cd\u4f5c\u3002PL\/SQL\u5141\u8a31\u7528\u6236\u7de8\u5beb\u8907\u96dc\u7684\u908f\u8f2f\u548c\u63a7\u5236\u7d50\u69cb\uff0c\u4e26\u80fd\u5920\u8655\u7406\u932f\u8aa4\u3002<\/p>\n<h2 id=\"4-%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e5%ae%89%e5%85%a8%e6%80%a7-djACidhSkN\">4. \u6578\u64da\u5eab\u7684\u5b89\u5168\u6027<\/h2>\n<p>Oracle\u6578\u64da\u5eab\u63d0\u4f9b\u4e86\u591a\u5c64\u6b21\u7684\u5b89\u5168\u6027\u63aa\u65bd\uff0c\u5305\u62ec\u7528\u6236\u8eab\u4efd\u9a57\u8b49\u3001\u6b0a\u9650\u7ba1\u7406\u548c\u6578\u64da\u52a0\u5bc6\u7b49\u3002\u7528\u6236\u53ef\u4ee5\u901a\u904e\u5275\u5efa\u89d2\u8272\u548c\u8ce6\u4e88\u6b0a\u9650\u4f86\u63a7\u5236\u5c0d\u6578\u64da\u7684\u8a2a\u554f\u3002\u4f8b\u5982\uff1a<\/p>\n<pre><code>CREATE ROLE my_role;\nGRANT SELECT, INSERT ON my_table TO my_role;\n<\/code><\/pre>\n<p>\u9019\u6bb5\u4ee3\u78bc\u5275\u5efa\u4e86\u4e00\u500b\u89d2\u8272\u4e26\u8ce6\u4e88\u5176\u5c0d\u7279\u5b9a\u8868\u7684\u67e5\u8a62\u548c\u63d2\u5165\u6b0a\u9650\u3002<\/p>\n<h2 id=\"5-%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e5%82%99%e4%bb%bd%e8%88%87%e6%81%a2%e5%be%a9-djACidhSkN\">5. \u6578\u64da\u5eab\u7684\u5099\u4efd\u8207\u6062\u5fa9<\/h2>\n<p>\u6578\u64da\u5eab\u7684\u5099\u4efd\u8207\u6062\u5fa9\u662f\u78ba\u4fdd\u6578\u64da\u5b89\u5168\u7684\u91cd\u8981\u63aa\u65bd\u3002Oracle\u63d0\u4f9b\u4e86\u591a\u7a2e\u5099\u4efd\u65b9\u6cd5\uff0c\u5305\u62ec\u5168\u5099\u4efd\u3001\u589e\u91cf\u5099\u4efd\u548c\u5dee\u7570\u5099\u4efd\u3002\u7528\u6236\u53ef\u4ee5\u4f7f\u7528RMAN\uff08Recovery Manager\uff09\u5de5\u5177\u4f86\u9032\u884c\u5099\u4efd\u548c\u6062\u5fa9\u64cd\u4f5c\u3002<\/p>\n<pre><code>RMAN&gt; BACKUP DATABASE;\n<\/code><\/pre>\n<p>\u9019\u689d\u547d\u4ee4\u5c07\u5c0d\u6574\u500b\u6578\u64da\u5eab\u9032\u884c\u5099\u4efd\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-djACidhSkN\">\u7e3d\u7d50<\/h2>\n<p>Oracle\u6578\u64da\u5eab\u662f\u4e00\u500b\u529f\u80fd\u5f37\u5927\u4e14\u9748\u6d3b\u7684\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff0c\u9069\u5408\u5404\u7a2e\u898f\u6a21\u7684\u4f01\u696d\u4f7f\u7528\u3002\u4e86\u89e3\u5176\u57fa\u672c\u67b6\u69cb\u3001\u6578\u64da\u985e\u578b\u3001SQL\u8a9e\u8a00\u3001\u6578\u64da\u5b89\u5168\u6027\u53ca\u5099\u4efd\u6062\u5fa9\u7b56\u7565\uff0c\u5c0d\u65bc\u6709\u6548\u7ba1\u7406\u548c\u904b\u7528Oracle\u6578\u64da\u5eab\u81f3\u95dc\u91cd\u8981\u3002\u5982\u679c\u60a8\u5c0d\u65bcVPS\u6216\u5176\u4ed6\u4f3a\u670d\u5668\u89e3\u6c7a\u65b9\u6848\u611f\u8208\u8da3\uff0c\u6b61\u8fce\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9 <a href=\"https:\/\/server.hk\">Server.HK<\/a> \u7372\u53d6\u66f4\u591a\u8cc7\u8a0a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3Oracle\u6578\u64da\u5eab\u7684\u57fa\u672c\u5e38\u8b58\uff0c\u5305\u62ec\u67b6\u69cb\u3001\u529f\u80fd\u3001\u512a\u52e2\u53ca\u61c9\u7528\u5834\u666f\uff0c\u52a9\u60a8\u66f4\u597d\u5730\u7ba1\u7406\u6578\u64da\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-95642","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/95642","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"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=95642"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/95642\/revisions"}],"predecessor-version":[{"id":95643,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/95642\/revisions\/95643"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=95642"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=95642"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=95642"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}