{"id":1410,"date":"2018-02-23T09:33:16","date_gmt":"2018-02-23T01:33:16","guid":{"rendered":"http:\/\/www.821121.com\/?p=1410"},"modified":"2021-03-02T10:51:08","modified_gmt":"2021-03-02T02:51:08","slug":"%e6%a8%a1%e6%8b%9f-rm-rf-%e8%af%af%e6%93%8d%e4%bd%9c%ef%bc%88%e6%97%a0%e5%a4%87%e4%bb%bd%ef%bc%89","status":"publish","type":"post","link":"http:\/\/www.821121.com\/?p=1410","title":{"rendered":"\u6a21\u62df rm -rf \u8bef\u64cd\u4f5c\uff08\u65e0\u5907\u4efd\uff09"},"content":{"rendered":"<h1>\uff081\uff09\u6a21\u62df\u5220\u9664\u6570\u636e\u6587\u4ef6<\/h1>\n<pre><code class=\"language-sql\">\/u01\/app\/oracle\/oradata\/racdb\/system01.dbf\n\/u01\/app\/oracle\/oradata\/racdb\/sysaux01.dbf\n\n! rm -rf \/u01\/app\/oracle\/oradata\/racdb\/system01.dbf\n! rm -rf \/u01\/app\/oracle\/oradata\/racdb\/sysaux01.dbf\n! ls -l \/u01\/app\/oracle\/oradata\/racdb\/system01.dbf<\/code><\/pre>\n<h1>\uff082\uff09\u67e5\u770b\u6570\u636e\u5e93\u57fa\u672c\u4fe1\u606f<\/h1>\n<pre><code class=\"language-sql\">select status from v$instance;\nselect open_mode from v$database;\nselect count(*) from dba_objects;\ncreate table aa as select * from dba_objects;\n\n\u7531\u4e8e\u6570\u636e\u6587\u4ef6\u90fd\u88ab\u5220\u9664\uff0c\u5176\u4e2d\u5305\u62ec system01.dbf\uff0c\u662f\u5b58\u653e\u6570\u636e\u5b57\u5178\u7684\u5bb9\u5668\uff0c\u60f3\u8981\u518d\u8bbf\u95ee\u6570\u636e\u5b57\u5178\u4e2d\u5f97\u89c6\n\u56fe\uff0c\u5f53\u7136\u662f\u4e0d\u53ef\u80fd\u7684\u4e86\uff0c\u6240\u4ee5\u8fd9\u91cc\u4f1a\u62a5\u9519\uff0c\u627e\u4e0d\u5230\u6587\u4ef6\uff0c\u6545\u969c\u51fa\u73b0<\/code><\/pre>\n<h1>\uff083\uff09\u5f00\u59cb\u6062\u590d<\/h1>\n<h2>3.1 \u5224\u65ad\u53e5\u67c4\u4f4d\u7f6e<\/h2>\n<pre><code class=\"language-sql\">\u5176\u5b9e\u8fd9\u4e2a\u65f6\u5019\uff0c\u6240\u6709 oracle \u7684\u8fdb\u7a0b\u90fd\u8fd8\u5728\uff0c\u90fd\u662f\u4ee5 ora_\u5f00\u5934\u7684\u90fd\u662f oracle \u7684\u540e\u53f0\u8fdb\u7a0b\uff1a\nSQL&gt; ! ps -ef|grep ora_\n--\u67e5\u770b lgwr \u8fdb\u7a0b\uff0c\u5224\u65ad\u9700\u8981\u6062\u590d\u6587\u4ef6\u53e5\u67c4\u6240\u5728\u76ee\u5f55\nSQL&gt; !ps -ef|grep ora_lgwr\noracle     2997      1  0 17:08 ?        00:00:00 ora_lgwr_racdb\noracle     3781   3747  0 17:54 pts\/1    00:00:00 \/bin\/bash -c ps -ef|grep ora_lgwr\noracle     3783   3781  0 17:54 pts\/1    00:00:00 grep ora_lgwr<\/code><\/pre>\n<h2>3.2 \u6062\u590d\u6570\u636e\u6587\u4ef6\u3001\u63a7\u5236\u6587\u4ef6\u3001tmp \u6587\u4ef6\u548c online log \u6587\u4ef6<\/h2>\n<pre><code class=\"language-sql\">cd \/proc\/31863\/fd\nll\uff08\u540e\u7f6e\u6807\u6ce8\u4e3adeleted\u5c31\u662f\u521a\u521a\u88ab\u5220\u9664\u7684\u6587\u4ef6\uff09\n[root@oracle fd]# ll\ntotal 0\nlr-x------ 1 oracle oinstall 64 Feb  3 17:56 0 -&gt; \/dev\/null\nl-wx------ 1 oracle oinstall 64 Feb  3 17:56 1 -&gt; \/dev\/null\nlrwx------ 1 oracle oinstall 64 Feb  3 17:56 10 -&gt; \/u01\/app\/oracle\/product\/11.2.0.4\/db_1\/dbs\/lkRACDB\nlr-x------ 1 oracle oinstall 64 Feb  3 17:56 11 -&gt; \/u01\/app\/oracle\/product\/11.2.0.4\/db_1\/rdbms\/mesg\/oraus.msb\nlrwx------ 1 oracle oinstall 64 Feb  3 17:56 14 -&gt; socket:[29608]\nl-wx------ 1 oracle oinstall 64 Feb  3 17:56 2 -&gt; \/dev\/null\nlrwx------ 1 oracle oinstall 64 Feb  3 17:56 256 -&gt; \/u01\/app\/oracle\/oradata\/racdb\/control01.ctl\nlrwx------ 1 oracle oinstall 64 Feb  3 17:56 257 -&gt; \/u01\/app\/oracle\/oradata\/racdb\/control02.ctl\nlrwx------ 1 oracle oinstall 64 Feb  3 17:56 258 -&gt; \/u01\/app\/oracle\/oradata\/racdb\/control03.ctl\nlrwx------ 1 oracle oinstall 64 Feb  3 17:56 259 -&gt; \/u01\/app\/oracle\/oradata\/racdb\/redo01_1.log\nlrwx------ 1 oracle oinstall 64 Feb  3 17:56 260 -&gt; \/u01\/app\/oracle\/oradata\/racdb\/redo01_2.log\nlrwx------ 1 oracle oinstall 64 Feb  3 17:56 261 -&gt; \/u01\/app\/oracle\/oradata\/racdb\/redo02_1.log\nlrwx------ 1 oracle oinstall 64 Feb  3 17:56 262 -&gt; \/u01\/app\/oracle\/oradata\/racdb\/redo02_2.log\nlrwx------ 1 oracle oinstall 64 Feb  3 17:56 263 -&gt; \/u01\/app\/oracle\/oradata\/racdb\/system01.dbf (deleted)\nlrwx------ 1 oracle oinstall 64 Feb  3 17:56 264 -&gt; \/u01\/app\/oracle\/oradata\/racdb\/sysaux01.dbf (deleted)\nlrwx------ 1 oracle oinstall 64 Feb  3 17:56 265 -&gt; \/u01\/app\/oracle\/oradata\/racdb\/undotbs1.dbf\nlrwx------ 1 oracle oinstall 64 Feb  3 17:56 266 -&gt; \/u01\/app\/oracle\/oradata\/racdb\/users01.dbf\nlrwx------ 1 oracle oinstall 64 Feb  3 17:56 267 -&gt; \/u01\/app\/oracle\/oradata\/racdb\/test01.dbf\nlrwx------ 1 oracle oinstall 64 Feb  3 17:56 268 -&gt; \/u01\/app\/oracle\/oradata\/racdb\/eas_d_anjoy_standard01.dbf\nlrwx------ 1 oracle oinstall 64 Feb  3 17:56 269 -&gt; \/u01\/app\/oracle\/oradata\/racdb\/temp01.dbf\nlr-x------ 1 oracle oinstall 64 Feb  3 17:56 3 -&gt; \/dev\/null\nlr-x------ 1 oracle oinstall 64 Feb  3 17:56 4 -&gt; \/dev\/null\nlr-x------ 1 oracle oinstall 64 Feb  3 17:56 5 -&gt; \/dev\/null\nlr-x------ 1 oracle oinstall 64 Feb  3 17:56 6 -&gt; \/u01\/app\/oracle\/product\/11.2.0.4\/db_1\/rdbms\/mesg\/oraus.msb\nlr-x------ 1 oracle oinstall 64 Feb  3 17:56 7 -&gt; \/proc\/2997\/fd\nlr-x------ 1 oracle oinstall 64 Feb  3 17:56 8 -&gt; \/dev\/zero\nlrwx------ 1 oracle oinstall 64 Feb  3 17:56 9 -&gt; \/u01\/app\/oracle\/product\/11.2.0.4\/db_1\/dbs\/hc_racdb.dat\n\n[root@orcltest fd]# ll | grep deleted\n[root@oracle fd]# ll | grep deleted\nlrwx------ 1 oracle oinstall 64 Feb  3 17:56 263 -&gt; \/u01\/app\/oracle\/oradata\/racdb\/system01.dbf (deleted)\nlrwx------ 1 oracle oinstall 64 Feb  3 17:56 264 -&gt; \/u01\/app\/oracle\/oradata\/racdb\/sysaux01.dbf (deleted)\n\n\u5206\u6790\uff1a\u53ef\u4ee5\u770b\u53e5\u67c4 256-266 \u7684\u6587\u4ef6\u672b\u5c3e\u88ab\u6807\u8bb0(deleted)\uff0c\u8fd9\u662f\u7531\u521a\u624d\u7684 rm -rf \u64cd\u4f5c\u6240\u5bfc\u81f4\u7684\uff0c\u8bef\u5220\n\u9664\u540e\u53ea\u8981 Oracle \u6570\u636e\u5e93\u672a\u91cd\u542f\uff0c\u8fdb\u7a0b\u5c31\u4e0d\u4f1a\u505c\u6b62\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u901a\u8fc7\/proc\/#oracle DBWn \u8fdb\u7a0b\u53f7\/fd \u76ee\u5f55\n\u4e2d\u7684\u6587\u4ef6\u53e5\u67c4\u53f7\uff0c\u6765\u5bf9\u8fd9\u4e9b\u88ab delete \u7684\u6587\u4ef6\u8fdb\u884c\u6062\u590d\uff0c\u65b9\u6cd5\u5c31\u662f cp \u6587\u4ef6\u53e5\u67c4\u5230\u539f\u8def\u5f84\uff0c\u6ce8\u610f\u4e00\u70b9\u8fd9\u91cc\u5982\u679c\n\u4e0d\u662f\u5728 fd \u76ee\u5f55\uff0c\u90a3\u5c31\u8981\u7528\u7edd\u5bf9\u8def\u5f84\u6765\u6307\u5b9a\u6587\u4ef6\u53e5\u67c4\uff0c\u5982\u679c\u5220\u9664\u6587\u4ef6\u540e\u5c31\uff0c\u53c8\u5bf9\u6570\u636e\u5e93\u8fdb\u884c\u4e86\u5173\u95ed\u64cd\u4f5c\uff0c\u90a3\u5c31\n\u65e0\u89e3\u4e86,\u53ea\u80fd\u60f3\u60f3 rman \u4e86\u5982\u679c\u91c7\u7528 secureCRT \u8f6f\u4ef6\u6765\u4f5c\u4e3a\u7ec8\u7aef\u67e5\u770b\u7684\u8bdd\uff0c\u53ef\u4ee5\u770b\u5230\u8fd9\u51e0\u4e2a deleted \u7684\u6587\u4ef6\u662f\u4e00\u76f4\u95ea\u52a8\u7684\u3002\n\n\u6267\u884c\u6062\u590d\uff0c\u6267\u884c\u5982\u4e0b\u811a\u672c\uff1a\n\ncp 263 \/u01\/app\/oracle\/oradata\/racdb\/system01.dbf\ncp 264 \/u01\/app\/oracle\/oradata\/racdb\/sysaux01.dbf\n\n\u6ce8\u610f\uff0c\u8fd9\u91cc\u4e00\u5b9a\u8981\u6ce8\u610f\u6743\u9650\u95ee\u9898\uff0c\u8981\u7528 oracle \u7528\u6237\u53bb cp\uff0c\u5982\u679c\u7528 root \u53bb cp \u51fa\u6765\u7684\u6587\u4ef6\uff0coracle \u8fdb\n\u7a0b\u662f\u6ca1\u6709\u6743\u9650\u64cd\u4f5c\u7684\uff0c\u5f53\u7136\uff0c\u4f60\u4e5f\u53ef\u4ee5\u5728\u7528 root \u6062\u590d\u5b8c\u540e\uff0c\u518d chown \u4e00\u4e0b\uff1a\nchown -R oracle:oinstall \/u01\/app\/oracle\/oradata\/racdb\/system01.dbf\nchown -R oracle:oinstall \/u01\/app\/oracle\/oradata\/racdb\/sysaux01.dbf\n\n\u5bf9\u6587\u4ef6\u8fdb\u884c\u6062\u590d\u4ee5\u540e\uff0c\u76f4\u63a5\u67e5\u8be2 fd \u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u72b6\u6001\uff0c\u4f9d\u7136\u53ef\u4ee5\u770b\u5230\u662f(deleted)\u7684\uff0c\u4f46\u662f\u6ca1\u5173\u7cfb\uff0c\u5b9e\u9645\u4e0a\u6587\u4ef6\u5df2\u7ecf\u6062\u590d\u6210\u529f\u4e86<\/code><\/pre>\n<h1>\u56db\u3001\u91cd\u542f\u6570\u636e\u5e93\uff0c\u68c0\u9a8c\u662f\u5426\u6b63\u5e38<\/h1>\n<pre><code class=\"language-sql\">startup force\n<\/code><\/pre>\n<h1>\u4e94\u3001\u603b\u7ed3<\/h1>\n<pre><code class=\"language-sql\">\u5f53\u6211\u4eec\u8fdb\u884c Linux \u64cd\u4f5c\u7cfb\u7edf\u547d\u4ee4 rm \u7684\u65f6\u5019\uff0c\u5207\u5fcc\u4e0d\u53ef\u968f\u610f\u52a0-rf \u53c2\u6570\uff0c\u5c31\u7b97\u4e00\u5b9a\u8981\u7528\uff0c\u4e5f\u8981\u786e\u5b9a\u518d\u4e09\u540e\n\u624d\u80fd\u6267\u884c\uff0c\u5426\u5219\u5bf9\u4e8e\u6570\u636e\u5e93\u800c\u8a00\uff0c\u53ef\u4ee5\u8bf4\u662f\u707e\u96be\u6027\u7684\u3002\u8fd9\u91cc\u53ea\u662f\u6d4b\u8bd5\u4e86\u4e00\u4e0b\u5220\u9664\n\/u01\/app\/oracle\/oradata\/\u4e0b\u7684\u5168\u90e8\u6587\u4ef6\uff0c\u8bd5\u60f3\u4e00\u4e0b\uff0c\u5982\u679c\u4f60\u5f53\u521d\u6267\u884c\u7684\u662f rm -rf \/u01 \u5462\uff1f\u53ef\u80fd\u60c5\u51b5\n\u5c31\u8981\u66f4\u52a0\u590d\u6742\u4e00\u70b9\u4e86\uff0c\u6062\u590d\u9700\u8981\u7684\u6b65\u9aa4\u4e5f\u5c31\u66f4\u591a\u4e86\u3002\n\u7531\u4e8e\u662f\u5728\u6570\u636e\u5e93 open \u72b6\u6001\u4e0b\u76f4\u63a5\u8fdb\u884c\u4e86\u7834\u574f\u6027\u64cd\u4f5c\uff0c\u5bf9\u4e8e redo buffer \u8fd8\u6765\u4e0d\u53ca\u5199\u5165 online redo\nlogfile \u7684\u90a3\u90e8\u5206\u64cd\u4f5c\uff0c\u80af\u5b9a\u662f\u4f1a\u4e22\u5931\u7684\uff0c\u56e0\u4e3a\u6211\u4eec\u901a\u8fc7\u6587\u4ef6\u53e5\u67c4\u53f7\u6062\u590d\u51fa\u6765\u7684\u65e5\u5fd7\u6587\u4ef6\u4e2d\uff0c\u5e76\u4e0d\u4e00\u5b9a\u5305\u542b\u6570\n\u636e\u5e93\u7684\u6700\u65b0\u53d8\u66f4\uff0c\u5373\u4fbf\u5982\u6b64\uff0c\u5bf9\u4e8e rm -rf \u8bef\u64cd\u4f5c\u7684\u6062\u590d\uff0c\u8fd8\u662f\u6709\u4e00\u5b9a\u610f\u4e49\u7684\uff0c\u81f3\u5c11\u53ef\u4ee5\u5728\u4f60\u6ca1\u6709\u4efb\u4f55\u5907\u4efd\u7684\n\u60c5\u51b5\u4e0b\uff0c\u591a\u63d0\u4f9b\u4e86\u4e00\u6839\u6551\u547d\u7a3b\u8349\u6765\u62ef\u6551\u4f60\u7684\u6570\u636e\u5e93\uff0c\u518d\u6b21\u5f3a\u8c03\u4e00\u4e0b\uff0crm -rf \u540e\uff0c\u5343\u4e07\u4e0d\u8981\u7740\u6025\u5730\u5173\u95ed\u6570\u636e\u5e93<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\uff081\uff09\u6a21\u62df\u5220\u9664\u6570\u636e\u6587\u4ef6 \/u01\/app\/orac<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33,18,41,40],"tags":[],"class_list":["post-1410","post","type-post","status-publish","format-standard","hentry","category-linux","category-oracle-11g","category-41","category--oracle-11g"],"_links":{"self":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/1410","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1410"}],"version-history":[{"count":2,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/1410\/revisions"}],"predecessor-version":[{"id":1412,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/1410\/revisions\/1412"}],"wp:attachment":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1410"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1410"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1410"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}