Results 1 to 6 of 6

Thread: analyze table?

  1. #1
    Join Date
    Feb 2004
    Posts
    9

    Exclamation Unanswered: analyze table?

    Is there a way of executing

    analyze table UserSchema.MyTable estimate statistics;

    without having to include the schema name? e.g.

    analyze table MyTable estimate statistics;

    I have tried setting up public synonyms for MyTable but analyze table does not seem to check Public Synonyms for Table name...

    Thankx in advance..

    Sheldon

    ... this will most definitely put a smile on my dial!!!

    :-}

  2. #2
    Join Date
    Feb 2004
    Posts
    45

    Re: analyze table?

    Sheldon, it's early in the morning at My keyboard - I assume you want you analyze a table/index in your own schema. If you invoke analyze table tablename, what happens ?

    Originally posted by sdamons
    Is there a way of executing

    analyze table UserSchema.MyTable estimate statistics;

    without having to include the schema name? e.g.

    analyze table MyTable estimate statistics;

    I have tried setting up public synonyms for MyTable but analyze table does not seem to check Public Synonyms for Table name...

    Thankx in advance..

    Sheldon

    ... this will most definitely put a smile on my dial!!!

    :-}
    It was working just 5 minutes ago - I promise !

  3. #3
    Join Date
    Feb 2004
    Posts
    9

    Re: analyze table?

    Firstly,Thankx for the reply...
    I can execute the query without the schema name from my own schema ie
    analyze table MyTablename estimate statistics;

    If I log on as another user(not the owner of the schema), it does not work unless I include the owners schema name ahead of the table. Is it possible to execute the query same i.e. without specifying the table's schema name. I have set up a public synonym for that table but this synonym does not work for the analyze table query! Is there maybe a way of setting up permissions or some setting to make this query work?

    Originally posted by palmercabel
    Sheldon, it's early in the morning at My keyboard - I assume you want you analyze a table/index in your own schema. If you invoke analyze table tablename, what happens ?

  4. #4
    Join Date
    Jan 2004
    Location
    India
    Posts
    191

    Re: analyze table?

    Hi,

    From another user you run
    alter session set current_schema='schemaName'

    Hope this will work without prefixing the owner name

    Thanks,
    Pagnint
    (No need to search web before posting new question)

  5. #5
    Join Date
    Feb 2004
    Posts
    9

    Re: analyze table?

    Thankx you very, very much!!! It works perfectly!!! You wont believe how much work you have saved me!!

    Have a good day!!

    Sheldon


    Originally posted by paginit
    Hi,

    From another user you run
    alter session set current_schema='schemaName'

    Hope this will work without prefixing the owner name

    Thanks,

  6. #6
    Join Date
    Feb 2004
    Posts
    3
    Once you create a synonym, give a 'grant read access' to that synonym to the user/users you may want to login as. Then you do not have to give the alter schema statement.

    Vijaya

Posting Permissions

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