Creating a dynamic Query for dbms_stats.unlock_table_stats
Hi Team,
I am running the queries below successfully for some tables, but since I have about 5,000 tables that I need to run the same queries against, I'd like to put the SQL statements below into a dynamic query to check for all [ stattype_locked ] (see query-1 below), if so, run the (query-2 below). If I can combine both queries and run it, that would be great, but if I can do first query and then modify it, that would be fine too.. Any input would be helpful..
query-1
SQL> select owner, table_name, stattype_locked from dba_tab_statistics where stattype_locked is not null ;