Job to import system statistics - errors
Job to import system statistics - errors 2006-06-13 - By Fuad Arshad
grant your id execute priviliege directly to dbms_stats and it should work. had the same issue -- -- Original Message ---- From: "Smith, Steven K - MSHA" <Smith.Steven@(protected)> To: oracle-l <oracle-l@(protected)> Sent: Tuesday, June 13, 2006 1:29:54 PM Subject: Job to import system statistics - errors I'm stuck. Pulling my hair out. I have collected system statistics for day, night and weekend processing. I can interactively import system statistics with no problems: SQL->execute DBMS_STATS.IMPORT_SYSTEM_STATS(stattab => 'SYSTEM_STAT_TABLE', statid => 'DAYTIME', statown => 'SYSTEM'); PL/SQL procedure successfully completed. When I put that in an oracle job, It errors and the trace file is: ORA-12012 (See ORA-12012.ora-code.com ): error on auto execute of job 2219ORA-20000 (See ORA-20000.ora-code.com ): Unable to import system statistics stats from user stat table SYSTEM. SYSTEM_STAT_TABLE: does not exist or insufficient privilegesORA-06512 (See ORA-06512.ora-code.com ): at "SYS.DBMS_STATS", line 5575ORA-06512 (See ORA-06512.ora-code.com ): at line 1 *** 2006-06-13 09:55:33.659ORA-12012 (See ORA-12012.ora-code.com ): error on auto execute of job 2219ORA-20000 (See ORA-20000.ora-code.com ): Unable to import system statistics stats from user stat table SYSTEM. SYSTEM_STAT_TABLE: does not exist or insufficient privilegesORA-06512 (See ORA-06512.ora-code.com ): at "SYS.DBMS_STATS", line 5575ORA-06512 (See ORA-06512.ora-code.com ): at line 1 I have given myself explicit privileges to the system.system_stat_table: 1 select grantee, owner, table_name, privilege 2 from dba_tab_privs 3* where table_name = 'SYSTEM_STAT_TABLE' GRANTEE OWNER TABLE_NAME PRIVILEGE -- ---- ---- ---- ---- ---- -- -- ---- ---- -- -- ---- ---- ---- ---- -- -- --- -- ---- ------ SSMITH SYSTEM SYSTEM_STAT_TABLE ALTER SSMITH SYSTEM SYSTEM_STAT_TABLE DELETE SSMITH SYSTEM SYSTEM_STAT_TABLE INDEX SSMITH SYSTEM SYSTEM_STAT_TABLE INSERT SSMITH SYSTEM SYSTEM_STAT_TABLE SELECT SSMITH SYSTEM SYSTEM_STAT_TABLE UPDATE SSMITH SYSTEM SYSTEM_STAT_TABLE REFERENCES II also have granted ssmith GATHER_SYSTEM_STATISTICS role. Any ideas? Steve <html><head><style type="text/css"><!-- DIV {margin:0px} --></style></head> <body><div style="font-family:times new roman, new york, times, serif;font-size :12pt"><DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> <DIV>grant your id execute priviliege directly to dbms_stats and it should work.</DIV> <DIV>had the same issue <BR><BR>-- -- Original Message ----<BR>From: "Smith, Steven K - MSHA" <Smith.Steven@(protected)><BR>To: oracle-l <oracle-l @(protected)><BR>Sent: Tuesday, June 13, 2006 1:29:54 PM<BR>Subject: Job to import system statistics - errors<BR><BR></DIV> <DIV><SPAN class=789061918-13062006><FONT face=Arial color=#0000ff size=2>I'm stuck. Pulling my hair out.</FONT></SPAN></DIV> <DIV><SPAN class=789061918-13062006><FONT face=Arial color=#0000ff size=2>< /FONT></SPAN> </DIV> <DIV><SPAN class=789061918-13062006><FONT face=Arial color=#0000ff size=2>I have collected system statistics for day, night and weekend processing. < /FONT></SPAN></DIV> <DIV><SPAN class=789061918-13062006><FONT face=Arial color=#0000ff size=2>< /FONT></SPAN> </DIV> <DIV><SPAN class=789061918-13062006><FONT face=Arial color=#0000ff size=2>I can interactively import system statistics with no problems:</FONT></SPAN></DIV> <DIV><SPAN class=789061918-13062006><FONT face=Arial color=#0000ff size=2>< /FONT></SPAN> </DIV> <DIV><SPAN class=789061918-13062006><FONT face=Arial color=#0000ff size=2>SQL- >execute DBMS_STATS.IMPORT_SYSTEM_STATS(stattab => 'SYSTEM_STAT_TABLE', statid => 'DAYTIME', statown => 'SYSTEM');</FONT></SPAN></DIV> <DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV> <DIV><SPAN class=789061918-13062006><FONT face=Arial color=#0000ff size=2>PL /SQL procedure successfully completed.</FONT></SPAN></DIV> <DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV> <DIV><SPAN class=789061918-13062006><FONT face=Arial color=#0000ff size=2>When I put that in an oracle job, It errors and the trace file is:</FONT></SPAN>< /DIV> <DIV><SPAN class=789061918-13062006><FONT face=Arial color=#0000ff size=2>< /FONT></SPAN> </DIV> <DIV><SPAN class=789061918-13062006><FONT face=Arial color=#0000ff size=2>ORA -12012: error on auto execute of job 2219<BR>ORA-20000 (See ORA-20000.ora-code.com ): Unable to import system statistics stats from user stat table SYSTEM.<BR>SYSTEM_STAT_TABLE: does not exist or insufficient privileges<BR>ORA-06512 (See ORA-06512.ora-code.com ): at "SYS.DBMS_STATS", line 5575 <BR>ORA-06512 (See ORA-06512.ora-code.com ): at line 1<BR>*** 2006-06-13 09:55:33.659<BR>ORA-12012 (See ORA-12012.ora-code.com ): error on auto execute of job 2219<BR>ORA-20000 (See ORA-20000.ora-code.com ): Unable to import system statistics stats from user stat table SYSTEM.<BR>SYSTEM_STAT_TABLE: does not exist or insufficient privileges<BR>ORA-06512 (See ORA-06512.ora-code.com ): at "SYS.DBMS_STATS", line 5575<BR>ORA -06512: at line 1</FONT></SPAN></DIV> <DIV><SPAN class=789061918-13062006><FONT face=Arial color=#0000ff size=2>< /FONT></SPAN> </DIV> <DIV><SPAN class=789061918-13062006> </DIV> <DIV><SPAN class=789061918-13062006></SPAN><FONT face=Arial color=#0000ff size =2>I<SPAN class=789061918-13062006> have given myself explicit privileges to the system.system_stat_table:</SPAN></FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=789061918-13062006>< /SPAN></FONT> </DIV> <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=789061918-13062006>  ; 1 select grantee, owner, table_name, privilege<BR> 2 from dba_tab_privs<BR> 3* where table_name = 'SYSTEM_STAT_TABLE'</SPAN></FONT> </DIV> <DIV> </DIV> <DIV><FONT face=Arial><SPAN class=789061918-13062006><FONT face=Courier color= #0000ff size=2>GRANTEE OWNER TABLE _NAME PRIVILEGE<BR>-- ---- ---- ---- ---- ---- -- -- ---- ---- -- - -- ---- ---- ---- ------ -- ---- ---- ---- --<BR>SSMITH SYSTEM SYSTEM_STAT_TABLE ALTER<BR>SSMITH SYSTEM SYSTEM_STAT _TABLE DELETE<BR>SSMITH SYSTEM SYSTEM_STAT_TABLE INDEX<BR>SSMITH   ; SYSTEM SYSTEM_STAT_TABLE INSERT<BR>SSMITH SYSTEM SYSTEM_STAT _TABLE SELECT<BR>SSMITH SYSTEM SYSTEM_STAT_TABLE UPDATE<BR>SSMITH SYSTEM SYSTEM_STAT_TABLE REFERENCES<BR></FONT></SPAN></DIV> <DIV><SPAN class=789061918-13062006></SPAN><FONT color=#0000ff><FONT size=2>I <SPAN class=789061918-13062006>I also have </SPAN>g<SPAN class=789061918 -13062006>ranted ssmith GATHER_SYSTEM_STATISTICS role.</SPAN></FONT></FONT></DIV > <DIV><FONT color=#0000ff><FONT size=2><SPAN class=789061918-13062006></SPAN>< /FONT></FONT> </DIV> <DIV><FONT color=#0000ff><FONT size=2><SPAN class=789061918-13062006>Any ideas? </SPAN></FONT></FONT></DIV> <DIV><FONT color=#0000ff><FONT size=2><SPAN class=789061918-13062006></SPAN>< /FONT></FONT> </DIV> <DIV><FONT color=#0000ff><FONT size=2><SPAN class=789061918-13062006>Steve< /SPAN></FONT></FONT></FONT></SPAN></DIV></DIV></div></body></html>