{"id":199930,"date":"2025-05-06T10:53:33","date_gmt":"2025-05-06T02:53:33","guid":{"rendered":"https:\/\/server.hk\/cnblog\/199930\/"},"modified":"2025-05-06T10:53:33","modified_gmt":"2025-05-06T02:53:33","slug":"%e6%9c%89%e6%95%88%e6%81%a2%e5%a4%8d%e4%b8%a2%e5%a4%b1oracle%e6%9c%8d%e5%8a%a1%e7%9a%84%e5%bf%ab%e9%80%9f%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/199930\/","title":{"rendered":"\u6709\u6548\u6062\u590d\u4e22\u5931Oracle\u670d\u52a1\u7684\u5feb\u901f\u65b9\u6cd5"},"content":{"rendered":"<p><b><\/b> <\/p>\n<h1>\u6709\u6548\u6062\u590d\u4e22\u5931Oracle\u670d\u52a1\u7684\u5feb\u901f\u65b9\u6cd5<\/h1>\n<p>\u73cd\u60dc\u65f6\u95f4\uff0c\u52e4\u594b\u5b66\u4e60\uff01\u4eca\u5929\u7ed9\u5927\u5bb6\u5e26\u6765\uff0c\u6b63\u6587\u5185\u5bb9\u4e3b\u8981\u6d89\u53ca\u5230\u7b49\u7b49\uff0c\u5982\u679c\u4f60\u6b63\u5728\u5b66\u4e60\uff0c\u6216\u8005\u662f\u5bf9\u6709\u7591\u95ee\uff0c\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u6211\uff01\u540e\u9762\u6211\u4f1a\u6301\u7eed\u66f4\u65b0\u76f8\u5173\u5185\u5bb9\u7684\uff0c\u5e0c\u671b\u90fd\u80fd\u5e2e\u5230\u6b63\u5728\u5b66\u4e60\u7684\u5927\u5bb6\uff01<\/p>\n<p><strong>\u5feb\u901f\u6062\u590dOracle\u670d\u52a1\u4e22\u5931\u7684\u6709\u6548\u65b9\u6cd5<\/strong><\/p>\n<p>Oracle\u6570\u636e\u5e93\u4f5c\u4e3a\u4f01\u4e1a\u7ea7\u5e94\u7528\u4e2d\u5e38\u7528\u7684\u6570\u636e\u5e93\u7cfb\u7edf\u4e4b\u4e00\uff0c\u5176\u7a33\u5b9a\u6027\u548c\u53ef\u9760\u6027\u5bf9\u4e8e\u4f01\u4e1a\u6570\u636e\u7684\u5b89\u5168\u81f3\u5173\u91cd\u8981\u3002\u7136\u800c\uff0c\u5728\u65e5\u5e38\u8fd0\u7ef4\u8fc7\u7a0b\u4e2d\uff0c\u6709\u65f6\u4f1a\u9047\u5230Oracle\u670d\u52a1\u4e22\u5931\u7684\u60c5\u51b5\uff0c\u9700\u8981\u53ca\u65f6\u6709\u6548\u5730\u8fdb\u884c\u6062\u590d\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u4e00\u4e9b\u5feb\u901f\u6062\u590dOracle\u670d\u52a1\u4e22\u5931\u7684\u6709\u6548\u65b9\u6cd5\uff0c\u5e76\u9644\u4e0a\u5177\u4f53\u7684\u4ee3\u7801\u793a\u4f8b\uff0c\u5e2e\u52a9\u8bfb\u8005\u66f4\u597d\u5730\u5e94\u5bf9\u8fd9\u79cd\u60c5\u51b5\u3002<\/p>\n<h3>1. \u68c0\u67e5\u670d\u52a1\u72b6\u6001<\/h3>\n<p>\u5728\u53d1\u73b0Oracle\u670d\u52a1\u4e22\u5931\u540e\uff0c\u9996\u5148\u9700\u8981\u68c0\u67e5\u6570\u636e\u5e93\u670d\u52a1\u7684\u5f53\u524d\u72b6\u6001\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770bOracle\u6570\u636e\u5e93\u7684\u76d1\u542c\u5668\u548c\u5b9e\u4f8b\u662f\u5426\u6b63\u5e38\u8fd0\u884c\uff1a<\/p>\n<pre>lsnrctl status<\/pre>\n<p>\u5982\u679c\u76d1\u542c\u5668\u6b63\u5e38\u8fd0\u884c\uff0c\u4f46\u5b9e\u4f8b\u672a\u542f\u52a8\uff0c\u5219\u9700\u8981\u624b\u52a8\u542f\u52a8Oracle\u5b9e\u4f8b\uff1a<\/p>\n<pre>sqlplus \/ as sysdba\nstartup<\/pre>\n<h3>2. \u6062\u590d\u63a7\u5236\u6587\u4ef6<\/h3>\n<p>\u5982\u679cOracle\u6570\u636e\u5e93\u7684\u63a7\u5236\u6587\u4ef6\u4e22\u5931\u6216\u635f\u574f\uff0c\u4f1a\u5bfc\u81f4\u6570\u636e\u5e93\u65e0\u6cd5\u6b63\u5e38\u542f\u52a8\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u6062\u590d\u63a7\u5236\u6587\u4ef6\uff1a<\/p>\n<ul>\n<li><strong>\u5907\u4efd\u63a7\u5236\u6587\u4ef6\uff1a<\/strong><\/li>\n<\/ul>\n<pre>alter database backup controlfile to trace;<\/pre>\n<ul>\n<li><strong>\u521b\u5efa\u65b0\u7684\u63a7\u5236\u6587\u4ef6\uff1a<\/strong><\/li>\n<\/ul>\n<pre>CREATE CONTROLFILE REUSE DATABASE \"DB_NAME\" NORESETLOGS NOARCHIVELOG\n    MAXLOGFILES 32\n    MAXLOGMEMBERS 2\n    MAXDATAFILES 32\n    MAXINSTANCES 1\n    MAXLOGHISTORY 449\nLOGFILE\n  GROUP 1 ('\/path\/to\/logfile\/log1a.rdo', '\/path\/to\/logfile\/log1b.rdo') SIZE 50M,\n  GROUP 2 ('\/path\/to\/logfile\/log2a.rdo', '\/path\/to\/logfile\/log2b.rdo') SIZE 50M\nDATAFILE\n  '\/path\/to\/datafile\/system01.dbf',\n  '\/path\/to\/datafile\/undotbs01.dbf',\n  '\/path\/to\/datafile\/users01.dbf',\n  '\/path\/to\/datafile\/example01.dbf'\nCHARACTER SET UTF8;<\/pre>\n<h3>3. \u6062\u590d\u5f52\u6863\u65e5\u5fd7<\/h3>\n<p>\u5982\u679c\u6570\u636e\u5e93\u4e2d\u7684\u5f52\u6863\u65e5\u5fd7\u4e22\u5931\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u6cd5\u8fdb\u884c\u6062\u590d\uff1a<\/p>\n<ul>\n<li><strong>\u624b\u52a8\u5e94\u7528\u5f52\u6863\u65e5\u5fd7\uff1a<\/strong><\/li>\n<\/ul>\n<pre>RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL;<\/pre>\n<ul>\n<li><strong>\u5c06\u7f3a\u5931\u7684\u5f52\u6863\u65e5\u5fd7\u62f7\u8d1d\u5230\u5f52\u6863\u65e5\u5fd7\u76ee\u5f55\u4e0b\uff0c\u7136\u540e\u624b\u52a8\u5e94\u7528\u5f52\u6863\u65e5\u5fd7\uff1a<\/strong><\/li>\n<\/ul>\n<pre>cp \/path\/to\/missing\/archivelog\/* \/path\/to\/archivelog<\/pre>\n<h3>4. \u6062\u590d\u6570\u636e\u6587\u4ef6<\/h3>\n<p>\u5982\u679c\u67d0\u4e2a\u6570\u636e\u6587\u4ef6\u4e22\u5931\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u6cd5\u8fdb\u884c\u6062\u590d\uff1a<\/p>\n<ul>\n<li><strong>\u4f7f\u7528RMAN\u6062\u590d\u6570\u636e\u6587\u4ef6\uff1a<\/strong><\/li>\n<\/ul>\n<pre>rman target \/\nRESTORE DATAFILE 1;\nRECOVER DATAFILE 1;\nALTER DATABASE DATAFILE 1 ONLINE;<\/pre>\n<h3>5. \u6570\u636e\u5e93\u5b8c\u6574\u6027\u68c0\u67e5<\/h3>\n<p>\u6062\u590d\u5b8c\u6570\u636e\u5e93\u4e4b\u540e\uff0c\u4e3a\u4e86\u786e\u4fdd\u6570\u636e\u5e93\u7684\u5b8c\u6574\u6027\u548c\u7a33\u5b9a\u6027\uff0c\u5efa\u8bae\u8fdb\u884c\u6570\u636e\u5e93\u5b8c\u6574\u6027\u68c0\u67e5\uff1a<\/p>\n<ul>\n<li><strong>\u6267\u884c\u6570\u636e\u5e93\u5b8c\u6574\u6027\u68c0\u67e5\uff1a<\/strong><\/li>\n<\/ul>\n<pre>dbv file=\/path\/to\/datafile\/datafile.dbf<\/pre>\n<h3>\u7ed3\u8bed<\/h3>\n<p>\u4ee5\u4e0a\u662f\u4e00\u4e9b\u5feb\u901f\u6062\u590dOracle\u670d\u52a1\u4e22\u5931\u7684\u65b9\u6cd5\u548c\u5177\u4f53\u7684\u4ee3\u7801\u793a\u4f8b\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u5f53\u9047\u5230Oracle\u670d\u52a1\u4e22\u5931\u7684\u60c5\u51b5\u65f6\uff0c\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u60c5\u51b5\u9009\u62e9\u76f8\u5e94\u7684\u6062\u590d\u65b9\u6cd5\uff0c\u5e76\u6839\u636e\u4ee3\u7801\u793a\u4f8b\u64cd\u4f5c\u3002\u5e0c\u671b\u4ee5\u4e0a\u5185\u5bb9\u5bf9\u8bfb\u8005\u5728Oracle\u6570\u636e\u5e93\u670d\u52a1\u6062\u590d\u8fc7\u7a0b\u4e2d\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n<p>\u597d\u4e86\uff0c\u672c\u6587\u5230\u6b64\u7ed3\u675f\uff0c\u5e26\u5927\u5bb6\u4e86\u89e3\u4e86\u300a\u6709\u6548\u6062\u590d\u4e22\u5931Oracle\u670d\u52a1\u7684\u5feb\u901f\u65b9\u6cd5\u300b\uff0c\u5e0c\u671b\u672c\u6587\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff01\u5173\u6ce8\u4e3b\u673a\u5b9d\u8d1d\u516c\u4f17\u53f7\uff0c\u7ed9\u5927\u5bb6\u5206\u4eab\u66f4\u591a\u6570\u636e\u5e93\u77e5\u8bc6\uff01<\/p>\n<dl>\n<dt>\n <\/dt>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u6548\u6062\u590d\u4e22\u5931Oracle\u670d\u52a1\u7684\u5feb&#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-199930","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199930","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=199930"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199930\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=199930"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=199930"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=199930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}