How can I maintian historical details from many table’s information schema and account info?

I need to be able to extract the schema and account information for historical purposes for minimum of 10 years planning. This is what I am using for selecting the query history, I would like to make a task to save it to a table. Create TABLE TEMP_history(Query_id varchar, query_text varchar, database_name varchar, schema_name varchar, […]