{"id":735,"date":"2018-05-21T14:09:33","date_gmt":"2018-05-21T06:09:33","guid":{"rendered":"http:\/\/www.821121.com\/?p=735"},"modified":"2020-12-04T11:11:55","modified_gmt":"2020-12-04T03:11:55","slug":"oracle-rman%e5%a4%87%e4%bb%bd%e8%84%9a%e6%9c%ac","status":"publish","type":"post","link":"http:\/\/www.821121.com\/?p=735","title":{"rendered":"ORACLE RMAN\u5907\u4efd\u811a\u672c"},"content":{"rendered":"<p>RMAN\u5168\u5907\u811a\u672c<br \/>\nexport today=<code>date +%Y%m%d%H%M<\/code><br \/>\nexport NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'<br \/>\nexport MYPATH=\/backup\/rman\/&quot;$ORACLE_SID&quot;\/&quot;$today&quot;<br \/>\nif [[ ! -e &quot;$MYPATH&quot; ]]<br \/>\nthen<br \/>\nmkdir -p &quot;$MYPATH&quot;;<br \/>\nfi<\/p>\n<p>$ORACLE<em>HOME\/bin\/rman target \/ log=$MYPATH\/full<\/em>&quot;$ORACLE<em>SID&quot;<\/em>&quot;$today&quot;.log &lt;&lt;EOF<br \/>\nrun{<br \/>\nallocate channel c1 device type disk;<br \/>\nallocate channel c2 device type disk;<br \/>\nallocate channel c3 device type disk;<br \/>\nallocate channel c4 device type disk;<br \/>\nbackup as compressed backupset full database tag 'dbfull' format '$MYPATH\/%d-%T-%U.full';<br \/>\nsql 'alter system archive log current';<br \/>\nbackup archivelog all  format '$MYPATH\/%d-%T-%U.arc' delete input;<br \/>\nbackup current controlfile format '$MYPATH\/%d-%T-%U.ctf';<br \/>\nbackup spfile format '$MYPATH\/%d-%T-%U.spt';<br \/>\ncrosscheck backup;<br \/>\ncrosscheck archivelog all;<br \/>\ndelete noprompt expired backup;<br \/>\ndelete noprompt expired archivelog all;<br \/>\ndelete noprompt obsolete;<br \/>\nrelease channel c1;<br \/>\nrelease channel c2;<br \/>\nrelease channel c3;<br \/>\nrelease channel c4;<br \/>\n}<br \/>\nexit;<br \/>\nEOF<\/p>\n","protected":false},"excerpt":{"rendered":"<p>RMAN\u5168\u5907\u811a\u672c export today=dat<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-735","post","type-post","status-publish","format-standard","hentry","category-34"],"_links":{"self":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/735","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=735"}],"version-history":[{"count":2,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/735\/revisions"}],"predecessor-version":[{"id":737,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/735\/revisions\/737"}],"wp:attachment":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=735"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=735"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=735"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}