首页 > 数据库技术 > 详细

Linux oracle cool back scritp

时间:2014-05-27 03:41:56      阅读:409      评论:0      收藏:0      [点我收藏+]

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

Linux oracle cool back scritp

原文:http://ericklee.blog.51cto.com/6941516/1412763

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!