{"id":276,"date":"2012-01-14T21:03:58","date_gmt":"2012-01-14T13:03:58","guid":{"rendered":"http:\/\/www.royalwzy.com\/?p=276"},"modified":"2014-01-14T21:09:31","modified_gmt":"2014-01-14T13:09:31","slug":"oracle%e4%b8%ad%e5%b7%a5%e5%85%b7%e7%9a%84%e4%bd%bf%e7%94%a801-dbnewid","status":"publish","type":"post","link":"http:\/\/www.royalwzy.com\/?p=276","title":{"rendered":"ORACLE\u4e2d\u5de5\u5177\u7684\u4f7f\u752801&#8211;DBNEWID"},"content":{"rendered":"<div>DBNEWID\u5de5\u5177\u7684\u4f7f\u7528<\/p>\n<div>\n<ol>\n<li>DBNEWID\u5de5\u5177\u4ecb\u7ecd:\n<ol>\n<li>\u624b\u52a8\u521b\u5efa\u4e00\u4e2a\u6570\u636e\u5e93\u7684\u62f7\u8d1d\u65f6,\u5728\u91cd\u5efa\u63a7\u5236\u6587\u4ef6\u65f6\u53ef\u4ee5\u6307\u5b9a\u4e00\u4e2a\u65b0\u7684DBNAME,\u4f46\u662f\u4e0d\u80fd\u4fee\u6539DBID.DBID\u662f\u5185\u90e8\u552f\u4e00\u6807\u793a\u4e00\u4e2a\u6570\u636e\u5e93\u7684\u6807\u793a\u7b26;RMAN\u662f\u4f7f\u7528DBID\u533a\u5206\u6570\u636e\u5e93\u7684,\u6240\u4ee5\u5c31\u4e0d\u80fd\u628a\u8fd9\u4e24\u4e2a\u6570\u636e\u5e93\u6ce8\u518c\u5230\u540c\u4e00\u4e2aRMAN\u7684\u8d44\u6e90\u5e93\u4e2d\u4e86;<\/li>\n<li>DBNEWID\u5de5\u5177\u53ef\u4ee5:\n<ol>\n<li>\u53ea\u4fee\u6539DBID(\u65e0\u6cd5\u63a7\u5236\u4fee\u6539\u4e3a\u591a\u5c11);<\/li>\n<li>\u53ea\u4fee\u6539DBNAME;<\/li>\n<li>\u540c\u65f6\u4fee\u6539DBID\u548cDBNAME;<\/li>\n<\/ol>\n<\/li>\n<li>\u5982\u679c\u4fee\u6539\u4e86DBID,\u4e4b\u524d\u6240\u6709\u7684\u5907\u4efd,\u5f52\u6863\u65e5\u5fd7\u90fd\u4f1a\u5931\u6548,\u800c\u4e14\u6253\u5f00\u6570\u636e\u5e93\u65f6\u9700\u8981\u6307\u5b9aRESETLOGS\u53c2\u6570;<\/li>\n<li>\u5f3a\u70c8\u5efa\u8bae\u5728\u4fee\u6539DBID\u4e4b\u524d\u5bf9\u6570\u636e\u5e93\u8fdb\u884c\u5907\u4efd;<\/li>\n<li>\u4f7f\u7528DBNEWID\u5de5\u5177\u4e0d\u4f1a\u5f71\u54cdglobal_name,\u5b83\u53ea\u80fd\u901a\u8fc7ALTER DATABASE\u8bed\u6cd5\u8fdb\u884c\u4fee\u6539,\u7531DB_NAME\u548c\u57df\u7ec4\u6210:ALTER DATABASE RENAME GLOBAL_NAME TO db_name.db_domain;<\/li>\n<li>DBNEWID\u5de5\u5177\u4e5f\u4e0d\u4f1a\u4fee\u6539INSTANCE_NAME,\u4f46\u662f\u4f1a\u4fee\u6539DB_NAME,DB_UNIQUE_NAME\u548cSERVICE_NAMES;<\/li>\n<\/ol>\n<\/li>\n<li>DBNEWID\u7684\u8bed\u6cd5:nid key=value;\n<ol>\n<li>TARGET=user\/pwd@tns_name:\u767b\u9646\u76ee\u6807\u6570\u636e\u5e93;<\/li>\n<li>DBNAME=newname:\u6307\u5b9a\u8981\u4fee\u6539\u7684\u65b0\u7684\u6570\u636e\u5e93\u7684\u540d\u79f0,\u5982\u679c\u4e0d\u6307\u5b9a\u6b64\u53c2\u6570,\u5219\u53ea\u4fee\u6539DBID;<\/li>\n<li>SETNAME=YES\/NO:\u9ed8\u8ba4\u4e3aNO,\u5982\u679c\u6307\u5b9a\u4e3aYES,\u8868\u793a\u503c\u4fee\u6539\u6570\u636e\u5e93\u540d\u79f0;<\/li>\n<li>REVERT=YES\/NO:\u9ed8\u8ba4\u4e3aNO,\u5982\u679c\u4e3aYES,\u8868\u793a\u5982\u679c\u5931\u8d25\u4e86\u56de\u9000\u5230\u4e4b\u524d\u7684\u72b6\u6001;<\/li>\n<li>LOGFILE=log_file:\u6307\u5b9a\u65e5\u5fd7\u6587\u4ef6;<\/li>\n<li>APPEND=YES\/NO:\u6307\u5b9a\u662f\u8ffd\u52a0\u65e5\u5fd7\u8fd8\u662f\u8986\u76d6\u65e5\u5fd7;<\/li>\n<li>\u4f8b\u5b50:\n<ol>\n<li>\u53ea\u4fee\u6539DBID:nid target=user\/pwd@tns_name logfile=nid.log;<\/li>\n<li>\u53ea\u4fee\u6539DBNAME:nid target=user\/pwd@tns_name\u00a0<span style=\"color: #e30000;\">dbname=newname setname=yes<\/span>\u00a0logfile=nid.log;<\/li>\n<li>\u540c\u65f6\u4fee\u6539DBID\u548cDBNAME:nid target=user\/pwd@tns_name\u00a0<span style=\"color: #e30000;\">dbname=newname<\/span>\u00a0logfile=nid.log;<\/li>\n<li>\u53d1\u751f\u9519\u8bef\u56de\u9000\u5230\u4e4b\u524d\u7684\u72b6\u6001:nid target=user\/pwd@tns_name\u00a0<span style=\"color: #e30000;\">revert=yes<\/span>\u00a0logfile=nid.log<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<li>\u4fee\u6539DBID\u548cDBNAME:\n<ol>\n<li>\u5bf9\u6570\u636e\u5e93\u505a\u4e00\u6b21\u5168\u5907;<\/li>\n<li>\u914d\u7f6e\u597d\u76d1\u542c(\u9759\u6001\u6ce8\u518c\u6570\u636e\u5e93)\u548c\u7f51\u7edc\u540d,\u5982\u679c\u662f\u5728\u672c\u673a\u64cd\u4f5c\u5219\u4e0d\u9700\u8981\u6b64\u6b65\u9aa4;<\/li>\n<li>\u67e5\u770b\u5f53\u524d\u7684DBID\u548cDBNAME:SELECT dbid, name FROM v$database; \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0<img decoding=\"async\" alt=\"\" src=\"file:\/\/\/C:\/TEMP\/enhtmlclip\/Image.png\" \/><\/li>\n<li>\u6b63\u5e38\u5173\u95ed\u6570\u636e\u5e93,\u5e76\u542f\u52a8\u5230mount\u72b6\u6001; \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0<img decoding=\"async\" alt=\"\" src=\"file:\/\/\/C:\/TEMP\/enhtmlclip\/Image(1).png\" \/><\/li>\n<li>\u8c03\u7528nid\u5de5\u5177,\u4f7f\u7528sysdba\u767b\u9646:nid target=sys\/oracle dbname=OMR,\u4fee\u6539\u5b8c\u6210\u540e\u6570\u636e\u5e93\u5904\u4e8eshutdown\u72b6\u6001; \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<img decoding=\"async\" alt=\"\" src=\"file:\/\/\/C:\/TEMP\/enhtmlclip\/Image(2).png\" \/><img decoding=\"async\" alt=\"\" src=\"file:\/\/\/C:\/TEMP\/enhtmlclip\/Image(3).png\" \/><\/li>\n<li>\u4fee\u6539spfile\u6587\u4ef6\u4e2d\u7684DB_NAME\u53c2\u6570(\u5982\u679c\u53ea\u4fee\u6539DBID\u7684\u8bdd,\u4e0d\u7528\u8fd9\u4e2a\u6b65\u9aa4); \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0<img decoding=\"async\" alt=\"\" src=\"file:\/\/\/C:\/TEMP\/enhtmlclip\/Image(4).png\" \/><img decoding=\"async\" alt=\"\" src=\"file:\/\/\/C:\/TEMP\/enhtmlclip\/Image(5).png\" \/><img decoding=\"async\" alt=\"\" src=\"file:\/\/\/C:\/TEMP\/enhtmlclip\/Image(6).png\" \/><\/li>\n<li>\u91cd\u7f6e\u5bc6\u7801\u6587\u4ef6(\u5982\u679c\u53ea\u4fee\u6539DBID\u6216\u8005\u6ca1\u6709\u4fee\u6539ORACLE_SID\u7684\u8bdd,\u4e0d\u7528\u8fd9\u4e2a\u6b65\u9aa4,\u56e0\u4e3a\u5bc6\u7801\u6587\u4ef6\u53ea\u8ddfORACLE_SID\u6709\u5173):<\/li>\n<li>\u542f\u52a8\u6570\u636e\u5e93\u5230mount\u72b6\u6001,\u7136\u540e\u4ee5resetlogs\u65b9\u5f0f\u6253\u5f00\u6570\u636e\u5e93:ALTER DATABASE OPEN RESETLOGS;(\u5982\u679c\u53ea\u662f\u4fee\u6539\u4e86DB_NAME\u7684\u8bdd,\u4e0d\u7528\u8fd9\u4e2a\u6b65\u9aa4,\u4e4b\u524d\u7684\u65e5\u5fd7\u8fd8\u53ef\u4ee5\u4f7f\u7528)<img decoding=\"async\" alt=\"\" src=\"file:\/\/\/C:\/TEMP\/enhtmlclip\/Image(7).png\" \/><\/li>\n<li>\u67e5\u770b\u65b0\u7684DBID\u548cDB_NAME; \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0<img decoding=\"async\" alt=\"\" src=\"file:\/\/\/C:\/TEMP\/enhtmlclip\/Image(8).png\" \/><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>DBNEWID\u5de5\u5177\u7684\u4f7f\u7528 DBNEWID\u5de5\u5177\u4ecb\u7ecd: \u624b\u52a8\u521b\u5efa\u4e00\u4e2a\u6570\u636e\u5e93\u7684\u62f7\u8d1d\u65f6,\u5728\u91cd\u5efa\u63a7\u5236\u6587\u4ef6\u65f6\u53ef\u4ee5\u6307\u5b9a\u4e00\u4e2a\u65b0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[34,2],"class_list":["post-276","post","type-post","status-publish","format-standard","hentry","category-oracle","tag-oracle","tag-oracle_basics"],"_links":{"self":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts\/276","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=276"}],"version-history":[{"count":0,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts\/276\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=276"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=276"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=276"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}