Session Hang Due To Foreign Key?

Jun 21, 2012

Version 10.2.0.4

CREATE TABLE T1 (I INT PRIMARY KEY);

CREATE TABLE T2 (I INT PRIMARY KEY, J INT);

ALTER TABLE T2 ADD CONSTRAINT T2_FK FOREIGN KEY (J) REFERENCES T1(I);Session 1

INSERT INTO T1 VALUES (1);Session 2

INSERT INTO T2 VALUES (1,1);Session 2 hangs. Why ?

View 9 Replies


ADVERTISEMENT

Server Administration :: Select A Table Cause Session Hang?

Aug 5, 2011

when i modify a column of table tb_hxl_user,just as flowing:

Alter Table TB_HXL_USER Modify CREATE_DATE Not Null

now i select the table TB_HXL_USER,just as flowing:

select * from TB_HXL_USER;

it is hang,and i found the wait event is library cache lock in v$session_waits,why?how can i avoid this.

View 8 Replies View Related

SQL & PL/SQL :: Primary And Foreign Key On Same Column And Foreign Key Index

Aug 25, 2010

Create table Car
(Car_cd VARCHAR2(5),
Car_Desc VARCHAR2(50)
);
alter table Car
add constraint Car_PK primary key (Car_CD);
INSERT INTO Car (Car_Cd, Car_Desc) VALUES ('CORLA','COROLLA');
Commit;
[code]....

The requirement necessitates a new table to map car to manufacturer. This mapping table may later be expanded to contain other attributes Engine, MPG, etc to hold details specific to a car.But this is in future.

Create Table Car_Mapping_Details
(Car_Cd VARCHAR2(5),
Manufacturer_Cd VARCHAR2(5));

--Primary Key Constraint
ALTER TABLE Car_Mapping_Details
ADD CONSTRAINT Car_Mapping_Details_pk PRIMARY KEY (Car_Cd );

--Not able to create this as Car_cd is already a PK in this table and therefore has Unique Index
ALTER TABLE Car_Mapping_Details ADD CONSTRAINT Car_Mapping_Details_fk1
FOREIGN KEY (Car_Cd)REFERENCES Car (Car_Cd);
[code]....

But in this case the Car_Mapping_Details.Car_cd is itself is a primary key and therefore has Unique index.Although I was able to create foreign key constraint on Car_mapping_details.car_cd column (which is also Primary Key), I was not able to create Foreign Key Index on this column. It gives me Quote:ORA-01408: such column list already indexed.In other words, not creating foreign index for foreign key column lead to table-level lock? Or will the Unique Index in that primary key column be sufficient to avoid table-level lock?

View 2 Replies View Related

Application Express :: Kill Current Session When Another Session With Same User Starts

Nov 19, 2012

I have an urgent requirement to kill an existing session if a new session starts for the same user. I have been reading lot of blogs and posts on the above topic, but could clearly tell me how to do it.

I thought of putting a process in 101 page when login button is pressed to catch this and kill the old session.

View 7 Replies View Related

Application Express :: (X) Process Taking 60% CPU In Two Session (30% Each Session)

Oct 23, 2012

We are using Apex 4.0/Oracle 10gR2/ Hp-Ux, We noticed that there is a process Running in Two Sessions that seems running since 3 Hours using 60% CPU,** 30% given below sql it executes in two Sessions!

declare function x return boolean is begin -- if instr(upper(:F4000_P4651_PLUG_SOURCE),'ORDER BY')>0 then
declare
l_position number := 0;
begin
loop
l_position := instr(upper(:F4000_P4651_PLUG_SOURCE),'ORDER BY ',l_position + 1) ;
exit when instr(upper(:F4000_P4651_PLUG_SOURCE),'ORDER BY ',l_position + 1) = 0 ;

[code]....

View 4 Replies View Related

Grant Select On V$session And Gv$session Directly?

Aug 28, 2013

Instead of giving permission directly to v$session and gv$session to a developer, Is there any other way to do the same?

View 3 Replies View Related

JDeveloper, Java & XML :: Programs (JRE) Hang On Startup?

Jun 23, 2011

I'm facing a problem with the starting of java programs on my Win XP system. The startup most often takes from 5 to 60min. Only in rare cases java programs start-up normally. I've these problems with Eclipse, Nitro and ProM which are all Java-based tools.

