def dump_db_info(separate_files, out_f, stdout):
	"""saves information about database schema in file/files"""
	t0 = time.time()
	test = '--test' in sys.argv
	if test or separate_files:
		for dn in (TABLES_INFO_DIR, VIEWS_INFO_DIR, SEQUENCES_INFO_DIR, FUNCTIONS_INFO_DIR, PROCEDURES_INFO_DIR, PACKAGES_INFO_DIR):
			ensure_directory(dn)

		if not test:
			sorted_in_comment = '--sorted-info' in sys.argv
			rs = select_qry(TABLE_NAMES_SQL)
			if rs:
				for row in rs:
					table = row[0]
					save_table_definition(table, sorted_in_comment)
	else:
		show_tables()
	if not TABLES_ONLY and not test:
		show_additional_info(separate_files)
	t2 = time.time()
	td = t2 - t0
	output_line('\n\nexecution time: %d min %d sec' % (divmod(td, 60)))
	output_line('\n\n-- the end --')
	if out_f:
		out_f.close()
		sys.stdout = stdout
	if '--zip' in sys.argv:
		save_files_in_zip()
saves information about database schema in file/files
recipes/Python/576534_Dump_Oracle_db_schema_to_text/recipe-576534.py