共需要创建两个文件在同一个目录下:一:文件oracle_cool_backup.bat,内容如下:Remark 定义时间日期变量set date=%date:~0,10%set h=%time:~0,2%set m=%time:~3,2%set s=%time:~6,2%set tempvar=%date%-%h%-%m%-%s%md "c:/temp/%tempvar%/"echo %tempvar%sqlplus /nolog @oracle_cool_backup.sql %tempvar%call oracle_cool_backup_spool.batpause 二:文件oracle_cool_backup.sql,内容如下:Remark oracle_cool_backup.sqlRemark 冷备份脚本Remark 设置SQL*Plus环境变量conn sys/sunny as sysdba;set feedback off heading off verify off trimspool offset pagesize 0 linesize 200Remark 设置用户变量define spoolfile = 'oracle_cool_backup_spool.bat'prompt *** spooling to &spoolfileRemark 创建包含备份命令的脚本文件spool &spoolfileRemark 下面的e:/temp/&1后必须加"/" 不然提示还是目录名(F = 文件,D = 目录)?select 'copy ' || name || ' c:/temp/&1/' from v$datafile;select 'copy ' || name || ' c:/temp/&1/' from v$controlfile;select 'copy ' || member || ' c:/temp/&1/' from v$logfile;select 'copy ' || name || ' c:/temp/&1/' from v$tempfile;spool off;Remark 关闭数据库shutdown immediate;exit;