Home » SQL & PL/SQL » SQL & PL/SQL » RUNSTATS Package Error (10.2.0.1.0, WIN XP)
RUNSTATS Package Error [message #328508] Fri, 20 June 2008 06:35 Go to next message
durgadas.menon
Messages: 365
Registered: December 2007
Location: Nowhere
Senior Member
Hi,

I am trying to use runstats_pkg but the compiler does not recognize it, Can anyone tell me why?

begin

  runstats_pkg.rs_start; 
  for i in 1..10000

  loop
   /*Method1 - procedure with bind variable which inserts data into table T*/
     method1('row '||I);
  end loop;

  runstats_pkg.rs_middle; 

  for i in 1..10000
   /*Method2 - procedure without bind variable which inserts data into table T*/
  loop
     method2('row '||I);
  end loop;

  runstats_pkg.rs_stop; 

end;

Quote:
SQL> @d:\test.sql
21 /
runstats_pkg.rs_start;
*
ERROR at line 3:
ORA-06550: line 3, column 3:
PLS-00201: identifier 'RUNSTATS_PKG.RS_START' must be declared
ORA-06550: line 3, column 3:
PL/SQL: Statement ignored
ORA-06550: line 10, column 3:
PLS-00201: identifier 'RUNSTATS_PKG.RS_MIDDLE' must be declared
ORA-06550: line 10, column 3:
PL/SQL: Statement ignored
ORA-06550: line 18, column 3:
PLS-00201: identifier 'RUNSTATS_PKG.RS_STOP' must be declared
ORA-06550: line 18, column 3:
PL/SQL: Statement ignored

[Updated on: Fri, 20 June 2008 06:38] by Moderator

Report message to a moderator

Re: RUNSTATS Package Error [message #328511 is a reply to message #328508] Fri, 20 June 2008 06:38 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It is not a standard package, it is T. Kyte's one, so go to AskTom.

Regards
Michel
Re: RUNSTATS Package Error [message #328515 is a reply to message #328511] Fri, 20 June 2008 06:41 Go to previous messageGo to next message
durgadas.menon
Messages: 365
Registered: December 2007
Location: Nowhere
Senior Member
You are write..it is from T.Kyte's book..
Re: RUNSTATS Package Error [message #328622 is a reply to message #328515] Fri, 20 June 2008 18:24 Go to previous messageGo to next message
Barbara Boehmer
Messages: 8635
Registered: November 2002
Location: California, USA
Senior Member
You can copy it from here:

http://asktom.oracle.com/tkyte/runstats.html
Re: RUNSTATS Package Error [message #328649 is a reply to message #328622] Sat, 21 June 2008 02:47 Go to previous messageGo to next message
durgadas.menon
Messages: 365
Registered: December 2007
Location: Nowhere
Senior Member
Thanks a lot Barbara..
Re: RUNSTATS Package Error [message #328653 is a reply to message #328622] Sat, 21 June 2008 03:05 Go to previous messageGo to next message
durgadas.menon
Messages: 365
Registered: December 2007
Location: Nowhere
Senior Member
Hi,

While executing the code I am getting 'insufficient privilege' error. The user has DBA role.

SQL> @d:\test.sql
      from v$statname a, v$mystat b
                         *
ERROR at line 3:
ORA-01031: insufficient privileges



Package created.


Warning: Package Body created with compilation errors.

SQL> desc v$statname


Can you tell me why?
Re: RUNSTATS Package Error [message #328654 is a reply to message #328653] Sat, 21 June 2008 03:13 Go to previous messageGo to next message
durgadas.menon
Messages: 365
Registered: December 2007
Location: Nowhere
Senior Member
sorry...I was supposed to grant the select on the following exclusively..

SYS.V_$STATNAME
SYS.V_$MYSTAT
SYS.V_$TIMER
SYS.V_$LATCH

but now the error has changed..

SQL> @d:\test.sql

View created.


Package created.


Warning: Package Body created with compilation errors.

SQL> show error
Errors for PACKAGE BODY RUNSTATS_PKG:

LINE/COL ERROR
-------- -----------------------------------------------------------------
11/5     PL/SQL: SQL Statement ignored
11/17    PL/SQL: ORA-00942: table or view does not exist
13/5     PL/SQL: SQL Statement ignored
13/17    PL/SQL: ORA-00942: table or view does not exist
24/5     PL/SQL: SQL Statement ignored
24/17    PL/SQL: ORA-00942: table or view does not exist
44/5     PL/SQL: SQL Statement ignored
44/17    PL/SQL: ORA-00942: table or view does not exist
52/5     PL/SQL: SQL Statement ignored
56/40    PL/SQL: ORA-00942: table or view does not exist
67/9     PL/SQL: Statement ignored

LINE/COL ERROR
-------- -----------------------------------------------------------------
67/31    PLS-00364: loop index variable 'X' use is invalid
78/5     PL/SQL: SQL Statement ignored
84/49    PL/SQL: ORA-00942: table or view does not exist
93/9     PL/SQL: Statement ignored
93/31    PLS-00364: loop index variable 'X' use is invalid
SQL> desc v$timer
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
Re: RUNSTATS Package Error [message #328656 is a reply to message #328654] Sat, 21 June 2008 04:08 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Did you grant select to the user or a role?
It must directly grant to the user.

Also we don't have your line numbers.

Regards
Michel
Re: RUNSTATS Package Error [message #328696 is a reply to message #328654] Sat, 21 June 2008 12:02 Go to previous messageGo to next message
Barbara Boehmer
Messages: 8635
Registered: November 2002
Location: California, USA
Senior Member
Did you create the run_stats global temporary table before trying to create the package body?

create global temporary table run_stats
( runid varchar2(15),
  name varchar2(80),
  value int )
on commit preserve rows;


Re: RUNSTATS Package Error [message #328698 is a reply to message #328696] Sat, 21 June 2008 12:26 Go to previous message
durgadas.menon
Messages: 365
Registered: December 2007
Location: Nowhere
Senior Member
Oops..yes I did miss that out.

Thanks
Previous Topic: How to get second maximum record
Next Topic: String Literal Required
Goto Forum:
  


Current Time: Fri Dec 09 01:48:24 CST 2016

Total time taken to generate the page: 0.11478 seconds