Example #1
0
	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():
			func=FunctionName(fnc_id)
			func.stat(lt.id,db_cursor)
	if not db_cursor.closed:
	    db_cursor.close()

work_cursor.close()
database.db_conn.close()