#!/nmsmw/python/bin/python import os import sys import re import time import datetime import cx_Oracle from multiprocessing import Pool remote_ora = {}#<>FOLD>> app_tables = {}#<>FOLD>> def StringToTime(strtime):#<>FOLD>> def gen_sqls(operate, date):#<>FOLD>> def ora_init(ora):#<', ora, '<------' try: db = cx_Oracle.connect(remote_ora[ora]) db.autocommit = True #print 'Connect to oracle server successfully ...' except: if ora in remote_rac.keys(): #print 'Time out, now try to connect the rac ...' try: db = cx_Oracle.connect(remote_rac[ora]) db.autocommit = True #print 'Connect to oracle server successfully ...' except: #print 'Error, Failed to connect oracle', ora return else: #print 'Error, Failed to connect oracle', ora return else: #print 'Error, Wrong oracle', ora return return db #>>FOLD>> def operate_partitions(ora):#<>FOLD>> def main():#<>FOLD>> if __name__ == '__main__': if 2 < len(sys.argv) and sys.argv[2].isdigit(): main() else: print 'Usage: %s {add|drop} 2016 [pc1, pc2 ...]'%sys.argv[0]