zoukankan      html  css  js  c++  java
  • 针对分区表一个月3个分区定期清理脚本

    1.定时任务--当前月的前一个月的当前日期

    05 20 1  * *  /bin/sh  /home/oracle/truncate_partition.sh &> /dev/null
    05 20 11 * *  /bin/sh  /home/oracle/truncate_partition.sh &> /dev/null
    05 20 21 * *  /bin/sh  /home/oracle/truncate_partition.sh &> /dev/null

    [oracle@testglt]$ cat /home/oracle/truncate_partition.sh
    #!/bin/bash

    source /home/oracle/.bash_profile
    sqlplus -s test/test@db>> /home/oracle//truncate_partition.log <<EOF
    set feedback off heading off term off
    set pages 1000 trim on trims on lines 32767 long 999999
    set echo off
    spool /home/oracle/truncate_partition_`date +%y%m%d`.sql
    @/home/oracle//truncate_partition.sql
    spool off
    EOF

    sqlplus sys/test@dbas sysdba  >> /home/oracle/exec_truncate_p.log <<EOF
    @/home/oracle/truncate_partition_`date +%y%m%d`.sql
    EOF

  • 相关阅读:
    dp
    数学分析 + 容斥原理
    容斥
    并查集
    矩阵hash + KMP
    扫描线
    位运算
    2015 Multi-University Training Contest 5 1009 MZL's Border
    iOS ZipArchive文件解压缩
    iOS GCD倒计时
  • 原文地址:https://www.cnblogs.com/ss-33/p/8951627.html
Copyright © 2011-2022 走看看