I have used STraceNT to find the cause of my problems but I couldn't figure it out. I've attached the STraceNT log file for the execution of ProM. The program runs until the last line in the log while starting without showing up anything. After 20min suddenly the programs shows up and works as it normally does. The last line in the log where the software hangs for this long time is a call to WaitForeSingleObject. Before that it seams to allocate memory. I could see similar patterns in the executions of the other java programs, but I still can't see where the problem lies. I also tried removing the JRE and install different versions.

View -1 Replies View Related

Performance Tuning :: NOWAIT Lock Requests Could Hang

Aug 29, 2013

May any one confirm that the below issue is not only to RAC but also on normal database enterprize edition 11.2.0.3 ? Bug 12865902 - NOWAIT lock requests could hang (like Parallel Queries may hang "enq: TS - contention") in RAC (Doc ID 12865902.8)

currently i am using for update nowait concurrently for 50 processes on similar table with similar query and getting performance issue.

SELECT txn_ID,status_FLAG
INTO txn_id,status_flag
FROM cp_txn_detail WHERE txn_ID = pi_txn_ID FOR UPDATE NOWAIT;

View 2 Replies View Related

Server Administration :: Recompile Package Lead To Hang

Sep 29, 2011

I recompile a package in a session,and found the session is hang, I know there are have others session run the package,how can i find what session run by the package?

View 2 Replies View Related

Backup & Recovery :: Database Hang Due To ArchiveLog Full

Jun 4, 2013

Just now my database is hang due to the archivelog full. I try to use RMAN to delete the expired one and free space but encounter the error:

RMAN>crosscheck archivelog all;
archive log filename=/geodata/oraclelog/archive_log/ORAGF45/archivelog/2013_06_04/o1_mf_1_1444_8tsxvwc2_.arc recid=1350 stamp=817182450
validation succeeded for archived log
archive log filename=/geodata/oraclelog/archive_log/ORAGF45/archivelog/2013_06_04/o1_mf_1_1445_8ttx2q6j_.arc recid=1351 stamp=817214416
[code].......

So I try to back it up first by using the below command:

RMAN> backup archivelog all;

Starting backup at 04-JUN-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
[code]......

I know that I have to extend the db_recovery_file_dest directory for "limit exceed" error but how can I safely delete the archivelog in order to bring up the database?

View 3 Replies View Related

Oracle 10g IMP - After Tables Are Loaded Procedure Appears To Hang?

Oct 14, 2011

I have an Oracle IMP that seems to complete, but there are two things that I don't understand:

1) The tables seem to load successfully in about 4 hours. After the tables are loaded, the IMP procedure appears to hang for10+ hours. I can query the tables at this time, so I'm not sure what it's doing. Is it maybe applying constraints?Is it normal for applying constraints to take 3-4X as long as importing the data?

2) I see a few of these messages in the alert log during the import.Thread 1 cannot allocate new log, sequence 2754 I don't see errors in the IMP log so are these messages informational or warnings, or will there be something wrong with my imported data?

View 1 Replies View Related

Backup & Recovery :: RMAN Command Hang Long Time?

Mar 20, 2012

We would take backup regulary by RMAN(catalog). Last two days we could not take backup. Backup start but after take backup some datafile then rman does not do anything.

View 4 Replies View Related

Server Administration :: Installed 10gr2 And Implemented 3GB - Database Hang?

Jan 26, 2010

My server RAM is 12GB. i installed 10gr2 and implemented /3GB also. Eventhough my database is giving problem.

View 20 Replies View Related

Server Administration :: Oracle Hang - Client Cannot Connect Database

Apr 29, 2012

all of the client cann't connect the db,and using sqlplus / as sysdba also cann't login there are many error of TNS-12535 and in the listener.log

alert.log:
Sun Apr 29 18:10:36 2012
opidcl aborting process unknown ospid (42992060) as a result of ORA-604
Sun Apr 29 18:10:54 2012
opidcl aborting process unknown ospid (26280196) as a result of ORA-604

[code]...

View 5 Replies View Related

Application Express :: When Email Sending Process Activated Pages Just Hang?

Aug 5, 2012

I have a system that has issues with sending some emails.

When the email sending process is activated the pages just hang.

Are there any logs or anything like that anywhere that i could look at to try and make sense of it.

View 1 Replies View Related

Application Express Listener :: Removal Of Cache Folder Causes Hang With GlassFish

Aug 7, 2012

We had several unexplained lock-ups of APEX in our environment in the last months. This all happened after we moved to GlassFish with the APEX Listener. The symptoms were always that all connections in the JDBC connection pool were in use and we had to restart the GlassFish server instance to free them up.

