script by last analyzed database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • heyeveto
    New Member
    • Feb 2008
    • 1

    script by last analyzed database

    Hi;

    Give me a script that can tell me when was the last time you ran statistics level scheme
  • amitpatel66
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    Originally posted by heyeveto
    Hi;

    Give me a script that can tell me when was the last time you ran statistics level scheme
    Could you please be more specific to what you are looking at?

    Comment

    • subashsavji
      New Member
      • Jan 2008
      • 93

      #3
      Originally posted by heyeveto
      Hi;

      Give me a script that can tell me when was the last time you ran statistics level scheme
      MAY THIS WILL HELP YOU
      Code:
      exec dbms_stats.export_column_stats(USER, 'servers', 'srvr_id', NULL, 'STAT_TAB');
      //
      
      exec dbms_stats.export_database_prefs('STAT_TAB', statown=> USER);
      //
      
      exec dbms_stats.export_database_stats;
      //
      
      exec dbms_stats.flush_database_monitoring_info;
      //
      BEGIN
       DBMS_DDL.ANALYZE_OBJECT('TABLE','SYS','X','COMPUTE');
       END;
       /
      
      SELECT * FROM USER_TABLES WHERE TABLE_NAME='X';
      //
      Last edited by amitpatel66; Feb 14 '08, 12:24 PM. Reason: code tags

      Comment

      Working...