Oracle数据库自动备份的具体实现步骤
2007-12-10 21:01:11 来源:WEB开发网 闂傚倸鍊搁崐鎼佸磹閹间礁纾归柟闂寸绾惧綊鏌熼梻瀵割槮缁炬儳缍婇弻鐔兼⒒鐎靛壊妲紒鐐劤缂嶅﹪寮婚悢鍏尖拻閻庨潧澹婂Σ顔剧磼閻愵剙鍔ょ紓宥咃躬瀵鎮㈤崗灏栨嫽闁诲酣娼ф竟濠偽i鍓х<闁诡垎鍐f寖闂佺娅曢幑鍥灳閺冨牆绀冩い蹇庣娴滈箖鏌ㄥ┑鍡欏嚬缂併劎绮妵鍕箳鐎n亞浠鹃梺闈涙搐鐎氫即鐛崶顒夋晬婵絾瀵ч幑鍥蓟閻斿摜鐟归柛顭戝枛椤牆顪冮妶搴′簼缂侇喗鎸搁悾鐑藉础閻愬秵妫冮崺鈧い鎺戝瀹撲礁鈹戦悩鎻掝伀缁惧彞绮欓弻娑氫沪閹规劕顥濋梺閫炲苯澧伴柟铏崌閿濈偛鈹戠€n€晠鏌嶆潪鎷屽厡闁汇倕鎳愮槐鎾存媴閸撴彃鍓卞銈嗗灦閻熲晛鐣烽妷褉鍋撻敐搴℃灍闁绘挻娲橀妵鍕箛闂堟稐绨肩紓浣藉煐濮樸劎妲愰幘璇茬闁冲搫鍊婚ˇ鏉库攽椤旂》宸ユい顓炲槻閻g兘骞掗幋鏃€鐎婚梺瑙勬儗閸樺€熲叺婵犵數濮烽弫鍛婃叏椤撱垹纾婚柟鍓х帛閳锋垶銇勯幒鍡椾壕缂備礁顦遍弫濠氱嵁閸℃稒鍊烽柛婵嗗椤旀劕鈹戦悜鍥╃У闁告挻鐟︽穱濠囨嚃閳哄啰锛滈梺褰掑亰閸欏骸鈻撳⿰鍫熺厸閻忕偟纭堕崑鎾诲箛娴e憡鍊梺纭呭亹鐞涖儵鍩€椤掑啫鐨洪柡浣圭墪閳规垿鎮欓弶鎴犱桓闂佸湱枪閹芥粎鍒掗弮鍫熷仺缂佸顕抽敃鍌涚厱闁哄洢鍔岄悘鐘绘煕閹般劌浜惧┑锛勫亼閸婃牠宕濋敃鈧…鍧楀焵椤掍胶绠剧€光偓婵犱線鍋楀┑顔硷龚濞咃絿妲愰幒鎳崇喓鎷犻懠鑸垫毐闂傚倷鑳舵灙婵炲鍏樺顐ゆ嫚瀹割喖娈ㄦ繝鐢靛У绾板秹寮查幓鎺濈唵閻犺櫣灏ㄥ銉р偓瑙勬尭濡繂顫忛搹鍦<婵☆垰鎼~宥囩磽娴i鍔嶉柟绋垮暱閻g兘骞嬮敃鈧粻濠氭偣閸パ冪骇鐎规挸绉撮—鍐Χ閸℃ê闉嶇紓浣割儐閸ㄥ墎绮嬪澶嬪€锋い鎺嶇瀵灝鈹戦埥鍡楃仯闁告鍕洸濡わ絽鍟崐鍨叏濡厧浜鹃悗姘炬嫹

核心提示:本文主要描述了Oracle数据库自动备份的具体实现步骤,具体内容请参考下文: 错误提示1: message file rman.msb not foundverify that oracle_home is set prop
本文主要描述了Oracle数据库自动备份的具体实现步骤,具体内容请参考下文:
错误提示1:
message file rman.msb not found verify that oracle_home is set properly ......
错误的主要原因:
自动执行的不能够识别相应的命令,需要在自动备份脚本中显式的声明Oracle的环境变量。
错误提示2:
standard in must be a tty ......
错误的主要原因:
不能在cron使用su或者管道等操作,必须将su命令移动到相关的shell脚本中。
错误提示3:
argument value description---------------- target quoted-string connect-string for target databasecatalog quoted-string connect-string for recovery catalognocatalog none if specified, then no recovery catalogcmdfile quoted-string name of input command filelog quoted-string name of output message log filetrace quoted-string name of output debugging message log fileappend none if specified, log is opened in append modedebug optional-args activate debuggingmsgno none show rman-nnnn prefix for all messagessend quoted-string send a command to the media managerpipe string building block for pipe namestimeout integer number of seconds to wait for pipe inputchecksyntax none check the command file for syntax errors------------- --both single and double quotes (" or ") are accepted for a quoted-string.quotes are not required unless the string contains embedded white-space. rman-00571: =======================================rman-00569: =============== error message stack follows ======rman-00571: ================================ rman-00556: could not open cmdfile "backup_ar.rcv" ......
错误原因:
需要在cmdfile中指明绝对路径,不能因为shell脚本调用的cmdfile是在同一个目录下就可以直接使用文件名或者直接使用./
正确示例代码:
1、#cron文件
0 12,18 * * * /home/oracle/bak_sh/backup_ar.sh
#表示每天12,18点对数据库归档日至进行全备份
2、入口shell文件,文件名:backup_ar.sh
export oracle_home= /home/u01/app/oracle/oracle/product /10.2.0/db_1export oracle_sid=testexport lang=en_us.utf-8/home/u01/app/oracle /oracle/product/10.2.0/db_1/bin/rman cmdfile = backup_ar.rcv
3、rman备份脚本
connect target /connect catalog rman/rman @rmanrun{allocate channel d1 device type disk;sql "alter system archive log current"; backup archivelog all delete input forma
- ››oracle 恢复误删除的表和误更新的表
- ››Oracle分页查询排序数据重复问题
- ››Oracle创建dblink报错:ORA-01017、ORA-02063解决
- ››Oracle 提高SQL执行效率的方法
- ››Oracle 动态查询,EXECUTE IMMEDIATE select into...
- ››Oracle 11g必须开启的服务及服务详细介绍
- ››oracle性能34条优化技巧
- ››oracle数据库生成随机数的函数
- ››Oracle 数据库表空间容量调整脚本
- ››oracle单库彻底删除干净的方法
- ››Oracle创建表空间、创建用户以及授权、查看权限
- ››oracle 中 UPDATE nowait 的使用方法
更多精彩
赞助商链接