oracle 定时truncate表

[[email protected] ~]$ cat /home/oracle/shell/truncate_t_test_lo_log.sh
#!/bin/bash
source /home/oracle/.bash_profile
sqlplus -s test/test >> /home/oracle/shell/truncate_t_test_lo_log.log <<EOF
set feedback off heading off term off
set pages 1000 trim on trims on lines 32767 long 999999
set echo off
@/home/oracle/shell/truncate_t_test_lo_log.sql

 

[[email protected] ~]$ cat /home/oracle/shell/truncate_t_test_lo_log.sql

truncate table test.t_test_lo_log;

--定时任务

10 02 * * * /bin/sh /home/oracle/shell/truncate_t_test_lo_log.sh &> /dev/null

猜你喜欢

转载自www.cnblogs.com/ss-33/p/8989710.html