'系统:linux redhat 3
closed_backup.sql脚本存放在/u01/backup/目录下
脚本内容:
1 Remark set sql*plus variables to manipulate output
2 set feedback off heading off verify off trimspool off
3 set pagesize 0 linesize 200
4 Remark set sql*plus user variables used in this script
5 define dir ='/u01/backup'
6 define fil='/u01/backup/closed_backup_commands.sql'
7 prompt *** Spooling to &fil
8 Remark create a command file with file backup commands
9 spool &fil
10 select 'host cp '|| name ||' &dir' from v$datafile order by 1;
11 select 'host cp '|| member ||' &dir' from v$logfile order by 1;
12 select 'host cp '|| name ||' &dir' from v$controlfile order by 1;
13 select 'host cp '|| name ||' &dir' from v$tempfile order by 1;
14 spool off;
15 Remark Shutdown the database cleanly
16 shutdown immediate;
17 Remark Run the copy file commands from the operation system
18 @&fil
19 Remark start the database again
20 startup;
21
用oracle中的sys or system 用户在sqlplus中运行
>@/u01/backup/closed_backup.sql
即可.
closed_backup.sql脚本存放在/u01/backup/目录下
脚本内容:
1 Remark set sql*plus variables to manipulate output
2 set feedback off heading off verify off trimspool off
3 set pagesize 0 linesize 200
4 Remark set sql*plus user variables used in this script
5 define dir ='/u01/backup'
6 define fil='/u01/backup/closed_backup_commands.sql'
7 prompt *** Spooling to &fil
8 Remark create a command file with file backup commands
9 spool &fil
10 select 'host cp '|| name ||' &dir' from v$datafile order by 1;
11 select 'host cp '|| member ||' &dir' from v$logfile order by 1;
12 select 'host cp '|| name ||' &dir' from v$controlfile order by 1;
13 select 'host cp '|| name ||' &dir' from v$tempfile order by 1;
14 spool off;
15 Remark Shutdown the database cleanly
16 shutdown immediate;
17 Remark Run the copy file commands from the operation system
18 @&fil
19 Remark start the database again
20 startup;
21
用oracle中的sys or system 用户在sqlplus中运行
>@/u01/backup/closed_backup.sql
即可.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12778571/viewspace-201786/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/12778571/viewspace-201786/