Unix Technical Forum

problem running export_schema_stats on different schema

This is a discussion on problem running export_schema_stats on different schema within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Hi, Question: What privileges do I need to run DBMS_STATS.EXPORT_SCHEMA_STATS routine? I need to export the stats for a ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-07-2008, 10:50 PM
M
 
Posts: n/a
Default problem running export_schema_stats on different schema

Hi,

Question: What privileges do I need to run
DBMS_STATS.EXPORT_SCHEMA_STATS routine?

I need to export the stats for a schema that is not mine. If I run it
using the schema owner POWNER (see below) it works, but
DBMS_STATS.EXPORT_SCHEMA_STATS will not allow the export of stats when
running it as myself (MK see below).

Database is Oracle 8.1.7 running on AIX.

I'm not a dba, just a developer using a script we wrote to export
database snapshots for testing our changes. I've spoken to 2 DBA's
about this and tried a host of things that didn't work (eg. GRANT
ANALYZE ANY TO MK and so on), please think about the problem before
posting a suggestion as it does not seem as easy as it sounds to
solve. Creating the stats table in my schema works fine, but always
get the following error when the DBMS_STATS.EXPORT_SCHEMA_STATS
routine is executed...

BEGIN
*
ERROR at line 1:
ORA-20000: Schema POWNER does not exist or insufficient privileges to
analyze
an object within it
ORA-06512: at "SYS.DBMS_STATS", line 3028
ORA-06512: at "SYS.DBMS_STATS", line 3050
ORA-06512: at "SYS.DBMS_STATS", line 3326
ORA-06512: at line 2

Here is a code sample...

-- this code works fine
BEGIN
DBMS_STATS.CREATE_STAT_TABLE ('MK',
'FULL_PROD_STATS',
NULL);
END;

-- Problem occurs here...
BEGIN
SYS.DBMS_STATS.EXPORT_SCHEMA_STATS ('POWNER',
'MK.FULL_PROD_STATS');
END;

Any help would be much appreciated.

Regards,

M
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-07-2008, 10:50 PM
M
 
Posts: n/a
Default Re: problem running export_schema_stats on different schema

Ok, here is the solution...thanks to me for my help...

BEGIN
SYS.DBMS_STATS.EXPORT_SCHEMA_STATS ('POWNER',
'FULL_PROD_STATS'
NULL,
USER);
END;

> -- Problem occurs here...
> BEGIN
> SYS.DBMS_STATS.EXPORT_SCHEMA_STATS ('POWNER',
> 'MK.FULL_PROD_STATS');
> END;

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-07-2008, 10:50 PM
M
 
Posts: n/a
Default Re: problem running export_schema_stats on different schema

Ok, here is the solution...thanks to me for my help...

BEGIN
SYS.DBMS_STATS.EXPORT_SCHEMA_STATS ('POWNER',
'FULL_PROD_STATS',
NULL,
USER);
END;

> -- Problem occurs here...
> BEGIN
> SYS.DBMS_STATS.EXPORT_SCHEMA_STATS ('POWNER',
> 'MK.FULL_PROD_STATS');
> END;

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:58 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com