Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2002
    Posts
    78

    Unanswered: Get the table & schema stats

    Hai

    How to get the statistics of the table and schema using dbms_stats package with examples

    I was getting the below error when executing the dbms_stats package

    ORA-2000 object does not exist

    Thanks in advance

  2. #2
    Join Date
    Oct 2002
    Location
    greenwich.ct.us
    Posts
    279

  3. #3
    Join Date
    Apr 2002
    Location
    California, USA
    Posts
    482

    Smile

    Here is an example for Windows, but you can adapt it to your OS easily:

    1. Create batch file - analyze_schema.bat

    REM analyze_schema.bat
    REM
    REM Execute SQL script for analyzing TIGER schema
    REM
    REM 03/11/02 - Trifon Anguelov - created


    set oracle_sid=db03

    sqlplus internal @d:\oracle\scripts\analyze_schema


    2. Create SQL file - analyze_schema.sql

    REM analyze_schema.sql
    REM
    REM Analyze all objects in TIGER schema
    REM
    REM 03/11/02 - Trifon Anguelov - created



    spool d:\oracle\scripts\analyze_schema.log
    exec dbms_stats.gather_schema_stats('TIGER', 35, FALSE, 'FOR ALL COLUMNS SIZE 1', 2, 'DEFAULT', FALSE);
    spool off

    exit


    3. Schedule the script with at


    You are getting


    ORA-2000 object does not exist
    because the user you are logged as doesn't have privileges to run this package and/or you have to specify your schema is this package in:

    SYS.DBMS_STATS......



    Hope that helps,

    clio_usa - OCP - DBA


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •