we know we can see lock mode held in session can be analysed using LM column in v$lock.But i confused in seeing LM column it all shows in numbers from 0 to 6.
Just noticed MR(media recovery lock ) in our database,further check showd all datafiles had this lock since our database was shutdown abortly but was startup gracefully.
I have a RAC environment with 3 nodes and application using Oracle Form Reports that access the database. Every day the application cause many locks on database when execute insert, update and delete. I don't understand why so much locks. Are there a way to avoid this? Always I have to eliminate session causing locks.
Our server got crash in server1 and we recovered the same DB to server2 using RMAN back up. But while running our scheduler for email alert we got the error message as ORA-01157: cannot identify/lock data file 201 - see DBWR trace file ORA-01110: data file 201: 'D:ORADATAKFDBTEMP01.DBF' Our temp file is already in E folder.
When i try to compile a package, im getting below error.
ERROR at line 1:ORA-04021: timeout occurred while waiting to lock object
i gave below query and found the sid of object.
select * from v$access where object='THINKING_PKG'
From v$session view,i found sid and serial# and at same time i queried dba_jobs and saw one jobs is running at this time.Now how to compile this object.
We are experiencing tx row lock wait time over hours. There is no blocking session and it seems that the application hangs. What is funny is that when we gather_stats on the tables, those tx row lock wait are being released.
I'm trying to get size of CLOB column but not getting any output.
SQL> desc TABLE_STEP_INST234 Name Null? Type ----------------------------------------- -------- ---------------------------- NUM_PENDING_PREREQS NOT NULL NUMBER(10) OBJID NOT NULL VARCHAR2(31) OUTFLOW_BITS NUMBER(19) PARAMS CLOB PARENT2PROC_INST NOT NULL VARCHAR2(31) ROOT2PROC_INST NOT NULL VARCHAR2(31) START_TIME DATE STATUS NOT NULL NUMBER(2) [code]...
DECLARE JOBSFILE UTL_FILE.FILE_TYPE; -- TAKE ALL JOB TITLES FROM JOBS CURSOR JOBSCUR IS SELECT * -- DDOCNAME,DDOCTITLE,DSECURITYGROUP,DDOCAUTHOR,DDOCTYPE,DINDATE,PRIMARYFILE,EXTRACTIONDATE,BATCH_ID FROM TARGET_UCM ; [code].......
this is my plsql here to print table values i am using many utl_file.put_line statements is there any way to print all table values in a single utl_file.put_line.
We are running a store procedure by calling it from shell script.The shell script is running in Server1 and the stored procedure is running in server2(which is the data base server.).
Functionality of the stored procedure:Generating a tab delimited file and place in a directory.
Requirement: The requirement is that the store should be modified in such a way that it should drop the output file to Server1 itself(The server from where it is getting called).
Attaching the store procedure for reference. mIn the store procedure,we have a variable "lv_file_dir" which currently refers to the directory location in Databse server(Server 2) We have to change this SP such that it drops the generated file in Server1 itself(From where the shell script is running).
Attached File(s) Procedure.txt ( 3.28K ) Number of downloads: 4
I have a server configured to German & English. when i connect with SQLPLUS, i have German language server output, but when i do "alter session set nls_language='AMERICAN'" - it solves the issue for me.
I need the same for expdp command, but I don't know how to do this. I have tried to add a parameter nls_language, but expdp doesn't recognize it. Is it possible to somehow see server output of the expdp & writing it to the log file in English?
Currently I have a requirement where I need to create 2 more output rows using each result row.
In my requirement I am populating charges table with types of charges, on each line item of charges, I need to apply 2 types of taxes and populate it along with the charge line item. I will be storing charges in table charges and the 2 taxes to be applied in taxes table respectively. For each row of charges, i need to apply these 2 taxes present in taxes table resulting in 3 rows output.
In my current project, I am handling an Oracle database with version 10.2.0.3. I analyzed the AWR report for the past month abd saw the following wait events consistently:
CPU time - 45.6% (% Total Call Time) db file sequential read - 30.6% (% Total Call Time) enq: TX - row lock contention - 18.8 % (% Total Call Time)
I have uploaded the report for your reference.What should be my approach to troubleshoot this?
Attached File(s)
awr_report.html ( 382.28K ) Number of downloads: 6
how one can lock a particular row in a table.for example i have a employee table in which 50 records. now i want to lock only 10 records of the employee table.
I have a transaction table with some custom properties and two status columns. There are 2 different applications(.Net and Pl/SQL Procedure) using the table. Both the process run parallel and fetch records one by one, perform some calculation and update the status column.
There are likely more chances that both applications will fetch the sane record and try to update the same row. This will cause a lock. Can i use row level lock before update by each application? Or is there any other methods/process in which this can be handled. ?
begin for i in 1..10000 loop update table1 set col1= col1+1 where type =1; commit; end loop; end;
My question is, if a strored procedure contains the script above and the said procedure will be invoked by two or more sessions at the same time. Does it mean that the 1st session will lock the related rows and other sessions will have to wait for loop in session one to finish?
i have application where user logs and perform manipulation operation such as insert and update on database table.some time its possible that same user login twice, i just want to hold one session until and unless dml operation perform by another session gets complete.how to accomplish this in database level .
I am unable to compile my package because of a lock being held on it . Let me provide the details for better clarity .
select * from dba_ddl_locks where session_id=111 and owner='RAHUL';
session_id owner name type mode_held mode_requested 111 RAHUL RAHUL_PKG BODY NULL None 111 RAHUL RAHUL_PKG Table/Procedure/Type NULL NoneThe session details of the session id 111 is as below
select sid,serial#,user#,username,command,status,process,sql_exec_start from v$session where sid=122
sid serial# user# username command status process SQL_EXEC_START 111 3558 222 RAHUL 47 KILLED 4420 13-DEC-12 02.00.00 AM
The strange this is that we have tried killing this session and the status above even shows ' 'KILLED', stilll the dba_ddl_locks is showing the lock details on the package RAHUL_PKG and we are unable to compile the package (the locking session is running since 13-Dec-2012 ) and we are unable to kill that . Also , is it like if i have executed a package that is referencing some other package then we wont be able to compile the referenced package until and unless the dependent package has completed its execution ??
In my trace file am getting the following error, I understand this is due to the row level deadlock between two sessions accessing the same rows in a table.
The following deadlock is not an ORACLE error. It is a deadlock due to user error in the design of an application or from issuing incorrect ad-hoc SQL. The following information may aid in determining the deadlock:
Deadlock graph: ---------Blocker(s)-------- ---------Waiter(s)--------- Resource Name process session holds waits process session holds waits TX-016e0017-0001e10f 75 2370 X 153 2269 X TX-0217000f-00009247 153 2269 X 75 2370 X
session 2370: DID 0001-004B-0015DCCEsession 2269: DID 0001-0099-000FB698 session 2269: DID 0001-0099-000FB698session 2370: DID 0001-004B-0015DCCE
----- Information for the OTHER waiting sessions ----- Session 2269: sid: 2269 ser: 36409 audsid: 563917587 user: 107/PICKLE flags: 0x8000041 pid: 153 O/S info: user: oracle, term: UNKNOWN, ospid: 27324 image: oracle@snokhup4000 client details: O/S info: user: appsrv, term: , ospid: 1234 machine: snokhup255 program: current SQL:
DELETE FROM moderation_queue WHERE parent_id =:1 AND submission_type =:2 AND site_id IN ( select site_id from sites where personna_id= 1 ) ----- End of information for the OTHER waiting sessions -----
Information for THIS session:
----- Current SQL Statement for this session (sql_id=5rywrxc0mpcc1) ----- delete from shadow_users where user_id=:1 and personna_id=:2
In the past, we setup a standby database on our production server. My OS is HPUX, Oracle 10g and my database is in archive mod. We are no longer using the standby database method. My problem now is that one of my tablespace (/oradata/tn/rd2_temp 20gb) became 100% full on my production system. In trying to provide more space, I removed one of the standby redo logs. Instead of using ALTER database, I just did a rm from the OS. As I said earlier my STANDBY DB is inoperatable.
When I tried to drop the tablespace(/oradata/tn/rd2_temp it is 20gb), I am getting an oracle error (ora-19528 redo logs being cleared may need access to files). Im also getting and INSTANCE LOCK on ARC4. The rd2_temp tablespace is now offline. If I get rid of rd2_temp, I will be able to gain more space back to /oradata/tn.
I have a situation where I need to check if a row in the table locked i.e (Select for Update with NO WAIT applied on it). If yes go fetch the next row .
While i am trying to execute below mentioned query i am facing "DEADLOCK FOUND WHEN TRYING TO GET LOCK" error.
UPDATE PLAN SET PLAN_PMS_BLOCK_ID ='' WHERE PLAN_PMS_BLOCK_ID<>'' AND PLAN_PMS_BLOCK_ID NOT BETWEEN '0' AND '9' AND PLAN_PMS_BLOCK_ID NOT BETWEEN 'A' AND 'Z' AND PLAN_PMS_BLOCK_ID NOT IN('-') AND LENGTH(PLAN_PMS_BLOCK_ID )=1;