def stat(self,in_time_id): tbls=self.get_tables() if not tbls: pass else: for tbl in tbls: tn=TableName(self.db_conn,self.prod_conn,tbl) if not tn.stat(in_time_id): logger.warning("SN.stat False from tn.stat()") if not tn.va_stat(in_time_id): logger.warning("SN.stat False from tn.va_stat()") funcs=self.get_functions() if not funcs: pass else: for fnc in funcs: fn=FunctionName(self.db_conn,self.prod_conn,fnc) if not fn.stat(in_time_id): logger.warning("SN.stat False from fn.stat()") return True
hc=HostCluster(hc_id[0]) hc.discover_cluster_params() hc.stat(lt.id) for dbs in hc.get_dependants(obs=True): db_conn_string=hc.return_conn_string(dbs['db_name']) dn=DatabaseName(dbs['id'],db_conn_string) dn.stat(lt.id) db_cursor=dn.get_prod_cursor() if db_cursor: for sn_id in dn.get_dependants(obs=True): sn=SchemaName(sn_id) sn.discover_tables(db_cursor) sn.discover_functions(db_cursor) for tbl_id in sn.get_tables(): tn=TableName(tbl_id) tn.stat(lt.id,db_cursor) tn.va_stat(lt.id,db_cursor) tn.discover_indexes(db_cursor) for ind_id in tn.get_dependants(): ind=IndexName(ind_id) ind.stat(lt.id,db_cursor) tn.discover_toast(db_cursor) toast_id=tn.get_toast_id() if toast_id: ttn=TableToastName(toast_id) ttn.stat(lt.id,db_cursor) ttn.discover_index(db_cursor) tin=IndexToastName(ttn.get_tindex_id()) tin.stat(lt.id,db_cursor) if hc.get_track_function(): for fnc_id in sn.get_functions():