The culprit is the caching folder that the APEX Listener uses for file caching. We use this to cache image downloads from the database through a procedure, and the caching folder was set to /tmp/apex/cache. I believe this is the default setting. All went well, when the procedure was called the images were downloaded from the database and cached under /tmp/apex/cache. However, for some (as yet unexplained) reason, Linux sometimes removes this folder from the /tmp file system. This seems to happen from time to time after an unknown period of inactivity. We didn't reboot the server. After the folder is gone, the APEX Listener is unable to recreate it, keeps on creating new database connections until the maximum configured is reached, and we need to restart the GlassFish instance to free them up. This also recreates the caching folder.

Our environment: GlassFish 3.1.1+3.1.2, APEX Listener 1.1.3, Oracle Linux 6.2. I didn't try out the new APEX Listener 1.1.4 yet so I'm not sure if this has been fixed in the last version.(kind of reminds me of the problem where the APEX config file is by default placed under /tmp and also disappears from time to time)

View 2 Replies View Related

SQL & PL/SQL :: Add Automatic Value In Foreign Key?

Nov 7, 2011

if have table primary key in this table empno and another table foreign key is empno and when add in the primary key 5522 how can

5522 in the empno "foreign key" automatic

View 5 Replies View Related

SQL & PL/SQL :: Replacing A Foreign Key With Another

Jul 26, 2011

I have an already populated table that refers to a wrong foreign key in another table. I have table abc that has the column fk_id. this column currently refers to column x_id1 in the table abc while it should refer to column x_id2 in xyz. I am trying to replace the data but I guess I miss something in the logic or the right way of doing it:

following is my trial:

create table abc
(
pk_id number(4) primary key,
abc_name varchar2(10),
fk_id number(4)
);

create table xyz
(
x_id1 number(4),
x_id2 number(4),
x_name varchar2(10)
);

commit;
insert all
into abc values (10,'ab1',1)
into abc values (11,'ab2',2)
into abc values (12,'ab3',5)
into abc values (13,'ab4',7)
into abc values (14,'ab5',9)
into xyz values (1,1,'d1')
into xyz values (2,2,'d2')
into xyz values (5,3,'d3')
into xyz values (7,4,'d4')
into xyz values (9,5,'d5')
select * from dual;
commit;

--this following select returns 5 rows

select * from abc, xyz where abc.fk_id = xyz.x_id1;

-- the following update only updates 3 rows and sets the other 2
-- to null!

update abc set fk_id = (select x_id2 from xyz where xyz.x_id1 = abc.fk_id);
commit;

select * from abc;

View 3 Replies View Related

SQL & PL/SQL :: Not Finding The Foreign Key?

Dec 4, 2011

I'm not really sure why oracle is not finding my Foreing Key, I'm creating an easy set of table for a company and I'm declaring all Primary keys and foreing keys as necessary and this is my

