Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Locked Gather Stats Jobs

Status
Not open for further replies.

tekpr00

IS-IT--Management
Jan 22, 2008
186
CA
Hello,

I am trying to select all non-system tables with locked status in the gather statistics job. This is oracle 11g database.

select table_name, OBJECT_TYPE, stattype_locked from user_tab_statistics where table_name != '%sys%'

no rows selected

Thanks for your help with the above query.
 
You can't select "all non-system tables" by querying user_tab_statistics. User_tab_statistics contains information about tables in your own schema only. That's no doubt why your query is returning no rows. If you really want to find stattype_lock for all non-system tables, you will have to query dba_tab_statistics instead. Also, your where clause "where table_name != '%sys%'" is not the right way to eliminate system tables. Instead you should try a query similar to the following:

Code:
select owner, table_name, object_type, stattype_locked from dba_tab_statistics
  where owner <> 'SYS';

You might also want to limit your query to only those tables with non null values of stattype_locked. Otherwise your query will probably return many thousands of rows.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top