This document discusses different types of enqueue waits caused by locks in an Oracle database. It covers common lock names like TX, TM, and UL; lock modes like exclusive and share; and how to identify the waiter, blocker, lock type, and object being blocked using views like v$lock, v$session, and v$active_session_history. The key pieces of information needed to resolve lock waits are the session ID of the waiter, the lock mode, and the object being blocked. User locks like TX and TM locks result from transactions and table modifications, while internal locks govern objects like redo and reusable objects.
All on Adaptive and Extended Cursor SharingMohamed Houri
Dig into details on how Oracle has implemented Adaptive Cursor Sharing feature to make using bind variables and having optimal plans at each query execution possible
MySQL exposes a collection of tunable parameters and indicators that is frankly intimidating. But a poorly tuned MySQL server is a bottleneck for your PHP application scalability. This session shows how to do InnoDB tuning and read the InnoDB status report in MySQL 5.5.
All on Adaptive and Extended Cursor SharingMohamed Houri
Dig into details on how Oracle has implemented Adaptive Cursor Sharing feature to make using bind variables and having optimal plans at each query execution possible
MySQL exposes a collection of tunable parameters and indicators that is frankly intimidating. But a poorly tuned MySQL server is a bottleneck for your PHP application scalability. This session shows how to do InnoDB tuning and read the InnoDB status report in MySQL 5.5.
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeJeff Frost
Let's face it, major version upgrades can be a pain. Most people are familiar with the dump/restore method, but if your database happens to be larger than a few GB, the downtime required for dump/restore is likely going to exceed your maximum maintenance window.
We'll briefly explore upgrade options including dump/restore, pg_upgrade and logical replication tools like Slony and why I think Slony is currently the best option. Then we'll run through a tutorial on how to use slony for a major version upgrade with minimal downtime.
You can find the scripts used in the demos here:
https://github.com/jfrost/scale-15x-talk
How to Avoid Pitfalls in Schema Upgrade with GaleraSveta Smirnova
Galera Cluster for MySQL is a 100% synchronized cluster in regards to data modification operations (DML). It is ensured by the optimistic locking model and ability to rollback a transaction, which cannot be applied on all nodes. However, schema changes (DDL operations) are not transactional in MySQL, which adds complexity when you need to perform an upgrade or change schema of the database.
Changes made by DDL may affect results of the queries. Therefore all modifications must replicate on all nodes prior next data access. For operations which run momentarily it can be easily achieved, but schema changes may take hours to apply. Therefore in addition to safest synchronous blocking schema upgrade method TOI Galera also supports more relaxed, thought not safe, method RSU.
In her talk Sveta will describe which pitfalls you can hit while performing the change using one or another method, why and how to avoid them.
Presented at MariaDB Day Brussels 0202 2020: https://mariadb.org/mariadb-day-brussels-0202-2020-provisional-schedule/
Hadoop World 2011: Leveraging Hadoop for Legacy Systems - Mathias Herberts, C...Cloudera, Inc.
Since many companies in the financial sector still rely on legacy systems for its daily operations, Hadoop can only be truly useful in those environments if it can fit nicely among COBOL, VSAM, MVS and other legacy technologies. In this session, we will detail how Crédit Mutuel Arkéa solved this challenge and successfully mixed the mainframe and Hadoop.
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeJeff Frost
Let's face it, major version upgrades can be a pain. Most people are familiar with the dump/restore method, but if your database happens to be larger than a few GB, the downtime required for dump/restore is likely going to exceed your maximum maintenance window.
We'll briefly explore upgrade options including dump/restore, pg_upgrade and logical replication tools like Slony and why I think Slony is currently the best option. Then we'll run through a tutorial on how to use slony for a major version upgrade with minimal downtime.
You can find the scripts used in the demos here:
https://github.com/jfrost/scale-15x-talk
How to Avoid Pitfalls in Schema Upgrade with GaleraSveta Smirnova
Galera Cluster for MySQL is a 100% synchronized cluster in regards to data modification operations (DML). It is ensured by the optimistic locking model and ability to rollback a transaction, which cannot be applied on all nodes. However, schema changes (DDL operations) are not transactional in MySQL, which adds complexity when you need to perform an upgrade or change schema of the database.
Changes made by DDL may affect results of the queries. Therefore all modifications must replicate on all nodes prior next data access. For operations which run momentarily it can be easily achieved, but schema changes may take hours to apply. Therefore in addition to safest synchronous blocking schema upgrade method TOI Galera also supports more relaxed, thought not safe, method RSU.
In her talk Sveta will describe which pitfalls you can hit while performing the change using one or another method, why and how to avoid them.
Presented at MariaDB Day Brussels 0202 2020: https://mariadb.org/mariadb-day-brussels-0202-2020-provisional-schedule/
Hadoop World 2011: Leveraging Hadoop for Legacy Systems - Mathias Herberts, C...Cloudera, Inc.
Since many companies in the financial sector still rely on legacy systems for its daily operations, Hadoop can only be truly useful in those environments if it can fit nicely among COBOL, VSAM, MVS and other legacy technologies. In this session, we will detail how Crédit Mutuel Arkéa solved this challenge and successfully mixed the mainframe and Hadoop.
Cassandra Community Webinar | Introduction to Apache Cassandra 1.2DataStax
Title: Introduction to Apache Cassandra 1.2
Details: Join Aaron Morton, DataStax MVP for Apache Cassandra and learn the basics of the massively scalable NoSQL database. This webinar is will examine C*’s architecture and its strengths for powering mission-critical applications. Aaron will introduce you to core concepts such as Cassandra’s data model, multi-datacenter replication, and tunable consistency. He’ll also cover new features in Cassandra version 1.2 including virtual nodes, CQL 3 language and query tracing.
Speaker: Aaron Morton, Apache Cassandra Committer
Aaron Morton is a Freelance Developer based in New Zealand, and a Committer on the Apache Cassandra project. In 2010, he gave up the RDBMS world for the scale and reliability of Cassandra. He now spends his time advancing the Cassandra project and helping others get the best out of it.
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
How fast can you modify your data collection to include a new field, make all the necessary changes in data processing and storage, and then use that field in analytics or product features? For many companies, the answer is a few quarters, whereas others do it in a day. This data agility latency has a direct impact on companies' ability to innovate with data. Schema-on-read has been a key strategy to lower that latency - as the community has shifted towards storing data outside relational databases, we no longer need to make series of schema changes through the whole data chain, coordinated between teams to minimise operational risk. Schema-on-read comes with a cost, however. Errors that we used to catch during testing or in early test deployments can now sneak into production undetected and surface as product errors or hard-to-debug data quality problems later than with schema-on-write solutions.
In this presentation, we will show how we have rejected the tradeoff between slow schema change rate and quality to achieve the best of both worlds. By using metaprogramming and versioned pipelines that are tested end-to-end, we can achieve fast schema changes with schema-on-write and the protection of static typing. We will describe the tools in our toolbox - Scalameta, Chimney, Bazel, and custom tools. We will also show how we leverage them to take static typing one step further and differentiate between domain types that share representation, e.g. EmailAddress vs ValidatedEmailAddress or kW vs kWh, while maintaining harmony with data technology ecosystems.
Troubleshooting Tips and Tricks for Database 19c ILOUG Feb 2020Sandesh Rao
This session will focus on 19 troubleshooting tips and tricks for DBAs covering tools from the Oracle Autonomous Health Framework (AHF) like Trace file Analyzer (TFA) to collect , organize and analyze log data , Exachk and orachk to perform mass best practices analysis and automation , Cluster Health Advisor to debug node evictions and calibrate the framework , OSWatcher and its analysis engine , oratop for pinpointing performance issues and many others to make one feel like a rockstar DBA
This talk will explore two libraries, a Cassandra native CQL client and a Clojure DSL for writing CQL3 queries.
This will demonstrate how Cassandra and Clojure are a great fit, show the strength of the functional approach to this domain and how in particular the data centric nature of Clojure makes a lot of sense in this context.
SQL Server is able to service requests from a large number of concurrent users. When SQL Server is servicing requests from many clients, there is a strong possibility that conflicts will occur because different processes request access to the same resources at the same time. A conflict in which one process is waiting for another to release a resource is called a block. Although in SQL Server a blocked process usually resolves itself when the first process releases the resource but there are times when a process holds a transaction lock and doesn't release it. In this tip, we will learn different techniques to troubleshoot and resolve blocks in SQL Server.
Troubleshooting Tips and Tricks for Database 19c - Sangam 2019Sandesh Rao
DBA's always have a bunch of scripts to do their daily tasks. How to find that stuck session, how to find who is consuming the most resources, how do I take a stack of multiple processes? This session will focus on troubleshooting tips and tricks for DBA's covering tools from the Oracle Autonomous Health Framework (AHF) like Trace file Analyzer (TFA) to collect , organize and analyze log data , Exachk and orachk to perform mass best practices analysis and automation , Cluster Health Advisor to debug node evictions and calibrate the framework , OSWatcher and its analysis engine , Oratop for pinpointing performance issues and many other native Database features like short stacks, system state summaries, quickly spot hangs across RAC clusters among some of them to make your jobs a lot more efficient and make you look good to your bosses !!
Successfully convince people with data visualizationKyle Hailey
Successfully convince people with data visualization
video of presentation available at https://www.youtube.com/watch?v=3PKjNnt14mk
from Data by the Bay conference
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
2. Locks Covered in this Section
Part I : Intro
Lock Name(type) and Mode
Finding waiter and blocker
Finding Object
Part II : User
TM – table modification
TX – Transaction locks
UL – user lock
Part III : Internal
CI – Cross Instance
HW – High Water
RO – Reusable Object
Copyright 2006 Kyle Hailey #.2
3. Part I : Intro
To Solve we need:
1.Waiter
2.Blocker
3.Lock Type
type
mode
1.Object blocking on
Missing : blocking SQL
Possibly with log miner
Copyright 2006 Kyle Hailey #.3
4. Solving – Data Sources
V$active_session_history
or
In “real time” can also use
v$lock
v$session (v$session_wait)
dba_blockers
dba_waiters
?/rdbms/admin/utllockt.sql
http://www.evdbt.com/enqwaits.sql
Copyright 2006 Kyle Hailey #.4
5. v$active_session_history
Fields in ASH for lock analysis and solution:
Waiter SQL Waiting
SESSION_ID
SQL_ID
SESSION_SERIAL#
Blocker
USER_ID
BLOCKING_SESSION
Object
BLOCKING_SESSION_STATUS
CURRENT_OBJ#
CURRENT_FILE# BLOCKING_SESSION_SERIAL#
CURRENT_BLOCK# Lock Type and Mode
Event = Type (name)
P1 = Type | Mode
Missing: SQL Blocking not reliably
possible, Maybe by dumping REDO
Copyright 2006 Kyle Hailey #.5
6. Lock Name and Mode
Select parameter1 from v$event_name where name=‘enqueue’;
Parameter1
----------
Name|mode
Select p1, p1raw from v$session where event like 'enq%';
P1 P1RAW
---------- --------
1415053318 54580006
Name: 5458 Mode: 0006
Hex Decimal ASCII
54 = 84 = “T” Lock = TX 6
58 = 88 = “X”
Copyright 2006 Kyle Hailey #.6
7. Type and Mode
SELECT
SELECT
chr(bitand(p1,-16777216)/16777215)||
chr(bitand(p1,-16777216)/16777215)||
chr(bitand(p1, 16711680)/65535) Type,
chr(bitand(p1, 16711680)/65535) Type,
mod(p1,16) lmode
mod(p1,16) lmode
from v$session_wait
from v$session_wait
where event=‘enqueue’;
where event=‘enqueue’;
TY
TY LMODE
LMODE
-- ----------
-- ----------
TX
TX 6
6
#.7
8. Lock Names (types)
9i
One Wait : “enqueue”
10g
208enqueue waits
Specific to each type of enqueue
enq: HW - contention Configuration
enq: SQ - contention Configuration
enq: SS - contention Configuration
enq: ST - contention Configuration
enq: TM - contention Application
enq: TW - contention Administrative
enq: TX - allocate ITL entry Configuration
enq: TX - index contention Concurrency
enq: TX - row lock contention Application
enq: TX – contention Application
Copyright 2006 Kyle Hailey #.8
9. Lock Modes
# Type Name
--- ------- ---------------------------
1 Null Null
2 SS Sub share
3 SX Sub exclusive
4 S Share
5 SSX Share/sub exclusive
6 X Exclusive
Copyright 2006 Kyle Hailey #.9
10. P1 = name | mode
P1 (parameter1) same for all locks
select distinct parameter1 from v$event_name PARAMETER1
where name like 'enq:%' name|mode
select
event,
mod(p1,16) as "mode"
from v$active_session_history
where event like 'enq:%‘;
EVENT mode
enq: TX - allocate ITL entry 4
enq: TX - row lock contention 6
enq: TX - row lock contention 4
Copyright 2006 Kyle Hailey #.10
11. OEM 10g
if P1 = 1415053318
then mode = 6
Then it is a data block
row lock
Copyright 2006 Kyle Hailey #.11
12. Querying ASH
select
substr(event,0,20) lock_name,
ash.session_id waiter,
mod(ash.p1,16) lmode,
ash.p2 p2,
ash.p3 p3,
o.object_name object,
o.object_type otype,
CURRENT_FILE# filen,
CURRENT_BLOCK# blockn,
ash.SQL_ID waiting_sql,
BLOCKING_SESSION blocker
--,ash.xid
from
v$active_session_history ash,
all_objects o
where
event like 'enq: %'
and o.object_id (+)= ash.CURRENT_OBJ#
/
Copyright 2006 Kyle Hailey #.12
13. Part II : User Locks
TX – Transaction Lock
Mode 6: Modifying same row
Mode 4: several reasons
TM – Table Modification
Mode 4: Unindexed Foreign Key
UL – User Lock
Copyright 2006 Kyle Hailey #.13
14. TX Lock
Session B
Undo
Wait for Tx Segment
update toto set
update toto set To commit Header
name = ‘ADAMS’
name = ‘ADAMS’
where id = 1;
where id = 1; Undo
Segment
Table Toto
Data Block
Data Block
Header
Header
Transaction 1
Session a
update toto set
update toto set
name = ‘SMITH’
name = ‘SMITH’
Row 1 where id = 1;
Delete from 1;
where id = toto where id
Delete from toto where id
Copyright 2006 Kyle Hailey = 2;
= 2;
Delete from toto where id
Delete from toto where #.14
id
15. Transaction Locks (TX)
TX = Transaction = Wait on UNDO
Mode 6 (exclusive)
modification of a row lock
Mode 4 (share)
Index block spilt
Unique Index Key enforcement
Foreign key enforcement
ITL space waits
Bitmap chunk conflicts
Alter tablespace … read only;
Free Lists slot waits
Possible with two phase commit
Copyright 2006 Kyle Hailey #.15
16. Transaction Locks (TX)
Mode 4, new Events:
1. enq: TX - allocate ITL entry
Wait on an ITL slot
1. enq: TX - index contention
Index block split
1. enq: TX - row lock contention
1. Mode 6 – classic row lock
2. Mode 4 - pk violation, fk violation, bitmap chunk wait
2. enq: TX – contention
Wait for a data file extension, Alter tbs read only
Copyright 2006 Kyle Hailey #.16
17. enq: TX - row lock contention
Mode 6, row in data block
User 1 User 2
SQL> delete from toto
where id = 1;
SQL> delete from toto
where id =1;
Table
ID Value
1 foo
Copyright 2006 Kyle Hailey #.17
18. enq: TX - row lock contention
if P1 = 1415053318
then mode = 6
Then it is a data block
row lock
Copyright 2006 Kyle Hailey #.18
19. TX – Mode 4
if P1 = 1415053316
then mode = 4
Not same data but conflicts
Copyright 2006 Kyle Hailey #.19
21. 1. enq: TX - row lock contention
Mode 4 , unique index
User 1 User 2
create table p(n number);
create unique index p_i on p(n);
insert into p values(2);
insert into p values(2);
PK Table
ID ID Value
2? 2?
Copyright 2006 Kyle Hailey #.21
22. 2. enq: TX - row lock contention
Mode 4, foreign key
User 1 User 2
create table parent (
id number primary key);
create table child (
id number references parent,
name varchar2(20));
insert into parent values (2);
insert into child values (2,88);
PK Parent Child
ID ID Value ID Name
2? 2? 2
Copyright 2006 Kyle Hailey #.22
23. 3. enq: TX - row lock contention
Mode 4
Bitmaps are compressed
Changes to the same bitmap cause locks
Value Start End Bitmap
Rowid Rowid
1 01010000111000011100001100
000.000.0000 000.000.000
2 01010000111000011100001100
000.000.0000 000.000.000
Copyright 2006 Kyle Hailey #.23
24. 3. enq: TX - row lock contention
Session 1
create table t1 ((
create table t1 Different rows but
n1
n1 number(4),
number(4), same key value
n2
n2 number(4));
number(4));
insert into t1
insert into t1
select 1, rownum
select 1, rownum
from all_objects
from all_objects
where rownum <= 400;
where rownum <= 400;
commit;
commit;
create bitmap index i1 on t1(n1);
create bitmap index i1 on t1(n1);
update t1 set n1 = 2
update t1 set n1 = 2
where n2 = 12;
where n2 = 12; Session 2
update t1 set n1 = 2
update t1 set n1 = 2
where n2 = 13;
where n2 = 13;
Copyright 2006 Kyle Hailey #.24
25. 3. enq: TX - row lock contention
Bitmaps are compressed
Changes to the same bitmap chunk cause
locks
Value Start End Bitmap
Rowid Rowid
1 01010000111000011100001100
200.0 204.7
1 01010000111000011100001100
205.0 210.3
2 01010000111000011100001100
200.0 205.6
block row
Copyright 2006 Kyle Hailey #.25
26. 3. enq: TX - row lock contention
Value Start End Bitmap
Rowid Rowid
1 01010000111000011100001100
200.0 204.7
2 01010000111000011100001100
205.0 210.3
3 01010000111000011100001100
200.0 205.6
Session 1 Session 2
Update id=12 Update id=13
set value 2 set value 2
Copyright 2006 Kyle Hailey #.26
30. enq: TX - allocate ITL entry
create table itl (
create table itl (
id number,
id number,
data varchar2(20)
data varchar2(20)
))
pctfree 0
pctfree 0
initrans 1
initrans 1
;;
insert into itl select rownum,'a' from all_objects
insert into itl select rownum,'a' from all_objects
where rownum < 2000;
where rownum < 2000;
commit;
commit;
session 1: update itl set data=data where id=1;
session 1: update itl set data=data where id=1;
session 2: update itl set data=data where id=2;
session 2: update itl set data=data where id=2;
session 3: update itl set data=data where id=3;
session 3: update itl set data=data where id=3;
session 4: update itl set data=data where id=4;
session 4: update itl set data=data where id=4;
session 5: update itl set data=data where id=5;
session 5: update itl set data=data where id=5;
Copyright 2006 Kyle Hailey #.30
31. enq: TX - contention
1. Altering tablespace read only with open transaction
Example
Session 1 – start transaction, don’t commit
Session 2 – alter tablespace read only
1. Data File Extension – waiter waiting for another session to extend
file
2. Index Block Split – waiter waiting for another session to split the
block
Copyright 2006 Kyle Hailey #.31
33. TX Further Investigation
Who is the blocker:
V$active_session_history :
BLOCKING_SESSION
BLOCKING_SESSION_STATUS
BLOCKING_SESSION_SERIAL#
No Guarentee of finding blocker SQL
Copyright 2006 Kyle Hailey #.33
35. enq: TM - contention
Exclusive Row Level Lock
User 1 User 2
create table parent (
id number primary key);
create table child (
id number references parent,
name varchar2(20));
insert into parent values (1);
insert into parent values (2);
commit;
insert into child values (1,2);
delete from parent where id=2;
Copyright 2006 Kyle Hailey #.35
36. enq: TM - contention
PK Parent Child
ID ID Value ID Name
1 1 1
X
2 X
2
Session 1 Insert into Child ID=1
Session 2 Delete from Parent where ID=2 :
Enqueue TM 4
Session 2 doesn’t know the value Session 1 inserted
Session 2 only knows there is an outstanding change
Copyright 2006 Kyle Hailey #.36
37. enq: TM – contention Solution
PK Parent Child
Index
ID ID Value ID ID Name
1 1
2
Foreign Key
Session 1: Insert into Child ID=1
Session 2: Delete from Parent ID=2
OK – can verify quickly in the child index
Copyright 2006 Kyle Hailey #.37
38. TM Further Investigation
select
event,
sql_id,
mod(p1,16) as "mode",
p2|| ' ' || o.name obj
from v$active_session_history ash,
obj$ o
where
event like 'enq: TM%'
and o.obj# (+)= ash.p2
order by sample_time;
EVENT SQL_ID mode OBJ
enq: TM - contention 8zw36yw3fq4yy 4 53372 CHILD
enq: TM - contention 8zw36yw3fq4yy 4 53372 CHILD
enq: TM - contention 8zw36yw3fq4yy 4 53372 CHILD
enq: TM - contention 8zw36yw3fq4yy 4 53372 CHILD
enq: TM - contention 8zw36yw3fq4yy 4 53372 CHILD
enq: TM - contention 8zw36yw3fq4yy 4 53372 CHILD
Copyright 2006 Kyle Hailey #.38
39. UL Locks
User-defined Locks
dbms_lock
Wait Event Parameter2 Parameter3
enq: UL - contention id 0
dbms_lock.allocate_unique(v_lockname, v_lockhandle);
dbms_lock.request(v_lockhandle, p_ltype);
dbms_lock.release(v_lockhandle);
Copyright 2006 Kyle Hailey #.39
40. Internal Locks
CI – Cross Instance
HW – High Water
KO – fast object checkpoint
RO – Reuse Object
SQ – Sequence Lock
ST – Space Transaction
Copyright 2006 Kyle Hailey #.40
41. enq: CI - contention
Cross Instance
not OPS lock.
invoke actions in background processes
checkpoints
log switches
instance is shut down
Copyright 2006 Kyle Hailey #.41
42. CI – Cross Instance
Id1 Meaning (parameter2)
Id1 Meaning (parameter2) Id2 Meaning (parameter3)
Id2 Meaning (parameter3)
00Flush buffers for reuse as new class
Flush buffers for reuse as new class 11Pass in Parameters
Pass in Parameters
11LGWR checkpointing and Hot Backup
LGWR checkpointing and Hot Backup 22Invoke the call in background process
Invoke the call in background process
22DBWR synchronization of SGA with control file
DBWR synchronization of SGA with control file 33Foreground has not returned yet
Foreground has not returned yet
33Log file add/drop/rename notification 44Used to allocate the CI call
Used to allocate the CI call
Log file add/drop/rename notification
44Write buffer for CR read 55Used to queue up interested clients
Used to queue up interested clients
Write buffer for CR read
55Test Call
Test Call
66Invalidate KCK cache in all instances
Invalidate KCK cache in all instances
77Alter rollback segment optimal
Alter rollback segment optimal
88Signal Query Servers/coordinator
Signal Query Servers/coordinator
99Create Remote Parallel Query Server
Create Remote Parallel Query Server
10 Set Global Partitions
10 Set Global Partitions
11 Stop Disk Writes
11 Stop Disk Writes
12 Drop Sort Segments
12 Drop Sort Segments
13 Release unused space from Sort Segments
13 Release unused space from Sort Segments
14 Instance Recovery for Parallel operation Group
14 Instance Recovery for Parallel operation Group
15 Validate parallel slave Lock Value
15 Validate parallel slave Lock Value
16 Check Transaction State Objects
16 Check Transaction State Objects
Copyright 2006 Kyle Hailey #.42
43. CI Locks
select
substr(sql_text,0,20) sql_text,
p2,p3,
CURRENT_OBJ# || ' ' || name obj
,CURRENT_FILE# file#
,CURRENT_BLOCK# block#
from v$active_session_history ash,
obj$ o,
v$sqltext sql
where
event like 'enq: CI%'
and o.obj# (+)= ash.current_obj#
and sql.sql_id (+)= ash.sql_id
order by sample_time;
SQL_TEXT P2 P3 OBJ FILE# BLOCK#
INSERT INTO TOTO1 VA 1 5 54225 TOTO1 6 682721
Copyright 2006 Kyle Hailey #.43
44. CI Locks
SQL_TEXT
SQL_TEXT P2 P3
P2 P3
---------------------------------------- --- --
---------------------------------------- --- --
alter table XXXXX drop partition YYYYY
alter table XXXXX drop partition YYYYY 1 5
1 5
P2 = 1 ""LGWR checkpointing and Hot Backup ""
P2 = 1 LGWR checkpointing and Hot Backup
P3 = 5. "Used to queue up interested clients""
P3 = 5. "Used to queue up interested clients
If p2=1 and p3=5, then contention on blocks being
checkpointed, try raising fast_start_mttr_target
alter system set fast_start_mttr_target=600 scope=both;
Copyright 2006 Kyle Hailey #.44
45. enq: HW - contention
Wait Event Parameter2 Parameter3
enq: HW - contention table space # block
Session 1 Header
Table
Session 2
Data
Session 3
High Water Mark
Empty
Copyright 2006 Kyle Hailey #.45
46. HW
Use Freelists
Cause a jump in High Water Mark by freelists *
_bump_highwater_mark_count
Hidden Parameter
_bump_highwater_mark_count
alter session set "_bump_highwater_mark_count"=100;
Not supported
ASSM
Automatic segment space management
Copyright 2006 Kyle Hailey #.46
47. HW Further Investigation
select
event,
sql_id,
CURRENT_OBJ# || ' ' || name obj
,CURRENT_FILE# file#
,CURRENT_BLOCK# block#
from v$active_session_history ash,
obj$ o
where
event like 'enq: HW%'
and o.obj# (+)= ash.current_obj#
order by sample_time;
EVENT SQL_ID OBJ FILE# BLOCK#
enq: HW - contention 49ch3jfkncnsp 53410 T1_I1 13 29734
Copyright 2006 Kyle Hailey #.47
48. enq: KO - fast object checkpoint
Used when checking the cache for blocks from a
table for PQO direct read
Copyright 2006 Kyle Hailey #.48
49. enq: RO - fast object reuse
Drop or Truncate a table
Wait for DBWR to clean cache
Solution
Tune DBWR using smaller MTTR
Use GTT
Truncate/drop less often
#.49
52. Summary : Internal Locks
CI – Cross Instance
HW – High Water
Look at object and SQL
use ASSM, freelists, pre-allocate extents
KO – fast object checkpoint
PQO
RO – reusable object
Reduce cache, tune DBWR, use GTT
SQ – Sequence Lock
logon/logoff problem
ST - Space Transaction
only one per database
used for space allocations uet, fet
Find object
use LMT
Copyright 2006 Kyle Hailey #.52
Editor's Notes
Lock seems easy Compared to latches, buffer busy waits etc
bitand(p1, 65536) "Mode"
TX if P1 = 1415053316 then mode = 4 if P1 = 1415053318 then mode = 6
col event for a22 col block_type for a18 col objn for a18 col otype for a10 col fn for 99 col sid for 9999 col bsid for 9999 col lm for 99 col p3 for 99999 col blockn for 99999 select to_char(sample_time,'HH:MI') st, substr(event,0,20) event, ash.session_id sid, mod(ash.p1,16) lm, ash.p2, ash.p3, nvl(o.object_name,ash.current_obj#) objn, substr(o.object_type,0,10) otype, CURRENT_FILE# fn, CURRENT_BLOCK# blockn, ash.SQL_ID, BLOCKING_SESSION bsid --,ash.xid from v$active_session_history ash, all_objects o where event like 'enq: TX %' and o.object_id (+)= ash.CURRENT_OBJ# and sample_time > sysdate - &1/(60*24) Order by sample_time /
create table p(n number); create unique index p_i on p(n); insert into p values(3);
Subject: Bitmap Indexes and Deadlocks: Deadlocks on Insert Statements Doc ID: Note:171795.1 Type: TROUBLESHOOTING Last Revision Date: 18-MAY-2004 Status: PUBLISHED PURPOSE ------- The purpose of this article is to explain the occurrence of deadlocks when the only DML activity is insert statements against a table with a bitmap index SCOPE & APPLICATION ------------------- Database administrators and Application developers involved in application design. BITMAP INDEXES: THE HIDDEN DEADLOCK THREAT ------------------------------------------ The "Oracle8i Designing and Tuning for Performance" guide explains the limitations of bitmap indexes as this: Extract of documentation: "DML and DDL statements, such as UPDATE, DELETE, DROP TABLE, affect bitmap indexes the same way they do traditional indexes: the consistency model is the same. A compressed bitmap for a key value is made up of one or more bitmap segments, each of which is at most half a block in size (but may be smaller). The locking granularity is one such bitmap segment. This may affect performance in environments where many transactions make simultaneous updates. If numerous DML operations have caused increased index size and decreasing performance for queries, then you can use the ALTER INDEX ... REBUILD statement to compact the index and restore efficient performance. A B*-tree index entry contains a single rowid. Therefore, when the index entry is locked, a single row is locked. With bitmap indexes, an entry can potentially contain a range of rowids. When a bitmap index entry is locked, the entire range of rowids is locked. The number of rowids in this range affects concurrency. As the number of rowids increases in a bitmap segment, concurrency decreases. Locking issues affect DML operations, and may affect heavy OLTP environments. Locking issues do not, however, affect query performance. As with other types of indexes, updating bitmap indexes is a costly operation. Nonetheless, for bulk inserts and updates where many rows are inserted or many updates are made in a single statement, performance with bitmap indexes can be better than with regular B*-tree indexes." ************** What is not mentioned is the fact that the same architectural feature that locks a range of rowid's also means that its possible to get a deadlock within the bitmap when updating rows in the underlying table. This deadlock is not in the table itself, as one might suspect, but rather in the bitmap index blocks. This kind of deadlock is easily diagnosable by the deadlock trace file, which has an entry that looks like the example below: 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-00080027-0000d2a1 12 37 X 15 35 S TX-000a0016-0000d6d2 15 35 X 12 37 S session 37: DID 0001-000C-00000002 session 35: DID 0001-000F-00000002 session 35: DID 0001-000F-00000002 session 37: DID 0001-000C-00000002 Rows waited on: Session 35: no row Session 37: no row The piece of information that leads us to a bitmap deadlock is the "no row" value in the session information. If we had encountered a deadlock in the underlying table, the Session line would give us row information so that we could track down the exact point of failure. Without a row, it would seem that we are at a dead end. Even more mysterious is when we get this deadlock on inserts, where we are inserting only new rows and therefore it would seem impossible to get a deadlock. No one should be requesting a row that someone else holds locked. There are no solutions to this kind of problems, except not using bitmap indexes when having an application where you can't control when the DML are issued against the tables with bitmap indexes. Bitmaps are normally intended for datawarehouse applications that are loading data via batches and that users are only querying. The following testcase can be used to see the results of this type of problem. We will create a table called CAR_TYPE, which holds information about cars, including the car's color. We will build a bitmap index on the COLOR column. After doing so, we will populate the table with data. After the initial insert, we will open two sessions of the same user, and run simultaneous inserts into the CAR_TYPE table. TESTCASE: ===================================== ===================================== create table car_type ( make varchar2(20), model varchar2(20), color varchar2(20), VIN number(15) primary key, year number(4)); create bitmap index car_type_bm_idx on car_type(color); create sequence car_type_seq start with 35001 increment by 1 nocache nocycle; declare v_CarMake varchar2(20) := 'Audi'; v_CarModel varchar(20) := 'Quattro'; v_CarColor varchar(20) := 'Gold'; v_CarVin binary_integer :=1; begin loop insert into car_type (make,model,color,VIN,year) values (v_CarMake, v_CarModel, v_CarColor, v_CarVin, '2002'); v_CarVin := v_CarVin + 1; exit when v_CarVin > 5000; end loop; end; / commit; declare v_CarMake varchar2(20) := 'Toyota'; v_CarModel varchar(20) := 'Camry'; v_CarColor varchar(20) := 'Red'; v_CarVin binary_integer :=5001; begin loop insert into car_type (make,model,color,VIN,year) values (v_CarMake, v_CarModel, v_CarColor, v_CarVin, '2002'); v_CarVin := v_CarVin + 1; exit when v_CarVin > 10000; end loop; end; / commit; declare v_CarMake varchar2(20) := 'Audi'; v_CarModel varchar(20) := 'Quattro'; v_CarColor varchar(20) := 'Blue'; v_CarVin binary_integer :=10001; begin loop insert into car_type (make,model,color,VIN,year) values (v_CarMake, v_CarModel, v_CarColor, v_CarVin, '2002'); v_CarVin := v_CarVin + 1; exit when v_CarVin > 15000; end loop; end; / commit; declare v_CarMake varchar2(20) := 'Toyota'; v_CarModel varchar(20) := 'Camry'; v_CarColor varchar(20) := 'Silver'; v_CarVin binary_integer :=15001; begin loop insert into car_type (make,model,color,VIN,year) values (v_CarMake, v_CarModel, v_CarColor, v_CarVin, '2002'); v_CarVin := v_CarVin + 1; exit when v_CarVin > 20000; end loop; end; / commit; declare v_CarMake varchar2(20) := 'Audi'; v_CarModel varchar(20) := 'Quattro'; v_CarColor varchar(20) := 'Green'; v_CarVin binary_integer :=20001; begin loop insert into car_type (make,model,color,VIN,year) values (v_CarMake, v_CarModel, v_CarColor, v_CarVin, '2002'); v_CarVin := v_CarVin + 1; exit when v_CarVin > 25000; end loop; end; / commit; declare v_CarMake varchar2(20) := 'Audi'; v_CarModel varchar(20) := 'Quattro'; v_CarColor varchar(20) := 'Black'; v_CarVin binary_integer :=25001; begin loop insert into car_type (make,model,color,VIN,year) values (v_CarMake, v_CarModel, v_CarColor, v_CarVin, '2002'); v_CarVin := v_CarVin + 1; exit when v_CarVin > 30000; end loop; end; / commit; declare v_CarMake varchar2(20) := 'Toyota'; v_CarModel varchar(20) := 'Camry'; v_CarColor varchar(20) := 'White'; v_CarVin binary_integer :=30001; begin loop insert into car_type (make,model,color,VIN,year) values (v_CarMake, v_CarModel, v_CarColor, v_CarVin, '2002'); v_CarVin := v_CarVin + 1; exit when v_CarVin > 35000; end loop; end; / commit; =============================== =============================== After this initial creation, cut the following script into a .sql file, and then execute it simultaneously from two sessions: =============================== =============================== insert into car_type values ( 'Toyota','Camry','White',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Red',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Silver',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Black',car_type_seq.nextval,'2002'); commit; insert into car_type values ( 'Audi','Quatro','Gold',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Blue',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Green',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','White',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Red',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Silver',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Black',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Gold',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Blue',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Green',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','White',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Red',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Silver',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Black',car_type_seq.nextval,'2002'); commit; insert into car_type values ( 'Audi','Quatro','Gold',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Blue',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Green',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','White',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Red',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Silver',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Black',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Gold',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Blue',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Green',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','White',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Red',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Silver',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Black',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Gold',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Blue',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Green',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','White',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Red',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Silver',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Black',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Gold',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Blue',car_type_seq.nextval,'2002'); commit; insert into car_type values ( 'Audi','Quatro','Green',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','White',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Red',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Silver',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Black',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Gold',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Blue',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Green',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','White',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Red',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Silver',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Black',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Gold',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Blue',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Green',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','White',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Red',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Silver',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Black',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Gold',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Blue',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Green',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','White',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Red',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Silver',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Black',car_type_seq.nextval,'2002'); commit; insert into car_type values ( 'Audi','Quatro','Gold',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Blue',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Green',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','White',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Red',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Silver',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Black',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Gold',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Blue',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Green',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','White',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Red',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Silver',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Black',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Gold',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Blue',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Green',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','White',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Red',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Silver',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Black',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Gold',car_type_seq.nextval,'2002'); commit; insert into car_type values ( 'Audi','Quatro','Blue',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Green',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','White',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Red',car_type_seq.nextval,'2002'); insert into car_type values ( 'Toyota','Camry','Silver',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Black',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Gold',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Blue',car_type_seq.nextval,'2002'); insert into car_type values ( 'Audi','Quatro','Green',car_type_seq.nextval,'2002'); commit; ======================================== ======================================== The result will be occasional deadlock errors: insert into car_type values ( * ERROR at line 1: ORA-00060: deadlock detected while waiting for resource The trace file will show the tell-tale 'No Row' message: Rows waited on: Session 11: no row Session 10: no row RELATED DOCUMENTS ----------------- Oracle8i Designing and Tuning for Performance Release 2 (8.1.6) Part Number A76992-01 .
select to_char(sample_time,'HH:MI') st, substr(event,0,20) event, ash.session_id sid, mod(ash.p1,16) lm, ash.p2, ash.p3, nvl(o.object_name,ash.current_obj#) objn, substr(o.object_type,0,10) otype, CURRENT_FILE# fn, CURRENT_BLOCK# blockn, ash.SQL_ID, BLOCKING_SESSION bsid from v$active_session_history ash, all_objects o where event like 'enq: TX - %' and o.object_id (+)= ash.CURRENT_OBJ# --and sample_time > sysdate - 40/(60*24) Order by sample_time /
Used to invoke specific actions in background processes on a specific instance or all instances. Examples include checkpoint, log switch, shutting down, identifying or re-identifying datafiles, etc. All in all, there are a small number (10’s) of predefined cross-instance call types. Not an Oracle Parallel Server lock. The name of this lock is misleading because it doesn't deal with distributed transactions. Rather, the CI lock is used to invoke specific actions in background processes on a specific instance or all instances. Examples would include checkpoints, log switches, or when the instance is shut down.
col event for a20 col obj for a12 col p2 for 9999 col p3 for 999999 col file# for 99999 col block# for 999999 select substr(sql_text,0,20) sql_text, --event, --sql_id, --p1, p2,p3, CURRENT_OBJ# || ' ' || name obj ,CURRENT_FILE# file# ,CURRENT_BLOCK# block# from v$active_session_history ash, obj$ o, v$sqltext sql where event like 'enq: CI%' and o.obj# (+)= ash.current_obj# and sql.sql_id (+)= ash.sql_id order by sample_time;
col event for a20 col obj for a12 col p2 for 9999 col p3 for 999999 col file# for 99999 col block# for 999999 select substr(sql_text,0,20) sql_text, --event, --sql_id, --p1, p2,p3, CURRENT_OBJ# || ' ' || name obj ,CURRENT_FILE# file# ,CURRENT_BLOCK# block# from v$active_session_history ash, obj$ o, v$sqltext sql where event like 'enq: CI%' and o.obj# (+)= ash.current_obj# and sql.sql_id (+)= ash.sql_id order by sample_time;
enq: HW - contention 4 16777715
column parameter format a30 column value format a10 select a.ksppinm parameter, c.ksppstvl value from x$ksppi a, x$ksppcv b, x$ksppsv c where a.indx = b.indx and a.indx = c.indx and substr(ksppinm,1,11)='_bump_highw' order by a.ksppinm;