Thursday, October 01, 2015

PLS-00201: identifier 'SYS.TT_STATS' must be declared in timesten 11.2.2.8.0

When using sql developer to create snapshot for timesten, following the demo http://www.oracle.com/webfolder/technetwork/tutorials/demos/db/timesten/tt1122/SQLDev/ttstats_viewlet_swf.html

An error was encountered performing the requested operation:

TT8503: ORA-06550: line 1, column 28:
PLS-00201: identifier 'TT_STATS' must be declared

Vendor code 8503



orarac1poc:DG:/u01/app/timesten/TimesTen/tt1122/quickstart/sample_code/jdbc> ttisql -version
TimesTen Release 11.2.2.8.0

orarac1poc:DG:/u01/app/timesten/TimesTen/tt1122> ttisql

Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.


Command> connect  "dsn=cachedb1_1122;uid=cacheadm;oraclepwd=xxxxxx";
Enter password for 'cacheadm':
Connection successful: DSN=cachedb1_1122;UID=cacheadm;DataStore=/u01/app/timesten/TimesTen/tt1122                        /info/DemoDataStore/cachedb1_1122;DatabaseCharacterSet=WE8MSWIN1252;ConnectionCharacterSet=US7ASC                        II;DRIVER=/u01/app/timesten/TimesTen/tt1122/lib/libtten.so;PermSize=40;TempSize=32;TypeMode=0;OracleNetServiceName=DG;
(Default setting AutoCommit=1)

-- Able to describe the procedure

Command> desc tt_stats;

Package SYS.TT_STATS:

  Procedure CAPTURE_SNAPSHOT:
    Arguments:
      CAPTURE_LEVEL                   IN     VARCHAR2 DEFAULTED
      DESCRIPTION                     IN     VARCHAR2 DEFAULTED

 ...



  Procedure SHOW_SNAPSHOTS:
    Arguments:
      RESULTSET                       OUT    PL/SQL TABLE SYS.TT_STATS.REPORT_TABLE
                                               VARCHAR2(32767)

Command> select * from dba_objects where object_name='TT_STATS';
< SYS, TT_STATS, , 316, , PACKAGE, 2015-09-21 15:08:22, 2015-09-21 15:08:22, 2015-09-21:15:08:22, VALID, N, N, N, 1, >
< SYS, TT_STATS, , 318, , PACKAGE BODY, 2015-09-21 15:08:22, 2015-09-21 15:08:22, 2015-09-21:15:08:22, VALID, N, N, N, 2, >
< PUBLIC, TT_STATS, , 317, , SYNONYM, 2015-09-21 15:08:22, 2015-09-21 15:08:22, 2015-09-21:15:08:22, VALID, N, N, N, 1, >
3 rows found.

Command> set serveroutput on;

Command> call sys.TT_STATS.SHOW_SNAPSHOTS;
 8503: ORA-06550: line 1, column 6:
PLS-00201: identifier 'SYS.TT_STATS' must be declared
 8503: ORA-06550: line 1, column 1:
PL/SQL: Statement ignored
The command failed.
Command> select * from dba_tab_privs where table_name='TT_STATS';
0 rows found.


The solution

Command> grant execute on tt_stats to cacheadm;

Command> select * from dba_tab_privs where table_name='TT_STATS';
< CACHEADM, SYS, TT_STATS, CACHEADM, EXECUTE, NO, NO >
1 row found.
Command> call sys.TT_STATS.SHOW_SNAPSHOTS;
ID     TimeStamp            Level     Description
-----  -------------------  --------  -----------
0 snapshots were found in current datastore
Command>

Verified in sql developer okay too.




No comments:

Post a Comment