Home » Infrastructure » Windows » Help in procedure (Oracle database,11.2.0.4, Windows OS)
Help in procedure [message #682788] Fri, 20 November 2020 01:39 Go to next message
charan379
Messages: 1
Registered: November 2020
Junior Member
We are trying to schedule hanganalyze automatically if number of sessions are greater than 300 as it is too difficult to monitor database continuously and this issue happens only for a couple of minutes.
Following is the procedure which we have written and it failed to execute. Can someone help on this to include session count and run this proc only when session count is greater than 300.

create or replace procedure sys.hanganalyze is
str1 varchar(300);
str2 varchar(300);
str3 varchar(300);
begin
str1:='oradebug setmypid';
execute immediate str1;
str2:='oradebug unlimit';
execute immediate str2;
str3:='oradebug hanganalyze 3';
execute immediate str3;
end;
/

Thanks
Re: Help in procedure [message #682789 is a reply to message #682788] Fri, 20 November 2020 02:34 Go to previous message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator

Technically speaking, oradebug is a SQL*Plus command NOT a SQL (or PL/SQL) statement:
SQL> exec execute immediate 'oradebug setmypid';
BEGIN execute immediate 'oradebug setmypid'; END;

*
ERROR at line 1:
ORA-00900: invalid SQL statement
ORA-06512: at line 1
You have to do this at OS level.

Now I doubt this will be useful for your actual problem.

[Updated on: Fri, 20 November 2020 03:27]

Report message to a moderator

Previous Topic: temporary table
Next Topic: Oracle VSS Services
Goto Forum:
  


Current Time: Thu Nov 21 09:52:25 CST 2024