Procedure hangs while create or replace!
Dear All,
My Database is Oracle 11g RAC.
I did few changes in one of my procedure and wanted to re-create it using CREATE OR REPLACE procedure...
The statement hangs for a long time and the concurrency in OEM raises up to a very high level. I tried to find the blocking sessions but for some time there was no blocking session.
I also tried stopping the activities on the tables used in this procedure.
Kindly suggest me what should I do in this situation. I have also tried running the query directly from the server.
Regards, Imran
Hi,
check for any locks & kill it , execute on each instance or use gv$
alter session set nls_date_format='dd-mon-yy hh24:mi:ss';
select /*+ CHOOSE */ a.sid, a.serial#,vp.spid,a.last_call_et,a.logon_time,a.status,sw.event, a.username,a.osuser, a.status,
a.program,a.MACHINE, a.type ptype,b.owner, b.object, b.type
from v$session a, v$access b,v$session_wait sw, v$process vp
where a.sid=b.sid and b.sid=sw.sid and a.paddr=vp.addr
and b.type<>'NON-EXISTENT'
and (b.owner is not null) and (b.owner<>'SYSTEM') and (b.owner<>'SYS')
and upper(b.object) like '%&obj_name%'
ORDER BY 3;Thanks,
Ajay More
http://moreajays.blogspot.com
Similar Messages
-
Oracle Portal 11g installation hangs while creating domain
I have patched the oracle portal 11.1.1.2 to 11.1.1.6 in Window 7 and tried to configure the oracle portal but the installation hangs while creating domain.
Just realised Window 7 does not support Oracle Portal 11g.
Edited by: user12063924 on Jul 5, 2012 11:58 PMDear Oracle Oracle BI Software,
This software is a big puzle for end users and it is really wasting our time in try and error scenarios. admit it with us and don't hide behid curtains. Well did u follow the Guides in the Book ? Yes Yes i followed and it is still showing errors .. in the name of God inform the Development Department to manage the setup .. i configured everything fine and what is really funny that after it loads 100 % it discovers that it can't create domain. sorry i m not a master Guy, but before the installtion it should validate for us if everything is ok and can be lauched not to do 1 hour workshop and cover out at the end of the movie that there is an error.
Guy put this product in the shelf until next release
Thank You -
OMWB 1.4.1 hangs while creating Oracle Model
Hi,
I'm migrating Sybase11 to Oracle 8.1.7 using OMWB 1.4.1.I'm
able to create the Sybase model but the tool hangs while
creating the Oralce model while mapping check constraints.
What could be the possible reason??
Reply ASAP pls!
TIA
BharathHi,
Have you tried OMWB 2.0.2?
Regards
John -
System is getting hanged while creating Adobe Form Layout
Hello,
I have Adobe Lifecycle Designer and Adobe Document Service Installed on our server, i have created Adobe form interface in transaction SFP and then a new form created with this interface passing the parameter carrid.
While creating from layout, through library section I used Text function, as I drag and drop text in to the layout, system is getting hanged everytime with message 1.275 bytes transferred.
Gurus please help me to understand this error.
Thanks,
AvinashGet Adobe life cycle designer updated vesrion.
Also check your desktop/laptop if it has good RAM .
Adobe is quite fat application which depend upon ur sys prefomanc.
Hope this will help.
Thanks Dhiraj. -
IWeb hangs while creating page
I have been using iWeb for quite a while without major problems. However, lately the program hangs when creating pages. When I try to publish to MobileMe, iWeb starts creating the pages, the bar turns completely blue and then it just sits there indefinitely. I have to Force quit the program. Restarting the program or the computer do not solve the problem.
Any suggestions? Thanks for your help!It finally published. Perhaps a bad connection with the server
-
Acrobat hangs while creating merged PDF in acrobat 9.0
Hello, We are facing issue with Acrobat 9.0 while combining MS office docs with PDF ( option of Merge files into single pdf). Whenever we combine word or excel docs with pdf, Acrobat hangs. Acrobat has to be terminated to clear the session.
The option of combine files was working fine in our environment. ( combining office files into PDF )
Would appreciate any sort help with this issue.
Thank youI think this is related to this other problem: http://forums.adobe.com/thread/567165?tstart=-1 . This has appeared with current releases of Acrobat, Acrobat Pro and Acrobat Reader. Adobe seems unresponsive. We started seeing it this week in conjunction with Excelsius 4.5. I have both Acrobat Pro 9.3 and Acrobat Reader 8 on my PC. Pro blows up when I open the .pdf created by Excelsius, but Reader does fine.
-
Repository hangs while creating repository schema..
Hi All,
When i try to create the repository schema from console, the repository hangs and it is not creating schema too.
the repository comes to normal only when i restart the server.
Im using MDM 5.5 SP06 Patch 4
Please help to solve this issue.
Regards,
NimalHello,
Can you share your code on how yor get the repository schema?
below is the code,
GetRepositorySchemaCommand getRepositorySchemaCommand = new GetRepositorySchemaCommand(
connectionPool);
getRepositorySchemaCommand.setSession(repositorySessionId);
getRepositorySchemaCommand.execute();
repositorySchema = getRepositorySchemaCommand.getRepositorySchema();
In general i notcied there is some performance issue with this getRepositorySchema() method,try avoid using it as it consumed almost 2 sec.
Cheers
Sabarinathan -
Hang while creating target schema
Hi,
We are trying to create a target using the runtime assistant, but the process always hangs at 0% complete. A file called log.txt.0 is created in oracle\owb92\owb\rtasst and contains this at the end:
=======================
Thu Aug 12 11:42:42 BST 2004
oracle.wh.util.DebugUtility: [getDBAOCIorThinConnection]: Trying with oci
Thu Aug 12 11:42:42 BST 2004
oracle.wh.util.DebugUtility: [getDBAOCIorThinConnection]: Asst: using oci
Thu Aug 12 11:42:42 BST 2004
oracle.wh.util.DebugUtility: .....in parseSqlFile()
Thu Aug 12 11:42:42 BST 2004
oracle.wh.util.DebugUtility: the tbspace for data is APPL_DATA
Thu Aug 12 11:42:42 BST 2004
oracle.wh.util.DebugUtility: the tbspace for indexes is APPL_INX
Thu Aug 12 11:42:42 BST 2004
oracle.wh.util.DebugUtility: the tbspace for snapshot is USERS
Thu Aug 12 11:42:42 BST 2004
oracle.wh.util.DebugUtility: [processSQLDBAToken]: Script Name is ../../rtasst/xmltk_grant.sql
===========================
Can someone help ?
Thanks in advance.
Regards,
Biswa.More info on this: The file content is:
====================
begin
dbms_java.grant_permission(upper('%user'), 'java.io.FilePermission','<<ALL FILES>>', 'read');
dbms_java.grant_permission(upper('%user'), 'java.net.SocketPermission','*', 'connect');
dbms_java.grant_permission(upper('%user'), 'java.util.PropertyPermission','*', 'read,write');
end;
grant AQ_USER_ROLE to %user;
=========================
I substituted %user with the target user name and ran this from the SYSDBA user account in TOAD. This gets stuck on the very first line, so it seems there is a problem with executing dbms_java.grant_permission.
Can someone please help us with this ? Note that the target user is already created and there are quite a few non-OWB objects there already. Can this be a problem ?
Thanks in advance,
Biswa. -
Procedure hangs while bulk delete
Hi,
I have the following situation:
I'm trying to delete the records using oracle bulk delete feature using SAVE EXCEPTIONS clause so that I can count how many were actually deleted and how many were not due to referential integrity constraint. I tried this on one table which has ca. 40,000 child records... this means that 40,000 exceptios were recorded by the SAVE EXCEPTIONS clause. Could this be the reason for the procedure to go in hang state ?
Could someone please advise me on this as to what might be going wrong. I'm working Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - 64bit.
Thanks.
-PatzaAnything could be the reason why something is hanging given that you've provided very little detail. So lets start at the beginning.
1. What platform? CPU? Operating system? RAM?
2. How long have you let it run?
3. Have you checked the alert log?
4. Have you tried starting with a delete of 100 rows, then increased to 1000, 5000, 10000, etc? If not why not? Have you then tried incrementally adding the child records to force the exceptions? If not why not? Start with generating 1, then 10, then 100 exceptions. -
Ampersand substitution in create or replace procedure statement
Hi Guys,
I wonder why my ampersand substitution does not work in a create or replace stored procedure statement.
CREATE OR REPLACE PROCEDURE UPDATE_DIM_SALES AS
UNDEFINE DimSales;
UNDEFINE FactTable;
DEFINE DimSales = 'TESTTAB';
DEFINE FactTable = myfact;
BEGIN
Error(5,20): PLS-00103: Encountered the symbol "=" when expecting one of the following: := . ( @ % ; not null range default character
If I then assign the value with := I get the error "invalid table" later on for the INSERT statemnt:
CREATE OR REPLACE PROCEDURE UPDATE_DIM_SALES AS
UNDEFINE DimSales;
UNDEFINE FactTable;
DEFINE DimSales := 'x2';
DEFINE FactTable := 'x1';
BEGIN
INSERT INTO &DimSales (column1, column2,...)
Why does ampersand substitution not work within a stored procedure?Hi,
Thanks for the suggestion.
The IF---ELSE Logic I have to write is quite complex.
I dont think joins will not do the trick and limiting the collection size to smaller than 4000 seems not very practical. there
is no poin using a collection if I have to use X amout of them.
UNDEFINE DimSALES;
UNDEFINE FactTable;
DEFINE DimSALES = 'TESTTAB';
DEFINE FactTable = 'testfact';
--Collect all distinct SELLERNr into materialized views
CREATE MATERIALIZED VIEW v1 AS select distinct SELLERnr from &FactTable;
CREATE MATERIALIZED VIEW v2 AS select distinct SELLER_ID from &DimSALES;
DECLARE
v_SELLERNr VarChar(9);
CURSOR v1_cursor IS Select * from v1;
l_exists INTEGER;
BEGIN
OPEN v1_cursor;
LOOP
FETCH v1_cursor INTO v_SELLERNr;
EXIT WHEN v1_cursor%NOTFOUND;
SELECT COUNT(*) INTO l_exists FROM v2 WHERE SELLER_id =v_SELLERNr AND ROWNUM = 1;
IF l_exists <> 1 THEN
INSERT INTO &DimSALES (K_SALES,REG,BVL,DS, VS,RS,SELLER_ID,VK,VALID_FROM)
(SELECT SEQ_DIM_SALES.NEXTVAL ,REG, BVL,DS, VS,RS,SELLERNR,VK,sysdate from &FactTable where SELLERNR =v_SELLERNr);
commit;
ELSE
--Update old combination(s), invalidate (DATE)
UPDATE &DimSALES SET VALID_TO = SYSDATE -1 WHERE REG||BVL||DS||VS||RS||SELLERNR||VK IN(
--In case the SELLER and combinations exists and differs from what is in the dimension then invalidate old combinations and insert new ones
SELECT * FROM(
SELECT REG||BVL||DS||VS||RS||SELLERNR||VK WHERE SELLERNR = v_SELLERNr FROM &FactTable;
MINUS
SELECT REG||BVL||DS||VS||RS||SELLERNR||VK WHERE SELLERNR = v_SELLERNr FROM &DimSALES;)
commit;
--Insert new combination
INSERT INTO &DimSALES (K_SALES,REG,BVL,DS, VS,RS,SELLER_ID,VK,VALID_FROM)
(SELECT SEQ_DIM_SALES.NEXTVAL ,REG, BVL,DS, VS,RS,SELLERNR,VK,sysdate from &FactTable where SELLERNR =v_SELLERNr) subselect;
WHERE &DimSALES.SELLER_Id=v_SELLERNr AND subselect.REG||BVL||DS||VS||RS||SELLERNR||VK NOT IN &DimSALES.REG||BVL||DS||VS||RS||SELLERNR||VK
commit;
END IF;
END LOOP;
CLOSE v1_cursor;
END;
DROP MATERIALIZED VIEW v1;
DROP MATERIALIZED VIEW v2;
----------------- -
Error while creating a simple function, procedure or triger in Oracle8i Lite
Hi,
I have Oracle8i Lite release 4.0.
While creating a simple proceudre/function/trigger on the database, it's throwing the following error:
create or replace function test return number is
ERROR at line 1:
OCA-30021: error preparing/executing SQL statement
[POL-5228] syntax error
Here is my sample code.
create or replace function test return number is
begin
return 0;
end;
Tried to create the same function in the user SYSTEM too but got the same error message.
Thanks in advance for the soluton.
nullI just started with 8i Lite, but as far as I know 8i Lite does not support PL/SQL code.
So you have to write your triggers and stored procedures in Java.
Ciao -
Error while creating procedure and package
Hi,
I am getting an error while creating an procedure
create or replace procedure mke_test (mke_gender varchar2) is
begin
declare global temporary table mag_hotline_glob
INDIVIDUAL_ID NUMBER,
ONE_MONTH NUMBER,
THREE_MONTH NUMBER,
SIX_MONTH NUMBER,
TWELVE_MONTH NUMBER,
CHILDREN_PRES VARCHAR2(1 BYTE)
) with replace on commit preserve rows not logged;
begin
insert into mag_hotline_glob
select * from magazine_gender;
end;
end;
can anybody plz suggestIt's a total mess. You need to read the documentation first.
Create your table separately
CREATE global temporary table mag_hotline_glob(INDIVIDUAL_ID NUMBER,
ONE_MONTH NUMBER,
THREE_MONTH NUMBER,
SIX_MONTH NUMBER,
TWELVE_MONTH NUMBER,
CHILDREN_PRES VARCHAR2(1 BYTE)) with replace on commit preserve rows not logged;Then use the procedure (I don't know why, this INSERT statement you can fire yourself)
create or replace procedure mke_test(mke_gender varchar2) is
begin
insert into mag_hotline_glob
select * from magazine_gender;
end;If you want to create the GTT inside the procedure(should be avoided) then Use EXECUTE IMMEDIATE.
By the way, where are you using the IN parameter ? It' unnecessary. -
Compilation error while creating procedure
Hi,
I am getting compilation error while creating procedure
CREATE OR REPLACE My_CHANGEDATE IS
error_string VARCHAR2(400) := NULL;
BEGIN
Create table set_temp as select * from set;
CURSOR c1 is
SELECT a.SETNUM, b.CHANGEDATE from
set a, setsp_t2 b
where a.setnum = b.setnum
and trunc(a.changedate) < trunc(b.CHANGEDATE);
BEGIN
FOR rec IN c1 LOOP
UPDATE set SET changedate = rec.changedate
WHERE setnum = rec.setnum;
Insert into set_temp select * from set where setnum = rec.setnum;
END LOOP;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
error_string := 'My_CHANGEDATE - '||SUBSTR(SQLERRM,1,350);
DBMS_OUTPUT.PUT_LINE(error_string);
RAISE;
END My_CHANGEDATE;I have taken your code and cleaned it up to be more readable. Please see the comments in the code.
CREATE OR REPLACE My_CHANGEDATE
IS
error_string VARCHAR2(400) := NULL;
BEGIN
/* The only way to issue DDL in a procedure is to either user
* DBMS_SQL or EXECUTE IMMEDIATE. Creating objects is generally
* not needed or recommended in frequently run code.
Create table set_temp as select * from set;
/* The cursor declarations need to go in the declaration section of the
* procedure (between IS .. BEGIN).
CURSOR c1 is
SELECT a.SETNUM, b.CHANGEDATE from
set a, setsp_t2 b
where a.setnum = b.setnum
and trunc(a.changedate) < trunc(b.CHANGEDATE);
BEGIN /* Where is the END that goes with this begin? */
/* Single record processing is generally not recommended. It is considered a "slow-by-slow" method. */
FOR rec IN c1 LOOP
UPDATE set SET changedate = rec.changedate
WHERE setnum = rec.setnum;
Insert into set_temp select * from set where setnum = rec.setnum;
END LOOP;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
error_string := 'My_CHANGEDATE - '||SUBSTR(SQLERRM,1,350);
DBMS_OUTPUT.PUT_LINE(error_string);
RAISE;
END My_CHANGEDATE;My general recommendations are as follows:
1. Remove the CREATE TABLE from the procedure altogether.
2. Don't use reserved words for object names (e.g. SET)
3. Remove the record by record processing and consolidate it to a single UDPATE statement as follows (note untested):
UPDATE set s
SET changedate = (
SELECT CHANGEDATE
FROM SET A
, SETSO_T2 B
WHERE A.SETNUM = B.SETNUM
AND S.SETNUM = A.SETNUM
AND TRUNC(A.CHANGEDATE) < TRUNC(B.CHANGEDATE)
WHERE EXISTS(
SELECT NULL
FROM SET A
WHERE A.SETNUM = S.SETNUM
)HTH! -
Why thr r 2 options Is/As while creating procedure or function
why there are 2 options avialable IS/AS while creating procedure or function ?
Like
create or replace procedure test (p_nbr NUMBER) AS
create or replace procedure test (p_nbr NUMBER) IS
tried both the options observed same result..
Is thr any differnce between IS and AS ?SShubhangi wrote:
why there are 2 options avialable IS/AS while creating procedure or function ?
Like
create or replace procedure test (p_nbr NUMBER) AS
create or replace procedure test (p_nbr NUMBER) IS
tried both the options observed same result..
Is thr any differnce between IS and AS ?Technically... there is no difference.
In terms of the English language, it would depend what you're describing...
[ do some action ] AS follows...
[ this object ] IS defined like this...
So in programming language terms you could say that:
create or replace procedure test (p_nbr NUMBER) AS...reads more naturally than
create or replace procedure test (p_nbr NUMBER) IS...because it is an "action" of creating or replacing something.
whereas, for example, a procedure in a package...
procedure test (p_nbr NUMBER) IS...is more clear than
procedure test (p_nbr NUMBER) AS...because this is stating what the procedure IS, rather than an action of creating it. (the package itself would be "create package ... AS")
As far as Oracle is concerned though, it doesn't care, they are both interchangable. For me personally, I like to use the one that makes it clearly readable. -
Difference between use of IS and AS while creating a Package or Procedure
Hi,
Had an interview in one of the company.
They asked me this, "What is the difference between using IS and AS while creating Package or Stored Procedure ?".
I checked creating package with same IS and AS, but there is no issues.
Kindly clarify me on this.
Lots of thanks in advance.
Regards,
Shiva>
Had an interview in one of the company.
They asked me this, "What is the difference between using IS and AS while creating Package or Stored Procedure ?".
>
Quite frankly my first response to them would be: why do you even care?
That would be quickly followed by: do you have any meaningful questions you would like to ask? Perhaps something that might actually be relevant to what you do here?
I personally don't care if someone has memorized the syntax required to create DDL/DML. I care whether they know how and when to use it.
Check the docs for the syntax diagram and from at least 9i on it will be similar to this from 9i
http://docs.oracle.com/cd/B10501_01/appdev.920/a96624/08_subs.htm
>
A procedure is a subprogram that performs a specific action. You write procedures using the syntax:
[CREATE [OR REPLACE]]
PROCEDURE procedure_name[(parameter[, parameter]...)]
[AUTHID {DEFINER | CURRENT_USER}] {IS | AS}
[PRAGMA AUTONOMOUS_TRANSACTION;]
[local declarations]
BEGIN
executable statements
[EXCEPTION
exception handlers]
END [name];
>
Here is the link for 11g
http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/create_procedure.htm
Note that the syntax for some objects requires one or the other and will not accept both.
>
CURSOR x IS ...
TYPE x IS ...
SUBTYPE x IS ...
CREATE TABLE x AS subquery
SELECT x AS "y" FROM z AS "w"
WITH x AS (SELECT ...
Maybe you are looking for
-
IPod Touch not being recognised on newly-installed OSX Leopard (10.5.4)
I have an iPod Touch (software version 2.0.2) which is not being recognised in OSX Leopard (version 10.5.4) which I just loaded onto the Powerbook G4. It was recognised under OSX 10.4, although the iPod Touch didn't launch iTunes when it was connecte
-
Google earth crashing[SOLVED]
The current AUR PKGBUILD doesn't run on this system. I have an ati x200m using opensource drivers (radeon). I installed an older package 5.0.xx and I get less errors but it still crashes. I am guessing this is a video issue, but whatever it is I c
-
Report output to spool...
i am running a report in background and the report is having some write statements which automatically comes into the spool. now the question is when this write statements come into the spool as a output, the page display is not coming as it usually
-
Can't Import in anything else then m4a 128 kbps
Obviously, this quality ***** and I can't seem to find the place to set it to import my music in higher quality. Before I know I went to Preferences, then Advanced, then Import, but now it seems that when I go to advanced the option isn't there anymo
-
Hi all ------here is my code ApplicationModule def=Configuration.createRootApplicationModule("model.AppModule", "AppModuleLocal"); MaitreViewImpl vo=(MaitreViewImpl)def.findViewObject("MaitreView1"); MaitreViewRowImpl row=(MaitreViewRowImpl)vo.getCur