一、冷备份流程
- 关闭数据库
shutdown immediate - 拷贝除redo log外其它文件到相应目录
- 数据文件
select name from v$datefile; union select name from v$tempfile;
- 控制文件
select name from v$controlfile;
- redo
select member from v$logfile;
- 数据文件
- 启动数据库到mount状态
startup mount
二、冷备份脚本
colbackup.sql(脚本写的比较粗糙,建议先备份,后删除,文件根据日期进行区分,从而避免备份时出现异常)
ho rm -rf /backup/orcl/* set heading off spool D:\backup\orcl\cool.sql select 'ho cp '||name||' /backup/orcl/' from v$datafile union select 'ho cp '||name||' /backup/orcl/' from v$tempfile union select 'ho cp '||member||' /backup/orcl/' from v$logfile union select 'ho cp '||name||' /backup/orcl/' from v$controlfile; spool off shutdown immediate start /backup/orcl/cool.sql ho rm -rf /backup/orcl/cool*.sql create pfile='/backup/orcl/initorcl.ora' from spfile; ho cp /u01/app/oracle/product/11.2.0/dbhome_1/database/pwdorcl.ora /backup/orcl/ startup