SQL Language (MOSC)

MOSC Banner

Creating a dynamic Query for dbms_stats.unlock_table_stats

edited Jun 24, 2014 4:10PM in SQL Language (MOSC) 2 commentsAnswered ✓

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 ;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center