oracle 定时truncate表

[oracle@test ~]$ 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

 

[oracle@test ~]$ 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

posted @ 2018-05-04 11:15  钱若梨花落  阅读(527)  评论(0编辑  收藏  举报