Sunteți pe pagina 1din 5

STACK_DEPTH EVENT_KIND EVENT_UNIT ----------- ---------- ------------------------------3 51 DBMS_OUTPUT 3 51 DBMS_OUTPUT 3 51 DBMS_OUTPUT 3 51 DBMS_OUTPUT 3 51 DBMS_OUTPUT 3 51 DBMS_OUTPUT 3 51 DBMS_OUTPUT 3 51 DBMS_OUTPUT 3 51 DBMS_OUTPUT

2 51 Y 3 51 DBMS_OUTPUT STACK_DEPTH EVENT_KIND EVENT_UNIT ----------- ---------- ------------------------------3 51 DBMS_OUTPUT 3 51 DBMS_OUTPUT 2 51 Y 1 51 <anonymous> 44 1 43 <anonymous> 1 51 <anonymous> 1 51 <anonymous> 2 51 DBMS_TRACE 2 51 DBMS_TRACE 3 51 DBMS_TRACE STACK_DEPTH EVENT_KIND EVENT_UNIT ----------- ---------- ------------------------------3 51 DBMS_TRACE 4 51 DBMS_TRACE 4 51 DBMS_TRACE 5 51 DBMS_TRACE 4 51 DBMS_TRACE 3 51 DBMS_TRACE 3 51 DBMS_TRACE 4 51 DBMS_TRACE 39 75 rows selected. SQL> select address, hash_value SQL_TEXT, SHARABLE_MEM from v$sql 2 where sql_text like %SCOTT%; where sql_text like %SCOTT% * ERROR at line 2: ORA-00911: invalid character SQL> select address, hash_value SQL_TEXT, SHARABLE_MEM from v$sql 2 where sql_text like '%SCOTT%'; ADDRESS SQL_TEXT SHARABLE_MEM -------- ---------- -----------66B99A70 3034598329 42955 SQL> EXEC DBMS_SHARED_POOL.KEEP('Y'); BEGIN DBMS_SHARED_POOL.KEEP('Y'); END;

* ERROR at line 1: ORA-06550: line 1, column 7: PLS-00201: identifier 'DBMS_SHARED_POOL.KEEP' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored SQL> @'C:\oracle\rdbms\admin\dbmspool.sql' Package created. Grant succeeded. View created. Package body created. SQL> EXEC DBMS_SHARED_POOL.KEEP('Y'); PL/SQL procedure successfully completed. SQL> select name, namespace, sharable_mem, kept from 2 v$db_object_cache where name = 'Y'; NAME -------------------------------------------------------------------------------NAMESPACE SHARABLE_MEM KEP ---------------------------- ------------ --Y TABLE/PROCEDURE 11261 YES SQL> @'C:\oracle\rdbms\admin\profload.sql' Package created. Grant succeeded. Synonym created. Library created. Package body created. Testing for correct installation SYS.DBMS_PROFILER successfully loaded. PL/SQL procedure successfully completed. SQL> @'C:\oracle\rdbms\admin\proftab.sql' drop table plsql_profiler_data cascade constraints

* ERROR at line 1: ORA-00942: table or view does not exist drop table plsql_profiler_units cascade constraints * ERROR at line 1: ORA-00942: table or view does not exist drop table plsql_profiler_runs cascade constraints * ERROR at line 1: ORA-00942: table or view does not exist drop sequence plsql_profiler_runnumber * ERROR at line 1: ORA-02289: sequence does not exist

Table created. Comment created. Table created. Comment created. Table created. Comment created. Sequence created. SQL> create or replace procedure my_profile (p1 in varchar2, p2 in varchar2) 2 is 3 v1 number 4 begin 5 6 . SQL> ed Wrote file afiedt.buf 1 create or replace procedure my_profile (p1 in varchar2, p2 in varchar2) 2 is 3 v1 number; 4 begin 5 v1 := dbms_profiler.start_profiler(p1,p2); 6 dbms_output.put_line('result from start ' ||v1); 7 y;

8 9 10 11 12* end; SQL> /

v1 := dbms_profiler.flush_data; dbms_outpt.put_line('result from flush ' ||v1); v1 := dbms_profiler.stop profiler; dbms_output.put_line('result from stop ' ||v1);

Warning: Procedure created with compilation errors. SQL> show errors Errors for PROCEDURE MY_PROFILE: LINE/COL ERROR -------- ----------------------------------------------------------------10/39 PLS-00103: Encountered the symbol "PROFILER" when expecting one of the following: . ( * @ % & = - + ; < / > at in is mod not rem <an exponent (**)> <> or != or ~= >= <= <> and or like between || The symbol "." was substituted for "PROFILER" to continue. SQL> ed Wrote file afiedt.buf 1 2 3 4 5 6 7 8 9 10 11 12* SQL> create or replace procedure my_profile (p1 in varchar2, p2 in varchar2) is v1 number; begin v1 := dbms_profiler.start_profiler(p1,p2); dbms_output.put_line('result from start ' ||v1); y; v1 := dbms_profiler.flush_data; dbms_outpt.put_line('result from flush ' ||v1); v1 := dbms_profiler.stop_profiler; dbms_output.put_line('result from stop ' ||v1); end; /

Warning: Procedure created with compilation errors. SQL> show errors Errors for PROCEDURE MY_PROFILE: LINE/COL ERROR -------- ----------------------------------------------------------------9/14 PLS-00201: identifier 'DBMS_OUTPT.PUT_LINE' must be declared 9/14 PL/SQL: Statement ignored SQL> ed Wrote file afiedt.buf 1 create or replace procedure my_profile (p1 in varchar2, p2 in varchar2) 2 is 3 v1 number; 4 begin 5 v1 := dbms_profiler.start_profiler(p1,p2); 6 dbms_output.put_line('result from start ' ||v1); 7 y; 8 v1 := dbms_profiler.flush_data; 9 dbms_output.put_line('result from flush ' ||v1); 10 v1 := dbms_profiler.stop_profiler;

11 12* end; SQL> / Procedure created.

dbms_output.put_line('result from stop ' ||v1);

SQL> execute my_profile('benchmark :1','this is the first run'); PL/SQL procedure successfully completed. SQL> set serveroutput on SQL> execute my_profile('benchmark :1','this is the first run'); result from start 0 hi result from flush 0 result from stop 0 PL/SQL procedure successfully completed. SQL> select runid,run_owner,run_date,run_comment,run_comment1, 2 run_total_time from plsql_profiler_runs; RUNID RUN_OWNER RUN_DATE ---------- -------------------------------- --------RUN_COMMENT -------------------------------------------------------------------------------RUN_COMMENT1 -------------------------------------------------------------------------------RUN_TOTAL_TIME -------------1 SYS benchmark :1 this is the first run 162540107

05-FEB-07

RUNID RUN_OWNER RUN_DATE ---------- -------------------------------- --------RUN_COMMENT -------------------------------------------------------------------------------RUN_COMMENT1 -------------------------------------------------------------------------------RUN_TOTAL_TIME -------------2 SYS benchmark :1 this is the first run 288089027 SQL> ed Wrote file afiedt.buf 1 select runid,run_owner,run_date,run_comment,run_comment1, 2* run_total_time from plsql_profiler_runs SQL>

05-FEB-07

S-ar putea să vă placă și