CREATE TABLE Items
(ItemID NUMBER(5) NOT NULL,
Description VARCHAR2(30),
ListPrice NUMBER(9,2) NOT NULL,
QtyOnHand Number(5),
ReorderPoint NUMBER(3),
ReorderQty NUMBER(3),
OnBackOrder Number(3),
CONSTRAINT ItemsPK

[Code] ............

There's three sets of inserts the first two successfully inserts the data NO problem but when i try to insert the data on SupplierItems comes as:

ERROR at line 1:
ORA-02291: integrity constraint (jcarter.SUPPLIERITEMSFK2) violated - parent key not found

I looked on the forum and it appears this happens when someone is doing a Insert ALL but this is not my case..

View 2 Replies View Related

SQL & PL/SQL :: Foreign Key Constraint

Feb 3, 2012

I have a parent table called dept and one child table emp which is referenced on deptno and now both have data . Now i want to truncate the dept table and i have truncated emp table after it when i am trying to truncate dept table then oracle throws a error that is-

"ORA-02266: unique/primary keys in table referenced by enabled foreign keys" ,

but when i tried to delete some records 1 by 1 then these have delete but truncate is not still working. why? if i have 10 millon records.

View 4 Replies View Related

PL/SQL :: Foreign Key Index

Mar 13, 2013

You should almost always index foreign keys because they are frequently used in joins. In addition, if you intend to delete or update unique or primary keys on the parent table, you should index the foreign keys to improve the locking of child records.what I don't understand are, I should create index on foreign key column in parent table or child table or both ?

View 1 Replies View Related

Server Administration :: Server Hang Very Often / How To Check Reason For Hanging

Mar 14, 2012

We a running oracle9i database and forms 6i application.

We have 4 gb ram size and sized the sga for 700mb pga for 400mb for past 4 months there is no problem.

Now from last week we encounter the server hang, and we do restart. How to check reason for hanging.what are all the check list to carried out.

View 19 Replies View Related

SQL & PL/SQL :: Foreign Key View In Oracle

Sep 6, 2011

Is there any view in oracle which gives the foreign key mapping.

E.g.

Table DEPT has DEPTNO as PK.
Table Emp has DEPTNO as FK to DEPT.DEPTNO.

I can get the information for DEPT table from R_CONSTRAINT_NAME column of all_constraints table.My requirement is to get the the which column of Emp table refers to DEPT.DEPTNO column .

View 3 Replies View Related

SQL & PL/SQL :: Locking And Foreign Key Indexes

Sep 1, 2013

Say we have an employee(id_emp) table with a primary key on id_emp. We have also some history tables emp_stuff with columns say (id_emp, dat_event, some_stuff) with primary key id_emp, dat_event.

This means that we have a unique index on (id_emp,dat_event). We also have a foreign key id_emp that references employee(id_emp). When we update id_emp on employee, we still have a lock on emp_stuff. According to this (end of the page) :

Quote:So, in short, with releases prior to Oracle Database 11g Release 1, you will want an index on the foreign key of the child table if you do any of the following:

Update the parent table primary key
Delete from the parent table
Merge into the parent table

So is id_emp in emp_stuff considered as indexed (through the unique index of the primary key) or do we have to add an explicit index
like this CREATE INDEX emp_stuff ON emp_stuff(id_emp) to avoide child table locks?

View 33 Replies View Related

SQL & PL/SQL :: Foreign Key - Primary Key Relation

May 2, 2012

I am trying to establish PK-FK relationship between 2 tables. Table 1 has VACC_ID as a primary key. Table 2 has VACC_ID and SCH_ID as the primary keys. I am trying to add VACC_ID from Table 2 as a FK to Table 1. This is the code I used

ALTER TABLE Table_1
ADD CONSTRAINT FK_VACC_ID
FOREIGN KEY (VACC_ID)
REFERENCES Table_2(VACC_ID)

I also tried to add it without writing the query and editing the Table 1. By default, I am getting 2 columns(both VACC_ID) in the local column being referenced to the 2 primary keys(VACC_ID and SCH_ID) of table 2. I also uploaded the screeshot of the error, when I run the query.

View 4 Replies View Related

SQL & PL/SQL :: Fetch Information For A Foreign Key

Jul 13, 2010

the view from where we can fetch information for a foreign key viz. reference table, referenced columns etc.

View 3 Replies View Related

SQL & PL/SQL :: Why Are Foreign Key Not Deferral By Default

Apr 18, 2013

In my point of view, deferral FK (DFK) are stronger than non-deferral FK (NDFK). In other words, every NDFK can be moved to DFK. Is there a performance issue ?

View 2 Replies View Related

SQL & PL/SQL :: Interchange The Value Which Has Foreign Key Dependency

Mar 29, 2011

I need to interchange the value which has foreign key depednecy,

For ex: I have a table dept

deptno| dname|dseq|
10 | CS | 1
20 | SC | 2

and in emp table

eno | ename | deptno |
1 |Raj | 10 |
2 |Ram | 10 |
3 |Vip | 10 |
4 |Muk | 10 |
5 |Sn | 20 |
6 |Snj | 20 |
7 |Asj | 20 |

there is a forign key define :

ALTER TABLE emp ADD (
CONSTRAINT rop_fk
FOREIGN KEY (deptno)
REFERENCES dept (deptno));

Now I want to change the deptno from 10 to 20 and 20 to 10 in dept table . So the ouput will be like

deptno| dname|dseq|
20 | CS | 1
10 | SC | 2

when i am deleting that row I am getting error "ORA-02292: integrity constraint (ROP_FK) violated - child record found".IF i am trying to update i am getting unique key contractin failure.

(Even I cannot update the rest of the column values in dept table as it is also having foreign key dependency) i need to put a sql script in production so that it will interchange.

View 10 Replies View Related

PL/SQL :: How Many Foreign Key Can Be Created On Table

May 3, 2013

in a table how many foreign keys can we create.

View 10 Replies View Related

SQL & PL/SQL :: Defining Foreign Keys

Oct 7, 2010

In my sql developer I have created a table. Created primary keys. Using alter table I have also created the foreign key. Now I need to add one more foreign key to the same table. Do I have to drop the existing foreign key and then create the 2 new foreign keys using the alter table condition or can I retain the existing FK and just use alter table to add another FK.

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved