SQL & PL/SQL :: Know If Procedure Is Running?
Jul 28, 2010
My problem is that i don't want to execute a procedure from my scheduler if the previous execute didn't finished. Is there a manage view or table that provide the procedure state?
View 15 Replies
ADVERTISEMENT
May 24, 2011
I have a package which has two procedures in it.
The second of which was put in just as a test:
PROCEDURE DST_RPT_INVOICE_REPRINT(refCur OUT Dsti_Rpt_Init_Pkg.RC, param_locationid VARCHAR2,
param_companycode VARCHAR2, param_frominvdate DATE, param_toinvdate DATE, param_project VARCHAR2,
param_invtype VARCHAR2, param_printed NUMBER) AS.....
Dsti_Rpt_Init_Pkg.PRINT_OUTPUT(strSql);
END DST_RPT_INVOICE_REPRINT
All this has within is an SQL statement which is built up (using the string, 'strSql') How can I view the output of a refCur to check what the final strSql is?
View 3 Replies
View Related
Oct 1, 2012
I have a procedure with following code which runs in infinite loop.
BEGIN
LOOP
line :='Test Message';
UTL_SMTP.write_data(l_mail_conn, line || Chr(13));
END LOOP;
EXCEPTION
WHEN OTHERS THEN
UTL_FILE.FCLOSE(NAMESFILE);
END;
I executed the procedure and disconnected from sql developer by killing the sql developer process from task manager. Reconnected and changed the code and when i tried to compile the procedure. It is not compiling, because the procedure is already running in infinite loop by some other session.
Is is possible to stop the running procedure without killing the session.What will happen if the procedure is not stopped which is running in infinite loop.When I queried the following found that the session is still ACTIVE and CPU used showing as '0' and executing the procedure.
select
SST.VALUE CPU, S.USERNAME, S.SID, s.status,S.SERIAL#, SQL_TEXT
FROM
V$SESSION S,
V$SQLTEXT_WITH_NEWLINES T,
V$SESSTAT SST
WHERE S.SQL_ID IS NOT NULL
[code]....
Can I do force drop or alter this procedure?
View 3 Replies
View Related
Oct 9, 2012
I have a stored procedure that is run from a command within our Clarity application.
The procedure involves some SQL Reads and SQL Inserts.
We have experienced users running the SP at the same time (slim chance to do this) and it creating duplicate entries.
if there is a clever way of preventing the same SP to be run concurrently?
Initially I was thinking of having the first step of the SP to interrogate a flag into a custom table - which the SP then sets to 1 if it is running, and 0 at the end.
Are there better more efficient/effective ways of doing this?
View 7 Replies
View Related
Aug 8, 2012
I have a requirement to create a packaged proc which lists down a set of database objects and its statuses whenever the status of objects is changed as valid/invalid in user_objects. Also, those valid objects need to be compiled while running the packaged proc.
View 5 Replies
View Related
Jun 4, 2012
I run procedure on toad 10.5, it gave me this error
Buffer overflow, limit of 20000 bytes
then it can not continue running the procedure.
View 8 Replies
View Related
Sep 20, 2013
how to write procedure to load the data into a table using xml as input parameter to a procedure and xml file is as shown below which is input to me.
xml version="1.0"?><DiseaseCodes><Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity></DiseaseCodes>.
View 3 Replies
View Related
Mar 6, 2010
I have created one procedure based on one table item master which has a field called item stock or non stock based on this i will fetch data from one of two tables .If its a stock item data will be retrieved from wip_main_acnt table and if its non stock it will pick from ns_main_acnt.my procedure is working fine but all i need is i just want to put an exception that if data is not found in one of the table based on the item selected.I am confused which one to be used whether no_data_found or notfound%.
CREATE OR REPLACE PROCEDURE dflt_pr_acnt (
l_item_code IN VARCHAR2,
l_main_acnt_code OUT VARCHAR2
)
[code]....
View 8 Replies
View Related
Sep 6, 2013
I have the following requirement.Say I have the following procedure created.create or replace procedure myproc (p1 varchar2, p2 varchar2) is begin
find_the_proc_name();
end;
In the above myproc, using find_the_proc_name() i should print the parent procedure name (or function) calling along with the parameters passed.
View 5 Replies
View Related
Jun 25, 2012
DB version:11g
can we create a procedure inside a procedure...if not is there any alternative??
in db2 it is allowed so do oracle support this????
View 5 Replies
View Related
Aug 10, 2007
I am trying to correct NMO NOT SETUID-ROOT (UNIX-ONLY) error. On production database (9..7). Googlng this error - it says to run root.sh as root. should this be run in /usr/local/bin. which is the default location.
I don't believe that there would be any problems - but would like some confirmation -to be safe.
View 5 Replies
View Related
Jun 6, 2012
I have installed an Express edition of Oracle 11 database on one host (Windows 7) and want to access to from another host (Backtrack Linux based on Debian) from SQL*PLUS Instant client.
While I managed to resolve multiple issues with shared libraries, I am still not able to run the sqlplus command as Oracle. I get the following errors:
oracle@evil:~/instantclient$ sqlplus
SP2-1503: Unable to initialize Oracle call interface
SP2-0152: ORACLE may not be functioning properly
I followed the installation manual by Oracle and also created Oracle user with 2 env. variables set to:
LD_LIBRARY_PATH=/opt/Oracle/instantclient/lib
ORACLE_HOME=/opt/Oracle
Note that I only installed SQPLUS client on Linux and there is no DB running. The version of sqlplus is 11.2.0.3.0
On different forums people advised to set other variables according to the DB installed but I have none. All I want is to run sqlplus with the IP address, SID, port and username. Is it feasible to have only SQL*PLUS client installed .
View 1 Replies
View Related
Apr 21, 2012
My example: I'm given an Allowance throughout the week. It happens to be 10 dollars but it can vary from day to day.I can create a running total with SUM(Amt) Over etc...This is the CUMUL column in the example below.
On certain days I've spent different percentages of the allowance. (The SPENT Column which is a field in the database)I can't manage to create the AMTLEFT column in the example below.The AmtLeft column seems to be a kind of running total that 'refers to itself' so this is where I'm stumped.
Week,Day,Amt,Cumul,Spent,AmtLeft
1,Mon,10,10,0%,10
1,Tue,10,20,50%,10
1,Wed,10,30,0%,20
1,Thu,10,40,0%,30
[code]...
My imaginary SQL would look something like at this point (if I have it right):
SELECT Week, Day, Amt, Sum(Amt) Over (Partition By Week, Order By Day) AS Cumul, Spent FROM AllowancesTable
How to get the last column AmtLeft?
View 14 Replies
View Related
Feb 26, 2009
From database server, I need to monitor the details about the sql statements which are being currenlt running in client machines.
I tried with V_$SQLTEXT view where I can only see the SQL statements, hash value,address,SQL_id. but I'm not able to get the user name,name the client machine .
find out these details?.Which Data Dictionary i need to use ?.
View 2 Replies
View Related
Mar 17, 2011
I have a job that runs two procedure parallely . The code is as follows:
DECLARE
jobno1 NUMBER;
jobno2 NUMBER;
flag NUMBER;
BEGIN
dbms_job.submit(jobno1,'pc;', next_date=>SYSDATE);
dbms_job.submit(jobno2, 'pc2;', next_date=>SYSDATE);
[code]....
And the stored procedure (in SQL File) is as follows:
procedure pc:
create or replace procedure pc
as
begin
for idx in 1..100 loop
dbms_output.put_line(idx);
end loop;
end;
/
procedure pc2:
create or replace procedure pc2
as
begin
for idx in 1..1000 loop
dbms_output.put_line(idx);
end loop;
end;
/
However, when I execute the job , I get the following output:
1
2
3
.
.
.
.
100
[code]....
Which indicates the job 1 got executed 1st and then job2. But this is not what I want.
View 4 Replies
View Related
Nov 12, 2012
I have a 11.2.0.3 database runing on AIX. The instance hangs and crashes due to memory usage issues. I checked the alert log of the database and this is what i see:
WARNING: Heavy swapping observed on system in last 5 mins.pct of memory swapped in [11.85%] pct of memory swapped out [3.45%]. make sure there is no memory pressure and the SGA and PGA are configured correctly. Look at DBRM trace file for more details.i also see the following in the alert.log:
Errors in file
/opt/oracle/diag/rdbms/iut3px1/iut3px1/trace/iut3px1_cjq0_55312404.trc:
ORA-00604: error occurred at recursive SQL level 2
ORA-04031: unable to allocate 3896 bytes of shared memory ("shared pool","select audit$,options from p...","sga heap(1,0)","kglsim object batch")
The file contents of iut3px1_cjq0_55312404.trc are:
====================
Process State Object
====================
----------------------------------------
SO: 0x70000007b97de70, type: 2, owner: 0x0, flag: INIT/-/-/0x00 if: 0x3 c: 0x3
proc=0x70000007b97de70, name=process, file=ksu.h LINE:12616 ID:, pg=0
[code]...
View 3 Replies
View Related
Mar 13, 2013
I want to calculate the running percentage. sample data is as below.
CREATE TABLE prod
(
code VARCHAR2(8),
name VARCHAR2(30),
stdate DATE,
itons NUMBER(7,3),
rtons NUMBER(7,3)
[code]....
Required Output is
CODE NAME STDATE ITONS RTONS %age
-------- ------------------------------ --------- ---------- ---------- -------
0-01-001 SEEDS 17-JUL-12 193.155 0
1-01-001 OIL 17-JUL-12 0 81.906 42.404
1-02-001 MEAL 17-JUL-12 0 104.304 54.000
1-03-001 DURT OIL 17-JUL-12 0 1.242 0.643
2-01-001 WASTE 17-JUL-12 0 5.703 2.953
[code]....
Percentage will be calculated as rtons of code not having first digit 0 devided by itons having having code 0 result multiply 100 for the same date code wise e.g. For dated 17-jul-13 meal percentage will be calculated as round((104.304/193.155)*100,3)=54.000
View 6 Replies
View Related
Apr 22, 2012
We have done cloning of our ORACLE APPLICATION(11i),after that performance of ERP is getting slow (like fetching of data). What we can do to increase the performance.
View 1 Replies
View Related
May 4, 2010
we are doing a performance tuning on a large database. Our main aim is to capture all the packages/procedures/view that are running on database. Below given is the format we have prepared
Eg:
SPIdSP_Name CPU TimeI/OLine Executed
1Emp_AllDetails221
1Emp_AllDetails582
1Emp_AllDetails25103
[code]...
Requirement:Write an Procedure that captures the above given information in the background of database and stores the information in a table.write the procedure to capture the above given information.
View 17 Replies
View Related
Jun 4, 2013
I have two queries that I need to run and compare the outputs against each other. Each query runs on a different host. I can run each query on a different pane (Window - I am using Toad for running query). What I am trying to do is:
- Run both queries on a single pane
- Compare the output where if a "study" matches on both query output, then display the result.
To being with, is it possible to run the queries on a single pane by defining SID string as a part of query syntax......?
SELECT study,
TO_CHAR (completed_date, 'mm/dd/yyyy') completed_date, status
FROM ...
SELECT study, name
FROM .....
View 15 Replies
View Related
Jul 24, 2011
i am trying to use Firefox to run 10g forms application. Firefox not detecting the initiator. Firefox each time says plugin missing and searching for it. giving option to download manually. each time i run the form in Firefox same thing. no plugin found and its downloading another copy from d10g folder.
View 2 Replies
View Related
Aug 30, 2011
I have set up two scheduled jobs in oracle 11g for executiong a procedure in specific time intervals. One as Hourly and other as minutely.But the scheduled jobs are not running as per schedule. i.e the minutely job is not running every minute. But If i see the run logs for some period it would have run every minute, and suddenly it will not execute and give a gap of 30 mins or 1 hour and then run again.
P.s. The job priority is set as 3. and except for these two jobs there are no other jobs set. But this is an important job which needs to be run every minute.
JOB_QUEUE_PROCESSES is set to 1000, which is max. And there are only 3 scheduled jobs in the whole DB.
BEGIN
SYS.DBMS_SCHEDULER.CREATE_JOB
(
job_name => 'LOGTBLPURGE'
[code]....
View 2 Replies
View Related
Jan 9, 2013
I have developed my PAYROLL application in forms 9i, which is successfully runnig at internet explorer version 6 but it is not running at internet explorer version 8 or later.
View 1 Replies
View Related
Apr 3, 2013
I am trying to find a way to identify what are the user_jobs currently running. I have found 1 way which requires DBA User ID to execute (e.g. DBA_JOBS and DBA_JOBS_RUNNING) which I don't want.
I believe there is NO equivalent User table for DBA_JOBS_RUNNING table.
I have done my 20 mins search in this forum and unable to find.
View 8 Replies
View Related
Nov 1, 2010
I have Oracle 11g R2 (11.2.0.1) with Oracle EM running on Solaris 10 with ZFS.When I start OEM it comes up and tells me that the listener is running but that the DB instance is down and agents are down.I know that the instance is up because I can start it manually.
Each time I start emctl, lsnrctl and DB manually everything starts running but OEM returns a failure for the DB. long as the display shows the DB not running OEM won't allow me to work in it.Instead of getting the login page I get the Database Control Page stating that "Enterprise Manager is not able to connect to the Database instance."I have tried the various emca -config dbcontrol db -repos drop and recreate but no luck.
Is there a way to uninstall/reinstall without dropping the DB?Are there control/configuration files I may hack to tell OEM the correct information?
View 3 Replies
View Related
Jul 29, 2010
i am facing group by issue when running the query.the error code is ORA-00979: not a GROUP BY expression.i suspect is due to the subquery in the SELECT clause.
SELECT
WHINR100.COMPANY,
WHINH210.SEQN,
FXINH039.OTBP,
WHINR100.BPID,
TCCOM100.NAMA,
WHINR100.ITEM,
WHINH210.RCNO,
FXINH051.btch,
case when (whinh210.ORNO in (select fxinh033.pdno from fxinh033))
[code]...
View 3 Replies
View Related
Feb 6, 2012
with the code below i have created 2 varaibles v_start_date and v_finish_date, i have inputs for them, thats fine the problem is when the inputs are empty, i have put a ELSIF statement in the begin section of the code, now if the variables have input from the textbox's then it works fine but if they are empty, the programme reads into the if statement executes that bit of code but doesn't seem to open the cursor up and execute that bit of code.
DECLARE
v_start_date enrollments.enrollment_date%TYPE:= :START_DATE;
v_finish_date enrollments.enrollment_date%TYPE := :FINISH_DATE;
CURSOR no_grades_cur IS
SELECT class_id,stu_id, status
FROM enrollments
[code].....
View 13 Replies
View Related
Sep 9, 2012
Is it possible to run Oracle 10g Report from PL/SQL code?
View 1 Replies
View Related
Feb 18, 2013
I am using oralce 10g database,because of performance hit in my database in want to generate AWR and STATSPACK reports.
I have already generated AWR report by running awrrpt.sql script.
I just wanted to know the steps to run STATSPACK reports.Will it create the same file as AWR does. Will i get much advantage after running STATSPACK reports than AWR.
View 8 Replies
View Related
Apr 29, 2013
how do I detect I/O before running sql statement?
View 3 Replies
View Related