zoukankan      html  css  js  c++  java
  • mysql 批量删除分区

    alter table titles drop partition p01;
    
    use zabbix;
    mysql> source drop_par.sql
    
    [oracle@oadb mysql]$ cat drop_par.sh 
    export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
    date=`echo $1 | tr -d '-'`
    date1=`echo $2 | tr -d '-'`
    date2=`echo $1`
    date_end=`get_date $2 +1 | tr -d '-'`
    while :
        do
          date3=`get_date $date +1`
         var=`date -d "$date3" +%s`
         echo "alter table trends drop partition p$date;"
          date2=`get_date $date +1`
          date=`echo $date2 | tr -d '-'`
          #echo $date3
    if [ "$date" = "$date_end" ]
           then
            exit
    fi
    done

  • 相关阅读:
    Java-循环语句和条件语句
    Java-变量函数 上
    python
    python
    python
    Xpath
    python + selenium
    python + selenium
    python + selenium
    Web
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13350898.html
Copyright © 2011-2022 走看看