{"id":1092,"date":"2025-04-29T19:06:08","date_gmt":"2025-04-29T11:06:08","guid":{"rendered":"http:\/\/192.168.5.24\/?p=1092"},"modified":"2025-04-30T12:00:36","modified_gmt":"2025-04-30T04:00:36","slug":"oracle%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84%e5%a4%87%e4%bb%bd%e4%b8%8e%e6%81%a2%e5%a4%8d","status":"publish","type":"post","link":"https:\/\/bigvip.dpdns.org\/?p=1092","title":{"rendered":"Oracle\u6570\u636e\u5e93\u7684\u5907\u4efd\u4e0e\u6062\u590d"},"content":{"rendered":"\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>\u7279\u6027<\/td><td>\u6570\u636e\u6cf5<\/td><td>RMAN\u70ed\u5907\u4efd<\/td><\/tr><tr><td><strong>\u5907\u4efd\u7c7b\u578b<\/strong><\/td><td>\u903b\u8f91\u5907\u4efd<\/td><td>\u7269\u7406\u5907\u4efd<\/td><\/tr><tr><td><strong>\u4e00\u81f4\u6027<\/strong><\/td><td>\u9700\u7279\u6b8a\u53c2\u6570\u4fdd\u8bc1<\/td><td>\u81ea\u52a8\u4fdd\u8bc1\u4e00\u81f4\u6027<\/td><\/tr><tr><td><strong>\u6062\u590d\u7c92\u5ea6<\/strong><\/td><td>\u8868\/Schema\u7ea7<\/td><td>\u5757\/\u6587\u4ef6\/\u5168\u5e93\u7ea7<\/td><\/tr><tr><td><strong>\u901f\u5ea6<\/strong><\/td><td>\u8f83\u6162\uff08\u9700\u8f6c\u6362\u6570\u636e\u683c\u5f0f\uff09<\/td><td>\u6781\u5feb\uff08\u76f4\u63a5\u590d\u5236\u6587\u4ef6\uff09<\/td><\/tr><tr><td><strong>\u7cfb\u7edf\u5f71\u54cd<\/strong><\/td><td>\u9ad8\uff08\u6d88\u8017CPU\/\u5185\u5b58\uff09<\/td><td>\u4f4e\uff08\u4f18\u5316I\/O\uff09<\/td><\/tr><tr><td><strong>\u6700\u4f73\u7528\u9014<\/strong><\/td><td>\u9009\u62e9\u6027\u6062\u590d\u3001\u8de8\u7248\u672c\u8fc1\u79fb<\/td><td>\u707e\u96be\u6062\u590d\u3001\u5feb\u901f\u8fd8\u539f<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">\u771f\u6b63\u70ed\u5907\u4efd\u7684\u5bf9\u6bd4\uff08RMAN\uff09<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e00\u3001\u4f7f\u7528rman\u5bf9\u6570\u636e\u5e93\u8fdb\u884c\u70ed\u5907\u4efd<\/h3>\n\n\n\n<p>1.\u542f\u7528\u5f52\u6863\u65e5\u5fd7\u6a21\u5f0f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u6253\u5f00SQL Plus \u6267\u884c\uff1a\nEnter user-name: sys\/ as sysdba\nEnter password:\nSQL&gt; shutdown immediate;\nSQL&gt; startup mount;\nSQL&gt; archive log list; \u67e5\u770b\u662f\u5426\u542f\u7528\u4e86\u5f52\u6863\u65e5\u5fd7\nSQL&gt; alter database archivelog; \u542f\u7528\u5f52\u6863\u65e5\u5fd7\nSQL&gt; alter database open; \u6253\u5f00\u6570\u636e\u5e93<\/code><\/pre>\n\n\n\n<p>2.\u521b\u5efa\u6062\u590d\u76ee\u5f55\u6570\u636e\u5e93\u5e76\u6ce8\u518c\u76ee\u6807\u6570\u636e\u5e93\u5230\u6062\u590d\u76ee\u5f55<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1.\u5728\u6062\u590d\u76ee\u5f55\u6570\u636e\u5e93\u4e2d \u521b\u5efa\u8868\u7a7a\u95f4\nSQL&gt; create tablespace rmants datafile 'c:\\backup\\rmants.dbf' size 500m;\n            \u5927\u5c0f\u4e3a500M\uff0c\u540d\u79f0\u4e3armants\u7684\u8868\u7a7a\u95f4\n            <strong>\u6ce8\u610f\uff1abackup\u76ee\u5f55\u9700\u4e8b\u5148\u624b\u5de5\u521b\u5efa<\/strong>,rmants.dbf\u4f1a\u81ea\u52a8\u521b\u5efa\n\n2.\u521b\u5efa\u7528\u6237,\u7528\u6237\u540drman,\u5bc6\u7801rman\nSQL&gt; create user rman identified by rman default tablespace rmants;\n\n            \u6388\u6743\uff1a\nSQL&gt; grant connect,resource,recovery_catalog_owner to rman;\n\n            \u9000\u51fa\uff1a\nSQL&gt;exit;\n\n3.rman\u8fde\u63a5\u5230\u6062\u590d\u76ee\u5f55\u6570\u636e\u5e93\nC:\\Users\\ASUS&gt;rman catalog rman\/\nRecovery Manager: Release 11.2.0.1.0 - Production on Tue Apr 29 18:58:06 2025\nCopyright (c) 1982, 2009, Oracle and\/or its affiliates.  All rights reserved.\nrecovery catalog database Password:\nconnected to recovery catalog database\n         \u5efa\u7acb\u6062\u590d\u76ee\u5f55:\nRMAN&gt;  create catalog tablespace rmants;\n\nrecovery catalog created\n            \u9000\u51fa\uff1a\nRMAN&gt;exit;\n\n4.\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\uff08\u5373\u8981\u5907\u4efd\u7684\u6570\u636e\u5e93\uff09\nC:\\Users\\ASUS&gt;rman target rman\/\nRecovery Manager: Release 11.2.0.1.0 - Production on Tue Apr 29 12:09:26 2025\nCopyright (c) 1982, 2009, Oracle and\/or its affiliates.  All rights reserved.\ntarget database Password:\nconnected to target database: ORCL (DBID=1726536795)\nRMAN&gt; connect catalog rman\/ ;\nconnected to recovery catalog database\n            \u4e0a\u8ff0\u547d\u4ee4\u8868\u793a\u8fde\u63a5\u5230\u6062\u590d\u76ee\u5f55\u6570\u636e\u5e93\n\nRMAN&gt; register database;\n\ndatabase registered in recovery catalog\nstarting full resync of recovery catalog\nfull resync complete\n\n            \u4e0a\u8ff0\u547d\u4ee4\u8868\u793a\u6ce8\u518c\u6570\u636e\u5e93<\/code><\/pre>\n\n\n\n<p>3\u3001\u5907\u4efd\u6570\u636e\u5e93<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1.\u914d\u7f6e\u81ea\u52a8\u901a\u9053\n   \u6307\u5b9a\u8bbe\u5907\u7684\u7c7b\u578b\u662f\u78c1\u76d8(disk)\uff0c\u901a\u9053\u7684\u4e2a\u6570\u662f5\u4e2a,\u9ed8\u8ba41\u4e2a\uff0c\u901a\u9053\u591a\u6548\u7387\u4f1a\u66f4\u9ad8\u3002\nRMAN&gt; configure device type disk parallelism 5;\n\n2.\u5f00\u59cb\u5907\u4efd\nRMAN&gt; backup database format 'c:\\backup\\%U';\n       \/\/ format\u6307\u5b9a\u4e86\u6587\u4ef6\u540d\uff0c\u6587\u4ef6\u540d\u662f\u52a8\u6001\u7684\uff0c\u4f1a\u81ea\u52a8\u751f\u6210,\u5982\u679c\u6ca1\u6709\u6307\u5b9a\u6587\u4ef6\u540d\uff0c\u9ed8\u8ba4\u5907\u4efd\u5230\u5feb\u95ea\u6062\u590d\u533a\uff08C:\\app\\Administrator\\flash_recovery_area\uff09\n\nRMAN&gt;backup database plus archivelog delete input;\n    \/\/\u5982\u679c\u8fd8\u8981\u5305\u542b\u5f52\u6863\u65e5\u5fd7\u6587\u4ef6\uff0c\u5219\u8981\u52a0\u4e0aplus archivelog\u5173\u952e\u5b57\uff0cdelete input\u7684\u610f\u601d\u662f\u5728\u5907\u4efd\u5b8c\u6210\u540e\uff0c\u5220\u9664archivelog\u6587\u4ef6<\/code><\/pre>\n\n\n\n<p>4\u3001\u6570\u636e\u5e93\u6062\u590d<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1.\u5173\u95ed\u6570\u636e\u5e93\u5e76\u5220\u9664\u6587\u4ef6\nC:\\Users\\Administrator&gt;sqlplus sys\/  as sysdba\nSQL&gt; shutdown  immediate;\n        \u628aC:\\app\\Administrator\\oradata\\orcl\\USERS01.DBF\u5220\u9664\u5230\u56de\u6536\u7ad9\n\n2.\u542f\u52a8\u6570\u636e\u5e93\u5e76\u6062\u590d\u6587\u4ef6 \nC:\\Users\\Administrator&gt;sqlplus sys\/  as sysdba\nSQL&gt; startup mount;  -- \u6570\u636e\u5e93\u8981\u5728mount\u72b6\u6001\u4e0b\u6267\u884c\u6062\u590d\nSQL&gt;exit;\n\nC:\\Users\\Administrator&gt;rman target rman\/\nRMAN&gt; restore database;\n\nStarting restore at 30-APR-25\nusing target database control file instead of recovery catalog\nallocated channel: ORA_DISK_1\nchannel ORA_DISK_1: SID=189 device type=DISK\nallocated channel: ORA_DISK_2\nchannel ORA_DISK_2: SID=221 device type=DISK\nallocated channel: ORA_DISK_3\nchannel ORA_DISK_3: SID=3 device type=DISK\nallocated channel: ORA_DISK_4\nchannel ORA_DISK_4: SID=33 device type=DISK\n\nchannel ORA_DISK_1: starting datafile backup set restore\nchannel ORA_DISK_1: specifying datafile(s) to restore from backup set\nchannel ORA_DISK_1: restoring datafile 00001 to C:\\APP\\ASUS\\ORADATA\\ORCL\\SYSTEM01.DBF\nchannel ORA_DISK_1: restoring datafile 00002 to C:\\APP\\ASUS\\ORADATA\\ORCL\\SYSAUX01.DBF\nchannel ORA_DISK_1: restoring datafile 00003 to C:\\APP\\ASUS\\ORADATA\\ORCL\\UNDOTBS01.DBF\nchannel ORA_DISK_1: restoring datafile 00004 to C:\\APP\\ASUS\\ORADATA\\ORCL\\USERS01.DBF\nchannel ORA_DISK_1: restoring datafile 00005 to C:\\APP\\ASUS\\ORADATA\\ORCL\\EXAMPLE01.DBF\nchannel ORA_DISK_1: restoring datafile 00006 to C:\\BACKUP\\RMANTS.DBF\nchannel ORA_DISK_1: reading from backup piece C:\\BACKUP\\053O4TUH_1_1\nchannel ORA_DISK_1: piece handle=C:\\BACKUP\\053O4TUH_1_1 tag=TAG20250429T190449\nchannel ORA_DISK_1: restored backup piece 1\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:35\nFinished restore at 30-APR-25\n\nRMAN&gt; recover database;\n\nStarting recover at 30-APR-25\nusing channel ORA_DISK_1\nusing channel ORA_DISK_2\nusing channel ORA_DISK_3\nusing channel ORA_DISK_4\n\nstarting media recovery\nmedia recovery complete, elapsed time: 00:00:01\n\nFinished recover at 30-APR-25\n\nRMAN&gt; alter database open;\n\ndatabase opened     \\\\    \u5982\u679c\u6570\u636e\u5e93\u542f\u52a8\u6210\u529f\u8868\u793a\u6062\u590d\u6210\u529f\u3002<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e8c\u3001\u4f7f\u7528\u6570\u636e\u6cf5\u5bf9\u6570\u636e\u5e93\u8fdb\u884c\u903b\u8f91\u5907\u4efd\u8fd8\u539f<\/h3>\n\n\n\n<p>           \u6570\u636e\u6cf5\u662f\u903b\u8f91\u5907\u4efd\u5de5\u5177\uff1a\u5bfc\u51fa\u7684\u662f\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u7ed3\u6784\u548c\u6570\u636e\uff08SQL\u53ef\u8bfb\u683c\u5f0f\uff09\u3002\u652f\u6301\u7684\u5bf9\u8c61\u7c7b\u578b\uff1a\u5b8c\u6574\u6570\u636e\u5e93\u3001Schema\u3001\u8868\u3001\u8868\u7a7a\u95f4\uff1b\u89c6\u56fe\u3001\u7d22\u5f15\u3001\u7ea6\u675f\u3001\u89e6\u53d1\u5668\uff1b\u5b58\u50a8\u8fc7\u7a0b\u3001\u51fd\u6570\u3001\u5305\uff1b\u6743\u9650\u3001\u89d2\u8272\u3001\u4e0a\u4e0b\u6587\u7b49\u5143\u6570\u636e\u3002<\/p>\n\n\n\n<p>1.\u521b\u5efa\u4e00\u4e2a\u64cd\u4f5c\u76ee\u5f55\u5e76\u5907\u4efd\u6570\u636e\u5e93\u8868\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>c:\\users\\administrator&gt;sqlplus sys\/ as sysdba\nSQL&gt; create directory dump_dir as 'c:\\opt\\backup'; &nbsp;\n   \\\\\u9996\u5148\u521b\u5efa\u4e00\u4e2a\u78c1\u76d8\u76ee\u5f55c:\\opt\\backup \u521b\u5efa\u4e00\u4e2a\u540d\u4e3adump_dir\u7684\u5bf9\u8c61\uff08\u540d\u5b57\u662f\u968f\u4fbf\u8d77\u7684\uff09\uff0c\u7c7b\u578b\u662fdirectory\uff0c \u8be5\u5bf9\u8c61\u548cc:\\opt\\backup\u5173\u8054\u8d77\u6765\u3002\n\nc:\\users\\administrator&gt;expdp scott\/  directory=dump_dir dumpfile=scotttab.dmp \ntables=dept,emp\n    \\\\\u4ee5scott\u7684\u8d26\u53f7\u8fde\u63a5\u6570\u636e\u5e93\uff0c\u5907\u4efdemp\u8868\u548cdept\u8868\uff0c\u751f\u6210\u5907\u4efd\u6587\u4ef6scotttab.dmp\uff0c\u653e\u5230c:\\opt\\backup<\/code><\/pre>\n\n\n\n<p>2\u3001\u4f7f\u7528\u6570\u636e\u6cf5\u6062\u590d\u6570\u636e\u5e93\u8868<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\Users\\Administrator>impdp scott\/   directory=dump_dir dumpfile=scotttab.dmp \ntables=emp  TABLE_EXISTS_ACTION=replace\n    \\\\\u4ee5scott\u7684\u8d26\u53f7\u8fde\u63a5\u6570\u636e\u5e93\uff0c\u6062\u590demp\uff0c\u5907\u4efd\u6587\u4ef6\u540d\u4e3ascotttab.dmp\uff0c\u653e\u5728c:\\opt\\backup\u76ee\u5f55\u4e2d<\/code><\/pre>\n\n\n\n<p>3\u3001\u4f7f\u7528\u6570\u636e\u6cf5\u5907\u4efd\u5b8c\u6574\u6570\u636e\u5e93<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-- \u5bfc\u51fa\u6570\u636e\u5e93\n \u00a0 C\uff1a\\users\\administrator>expdp system\/  directory=dump_dir \ndumpfile=full.dmp full=y\n-- \u5bfc\u5165\u6570\u636e\u5e93\n \u00a0 C\uff1a\\users\\administrator>impdp system\/  directory=dump_dir \ndumpfile=full.dmp full=y TABLE_EXISTS_ACTION=replace<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7279\u6027 \u6570\u636e\u6cf5 RMAN\u70ed\u5907\u4efd \u5907\u4efd\u7c7b\u578b \u903b\u8f91\u5907\u4efd \u7269\u7406\u5907\u4efd \u4e00\u81f4\u6027 \u9700\u7279\u6b8a\u53c2\u6570\u4fdd\u8bc1 \u81ea\u52a8\u4fdd\u8bc1\u4e00\u81f4\u6027 \u6062\u590d\u7c92\u5ea6  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"aside","meta":{"footnotes":""},"categories":[19,35],"tags":[21],"class_list":["post-1092","post","type-post","status-publish","format-aside","hentry","category-windows","category-35","tag-oracle","post_format-post-format-aside"],"_links":{"self":[{"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/1092","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1092"}],"version-history":[{"count":20,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/1092\/revisions"}],"predecessor-version":[{"id":1127,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/1092\/revisions\/1127"}],"wp:attachment":[{"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1092"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1092"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}