Linux oracle cool back scritp

时间:2014-05-27 03:43:10   收藏:0   阅读:283

oracle 冷备份是一致性备份,备份的内容有数据文件,redo文件,temp文件,控制文件等,

SQLBLANKLINES ON 是预防脚本中有空格,sqlplus误认为是结束,报

SP2-0734: unknown command beginning "where t.bg..." - rest of line ignored.

错误.


set feedback off heading off verify off trimspool off SQLBLANKLINES ON

set pagesize 0 linesize 200

define dir=‘/u01/backup‘

define script=‘/tmp/coolbak.sql‘

spool &script

select ‘! cp ‘ || name || ‘ &dir ‘ from v$datafile order by 1;

select ‘! cp ‘ || member || ‘ &dir ‘ from v$logfile order by 1;

select ‘! cp ‘ || name || ‘ &dir ‘ from v$controlfile order by 1;

select ‘! cp ‘ || name || ‘ &dir ‘ from v$tempfile order by 1;

create pfile = ’&dir/initDBID.ora’ from spfile;

ho cp /u01/app/oracle/product/11.2.0/db_1/dbs/orapwDBID  ‘ &dir ‘

spool off

shutdown immediate

@&script

startup




本文出自 “Permanent” 博客,谢绝转载!

Linux oracle cool back scritp,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!