|
游客
|
发表于 2011-3-23 22:28:37
可以先在操作系统写好shell脚本,然后再使用操作系统计划任务,类似crontab功能,脚本的例子有很多,比如:
#!/bin/bash
source /home/oracle/.bash_profile
btime=`date +%Y%m%d`
select_rebackup_ptab_list () ####list the need rebackup partition LST(table,date)
{
sqlplus -S $USERNAME/$PASSWORD@$SID_LOG <<EOF > ${DATA_SCRIPT}/rebackup_ptab_${btime}.lst
set wrap off;
set pagesize 50000;
set linesize 100;
set head off;
set FEEDBACK off;
insert into emp as select * from employee where log_time >=to_date('$1','yyyymmdd');
EOF
}
select_rebackup_ptab_list $btime
--end |
|