<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4096575</id><updated>2013-05-23T02:49:49.024-04:00</updated><category term='#ACED'/><category term='prelim'/><category term='#oow10 #ACED #ACE #oracle performance tuning RAC profiling application scalability'/><category term='resource manager'/><category term='Istanbul'/><category term='NYOUG 11g Upgrade ACE Director'/><category term='11.2.0.2'/><category term='Listeners'/><category term='Database Replay'/><category term='Exadata'/><category term='SPM'/><category term='APEX'/><category term='#Oracle #Security #DefaultPassword'/><category term='CLOB'/><category term='buffer cache'/><category term='Automatic Resizing of SGA'/><category term='Real Application Testing'/><category term='Standby Database'/><category term='Quick and Easy'/><category term='RAC'/><category term='Oracle University'/><category term='OOW09'/><category term='ORA-304'/><category term='11g'/><category term='performance'/><category term='#oow10 #ACED'/><category term='ACE'/><category term='arup nanda ACE oracle materialized view alter modify prebuilt table'/><category term='openworld08'/><category term='Statistics; RAC Performance'/><category term='&quot;presentation tips&quot;'/><category term='Baselines'/><category term='difference'/><category term='foreign key'/><category term='oradebug'/><category term='Open World'/><category term='#ACEDirector'/><category term='Physical Standby'/><category term='architectural guidelines'/><category term='RAT'/><category term='Oracle Application Express'/><category term='Design'/><category term='#ACED Oracle Partition Maintenance Automatic Addition'/><category term='GES'/><category term='Celebrity Seminar Series'/><category term='Best Practices'/><category term='Webcast'/><category term='DMA Exadata Administration Management'/><category term='CR'/><category term='online'/><category term='RMAN Incremental'/><category term='GRD'/><category term='Listener Logs'/><category term='session'/><category term='#Oracle #Quiz'/><category term='SQL Plan Management'/><category term='Block Change Tracking'/><category term='DBA'/><category term='ITL Wait'/><category term='#tanelpoder #AOT20 #AST E2SN &quot;Performance Tuning&quot; Oracle'/><category term='#OOW09'/><category term='New Features'/><category term='ADR'/><category term='ACE Director'/><category term='&quot;ITL wait&quot; INITRANS MAXTRANS'/><category term='APEX 4.0'/><category term='insert causing deadlocks'/><category term='#Exadata $ACED #Oracle'/><category term='Arup Nanda'/><category term='RACOne'/><category term='NYOUG'/><category term='External Procedures'/><category term='#C12LV'/><category term='Cache Fusion'/><category term='Oracle Role Privilege Discrepancy'/><category term='IOUG'/><category term='Security'/><category term='Oracle'/><category term='RAC Performance'/><category term='Latin American Oracle User Group'/><category term='#C10'/><category term='ITL &quot;Interested Transaction List&quot; Locking Oracle Lock Locks &quot;Dumping Block&quot;'/><category term='deadlocks'/><category term='Best Practice'/><category term='Data Pump'/><category term='NYOUG &quot;Cache Fusion&quot; RAC'/><category term='Plan Stability'/><category term='Oracle Performance Tuning'/><category term='Library Cache'/><category term='comparison'/><category term='Data Guard'/><category term='Collaborate IOUG'/><category term='Linux Command Advanced Oracle DBA #ACED #Linux #Oracle #linuxcommand'/><category term='streams_pool_size'/><category term='11g New Features'/><category term='Linux shell variable readonly arup nanda ACE'/><category term='Connection Manager CMAN Oracle Network'/><category term='11gR2 11g R2 11g Release 2 arup nanda new features'/><category term='ASM disk discovery problem arup nanda ACE oracle'/><category term='Problem'/><category term='1-Day'/><category term='Book Review'/><category term='Collaborate'/><category term='Oracle RMAN Backup Status Catalog #ACED'/><category term='Seminar'/><category term='Interpreting'/><category term='primary key'/><category term='Validnode Checking'/><category term='GCS'/><category term='process'/><category term='Partitioning'/><category term='oracle performance'/><category term='refresh'/><category term='Oracle Security'/><category term='Gap Resolution'/><category term='11g upgrade 11.1.0.7 patchkit'/><category term='Beginner'/><category term='INSTANCE_NUMBER is busy'/><category term='Locking'/><category term='#virtathon &quot;virtual conference&quot;'/><category term='full table scan'/><category term='New Zealand Oracle User Group'/><category term='XCUR'/><category term='FAL Server'/><category term='Node Validation'/><category term='Contention'/><category term='BCT'/><title type='text'>The Arup Nanda Blog</title><subtitle type='html'>Confessions of an Oracle Database Junkie - Arup Nanda

The opinions expressed here are mine and mine alone. They may not necessarily reflect that of my employers and customers - both past or present. The comments left by the reviewers are theirs alone and may not reflect my opinion whether implied or not. None of the advice is warranted to be free of errors and ommision. Please use at your own risk and after thorough testing in your environment.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://arup.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default?start-index=26&amp;max-results=25'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>114</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4096575.post-7061780442417538123</id><published>2013-04-19T09:52:00.000-04:00</published><updated>2013-04-19T09:52:54.392-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Automatic Resizing of SGA'/><category scheme='http://www.blogger.com/atom/ns#' term='Data Pump'/><category scheme='http://www.blogger.com/atom/ns#' term='streams_pool_size'/><title type='text'>Streams Pool is only for Streams? Think Again!</title><content type='html'>If you don’t use the automatic SGA (i.e. set the &lt;code&gt;sga_target=0&lt;/code&gt;) - something I frequently do - and don’t use Streams, you probably have set the parameter &lt;code&gt;streams_pool_size&lt;/code&gt; to 0 or not set it at all, since you reckon that the pool is used for Streams alone and therefore would be irrelevant in your environment wasting memory.&lt;br /&gt;&lt;br /&gt;But did you know that &lt;b&gt;the Streams Pool is not &lt;/b&gt;&lt;b&gt;&lt;i&gt;&lt;emphasis&gt;just&lt;/emphasis&gt;&lt;/i&gt;&lt;/b&gt;&lt;b&gt;&lt;i&gt; &lt;/i&gt;for Streams &lt;/b&gt;and&amp;nbsp;it is used for other tools some of which are frequently used in almost any database environment? Take for instance, Data Pump. It uses Streams Pool, contrary to conventional wisdom. If Streams Pool is not defined, it is dynamically allocated by stealing that much memory from the buffer cache. And the size is &lt;i&gt;not &lt;/i&gt;reset back to zero after the demand for the pool is over. You should be aware of this &lt;i&gt;&lt;emphasis&gt;lesser known&lt;/emphasis&gt;&lt;/i&gt; fact as it reduces the buffer cache you had allocated to the instance earlier.&lt;br /&gt;&lt;h1&gt;Demonstration&lt;/h1&gt;Let’s examine this with an example. First, let’s check the various pools defined in the database instance right now: &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&amp;gt; show parameter sga_target&lt;br /&gt;&lt;br /&gt;NAME TYPE VALUE&lt;br /&gt;------------------------------------ ----------- -----&lt;br /&gt;sga_target big integer 0&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; show parameter db_cache_size&lt;br /&gt;&lt;br /&gt;NAME TYPE VALUE&lt;br /&gt;------------------------------------ ----------- -----&lt;br /&gt;db_cache_size big integer 300M&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; show parameter streams_pool_size&lt;br /&gt;&lt;br /&gt;NAME TYPE VALUE&lt;br /&gt;------------------------------------ ----------- -----&lt;br /&gt;streams_pool_size big integer 0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Note carefully the values of the following parameters: &lt;br /&gt;&lt;ul&gt;&lt;li&gt;sga_target = 0 --&amp;gt; this means the SGA is not auto tuned.&lt;/li&gt;&lt;li&gt;db_cache_size = 300M --&amp;gt; this is the buffer cache&lt;/li&gt;&lt;li&gt;streams_pool_size = 0 --&amp;gt; this is the stream pool, set to 0 as expected&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Now kick off a Data Pump Export (expdp) job: &lt;br /&gt;&lt;pre&gt;$ expdp directory=DATA_FILE_DIR tables=arup.t1&lt;br /&gt;&lt;br /&gt;&lt;emphasis&gt;... output truncated ...&lt;/emphasis&gt;&lt;br /&gt;&lt;br /&gt;Job "SYS"."SYS_EXPORT_TABLE_01" successfully completed at 14:49:16&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;After the Data Pump job is complete, check the size of the buffer cache again: &lt;br /&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;SQL&amp;gt; show parameter db_cache_size&lt;br /&gt;&lt;br /&gt;NAME TYPE VALUE&lt;br /&gt;------------------------------------ ----------- -----&lt;br /&gt;db_cache_size big integer 280M&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The buffer cache got compressed from 300 MB earlier to 280 MB. But you didn’t do that; Oracle did it.&lt;br /&gt;&lt;br /&gt;Well, where did the 20 MB of missing memory go? Now, check the size of the Streams Pool: &lt;br /&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;SQL&amp;gt; show parameter streams_pool_size&lt;br /&gt;&lt;br /&gt;NAME TYPE VALUE&lt;br /&gt;------------------------------------ ----------- -----&lt;br /&gt;streams_pool_size big integer 20M&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The Streams Pool was 0 earlier, as you intended it to be; but Oracle allocated 20 MB to it by stealing that much memory from the buffer cache. The reason: the Streams Pool was used for the Data Pump Export job, even though it does not sound intuitive. If you check the alert log, you will see the activity recorded there: &lt;br /&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;$ adrci&lt;br /&gt;&lt;br /&gt;ADRCI: Release 11.2.0.1.0 - Production on Thu Apr 18 14:44:46 2013&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.&lt;br /&gt;&lt;br /&gt;ADR base = "/opt/oracle"&lt;br /&gt;adrci&amp;gt; set homepath diag/rdbms/d112d2/D112D2&lt;br /&gt;adrci&amp;gt; show alert -tail –f&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here are the excerpts from the alert log: &lt;br /&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;2013-04-18 14:48:45.581000 -04:00&lt;br /&gt;streams_pool_size defaulting to 20971520. Trying to get it from Buffer Cache for process 27378.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The next question you may be wondering about is – why did Oracle decide to give only 20 MB to the Streams Pool? Why not 100 MB, or 10 MB? Is it dependent on the size of the table being exported? The answer is no. &lt;br /&gt;&lt;br /&gt;Oracle by default gives 10% of the size of the shared pool to the Streams Pool. Let me find out the size of the shared pool: &lt;br /&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;SQL&amp;gt; show parameter shared_pool_size&lt;br /&gt;&lt;br /&gt;NAME TYPE VALUE&lt;br /&gt;------------------------------------ ----------- -----&lt;br /&gt;shared_pool_size big integer 200M&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The shared pool is 200 MB. 10% of that is 20 MB, which is how much was assigned to the Streams Pool. That size is not dependent on the size of the exported data; but the size of the shared pool. &lt;br /&gt;&lt;br /&gt;It's important to understand that the shared pool is used to compute the default size of the streams pool; the actual memory is carved out of buffer cache; not the shared pool.&lt;br /&gt;&lt;br /&gt;If you check the database’s operations, you will be able to confirm Oracle’s adjustment of the pools: &lt;br /&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;SQL&amp;gt; select component, oper_type, parameter, initial_size, target_size, final_size&lt;br /&gt;2 from v$sga_resize_ops&lt;br /&gt;3 order by start_time;&lt;br /&gt;&lt;br /&gt;COMPONENT OPER_TYPE PARAMETER INITIAL_SIZE TARGET_SIZE FINAL_SIZE&lt;br /&gt;--------------- ------------- -------------------- ------------ ----------- ----------&lt;br /&gt;DEFAULT buffer STATIC db_cache_size 0 314572800 314572800&lt;br /&gt;cache&lt;br /&gt;DEFAULT buffer SHRINK db_cache_size 314572800 293601280 293601280&lt;br /&gt;cache&lt;br /&gt;streams pool GROW streams_pool_size 0 20971520 20971520&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The output has been truncated to show only the relevant records. From the output you can see clearly that the buffer cache was defined statically as 314572800, or 300 MB initially. Later the buffer cache shrank from 314572800 to 293601280 (about 280 MB). The amount of shrinkage was 314572800 - 293601280 = 20971520 (or, 20 MB), the exact amount the &lt;code&gt;streams_pool_size&lt;/code&gt; was allocated.&lt;br /&gt;&lt;br /&gt;Why this is a problem? Well, the biggest problem is that the buffer cache size is now reduced without your knowledge. The buffer cache lost 10% of the shared pool. But systems with large shared pool, it could be substantial. Worse, the amount allocated to Streams Pool remains there; it is not returned to the buffer cache as you might expect. You have to manually give it back: &lt;br /&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;SQL&amp;gt; alter system set streams_pool_size = 0;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In case of a RAC database, it’s possible that only one instance sees this change in Streams Pool size; the other instances will be unaffected.&lt;br /&gt;&lt;br /&gt;It would be prudent to note here that this surprise occurs when you do not use automatic SGA settings. When auto SGA is used, i.e. &lt;code&gt;sga_target&lt;/code&gt; is set to a non-zero value, you give up complete control to Oracle to manipulate the memory structures. In that case Oracle juggles the memory between various pools – including Streams Pool - without your control anyway.&lt;br /&gt;&lt;br /&gt;While it is not very well known, this behavior is not undocumented. It’s mentioned in the Utilities Guide at &lt;a href="http://docs.oracle.com/cd/E11882_01/server.112/e22490/dp_perf.htm#SUTIL973"&gt;http://docs.oracle.com/cd/E11882_01/server.112/e22490/dp_perf.htm#SUTIL973&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Conclusion &lt;/h1&gt;Just because you haven’t defined the &lt;code&gt;streams_pool_size&lt;/code&gt; parameter as you don’t use Streams&amp;nbsp;doesn't&amp;nbsp;mean that Oracle will not assign some memory to Streams Pool. Data Pump, which is frequently used in many databases, uses the Streams Pool and Oracle will assign it as 10% of the size of the shared pool and reduce the buffer cache by that amount to fund the memory for the Streams Pool. So you should configure the Streams Pool, even if you don’t use Streams, so that Data Pump can use a precisely allocated pool it rather than stealing it from the Buffer Cache. If you don’t do that now, or don’t intend to do it, then regularly check the &lt;code&gt;streams_pool_size&lt;/code&gt; value and set it to zero if it is not so. &lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/7061780442417538123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=7061780442417538123' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/7061780442417538123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/7061780442417538123'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2013/04/streams-pool-is-only-for-streams-think.html' title='Streams Pool is only for Streams? Think Again!'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-7163693325800221552</id><published>2013-04-18T13:16:00.000-04:00</published><updated>2013-04-20T19:55:02.332-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='foreign key'/><category scheme='http://www.blogger.com/atom/ns#' term='ITL Wait'/><category scheme='http://www.blogger.com/atom/ns#' term='insert causing deadlocks'/><category scheme='http://www.blogger.com/atom/ns#' term='primary key'/><category scheme='http://www.blogger.com/atom/ns#' term='deadlocks'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Application Design is the only Reason for Deadlocks? Think Again</title><content type='html'>&lt;span style="color: #38761d;"&gt;[Updated on 4/20/2013 after feedback from &lt;/span&gt;&lt;a href="http://hoopercharles.wordpress.com/" rel="nofollow" target="_blank"&gt;&lt;span style="color: #38761d;"&gt;Charles Hooper&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #38761d;"&gt;, &lt;/span&gt;&lt;a href="http://jonathanlewis.wordpress.com/" rel="nofollow" target="_blank"&gt;&lt;span style="color: #38761d;"&gt;Jonathan Lewis&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #38761d;"&gt;,&amp;nbsp;&lt;a href="http://laurentschneider.com/" rel="nofollow" target="_blank"&gt;&lt;span style="color: #6aa84f;"&gt;Lau&lt;/span&gt;&lt;span style="color: #38761d;"&gt;rent Schneider&lt;/span&gt;&lt;/a&gt;&amp;nbsp;and &lt;/span&gt;&lt;a href="http://www.blogger.com/profile/11687776847553675567" rel="nofollow" target="_blank"&gt;&lt;span style="color: #38761d;"&gt;Mohamed Houri&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #38761d;"&gt;&amp;nbsp;and with some minor cosmetic enhancements of outputs] &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Have you ever seen a message “ORA-00060: Deadlock detected” and automatically assumed that it was an application coding issue? Well, it may not be. There are DBA-related issues and you may be surprised to find out that INSERTs may cause deadlock. Learn all the conditions that precipitate this error, how to read the "deadlock graph" to determine the cause, and most important: how to avoid it.&lt;br /&gt;&lt;h1&gt;Introduction&lt;/h1&gt;I often get a lot of questions in some form or the other like the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;What's a Deadlock&lt;/li&gt;&lt;li&gt;How can I prevent it&lt;/li&gt;&lt;li&gt;Why would an INSERT cause deadlock&lt;/li&gt;&lt;li&gt;Why would I need to index FK columns&lt;/li&gt;&lt;li&gt;Is ON DELETE CASCADE FK constraint a good idea?&lt;/li&gt;&lt;/ul&gt;Deadlock is one of those little understood and often misinterpreted concepts in the Oracle Database. The word rhymes with locking, so most people assume that it is some form of row locking. Broadly speaking, it’s accurate; but not entirely. There could be causes other than row level locking. This is also often confused by people new to Oracle technology since the term deadlock may have a different meaning in other databases. To add to the confusion, Oracle’s standard response to the problem is that it’s an application design issue and therefore should be solved through application redesign. Well, in a majority of cases application design is a problem; but not in all cases. In this post, I will describe:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Why Deadlocks Occur&lt;/li&gt;&lt;li&gt;Primer on Oracle Latching, Locking&lt;/li&gt;&lt;li&gt;How to Interpret Deadlock Traces&lt;/li&gt;&lt;li&gt;Various Cases of Deadlocks&lt;/li&gt;&lt;li&gt;Some Unusual Cases from My Experience&lt;/li&gt;&lt;/ol&gt;&lt;h1&gt;Deadlocks Explained&lt;/h1&gt;With two Oracle sessions each locking the resource requested by the other, there will never be a resolution because both will be hanging denying them the opportunity to commit ot rollback and therefore releasing the lock. Oracle automatically detects this deadly embrace and breaks it by forcing one statement to&amp;nbsp;roll back&amp;nbsp;abruptly (and releasing the lock) and letting the other transaction to continue. &lt;br /&gt;&lt;br /&gt;Here is how a deadlock occurs. Two sessions are involved, doing updates on different rows, as shown below:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Step Session 1           Session 2&lt;br /&gt;---- ------------------- -----------------&lt;br /&gt;1.   Update Row1&lt;br /&gt;     (Does not Commit)&lt;br /&gt;2.                       Update Row2&lt;br /&gt;                        (Does not Commit)&lt;br /&gt;3.   Update Row2&lt;br /&gt;4.   Waits on TX Enqueue&lt;br /&gt;5.                       Update Row1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;At the step 5 above since Row1 is locked by session1, session2 will wait; but this wait will be forever, since session1 is also waiting and can’t perform a commit or rollback until that wait is over. But session 1's wait will continue to exist until session 2 commits or rollback - a Catch 22 situation. This situation is a cause of&amp;nbsp;deadlock and Oracle triggers the ststement at Step&amp;nbsp;3 to be rolled back (since it detected that deadlock). Note that only the&amp;nbsp;statement that detected the deadlock is rolled; the previous statements stay. For instance, update row1 in Step 1 stays.&lt;br /&gt;&lt;br /&gt;This is the most common cause of deadlocks and is purely driven by application design and can only be solved by reducing the possibility of occurence of that scenario. Now that you understand how a deadlock occurs, we will explore some other causes of deadlocks. But before that, we will explore different types of locks in Oracle.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Types of Locks&lt;/h2&gt;Database locks are queue-based, i.e. the session first waiting for the lock will get it first, before another session which started waiting for the same resource after the first session. The requesters are placed in a queue, hence locks are also called &lt;b&gt;Enqueues&lt;/b&gt;. There are several types of enqueues; but we will focus on row locking, and specifically only two type of them:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;TM &lt;/b&gt;– this is related to database structural changes. Suppose someone is executing some query against a table, such as SELECTing from it. The table structure should remain the same in that period. TM locks protect the table structure so that someone does not add a column during that query. TM locks allow multiple queries and DMLs, but not DDL against the table.&lt;/li&gt;&lt;li&gt;&lt;b&gt;TX &lt;/b&gt;– this is the row level locking. When a row is locked by a session, this type of lock is acquired. &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h1&gt;Anatomy of a Deadlock Trace&lt;/h1&gt;When a deadlock occurs and one of the statements gets rolled back, Oracle records the incident in the alert log. Here is an example entry:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt; ORA-00060: Deadlock detected. More info in file&lt;br /&gt;/opt/oracle/diag/rdbms/odba112/ODBA112/trace/ODBA112_ora_18301.trc.&lt;/pre&gt;&lt;br /&gt;Along with the alert log entry, the incident creates a tracefile (as shown above). The trace file shows valuable information on the deadlock and should be your first stop in diagnosis. Let's see the various sections of the tracefile:&lt;br /&gt;&lt;h2&gt;Deadlock Graph&lt;/h2&gt;The first section is important; it shows the deadlock graph. Here are the various pieces of information on the graph. Deadlock graph tells you which sessions are involved, what types of locks are being sought after, etc. Let's examine the deadlock graph, shown in the figure below:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-T7p4s4Nj8dE/UXAnmOSCYoI/AAAAAAAAAt8/sLj0wZLi54c/s1600/Fig1.png" imageanchor="1"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-T7p4s4Nj8dE/UXAnmOSCYoI/AAAAAAAAAt8/sLj0wZLi54c/s320/Fig1.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;h2&gt;Row Information &lt;/h2&gt;The next critical section shows the information on the rows locked during the activities of the two sessions. From the tracefile you can see the object ID. Using that, you can get the object owner and the name from the DBA_OBJECTS view. The information in on rowID is also available here. You can get primary key information from the object using that rowID.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-am69X-irsiw/UXAoGYfkEVI/AAAAAAAAAuU/pnD-BBbJ51k/s1600/fig2.png" imageanchor="1"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-am69X-irsiw/UXAoGYfkEVI/AAAAAAAAAuU/pnD-BBbJ51k/s320/fig2.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;h2&gt;Process Information&lt;/h2&gt;The tracefile also shows the Oracle process information which displays the calling user. That information is critical since the schema owner may &lt;i&gt;not &lt;/i&gt;be the one that issued the statement. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-GjC1F8tAgYo/UXAoNqHiH3I/AAAAAAAAAuc/7fyh5R8M40E/s1600/fig3.png" imageanchor="1"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-GjC1F8tAgYo/UXAoNqHiH3I/AAAAAAAAAuc/7fyh5R8M40E/s320/fig3.png" /&gt;&lt;/a&gt;&lt;br /&gt;With the information collected from various sections of the deadlock graph, you now know the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The session that caused it&lt;/li&gt;&lt;li&gt;The session that was the victim&lt;/li&gt;&lt;li&gt;The Oracle SID and process ID of the sessions&lt;/li&gt;&lt;li&gt;The object (the table, materialized view, etc.) whose row was in the deadlock&lt;/li&gt;&lt;li&gt;The exact row that was so popular to cause the deadlock.&lt;/li&gt;&lt;li&gt;The SQL statement that caused the deadlock.&lt;/li&gt;&lt;li&gt;The machine the session came from with the module, program (e.g. SQL*Plus) and userid information&lt;/li&gt;&lt;/ul&gt;Now it is a cinch to know the cause of that deadlock and which specific part of the application you need to address to fix it.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Other Causes&lt;/h2&gt;The case described above is just one type of locking scenario causing deadlocks; but this is not the only one. Other types of locks also cause deadlocks. These scenarios are usually difficult to identify and diagnose and are often misinterpreted. Well, not for you.You will learn how to diagnose these other causes in this post. These causes include:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;ITL Waits&lt;/li&gt;&lt;li&gt;Bitmap Index Update&lt;/li&gt;&lt;li&gt;Direct Path Load&lt;/li&gt;&lt;li&gt;Overlapping PK Values&lt;/li&gt;&lt;/ol&gt;&lt;h1&gt;Deadlocks due to ITL Shortage &lt;/h1&gt;You can read how ITL works in another of my blogposts - &lt;a href="http://arup.blogspot.com/2011/01/how-oracle-locking-works.html"&gt;How Oracle Locking Works&lt;/a&gt;. In summary, when a session locks a row, it does not go to a central lock repository and get a lock from there. Instead, the session puts the information on the lock in the header of the block, called Interested Transaction List (ITL). Each ITLslot takes up 24 bytes. Figure 1 below shows an empty block with just one ITL slot. When rows are inserted, from bottom of the block upwards, the free space gradually drops.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-f4PT8I4cTKk/UXAoVqoephI/AAAAAAAAAuk/fD37vAWuEqM/s1600/fig4.PNG" imageanchor="1"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-f4PT8I4cTKk/UXAoVqoephI/AAAAAAAAAuk/fD37vAWuEqM/s320/fig4.PNG" /&gt;&lt;/a&gt;&lt;br /&gt;When a session - session1 - wants to lock the row1, it uses the slot#1 of the ITL, as shown in Figure 3 below. Later, another session – session2 – updates row2. Since there is no more ITL slot, Oracle creates a new slot – slot#2 – for this transaction. However, at this stage, the block is almost packed. If a third transaction comes in, there will be no more room for a third ITL slot to be created; causing the session to wait on ITL. Remember, this new session wants to lock &lt;i&gt;row3&lt;/i&gt;, which is not locked by anyone and could have been locked by the session; but it’s artificially prevented from being locked due to the absence of an ITL slot.&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-f97Mvxlzjko/UXAoewnsjfI/AAAAAAAAAus/4kGIL9byWUc/s1600/fig5.png" imageanchor="1"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-f97Mvxlzjko/UXAoewnsjfI/AAAAAAAAAus/4kGIL9byWUc/s320/fig5.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;h2&gt;Checking for ITL Shortage&lt;/h2&gt;You can check for ITL shortage by issuing this query:&lt;br /&gt;&lt;pre&gt;select owner, object_name, value&lt;br /&gt;from v$segment_statistics&lt;br /&gt;where statistic_name = 'ITL waits'&lt;br /&gt;and value &amp;gt; 0&lt;/pre&gt;Here is a sample output:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;OWNER       OBJECT_NAME                    VALUE&lt;br /&gt;----------- ------------------------- ----------&lt;br /&gt;SYSMAN      MGMT_METRICS_1HOUR_PK             19&lt;br /&gt;ARUP        DLT2                              23&lt;br /&gt;ARUP        DLT1                             131&lt;br /&gt;&lt;/pre&gt;If you check the EVENT column of V$SESSION to see which sessions are experiencing it right now, you will see that the sessions are waiting with the event: &lt;code&gt;enq: TX - allocate ITL entry&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Deadlock Scenario&lt;/h2&gt;Here is the scenario where two sessions cause a deadlock due to ITL shortage. Imagine two rows – row1 and row2 – are in the &lt;i&gt;same block&lt;/i&gt;. The block is so tightly packed that only two ITL slots can be created.&lt;br /&gt;&lt;table border="1" cellpadding="2" cellspacing="2" style="width: 100%px;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign="top"&gt;&lt;strong&gt;Step&lt;/strong&gt;&lt;/td&gt;&lt;td valign="top"&gt;&lt;strong&gt;Session1&lt;/strong&gt;&lt;/td&gt;&lt;td valign="top"&gt;&lt;strong&gt;Session2&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;1&lt;/td&gt;&lt;td valign="top"&gt;Update Table1 Row1&lt;br /&gt;(1 ITL slot is used; no more free ITL slots and no room in the block to create one)&lt;/td&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;2&lt;/td&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td valign="top"&gt;Update Table2 Row1&lt;br /&gt;(One ITL slot is gone. There are no more free ITL slots and no room to create one)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;3&lt;/td&gt;&lt;td valign="top"&gt;Update Table2 Row2&lt;br /&gt;(Lack of ITL slots; so this will hang)&lt;/td&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;4&lt;/td&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td valign="top"&gt;Update Table1 Row2&lt;br /&gt;(Lack of ITL slots will make this hang as well. &lt;b&gt;Deadlock&lt;/b&gt;!)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;At Step 4 Session 2's hang can't be resolved until session 1 releases the lock, which is not possible since it itself is hanging. This never ending situation is handled by Oracle by detecting it as a deadlock and killing one of the sessions.&lt;br /&gt;&lt;h2&gt;Deadlock Graph&lt;/h2&gt;To identify this scenario as the cause of deadlock, look at the deadlock graph. This is how a deadlock graph looks like when caused by ITL waits.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-NGRYcR7t-ws/UXAosPh5NnI/AAAAAAAAAu0/3MqUimXHDxU/s1600/fig6.png" imageanchor="1"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-NGRYcR7t-ws/UXAosPh5NnI/AAAAAAAAAu0/3MqUimXHDxU/s320/fig6.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The absence of row information on one of the sessions is a dead giveaway that this is a block level issue; not related to specific rows. Here are the clues in this deadlock graph:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The lock type is TX (row lock) for both the sessions &lt;/li&gt;&lt;li&gt;The holders held the lock in "X" (exclusive) mode (this is expected for TX locks)&lt;/li&gt;&lt;li&gt;However, only one of the waiters is waiting in the "X" mode. The other is waiting with the "S" (shared) mode, indicating that it's not really a row lock the session is waiting for.&lt;/li&gt;&lt;li&gt;One session has the row information; the other doesn't.&lt;/li&gt;&lt;/ul&gt;These clues give you the confirmation that this is an ITL related deadlock; not because of the application design. Further down the tracefile we see:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-STwFAikKGD0/UXAox9i8zII/AAAAAAAAAu8/NfCIwQ9cCFY/s1600/fig7.png" imageanchor="1"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-STwFAikKGD0/UXAox9i8zII/AAAAAAAAAu8/NfCIwQ9cCFY/s320/fig7.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;As you can see, it’s not 100% clear from the tracefile that the deadlock was caused by ITL. However by examining the tracefile we see that the locks are of TX type and the wait is in the “S” (shared) mode. This usually indicates ITL wait deadlock. You can confirm that is the case by checking the ITL shortages on that segment from the view V$SEGMENT_STATISTICS as shown earlier.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #6aa84f;"&gt;Update on 4/19/2013: [Thanks, &lt;/span&gt;&lt;a href="http://jonathanlewis.wordpress.com/" rel="nofollow" target="_blank"&gt;&lt;span style="color: #6aa84f;"&gt;Jonathan Lewis&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #6aa84f;"&gt;]&lt;/span&gt; Occasionally you may see two rows here as well, as a result of a previous wait (e.g. buffer busy wait) on the block which has not been cleaned out yet. In such a case you will see information on two rows; but there are some other clues that may point to this cause. The row portion of the rowid will be 0, meaning it was not a row but the block. The other clue might be that the row information points to a row that has nothing to do with the SQL statement. For instance, you may find the row information pointing to a row in table Table1 whereas the SQL statement is "update Table2 set col2 = 'X' where col1 = 2".&lt;br /&gt;&lt;br /&gt;The solution is very simple. Just increase the INITRANS value of the table. INITRANS determines the initial number of ITL slots. Please note, this value will affect only the new blocks; the old ones will still be left with the old values. To affect the old ones you can issue &lt;code&gt;ALTER TABLE &lt;i&gt;TableName &lt;/i&gt;MOVE&lt;/code&gt; to move the tables to nw blocks and hence new structure.&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Deadlock due to Foreign Key&lt;/h1&gt;This is a really tricky one; but not impossible to identify. When a key value in parent table is updatd or a row is deleted,&amp;nbsp;Oracle attempts to takes&amp;nbsp;TM lock on the entire child table. If an index is present on the foreign key column, then Oracle&amp;nbsp;locates the corresponding child rows and locks only those rows. The documentation in some versions may not very clear on this. There is a documentation bug (MOS Bug# 2546492). In the absense of the index, a whole table TM lock may&amp;nbsp;cause a deadlock. Let's see the scenario when it happens.&lt;br /&gt;&lt;h2&gt;Scenario&lt;/h2&gt;Here is the scenario when this deadlock occurs.&lt;br /&gt;&lt;table border="1" cellpadding="2" cellspacing="2" style="width: 100%px;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign="top"&gt;&lt;b&gt;Step&lt;/b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/td&gt;&lt;td valign="top"&gt;&lt;b&gt;Session1&lt;/b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/td&gt;&lt;td valign="top"&gt;&lt;b&gt;Session2&lt;/b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;1&lt;/td&gt;&lt;td valign="top"&gt;Delete Chaild Row1&lt;/td&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;2&lt;/td&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td valign="top"&gt;Delete Child Row2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;3&lt;/td&gt;&lt;td valign="top"&gt;Delete Parent Row1&lt;br /&gt;(Waits on TM Enqueue)&lt;/td&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;4&lt;/td&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td valign="top"&gt;Delete Parent Row2&lt;br /&gt;(Waits on TM Enqueue)&lt;br /&gt;&lt;b&gt;Deadlock&lt;/b&gt;!&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h2&gt;Deadlock Graph&lt;/h2&gt;This is how the deadlock graph looks like when caused by unindexed foreign key. As you can see, the deadlock graph does not clearly say that the issue was to do with Foreign Key columns not being indexed.Instead, the clues here are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;TM locks for both the sessions, instead of TX. Remember: TM are metadata related, as opposed to TX, which is a row related lock. &lt;/li&gt;&lt;li&gt;The lock type of holders is Share Exclusive (SX) as opposed to Exclusive (X)&lt;/li&gt;&lt;li&gt;Sessions do not show any row information&lt;/li&gt;&lt;/ul&gt;These three clues together show that this deadlock is due to FK contention rather than the conventional row locks. &lt;br /&gt;&lt;br /&gt;So, what do you do? Simple - create the indexes on those FKs and you will not see this again. As a general rule you should have indexes on FKs anyway; but there are exceptions, e.g. a table whose parent key is never updated or deleted infrequently (think a table with country codes, state codes or something pervasive like that). If you see a lot of deadlocks in those cases, perhaps you should create indexes on those tables&amp;nbsp;anyway.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-ApqqE4S7ADk/UXApCIdHnfI/AAAAAAAAAvE/G4lcZ_chKQI/s1600/fig8.png" imageanchor="1"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-ApqqE4S7ADk/UXApCIdHnfI/AAAAAAAAAvE/G4lcZ_chKQI/s320/fig8.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;h1&gt;Deadlock due to Direct Load&lt;/h1&gt;Direct Load is the fastest way to load data into a table from another source such as a table or a text file. It can be effected in two ways – the APPEND hint in INSERT statement ( &lt;code&gt;insert /*+ append */&lt;/code&gt; ) or by using DIRECT=Y option in SQL*Loader. When a table is loaded with Direct Path, the entire table is locked from further DMLs, until committed. This lock may cause deadlocks, when two sessions try to load into the same table, as shown by the scenario below.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Scenario&lt;/h2&gt;&lt;br /&gt;&lt;table border="1" cellpadding="2" cellspacing="2" style="width: 100%px;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign="top"&gt;Step&lt;/td&gt;&lt;td valign="top"&gt;Session1&lt;/td&gt;&lt;td valign="top"&gt;Session2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;1&lt;/td&gt;&lt;td valign="top"&gt;Direct Path Load into Table1&lt;/td&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;2&lt;/td&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td valign="top"&gt;Direct Path Load into Table2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;3&lt;/td&gt;&lt;td valign="top"&gt;Direct Path Load into Table2&lt;br /&gt;(Hangs with TM Enqueue; since Session2 has the lock)&lt;/td&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;4&lt;/td&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td valign="top"&gt;Direct Load into Table1&lt;br /&gt;TM lock on Table1 prevents this operation&lt;br /&gt;&lt;b&gt;Deadlock&lt;/b&gt;!&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;h2&gt;Deadlock Graph&lt;/h2&gt;As usual, the deadlock graph confirms this condition. Here is how the deadlock graph looks like:&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-ka0og9Ry73k/UXApPm7lLEI/AAAAAAAAAvM/YMUbUqzRO1U/s1600/fig9.png" imageanchor="1"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-ka0og9Ry73k/UXApPm7lLEI/AAAAAAAAAvM/YMUbUqzRO1U/s320/fig9.png" /&gt;&lt;/a&gt; Both sessions do not show any row information; and subsequent parts of the tracefile do not show any other relevant information. The key to identify this deadlock as caused by Direct Path is to look for the type of lock mode – X. This type of lock mode exists for row level locking as well. However the deadlock graph shows row information in that case. So, the clues for this type of deadlock are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Lock type is TM (as shown in the Resource Name)&lt;/li&gt;&lt;li&gt;Lock mode for both the holders and waiters is X (indicating a row lock)&lt;/li&gt;&lt;li&gt;No row information (since it is not really row-related)&lt;/li&gt;&lt;/ul&gt;&lt;h1&gt;Deadlock due to Bitmap Index Contention&lt;/h1&gt;Bitmap Index is a special type of index that stores bitmaps of actual values and compare bitmaps to bitmaps, e.g. instead of comparing literals such as "A" = "A", Oracle converts the value to a bitmap and compares against the stored bitmap values. For instance “A” might be represented as "01011"; so the comparison will be “01011” = "01011". Index searches are way faster compared to literal comparison.&lt;br /&gt;&lt;br /&gt;However, there is a price to pay for this performance. Unlike a regular b*tree index, when a row is updated, the index piece of the&amp;nbsp;bitmap index is locked until the transaction is committed. Therefore&amp;nbsp;udates to any of the rows covered&amp;nbsp;by that index piece&amp;nbsp;hangs. When two sessions update two different rows covered by the same index piece, they wait for each other. Here is the scenario when this condition arises.&lt;br /&gt;&lt;h3&gt;Scenario&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/h3&gt;&lt;table border="1" cellpadding="2" cellspacing="2" style="width: 100%px;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign="top"&gt;&lt;b&gt;Step&lt;/b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/td&gt;&lt;td valign="top"&gt;&lt;b&gt;Session1&lt;/b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/td&gt;&lt;td valign="top"&gt;&lt;b&gt;Session2&lt;/b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;1&lt;/td&gt;&lt;td valign="top"&gt;Update Row 1&lt;br /&gt;(Bitmap index piece is locked)&lt;/td&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;2&lt;/td&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td valign="top"&gt;Update Row2&lt;br /&gt;(Hangs for TX Row Lock)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;3&lt;/td&gt;&lt;td valign="top"&gt;Update Row2&lt;br /&gt;(Hangs as bitmap index piece is locked by session2 and can't release until it commits)&lt;br /&gt;&lt;b&gt;Deadlock!&lt;/b&gt;&lt;/td&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;h2&gt;Deadlock Graph&lt;/h2&gt;You can confirm this occurrence from readling the deadlock graph. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-WfLPAG1kzJU/UXApYHLAr7I/AAAAAAAAAvU/f1DGTDICx6I/s1600/fig10.png" imageanchor="1"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-WfLPAG1kzJU/UXApYHLAr7I/AAAAAAAAAvU/f1DGTDICx6I/s320/fig10.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The clues that show this type of deadlock:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The lock type is TX (as shown in the Resource Name)&lt;/li&gt;&lt;li&gt;The lock wait mode is “S” (shared) but the type of lock is TX rather than TM.&lt;/li&gt;&lt;li&gt;The waiter waits with mode "S" instead of "X"&lt;/li&gt;&lt;li&gt;The row information is available but the object ID is not the ID of the table; but the bitmap index. &lt;/li&gt;&lt;/ul&gt;The solution to this deadlock is really simple – just alter the application logic in such a way that the two updates will not happen in sequence without commits in between. If that’s not possible, then you have to re-evaluate the need for a bitmap index. Bitmap indexes are usually for datawarehouse only; not for OLTP. &lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Deadlock due to Primary Key Overlap&lt;/h1&gt;This is a very special case of deadlock, which occurs during inserts; not updates or deletes. This is probably the only case where inserts cause deadlocks. When you insert a record into a table but not commit it, the record goes in but a further insert with the same primary key value waits. This lock is required for Oracle because the first insert may be rolled back, allowing the second one to pass through. If the first insert is committed, then the second insert fails with a PK violation. But in the meantime-before the commit or rollback is issued-the transaction causes the second insert to wait and that causes deadlock. Let's examine the scenario:&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Scenario&lt;/h2&gt;&lt;br /&gt;&lt;table border="1" cellpadding="2" cellspacing="2" style="height: 284px; width: 100%px;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign="top"&gt;&lt;b&gt;Step&lt;/b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/td&gt;&lt;td valign="top"&gt;&lt;b&gt;Session&lt;/b&gt;&lt;b&gt;1&lt;/b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/td&gt;&lt;td valign="top"&gt;&lt;b&gt;Session2&lt;/b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;1&lt;/td&gt;&lt;td valign="top"&gt;Insert PK Col value = 1&lt;br /&gt;(Doesn't commit)&lt;/td&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;2&lt;/td&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td valign="top"&gt;Insert PK Col value = 2&lt;br /&gt;(Doesn't commit)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;3&lt;/td&gt;&lt;td valign="top"&gt;Insert PK Col = 2&lt;br /&gt;(Hangs, until Session2 commits)&lt;/td&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;4&lt;/td&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td valign="top"&gt;Insert PK Col = 1&lt;br /&gt;(Hangs and &lt;b&gt;Deadlock&lt;/b&gt;)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;h2&gt;Deadlock Graph&lt;/h2&gt;The deadlock graph looks like the following. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-XPUm0a7CDdc/UXApfKpfuLI/AAAAAAAAAvc/mnkBBSV_Jk0/s1600/fig11.png" imageanchor="1"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-XPUm0a7CDdc/UXApfKpfuLI/AAAAAAAAAvc/mnkBBSV_Jk0/s320/fig11.png" /&gt;&lt;/a&gt;&lt;br /&gt;The key clues are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The lock type is TX (row lock)&lt;/li&gt;&lt;li&gt;The holders are holding the lock in "X" (exclusive) mode&lt;/li&gt;&lt;li&gt;The waiters are waiting for locks in “S” mode, even when the locks type TX. &lt;/li&gt;&lt;li&gt;The subsequent parts of the tracefile don’t show any row information. &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;However, the latter parts of the tracefile shows the SQL statement, which should be able to point to the cause of the deadlock as the primary key deadlock. Remember, this may be difficult to diagnose first since there is no row information. But this is probably normal since the row is not formed yet (it's INSERT, remember?).&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Special Cases&lt;/h1&gt;I have encountered some very interesting cases of deadlocks which may be rather difficult to diagnose. Here are some of these special cases.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Autonomous Transactions&lt;/h2&gt;Autonomous transactions are ones that are kicked off form inside another transaction. The autonomous one follows its own commit, i.e. it can commit independently of the outer transaction. The autonomous transaction may lock some records the parent transaction might be interested in and vice versa – a perfect condition for deadlocks. Since the autonomous transactions is triggered by its parent, the deadlocks are usually difficult to catch. &lt;br /&gt;&lt;br /&gt;Here is how the deadlock graph looks like (exceprted from the tracefile) &lt;br /&gt;&lt;pre&gt;---------Blocker(s)-------- ---------Waiter(s)---------&lt;br /&gt;Resource Name process session holds waits process session holds waits&lt;br /&gt;TX-0005002d-00001a40 17 14 X 17 14 X&lt;br /&gt;session 14: DID 0001-0011-00000077&lt;br /&gt;session 14: DID 0001-0011-00000077&lt;br /&gt;Rows waited on:&lt;br /&gt;Session 14: obj - rowid = 000078D5 - AAAHjVAAHAAAACOAAA&lt;br /&gt;(dictionary objn - 30933, file - 7, block - 142, slot - 0)&lt;br /&gt;Information on the OTHER waiting sessions:&lt;br /&gt;End of information on OTHER waiting sessions.&lt;br /&gt;&lt;/pre&gt;Here are the interesting things about this deadlock graph, which are clues to identifying this type of deadlock:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The lock type is TX (row lock) and the mode is "X", which is exclusive. This indicates a simple row lock.&lt;/li&gt;&lt;li&gt;Remember, deadlocks are always as a result of two transactions; not one. However, the deadlock graph shows only one session. The other session information is not even there.The presence of only one session indicates that the other transaction originated from the same session - hence only one session was recorded. The only way two transactions could have originated from the same session is when the transaction is an autonomous one.&lt;/li&gt;&lt;li&gt;The row information is not there because the autonomous transaction acts independently of the parent. &lt;/li&gt;&lt;/ul&gt;If you see a deadlock graph like this, you can be pretty much assured that autonomous transactions are to blame.&lt;br /&gt;&lt;br /&gt;Update on 4/19/2013. [Thanks, &lt;a href="http://www.blogger.com/profile/11687776847553675567" rel="nofollow" target="_blank"&gt;Mohamed Houri&lt;/a&gt;] The above cause is not limited to TX locks; it could happen in TM locks as well. The diagnosis remains the same.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Deadlocks among the PQ slaves&lt;/h2&gt;Consider a procedural logic like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt; LOOP&lt;/pre&gt;&lt;pre&gt; &amp;nbsp; SELECT /*+ PARALLEL */ … FOR UPDATE&lt;/pre&gt;&lt;pre&gt; END LOOP&lt;/pre&gt;&lt;br /&gt;This code locks the rows selected by the parallel query slaves. Since the select is done in parallel, the PQ slaves distribute the rows to be selected. Therefore the locking is also distributed among the PQ slaves. Since no two rows are updated by the same PQ slave (and hence the same session), there is no cause for deadlocks.&lt;br /&gt;&lt;br /&gt;However, assume the code is kicked off more than once concurrently. This kicks off several PQ slaves and many query coordinators. In this case there is no guarantee that two slaves (from different coordinators) will not pick up the same row. In that case, you may run into deadlocks.&lt;br /&gt;&lt;h2&gt;Triggers firing Autonomous Transactions&lt;/h2&gt;If you have triggers firing Autonomous Transactions, they may cause deadlocks, in the same line described in the section on autonomous transactions.&lt;br /&gt;&lt;h2&gt;Freelists&lt;/h2&gt;In case of tablespaces defined with manual segment space management, if too many process freelists are defined, it's possible to run out of transaction freelists, causing deadlocks.&lt;br /&gt;&lt;h1&gt;In Conclusion&lt;/h1&gt;The most common cause of deadlocks is the normal row level locking, which is relatively easy to find. But that's not the only reason. ITL Shortage, Bitmap Index Locking, Lack of FK Index, Direct Path Load, PK Overlap are also some of the potential causes. You must check the tracefile and interpret the deadlock graph to come to a definite conclusion on the cause of the deadlock. Some of the causes, e.g. ITL shortage, are to do with the schema design; not application design and are quite easy to solve. Some causes, as in the case of the PK overlap case, INSERTs cause deadlocks.&lt;br /&gt;&lt;br /&gt;I hope you found it useful in diagnosing the deadlock conditions in your system. As always, your feedback is very much appreciated.</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/7163693325800221552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=7163693325800221552' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/7163693325800221552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/7163693325800221552'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2013/04/application-design-is-only-reason-for.html' title='Application Design is the only Reason for Deadlocks? Think Again'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-T7p4s4Nj8dE/UXAnmOSCYoI/AAAAAAAAAt8/sLj0wZLi54c/s72-c/Fig1.png' height='72' width='72'/><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-2766907535601926822</id><published>2013-04-09T00:18:00.000-04:00</published><updated>2013-04-09T00:18:02.779-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='NYOUG'/><category scheme='http://www.blogger.com/atom/ns#' term='Exadata'/><title type='text'>Exadata Article as NYOUG's Article of the Year 2012</title><content type='html'>&lt;html&gt;&lt;head&gt;&lt;title&gt;Exadata Article as NYOUG's Article of the Year 2012&lt;/title&gt;&lt;/head&gt;&lt;body&gt;The Editors of &lt;a href="http://www.nyoug.org/"&gt;New York Oracle User Group (NYOUG)&lt;/a&gt; publication - TechJournal - chose my article &lt;b&gt;Exadata   Demystified&lt;/b&gt; as the &lt;b&gt;Article of the Year&lt;/b&gt;. Here is the snippet from the Editorial:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;h1&gt;&lt;cite&gt;And the Award Goes To …&lt;/cite&gt;&lt;/h1&gt;&lt;cite&gt;&lt;br /&gt;&lt;/cite&gt;&lt;cite&gt;The Editor’s Choice Award for 2013 (for papers written and/or presented in 2012) is awarded to Arup Nanda, author of the paper, Exadata Demystified, published in the current issue of the NYOUG Tech Journal.&amp;nbsp; Arup presented this topic at the December 2012 NYOUG User Group meeting.&amp;nbsp; A long-time DBA (17 years, so far), Arup is a consummate database professional, two-time recipient of Oracle Magazine’s annual excellence awards (DBA of the year, 2003, and Technologist of the Year, 2012), prolific author (coauthor of 4 books and author of more than 300 articles), and a tireless mentor.&amp;nbsp; Arup consistently delivers well-researched and engaging papers and presentations, and is a marvelous educator. &lt;/cite&gt;&lt;cite&gt;&lt;br /&gt;&lt;/cite&gt;&lt;cite&gt;His attention to detail and clear expository style help to make each one of his articles an informative read and his presentations an enjoyable educational experience.&amp;nbsp; If Arup’s Exadata paper had not been chosen for the Editor’s Choice award, his paper, Partitioning: What, When, Why and How, (also published in the current issue) would have taken its place. Whether you agree with my choice of which of his papers is actually more useful for your (or general) purposes, I think you will agree that both are well worth a read, and a re-read, and a forwarding-on. It is a pleasure to have Arup Nanda associated with the NYOUG.&lt;/cite&gt;&lt;cite&gt;&lt;br /&gt;&lt;/cite&gt;&lt;cite&gt;&lt;br /&gt;&lt;/cite&gt;&lt;cite&gt;Thank you, per usual, for all of your huge contributions to the Oracle community.&lt;/cite&gt;&lt;cite&gt;&lt;br /&gt;&lt;/cite&gt;&lt;/blockquote&gt;&lt;br /&gt;Thank you, &lt;a href="email:melanie.caffrey@gmail.com"&gt;Melanie Caffrey&lt;/a&gt; - the Editor of TechJournal. I am humbled and without words. Your recognition of my work is very much appreciated.&lt;br /&gt;&lt;br /&gt;If you are not a member of NYOUG, would you like to read the paper? Well, Melanie (and NYOUG) has graciously provided the permission for me to reproduce this article on my blog. Here it is. Please feel to &lt;a href="http://www.proligence.com/pres/nyoug/2012/nyoug_mar13_exadata_article.pdf"&gt;download    &lt;/a&gt;and read. As always, I would very much like to know what &lt;i&gt;you&lt;/i&gt;thought.&lt;br /&gt;&lt;br /&gt;While on that topic, you may also want to check out my four article series on &lt;a href="http://arup.blogspot.com/p/collection-of-some-of-my-very-popular.html"&gt;Exadata Command Reference&lt;/a&gt; on Oracle Technology Network. It describes various tools, utilities and commands to become an expert Database Machine Administrator (DMA) of Exadata.&lt;br /&gt;&lt;br /&gt;&lt;/body&gt;&lt;/html&gt;</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/2766907535601926822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=2766907535601926822' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/2766907535601926822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/2766907535601926822'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2013/04/exadata-article-as-nyougs-article-of.html' title='Exadata Article as NYOUG&apos;s Article of the Year 2012'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-6230436060534057755</id><published>2013-04-05T21:40:00.000-04:00</published><updated>2013-04-05T21:40:45.847-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Listener Logs'/><category scheme='http://www.blogger.com/atom/ns#' term='ADR'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Switching Back to Regular Listener Log Format</title><content type='html'>Did you ever miss the older listener log file format and want to turn off the ADR-style log introduced in 11g? Well, it's really very simple.&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Problem&lt;/h1&gt;&lt;br /&gt;&lt;br /&gt;Oracle introduced the Automatic Diagnostic Repository (ADR) with Oracle 11g Release 1. This introduced some type of streamlining of various log and trace files generated by different Oracle components such as the database, listener, ASM, etc. this is why you didn't find the alert log in the usual location specified by the familiar &lt;code&gt;background_dump_dest&lt;/code&gt; initialization parameter but in a directory specified by a diferent parameter - &lt;code&gt;ADR_BASE&lt;/code&gt;. Similarly listener logs now go in this format: &lt;br /&gt;&lt;pre&gt;$ADR_BASE/tnslsnr/&lt;hostname&gt;/listener/alert/log.xml&lt;/hostname&gt;&lt;/pre&gt;Remember, this is in the XML format; not the usual listener.log. The idea was to present the information in the listener log in a consistent, machine readable format instead of the usually cryptic inconsistent older listener log format. Here is an example of the new format: &lt;br /&gt;&lt;pre&gt;&amp;lt;msg&amp;nbsp; time='2013-03-31T13:17:22.633-04:00' org_id='oracle' comp_id='tnslsnr'&lt;br /&gt;&amp;nbsp; type='UNKNOWN' level='16' host_id='oradba2'&lt;br /&gt;&amp;nbsp; host_addr='127.0.0.1' version='1'&lt;br /&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;txt&amp;gt;31-MAR-2013 13:17:22 * service_update * D112D2 * 0&amp;lt;/txt&amp;gt;&lt;br /&gt;&amp;lt;/msg&amp;gt;&lt;br /&gt;&amp;lt;msg&amp;gt;&amp;nbsp;time='2013-03-31T13:17:25.317-04:00' org_id='oracle' comp_id='tnslsnr'&lt;br /&gt;&amp;nbsp;type='UNKNOWN' level='16' host_id='oradba2'&lt;br /&gt;&amp;nbsp;host_addr='127.0.0.1'&lt;br /&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;txt&amp;gt;WARNING: Subscription for node down event still pending&amp;nbsp;&amp;lt;/txt&amp;gt;&lt;br /&gt;&amp;lt;/msg&amp;gt;&lt;br /&gt;&lt;/pre&gt;Being in XML format, many tools now can be made to read the files unambiguously since the data is now enclosed within meaningful tags. Additionally the listener log files (the XML format) is now rotated. After reaching a certain threshold value the file is renamed to log_1.xml and a new log.xml is created - somewhat akin to the archived log concept in the case of redo log files. &lt;br /&gt;While it proved useful for new tools, there was also the presence of myriads of tools that read the older log format perfectly. So Oracle didn't stop the practice of writing to the old format log. The old format log was still called &lt;code&gt;listener.log&lt;/code&gt; but the directory it is created in is different - &lt;code&gt;$ADR_BASE/tnslsnr/&lt;i&gt;Hostname&lt;/i&gt;/listener/trace&lt;/code&gt;. Unfortunately there is no archiving scheme for this file so&amp;nbsp;this simply kept growing.&lt;br /&gt;In the pre-11g days you could temporarily redirect the log to a different location and archive the old one by setting the following parameter in listener.ora: &lt;br /&gt;&lt;pre&gt;log_directory = &lt;i&gt;tempLocation&lt;/i&gt;&lt;/pre&gt;However, in Oracle 11g R1 and beyond, this will not work; you can't set the location of the log_directory. &lt;br /&gt;&lt;h1&gt;Solution&lt;/h1&gt;So, what's the solution? Simple. Just set the following parameter in listener.ora: &lt;br /&gt;&lt;pre&gt;diag_adr_enabled_listener = off&lt;/pre&gt;This will disable the ADR style logging for the listener. Now, suppose you want to set the directory to /tmp and log file name to listener_0405.log, add the following into listener.ora (assuming the name of the listener is "listener"; otherwise make the necessary change below): &lt;br /&gt;&lt;pre&gt;log_file_listener = listener_0405.log&lt;br /&gt;log_directory_listener = /tmp&lt;br /&gt;&lt;/pre&gt;That's it. the ADR style logging will be permanently be gone and you will be reunited with your highly missed pre-11g style logging. You can confirm it: &lt;br /&gt;&lt;pre&gt;LSNRCTL&amp;gt; status&lt;br /&gt;Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))&lt;br /&gt;STATUS of the LISTENER&lt;br /&gt;------------------------&lt;br /&gt;Alias&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; listener&lt;br /&gt;Version&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TNSLSNR for Linux: Version 11.2.0.1.0 - Production&lt;br /&gt;Start Date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 26-NOV-2012 16:50:58&lt;br /&gt;Uptime&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 129 days 15 hr. 33 min. 31 sec&lt;br /&gt;Trace Level&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; off&lt;br /&gt;Security&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON: Local OS Authentication&lt;br /&gt;SNMP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OFF&lt;br /&gt;Listener Parameter File&amp;nbsp;&amp;nbsp; /opt/oracle/product/11.2.0/grid/network/admin/listener.ora&lt;br /&gt;&lt;span style="color: red;"&gt;Listener Log File&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /tmp/listener_0405.log&lt;/span&gt;&lt;br /&gt;Listening Endpoints Summary...&lt;br /&gt;&amp;nbsp; (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))&lt;br /&gt;&amp;nbsp; (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oradba2)(PORT=1521)))&lt;br /&gt;&lt;br /&gt;Services Summary...&lt;br /&gt;&lt;br /&gt;Service "+ASM" has 1 instance(s).&lt;br /&gt;&lt;br /&gt;&lt;i&gt;... output truncated ...&lt;/i&gt;&lt;/pre&gt;Happy logging.&lt;br /&gt;&lt;br /&gt;P.S. By the way, you can also change the values by issuing &lt;b&gt;set&lt;/b&gt; commands from &lt;code&gt;LSNRCTL &lt;/code&gt;command prompt: &lt;br /&gt;&lt;pre&gt;LSNRCTL&amp;gt; set log_file '/tmp'&lt;/pre&gt;However, if you have heeded my &lt;a href="http://arup.blogspot.com/2008/08/why-should-you-set-adminrestrictionslis.html"&gt;advice earlier&lt;/a&gt;, you might have set admin_restrictions to ON; so can't use the set command. Instead, you would put the value in listener.ora and reload the listener for the desired effect.&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/6230436060534057755/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=6230436060534057755' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/6230436060534057755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/6230436060534057755'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2013/04/switching-back-to-regular-listener-log.html' title='Switching Back to Regular Listener Log Format'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-2535189646618961704</id><published>2013-02-15T20:30:00.002-05:00</published><updated>2013-02-15T20:30:35.679-05:00</updated><title type='text'>My Sessions in RMOUG 2013</title><content type='html'>Many thanks for attending my sessions (I had a whopping &lt;em&gt;four&lt;/em&gt; of them!) ar Rocky Mountain Oracle User Group Training Days 2013. I was pleasantly surprised to find some attending all four. Thank you. You all made my day.&lt;br /&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;a href="http://bit.ly/XUw2ea" target="_blank"&gt;Here&lt;/a&gt; you can download the slides and the demo scripts I used. Sorry about the delay. I didn't get a chance to post these earlier. &lt;br /&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;ol&gt;&lt;li&gt;Exadata for Oracle DBAs&lt;/li&gt;&lt;li&gt;RAC for Beginners&lt;/li&gt;&lt;li&gt;Beginning Performance Tuning &lt;/li&gt;&lt;li&gt;Stats with Confidence &lt;/li&gt;&lt;li&gt;Stats with Intelligence&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;As always, your &lt;a href="mailto:arup@proligence.com" target="_blank"&gt;feedback&lt;/a&gt; will be greatly appreciated.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/2535189646618961704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=2535189646618961704' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/2535189646618961704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/2535189646618961704'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2013/02/my-sessions-in-rmoug-2013.html' title='My Sessions in RMOUG 2013'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-165846097904835027</id><published>2013-02-07T12:02:00.000-05:00</published><updated>2013-02-07T12:02:02.925-05:00</updated><title type='text'>Boston DBA SIG Feb 6, 2013 Meeting Materials</title><content type='html'>Thank you all for coming to my session - &lt;strong&gt;Exadata from Beginner to Advanced in 3 Hours&lt;/strong&gt; - on an evening in the dead of winter and staying for 4 hours. It was an amazing experience for me to see the sheer volume of interaction, which can only mean the depth of engagement of the attendees - a dream for any speaker. Thank you.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://proligence.com/pres/bostonsig_exadata_beginner/deck.pdf" target="_blank"&gt;Here&lt;/a&gt; is the deck for the session which contains the scripts I used in the demo. Hope you enjoy them. As always, I will appreciate any feedback - good, ugly and anything in between.&lt;br /&gt;&lt;br /&gt;Congratulation to those who won the upcoming book from Apress: &lt;a href="http://www.apress.com/9781430249146" target="_blank"&gt;Expert Exadata Recipes by John Clarke&lt;/a&gt;. It's the latest, and arguably the best book on Exadata so far. No; I am not the author and I have no incentive to promote this book in any way. But I have had the privilege to be the technical reviewer and I have first hand account of the quality of the book.</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/165846097904835027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=165846097904835027' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/165846097904835027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/165846097904835027'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2013/02/boston-dba-sig-feb-6-2013-meeting.html' title='Boston DBA SIG Feb 6, 2013 Meeting Materials'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-8912593261157858535</id><published>2012-11-22T20:28:00.000-05:00</published><updated>2012-11-22T20:28:03.593-05:00</updated><title type='text'>Thanksgiving Thoughts</title><content type='html'>&lt;br /&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 11pt; line-height: 115%;"&gt;Today is &lt;b&gt;Thanksgiving Day&lt;/b&gt; in the US. For those who are not familiar with American holidays and traditions, Thanksgiving is a really tribute to cooperation and camaraderie. There are many theories and&amp;nbsp;&lt;/span&gt;&lt;span style="font-size: 15px; line-height: 17px;"&gt;folklore&lt;/span&gt;&lt;span style="font-size: 11pt; line-height: 115%;"&gt;&amp;nbsp;surrounding the concept; but I think one trumps over the rest. More than four scores ago when the pilgrims from England set foot in North America and decided to call it their home, they&amp;nbsp;&lt;/span&gt;&lt;span style="font-size: 15px; line-height: 17px;"&gt;didn't&lt;/span&gt;&lt;span style="font-size: 11pt; line-height: 115%;"&gt;&amp;nbsp;encounter a Welcome to America sign at JFK airport. Harsh New England weather was just one of the many sobering reminders of the fate of things to come for the visitors. The pilgrims&amp;nbsp;&lt;/span&gt;&lt;span style="font-size: 15px; line-height: 17px;"&gt;didn't&lt;/span&gt;&lt;span style="font-size: 11pt; line-height: 115%;"&gt;&amp;nbsp;have a Walmart and a credit card to swipe for potatoes and cereal; they had to grow their own food. Well, they did that in their own country; but they had no idea how to do that in this strange land. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri; font-size: x-small;"&gt;&lt;span style="font-size: 11.0pt; line-height: 115%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri; font-size: x-small;"&gt;&lt;span style="font-size: 11.0pt; line-height: 115%;"&gt;Fortunately for them, they got help from the Native Americans who taught them farming in this unfamiliar terrain. Had it not been for those helpful locals, the pilgrims would have perished in the first winter cold and perhaps there would not have been a United States of America later. To show their appreciation, the newly minted “Americans” (of course, a term yet to be used) organized a feast for their comrades and called it a symbol of giving their thanks. It would take hundred and fifty more years before George Washington, the first president of the new nation called USA formally declare the Thanksgiving Holidays as a firmly footed American tradition; but the spirit of the Thanksgiving has been in American hearts since early 17th century. This is time of the year we explicitly give thanks to all those who we benefited from, derive our joys from and to those who define who and what we are today.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri; font-size: x-small;"&gt;&lt;span style="font-size: 11.0pt; line-height: 115%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri; font-size: x-small;"&gt;&lt;span style="font-size: 11.0pt; line-height: 115%;"&gt;I was not born in this country. I came when I was 22 - young and stupid; with a sense of adventure and trepidation at the same time - in some ways like the pilgrims. I was yet another immigrant into the melting pot called the USA; but there is a not a day goes by I think about the wonderful people who helped me through, made me feel at ease - taking me to grocery shopping to ballgames, regaling me with stories of hunting and trekking, and dropping down in the foot-deep snow to change the flat tire of my car. All little to big acts - but all hallmarks of this great land and the people who live in it. I am thankful to all those who have have held my hand in the darkest of the times and sweetest of the moments - and made me who I am today; are doing it and I am sure will continue to do it for the rest of my life.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri; font-size: x-small;"&gt;&lt;span style="font-size: 11.0pt; line-height: 115%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri; font-size: x-small;"&gt;&lt;span style="font-size: 11.0pt; line-height: 115%;"&gt;Happy Thanksgiving!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/8912593261157858535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=8912593261157858535' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/8912593261157858535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/8912593261157858535'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2012/11/thanksgiving-thoughts.html' title='Thanksgiving Thoughts'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-6650369551574721110</id><published>2012-11-16T23:43:00.001-05:00</published><updated>2012-11-16T23:43:11.074-05:00</updated><title type='text'>Presentations at Philadelphia Area Oracle User Group 2012</title><content type='html'>Thank you all those who came to my sessions at PHLOUG in November. You can download the presentations and the demo scripts I used &lt;a href="http://proligence.com/pres/phloug" target="_blank"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/6650369551574721110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=6650369551574721110' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/6650369551574721110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/6650369551574721110'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2012/11/presentations-at-philadelphia-area.html' title='Presentations at Philadelphia Area Oracle User Group 2012'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-3467157716545018474</id><published>2012-09-30T13:58:00.000-04:00</published><updated>2012-09-30T13:58:03.373-04:00</updated><title type='text'>OOW12: Beginning Performance Tuning</title><content type='html'>Thank you very much for coming to my session "Beginning Performance Tuning" on the #IOUG track at #OOW12 Oracle Open World 2012. It makes the day for any speaker to see the room filled to capacity even at 9 AM on a Sunday morning. Much, much appreciated.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bit.ly/Qftt3y" target="_blank"&gt;Here &lt;/a&gt;are the slides and the scripts I used in the demos. Please feel free to reuse the slides and scripts for for any purpose. All I ask is to give due credit to me. I imply no warranty and support for the materials. Use your discretion while using.&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/3467157716545018474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=3467157716545018474' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/3467157716545018474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/3467157716545018474'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2012/09/oow12-beginning-performance-tuning.html' title='OOW12: Beginning Performance Tuning'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-5293414879314269274</id><published>2012-06-08T00:00:00.000-04:00</published><updated>2012-06-08T23:30:44.097-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='#Oracle #Quiz'/><title type='text'>Quiz: Mystery of Create Table Statement</title><content type='html'>Happy Friday! I thought I would jumpstart your creative juices with&amp;nbsp;this little, really simple&amp;nbsp;quiz. While it's trivial, it&amp;nbsp;may not be that obvious to many. See if you can catch it. Time yourself exactly 1 minute to get the answer. Tweet answer to me @arupnanda&lt;br /&gt;&lt;br /&gt;Here it goes. Database is 11.2.0.3. Tool is SQL*Plus.&lt;br /&gt;&lt;br /&gt;The user ARUP owns a procedure that accepts an input string and executes it. Here is the procedure.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;create or replace procedure manipulate_arup_schema&lt;br /&gt;(&lt;br /&gt;        p_input_string  varchar2&lt;br /&gt;)&lt;br /&gt;is&lt;br /&gt;begin&lt;br /&gt;        execute immediate p_input_string;&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The user ARUP have granted EXECUTE privileges on this to user SCOTT. The idea is simple: SCOTT can create and drop tables and other objects in ARUP's schema without requiring&amp;nbsp;the dangerous create any table system privilege.&lt;br /&gt;&lt;br /&gt;With this, SCOTT tries to create a table in the ARUP schema:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&amp;gt; exec arup.manipulate_arup_schema ('create table abc (col1 number)')&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;/pre&gt;The table creation was successul. Now SCOTT tries to create the table&amp;nbsp;in a slightly different manner:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&amp;gt; exec arup.manipulate_arup_schema ('create table abc1 as select * from dual');&lt;br /&gt;&lt;/pre&gt;It fails with an error: &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;BEGIN bus_schema.manipulate_bus_schema ('create table abc as select * from dual'); END;&lt;br /&gt;&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-01536: space quota exceeded for tablespace 'USERS'&lt;br /&gt;ORA-06512: at "ARUP.MANIPULATE_ARUP_SCHEMA", line 18&lt;br /&gt;ORA-06512: at line 1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Huh? After checking you did confirm that the user indeed doesn't have the quota on tablespace USERS, so the error is genuine; but how did the first table creation command go through successfully?&lt;br /&gt;&lt;br /&gt;Tweet me the answer @arupnanda. Aren't on Twitter? Just post the answer here as a comment. I will post the answer right here in the evening. Let's see who posts the first answer. It shouldn't take more than 5 minutes to get the answer.&lt;br /&gt;&lt;br /&gt;Have fun.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: red;"&gt;Update at the end of the Day. Here is the answer:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Oracle 11g R2 introduced a new feature called deferred segment creation. Segments are stored data objects such as tables, views and materialized views. Prior to Oracle 11gR2, when you created a table, a segment was automatically created. The segment was empty; but created it was. From 11gR2, the table is created only in data dictionary, if there is no data. In the second case, the create table statement used create table as select format, which pulled the data from dual to create the table. However the user didn't have quota on tablespace users; so the statement failed. In the first case, the create table statement merely created the table in dictionary; not the segment. Since there was no segment, there was no space consumption; so the unavailability of quota in the tablespace didn't matter and the statement was successful.&lt;br /&gt;&lt;br /&gt;It was a simple puzzle; but I have seen many DBAs, even seasoned ones, stumble over. Eventually they get it; but, well..., they should have taken just a few minutes. From all the responses I got - on twitter and this blog - Yasin Baskan (@yasinbaskan) was the first one to get back with correct answer. Several others did eventually; but Yasin takes the honor of being the first one.&lt;br /&gt;&lt;br /&gt;Congratulations, Yasin and thank you all who twitted and posted comments here.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/5293414879314269274/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=5293414879314269274' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/5293414879314269274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/5293414879314269274'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2012/06/quiz-mystery-of-create-table-statement.html' title='Quiz: Mystery of Create Table Statement'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>13</thr:total><georss:featurename>Danbury, CT, USA</georss:featurename><georss:point>41.394817 -73.4540111</georss:point><georss:box>41.29952350000001 -73.6119396 41.4901105 -73.2960826</georss:box></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-1606038684322690343</id><published>2012-06-07T01:34:00.000-04:00</published><updated>2012-06-07T01:34:59.108-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='#Oracle #Security #DefaultPassword'/><title type='text'>What to Learn from LinkedIn Password Hack as an Oracle DBA</title><content type='html'>One of the major news today was the hacking and resultant publishing of passwords in &lt;a href="http://www.linkedin.com/" target="_blank"&gt;LinkedIn&lt;/a&gt;. Didn't hear about it? Well, read it &lt;a href="http://techcrunch.com/2012/06/06/linkedin-speaks-some-of-those-compromised-passwords-are-from-linkedin-accounts/" target="_blank"&gt;here&lt;/a&gt;. In summary, someone smart but with head screwed a little askew decided to pull passwords from LinkedIn account using a little known flaw in the LinkedIn iOS app. LinkedIn later confirmed that leak and asked users to change the password. This created a major ripple effect all over the world. The news competed for attention with others such as Spain's economic reforms; but in the end it managed to rise to the top since many professionals and executives are members of the LinkedIn site and were affected.&lt;br /&gt;&lt;br /&gt;Well, what is that to do with being an Oracle DBA - you may ask. Fair question. You see, there is a very important lesson to be learned here from this incident - a lesson commonly ignored by many DBAs, developers, architects and pretty much all users of an Oracle database. Let's see what that is.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Mechanics of the LinkedIn Password Hack&lt;/h2&gt;&lt;br /&gt;Adversaries (a.k.a. hackers) obtain password in many ways. Some use brute force approach of guessing the password and trying to login until they succeed. However, many systems employ a simple mechanism of locking out the user when more than a threshold number of incorrect attempts are made - not very effective. There is another type of attack, where the adversary simply gets the password stored in the servers of the site. But, wait, shouldn't that password be &lt;em&gt;encrypted&lt;/em&gt;?&lt;br /&gt;&lt;br /&gt;Yes, they generally are. But here is where a twist comes. The passwords may not be really "encrypted"; but merely "hashed". There is a huge difference. Encryption generally requires a key that is used to encrypt a value; hashing does not. Hashing sort of transforms the value but not in a predictable way; so you can't reverse the hasing process to get the source value. Let's see how it works.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Hashing&lt;/h2&gt;&lt;br /&gt;Here is a simple example. Suppose you are negotiating a rate for your baby sitter and you agreed on an amount - $123. Now you asked the sitter to tell your spouse that amount. Well, how do you make sure she would mention that very amount? After all, she has incentive to say a higher amount, doesn't see? She could say that you agreed on $125 or even $150; your spouse will not be able to ascertain that. (Imagine for a moment that you don't have access to normal modern technology like a cellphone, etc. for you to communicate directly with your spouse). So you develop a simple strategy - you come up with a formula that creates a number from the amount. It could be as simple as, say, the total of all digits. So your amount - $123 becomes:&lt;br /&gt;&lt;br /&gt;1 + 2 + 3 = 6&lt;br /&gt;&lt;br /&gt;You&amp;nbsp;write that down on a paper, seal it in an envelope and ask&amp;nbsp;the sitter to give it to your spouse in addition to mentioned the agreed upon amount.&amp;nbsp;You and your spouse both know this formula; but the sitter doesn't. Suppose she fudges the amount you agreed on to make it to, say&amp;nbsp;$125.&amp;nbsp;Upon her telling&amp;nbsp;your spouse computes the magic number:&lt;br /&gt;&lt;br /&gt;1 +&amp;nbsp;2 + 5 = 8&lt;br /&gt;&lt;br /&gt;Your spouse will compare this with the number inside the sealed envelope and immediately&amp;nbsp;come to the conclusion that the amount agreed by you was something different; not $125. The&amp;nbsp;authenticity of&amp;nbsp;the value is now definitively established to be false.&lt;br /&gt;&lt;br /&gt;This process is called hashing and this magic number is called a hash value. Of course the hashing process is much more complex than merely adding the digits. I just wanted to show the concept with a very simple example. The mechanics of the process, which was simply ading up the digits, is known as the &lt;em&gt;hashing algorithm&lt;/em&gt;.&lt;br /&gt;&lt;br /&gt;Here are some properties of this hashing process:&lt;br /&gt;&lt;br /&gt;(1) The process is one-way. You can determine the hashvalue by adding the digits (1+2+3); but you can't determine the source number from the hashvalue (6). You spouse can't determine from the hashvalue mentioned by the sitter what amount you agreed on. So, it's not the same as encryption, which allows you to decrypt and come up with the source number.&lt;br /&gt;&lt;br /&gt;(2) The purpose is not to store values. It's merely to establish the authenticity. In this example, your spouse determines that the amount mentioned by the baby sitter ($125) must be wrong, because its hashvalue would have been 8, not 6. After that authenticity is established (or rejected, as in this case) the purpose of the hashvalue cease to exist.&lt;br /&gt;&lt;br /&gt;(3) The hashing function is deterministic, i.e. it will always come up with the same value everytime it is invoked against the same source value. &lt;br /&gt;&lt;br /&gt;(4) What if the baby sitter had mentioned $150? The hashvalue, in that case, would have been 1+5+0 = 6, exactly the hashvalue computed by you. In that case, your spouse would have determined the value $150 to be authentic, which would have been wrong. So, it's important that the hashvalue is somewhat unique, to reduce possibility of two different numbers producing the same result. This is known as "collision" of hashvalues.&lt;br /&gt;&lt;br /&gt;The algorithm is the key to make sure the possibilty of collisions is reduced. There are several algortihms in use.&amp;nbsp;Two very common ones are MD5 (message digest) and SHA-1 (secure hash algorithm).&lt;br /&gt;&lt;br /&gt;Since the source value can't be computed back from&amp;nbsp;hash value, this is considered by some as a more secure process than encryption.&amp;nbsp;This&amp;nbsp;process is useful in situations where the reverse computation of values is not necessary; merely the matching of hashvalues&amp;nbsp;is needed. One such example is passwords. If you want to establish that the password entered by the user matches the stored password, all you have to do is generate the hashvalue and match that with the hashvalue stored in the database. If they match, you establish that the password is correct; if not then, well, it's not. This has an inherent security advantage. If someone somehow manages to read the passwords, all that will be exposed will be the hashvalues of the passwords; not the actual values of the passwords themselves. As we saw earlier, it will be impossible to decipher the original password from the hashvalue. That's why it is common in password storage.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Salt&lt;/h3&gt;So, that's great, with some higher degree of security for password store. What's the problem?&lt;br /&gt;&lt;br /&gt;The problem is that the hashvalues are way too predictable. Recall from the previous section that the hashvalue of a specific input value is always the same value. Considering the simpel hashfunction (adding digits), the input value $123 will always return 6 as the hashvalue. Consider this: an adversary can see the hashvalue and guess the value, as shown below.&lt;br /&gt;&lt;br /&gt;Is the input value $120? The hash value is 1+2+0 = 3, which does not match "6", so it must not be the correct number.&lt;br /&gt;&lt;br /&gt;Is it $121? Hash value of 121 is 1+2+1=4, different from 6; so this is not correct either.&lt;br /&gt;&lt;br /&gt;Is it $122? Hashvalue of 122 is 5; so not correct.&lt;br /&gt;&lt;br /&gt;Is it $123? Hashvalue is 6. Bingo! The adversary now knows the input value.&lt;br /&gt;&lt;br /&gt;In just&amp;nbsp;4 attempts the adversary figured out the input value from the hashvalue. Consider this scenario for passwords. The adversary can see the password hash (from&amp;nbsp;which he can't decipher the password); but he can generate hashes from multiple nmput strings and check which one matches the stored password hashvalue. Using the computing power of modern computers this turns almost trivial. So a hash value is not inherently secure.&lt;br /&gt;&lt;br /&gt;What is the solution, then? What if the hash value was not as predictable? If the hash value generated from an input value were different, it would have been impossible to match it against some stored value. This element of randomness to an otherwise deterministic function is briught by introducing a modifier to the process, called a "salt". Like its real-life namesake, salt adds spice to the hashvalue to give it a unique "flavor", or a different vlaue. Here is an example where we are storing the password value "Secret":&lt;br /&gt;&lt;br /&gt;hash("Secret") = "X"&lt;br /&gt;&lt;br /&gt;hash("Secret") + salt = "Y"&lt;br /&gt;&lt;br /&gt;hash("Secret") + salt = "Z"&lt;br /&gt;&lt;br /&gt;Everytime the salt is added, a different value is produced. It will not allow the matching of passwords.&lt;br /&gt;&lt;br /&gt;In case of LinkedIn, the passwords were stored without salt. Therefore it was easy for the adversary to guess the passwords by creating SHA-1 hash values from known words and comparing against the stored value. Here is a rough pseudo-code:&lt;br /&gt;&lt;br /&gt;for w in ( ... list of words ... ) loop&lt;br /&gt;&amp;nbsp;&amp;nbsp; l_hash := hash(w);&lt;br /&gt;&amp;nbsp;&amp;nbsp; if l_hash != stored_value&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; continue;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; show "Bingo! The password is '||w&lt;br /&gt;&amp;nbsp;&amp;nbsp; end if;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Lesson for Oracle DBAs&lt;/h2&gt;&lt;br /&gt;In Oracle database (as of 11g R2 and all prior versions), the passwords are stored in the database in a table called USER$. There is a column called PASSWORD which stores the SHA-1 hashvalue. Using the algorithm mentioned above, an adversary can pass a very long listof words, perhaps the entire Oxford English Dictionary and crack open the password. You may argue that this process is cumbersome and time consuming. Actually, it's quite trivial for a resonably fast computer. &lt;br /&gt;&lt;br /&gt;In Oracle, the passwords are not hashed alone. The userid is combined with the password to produce the hash, e.g. suppose SCOTT's password is TIGER. The hash function is applied as:&lt;br /&gt;&lt;br /&gt;hash('SCOTTTIGER')&lt;br /&gt;&lt;br /&gt;Let's see how Oracle stores the password with an example. Take a look at the password column in the view DBA_USERS: &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;select username, password&lt;br /&gt;from dba_users&lt;br /&gt;where username = 'SCOTT';&lt;br /&gt;&lt;br /&gt;USERNAME PASSWORD&lt;br /&gt;-------- ----------------&lt;br /&gt;SCOTT    F894844C34402B67&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The password is hashed and thus undecipherable, but we know that SCOTT’'s password is "tiger." Therefore, the hash value for "tiger" when userid is "SCOTT" is F894844C34402B67. Now, if SCOTT’'s password changes, this hash value also changes. You can then confirm in the view DBA_USERS to see if SCOTT’s password matches this hash value, which will verify the password as "tiger".&lt;br /&gt;&lt;br /&gt;So how can an adversary use this information? It's simple. If he creates the user SCOTT&amp;nbsp;with the password TIGER, he will come to know the hash values of stored in the password column. Then he can build a table of such accounts and the hashed values of the passwords and compare them against the password hashes stored in the data dictionary. What's worse: he can create this user in any Oracle database; not necessarly the one he is attacking right now.&lt;br /&gt;&lt;br /&gt;This is why you must never use default passwords and easily guessed passwords.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Protection&lt;/h2&gt;Now that you know how the adversaries use the password hash to guess passwords. you should identify all such users and expire them, or force them to change passwords. How can you get a list of such users?&lt;br /&gt;&lt;br /&gt;In Oracle Database 11g, this&amp;nbsp;is easy, almost to the point of being trivial. The database has a special view, &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;strong&gt;dba_users_with_defpwd&lt;/strong&gt;&lt;/span&gt;, that lists the usernames with the default passwords. Here is an example usage:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;select * from dba_users_with_defpwd;&lt;br /&gt;&lt;br /&gt;USERNAME&lt;br /&gt;------------------------------&lt;br /&gt;DIP&lt;br /&gt;MDSYS&lt;br /&gt;XS$NULL&lt;br /&gt;SPATIAL_WFS_ADMIN_USR&lt;br /&gt;CTXSYS&lt;br /&gt;OLAPSYS&lt;br /&gt;OUTLN&lt;br /&gt;OWBSYS&lt;br /&gt;SPATIAL_CSW_ADMIN_USR&lt;br /&gt;EXFSYS&lt;br /&gt;ORACLE_OCM&lt;br /&gt;&lt;em&gt;… output truncated …&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The output clearly shows the usernames that have the default password. You can join this view with DBA_USERS to check on the status of the users:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;select d.username, account_status&lt;br /&gt;from dba_users_with_defpwd d, dba_users u&lt;br /&gt;where u.username = d.username;&lt;br /&gt;&lt;br /&gt;USERNAME                       ACCOUNT_STATUS&lt;br /&gt;------------------------------ --------------------------------&lt;br /&gt;PM                             EXPIRED &amp;amp; LOCKED&lt;br /&gt;OLAPSYS                        EXPIRED &amp;amp; LOCKED&lt;br /&gt;BI                             EXPIRED &amp;amp; LOCKED&lt;br /&gt;SI_INFORMTN_SCHEMA             EXPIRED &amp;amp; LOCKED&lt;br /&gt;OWBSYS                         EXPIRED &amp;amp; LOCKED&lt;br /&gt;XS$NULL                        EXPIRED &amp;amp; LOCKED&lt;br /&gt;ORDPLUGINS                     EXPIRED &amp;amp; LOCKED&lt;br /&gt;APPQOSSYS                      EXPIRED &amp;amp; LOCKED&lt;br /&gt;… output truncated … &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h2&gt;Oracle 10g&lt;/h2&gt;What if you don't have Oracle 11g? &lt;br /&gt;&amp;nbsp; &lt;br /&gt;In January 2006, Oracle made a downloadable utility available for identifying default passwords and their users. This utility, available via a patch 4926128 is available on My Oracle Support as described in the document ID 361482/1. As of this writing, the utility checks a handful of default accounts in a manner similar to that described above; by the time you read this, however, its functionality may well have expanded.&lt;br /&gt;&lt;br /&gt;Security expert Pete Finnigan has done an excellent job of collecting all such default accounts created during various Oracle and third-party installations, which he has exposed for public use in his website, petefinnigan.com. Rather than reinventing the wheel, we will use Pete's work and thank him profusely. I have changed his original approach a little bit, though. &lt;br /&gt;&lt;br /&gt;First, create the table to store the default accounts and default password:. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;CREATE TABLE osp_accounts (&lt;br /&gt;product VARCHAR2(30),&lt;br /&gt;security_level NUMBER(1),&lt;br /&gt;username VARCHAR2(30),&lt;br /&gt;password VARCHAR2(30),&lt;br /&gt;hash_value VARCHAR2(30),&lt;br /&gt;commentary VARCHAR2(200)&lt;br /&gt;);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Then you can load the table using data collected by Pete Finnigan from many sources. (Download the script script &lt;a href="http://petefinnigan.com/default/osp_accounts_public.zip" target="_blank"&gt;here&lt;/a&gt;.) After the table is loaded, you are ready to search for default passwords. I use a very simple SQL statement to find out the users: &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;col password format a20&lt;br /&gt;col account_status format a20&lt;br /&gt;col username format a15&lt;br /&gt;select o.username, o.password, d.account_status&lt;br /&gt;from dba_users d, osp_accounts o&lt;br /&gt;where o.hash_value = d.password&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;USERNAME        PASSWORD             ACCOUNT_STATUS&lt;br /&gt;--------------- -------------------- --------------------&lt;br /&gt;CTXSYS          CHANGE_ON_INSTALL    OPEN&lt;br /&gt;OLAPSYS         MANAGER              OPEN&lt;br /&gt;DIP             DIP                  EXPIRED &amp;amp; LOCKED&lt;br /&gt;DMSYS           DMSYS                OPEN&lt;br /&gt;EXFSYS          EXFSYS               EXPIRED &amp;amp; LOCKED&lt;br /&gt;SYSTEM          ORACLE               OPEN&lt;br /&gt;WMSYS           WMSYS                EXPIRED &amp;amp; LOCKED&lt;br /&gt;XDB             CHANGE_ON_INSTALL    EXPIRED &amp;amp; LOCKED&lt;br /&gt;OUTLN           OUTLN                OPEN&lt;br /&gt;SCOTT           TIGER                OPEN&lt;br /&gt;SYS             ORACLE               OPEN&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here you can see some of the most vulnerable of situations, especially the last line, which where the username says is SYS and the password is "ORACLE" (as is that of SYSTEM)!! It may not be "change_on_install,", but it's just as predictable. &lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Action Items&lt;/h2&gt;&lt;br /&gt;Now that you know how one adversary used the salt-less hashing algorithm to guess passwords, you have some specific actions to take.&lt;br /&gt;&lt;br /&gt;(1) Advocate the use of non-dictionary words. Remember, the adversary can create passwords and compare the resultant hash against the stored hash to see if they match. Making it impossible for him to guess the list of such input values makes it impossible to generate has values.&lt;br /&gt;(2) Immediately check in the database for users with default passwords. Either change the passwords, or Expire and Lock them.&lt;br /&gt;(3) Whenever you use hashing (and not encryption), use salt, to make sure it is diffcult, if not impossible for the adversary to guess.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/1606038684322690343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=1606038684322690343' title='16 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/1606038684322690343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/1606038684322690343'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2012/06/what-to-learn-from-linkedin-password.html' title='What to Learn from LinkedIn Password Hack as an Oracle DBA'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>16</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-4211391811949660132</id><published>2012-04-25T21:48:00.003-04:00</published><updated>2012-04-29T16:39:12.123-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Performance Tuning'/><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='#C12LV'/><category scheme='http://www.blogger.com/atom/ns#' term='Beginner'/><category scheme='http://www.blogger.com/atom/ns#' term='Locking'/><title type='text'>Collaborate 2012 Sessions and Select Article</title><content type='html'>Thank you all who came to my sessions at #IOUG &lt;b&gt;Collaborate 2012&lt;/b&gt; #C12LV on April 22-24 in Las Vegas. I had &lt;b&gt;four &lt;/b&gt;full sessions, &lt;b&gt;two &lt;/b&gt;panels and &lt;b&gt;one &lt;/b&gt;bootcamp. Quite a busy schedule, as you can see. I also worked on some urgent performance issues at work during the week.&lt;br /&gt;&lt;br /&gt;You can download the the slides and scripts here. They are available from the IOUG site but I thought I would put them for download here as well.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Rise of the Machines &lt;a href="http://bit.ly/I5mlFR"&gt;slides&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Secure Your Database in a Single Day &lt;a href="http://bit.ly/IwUFs6"&gt;slides &lt;/a&gt;&lt;a href="http://bit.ly/IqRIbW"&gt;scripts&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Beginning Oracle Performance Tuning &lt;a href="http://bit.ly/IwTetD"&gt;slides &lt;/a&gt;&lt;a href="http://bit.ly/IEY075"&gt;scripts&lt;/a&gt;&lt;/li&gt;&lt;li&gt;How Oracle Locking Works &lt;a href="http://bit.ly/JH0qmR"&gt;slides&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;My article Cache Fusion Demystified on SELECT Journal won the &lt;b&gt;Editor's Choice award&lt;/b&gt; for 2011. This article is available for free download &lt;a href="http://t.co/us1KYxME"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I hope you like them. As always, feedback - good, bad and something in between - will be appreciated.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: #cc0000;"&gt;Update as of April 29th, 2012&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I usually add more stuff to my slides after the session is over. This may result from a&amp;nbsp;direct&amp;nbsp;attendee feedback that some content was not clear, inadequate, misleading or even incorrect. This time is no exception. I added some more content to make the concepts clearer. Also many thanks to &lt;a href="http://hoopercharles.wordpress.com/" rel="nofollow" target="_blank"&gt;Charles Hooper&lt;/a&gt; for pointing out an Oracle documentation bug which makes two scripts in my session incorrect. I have since corrected the slides and re-uploaded. Please redownload the &lt;b&gt;slides for&amp;nbsp;How Oracle Locking Works&lt;/b&gt; and&amp;nbsp;specifically&amp;nbsp;look at the slides 14, 18, 24, 25 and 26. Also please download the &lt;b&gt;scripts for Beginning Oracle Performance Tuning&lt;/b&gt;. More specifically, the script lock1.sql has changed.</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/4211391811949660132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=4211391811949660132' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/4211391811949660132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/4211391811949660132'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2012/04/collaborate-2012-sessions-and-select.html' title='Collaborate 2012 Sessions and Select Article'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-1644418732806997425</id><published>2012-02-24T08:42:00.000-05:00</published><updated>2012-02-24T08:42:45.280-05:00</updated><title type='text'>The Arup Nanda Blog: AIOUG Webcast:Methodical Performance Tuning Part 2</title><content type='html'>&lt;a href="http://arup.blogspot.com/2012/02/aioug-webcastmethodical-performance.html"&gt;The Arup Nanda Blog: AIOUG Webcast:Methodical Performance Tuning Part 2&lt;/a&gt;</content><link rel='related' href='http://arup.blogspot.com/2012/02/aioug-webcastmethodical-performance.html' title='The Arup Nanda Blog: AIOUG Webcast:Methodical Performance Tuning Part 2'/><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/1644418732806997425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=1644418732806997425' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/1644418732806997425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/1644418732806997425'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2012/02/arup-nanda-blog-aioug-webcastmethodical.html' title='The Arup Nanda Blog: AIOUG Webcast:Methodical Performance Tuning Part 2'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-7394698252472551451</id><published>2012-02-24T08:41:00.000-05:00</published><updated>2012-02-24T08:41:28.072-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='oracle performance'/><title type='text'>AIOUG Webcast:Methodical Performance Tuning Part 2</title><content type='html'>Thank you all for attending the Part 2 of the Methodical Performance Tuning series. I hope you got something out of the 1 hour long session. You can download the slides and the scripts I used during the demo &lt;a href="http://www.proligence.com/pres/aioug12/aioug_perf2.zip"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;As always, I will appreciate any &lt;a href="mailto:arup@proligence.com"&gt;feedback&lt;/a&gt; which helps me in designing future content.</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/7394698252472551451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=7394698252472551451' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/7394698252472551451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/7394698252472551451'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2012/02/aioug-webcastmethodical-performance.html' title='AIOUG Webcast:Methodical Performance Tuning Part 2'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-6198169218417023077</id><published>2011-11-20T18:15:00.001-05:00</published><updated>2011-11-20T18:24:13.197-05:00</updated><title type='text'>Revived Boston Area DBA SIG Meeting</title><content type='html'>&lt;br /&gt;The DBA SIG of the Northeast Oracle User Group has been revived (thank you, Lyson and Jeane) and I was honored to be the speaker of the first session of what I hope will be a long list of very successful like the old days.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;I started at 7 PM and finished at midnight - a solid 5 hours later! Thank you for your patience. It just made my day to have you in the audience that late. I hope you found it useful.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bit.ly/tBJCL0"&gt;Here &lt;/a&gt;is the slide deck and the scripts I used during my session. As in the past, I cherish the moments and will highly appreciate to have your feedback.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/6198169218417023077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=6198169218417023077' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/6198169218417023077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/6198169218417023077'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2011/11/revived-boston-area-dba-sig-meeting.html' title='Revived Boston Area DBA SIG Meeting'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-6905074099667761806</id><published>2011-11-10T15:41:00.001-05:00</published><updated>2011-11-10T16:00:26.268-05:00</updated><title type='text'>Revived NOUG DBA SIG Events</title><content type='html'>&lt;br /&gt;&lt;br /&gt;Congratulations to North East Oracle User Group in the Boston area who has restarted the DBA SIG. This was a highly successful program that used to be held after work hours on a weekday in the Oracle building in Burlington. I was privileged to have presented there from 2004 until its sad demise in 2009. Now,&amp;nbsp;I am honored to be invited to be the first speaker in the revived program. I am presenting the session "Addressing Performance Issues during Change with Real Application Testing, Intelligent Stats and SQL Plan Baselines with Live Demos". More information &lt;a href="http://noug.com/files/november_16_2011_Arup_NANDA_invite.doc"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;When&lt;/b&gt;: Nov 16th 6:30 PM to 9:00 PM&lt;br /&gt;&lt;b&gt;Where&lt;/b&gt;: Doubletree by Hilton at 5400 Computer Drive, Westborough, MA 01581&lt;br /&gt;Food and drinks will be served.&lt;br /&gt;The event is free to all NOUG members.&lt;br /&gt;&lt;br /&gt;I will give away several Oracle books at the event for the best questions, etc.&lt;br /&gt;&lt;br /&gt;If you plan on attending this,&lt;b&gt; the&amp;nbsp;organizers respectfully request that you RSVP to &lt;a href="mailto:treasurer@noug.com"&gt;treasurer@noug.com&lt;/a&gt; immediately&lt;/b&gt;. They need some reasonably accurate headcount to order food and drinks, which is yet another reason to attend.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Abstract&lt;/b&gt;: Change is inevitable - be it applying a patchset or creating an index. In this session you will learn how to harness the power of three major features of Oracle database to improve the performance during any types of change, or at any other time. You will learn, with plenty of demos, how to configure and use Database Replay and SQL Performance Analyzer to predict performance, use extended statistics to make the optimizer more intelligent and use SQL Plan Baselines to make the performance consistent but open to further improvements.&lt;br /&gt;&lt;br /&gt;As it has been the norm, I plan to explain these concepts and techniques with lots of live demos. If you are in the Boston area, I sincerely hope to see you all there. I have nothing but pleasant memories every one of the 5 times I have presented in that venue and expect nothing less this time.&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/6905074099667761806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=6905074099667761806' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/6905074099667761806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/6905074099667761806'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2011/11/revived-noug-dba-sig-events.html' title='Revived NOUG DBA SIG Events'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-2158454655744968359</id><published>2011-10-18T01:00:00.000-04:00</published><updated>2011-10-18T01:00:52.510-04:00</updated><title type='text'>AIOUG Webcast: Methodical Performance Tuning</title><content type='html'>A big thank you to all those you attended my session today. I sincerely hope you got something out of it. &lt;a href="http://bit.ly/nnLD2s"&gt;Here &lt;/a&gt;are the scripts I used in the demo. And, &lt;a href="http://bit.ly/ngnap8"&gt;here &lt;/a&gt;is the slide deck, if you are interested.&lt;br /&gt;&lt;br /&gt;Remember, this was just the beginner's session. We will have intermediate and advanced ones in near future. Stay tuned through the AIOUG site.</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/2158454655744968359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=2158454655744968359' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/2158454655744968359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/2158454655744968359'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2011/10/aioug-webcast-methodical-performance.html' title='AIOUG Webcast: Methodical Performance Tuning'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-5626938995031041584</id><published>2011-10-06T20:40:00.001-04:00</published><updated>2011-10-06T20:40:44.188-04:00</updated><title type='text'>Migration to Exadata Session at #OOW11</title><content type='html'>Considering it was the last session of #OOW11 I was surprised to see a&amp;nbsp;sizable&amp;nbsp;number of folks showing up for my 3rd and final session slated for 3 to 4 PM on Thursday. Thank you for attending and for your questions.&lt;br /&gt;&lt;br /&gt;Here is the slide &lt;a href="http://www.proligence.com/pres/oow11/migration_to_exadata.ppsx"&gt;deck&lt;/a&gt;. Note: please do not click on the link. Instead, right click on it, save the file and open it. It's a Powerpoint show; not a PPT. You can download free Powerpoint player to watch it, if you don't have Powerpoint installed.</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/5626938995031041584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=5626938995031041584' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/5626938995031041584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/5626938995031041584'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2011/10/migration-to-exadata-session-at-oow11.html' title='Migration to Exadata Session at #OOW11'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-1066719611055807534</id><published>2011-10-05T23:03:00.001-04:00</published><updated>2012-04-29T16:10:11.497-04:00</updated><title type='text'>Rise of the Machines</title><content type='html'>This is the penultimate day of #OOW11 and I am here at the hotel lobby&amp;nbsp;trying to put some order around the myriads of nuggets of information I have had over the last several days.&lt;br /&gt;&lt;br /&gt;The announcements this year have been centered around&amp;nbsp;introduction&amp;nbsp;of various new products from Oracle - Oracle Database Cloud, Cloud Control, Database Appliance, Big Data Appliance, Exalytics, T4 Super cluster and so on. One interesting pattern that emerges from the announcements that is different &amp;nbsp;from all the previous years is the introduction of several engineered and assembled systems that perform some type of task - specialized or generic. In the past Oracle announced machines too; but not so many at the same time, leading to an observation by April Sims (Executive Editor, Select Journal) that this year can be summed up in one phrase - &lt;b&gt;Rise of the Machines&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;But many of the folks I met in person or online were struggling to put their head around the whole lineup. It's quite clear that they were very unclear (no pun intended) how these are different and what situation each one would fit in. It's perfectly normal to be little confused about the sweet spots of each product considering the glut of information on them and seemingly overlapping functionalities.&amp;nbsp;In the Select Journal Editorial Board meeting we had earlier this morning, &lt;b&gt;I committed to writing about the differences between the different systems announced&lt;/b&gt; at #OOW11 and their usages in Select Journal 2012 Q1 edition. I didn't realize at that time what a tall order that is.&amp;nbsp;I need to reach out to several product managers and executives inside Oracle to understand the functionality&amp;nbsp;differences in these machines. Well, now that I have firmly put my feet in mouth, I will have to do just that. [Update on 4/29/2012: I have done that. Please see below]&lt;br /&gt;&lt;br /&gt;In the demogrounds I learned about &lt;b&gt;Oracle Data Loader for Hadoop&lt;/b&gt; and &lt;b&gt;Enterprise-R&lt;/b&gt;, two exciting&amp;nbsp;technologies&amp;nbsp;that will change the way we collect and analyze large data sets, especially unstructured ones. Another new&amp;nbsp;technology, centered around Cloud Control, was the &lt;b&gt;Data Subsetting. &lt;/b&gt;It allows you to pull a subset of data from the source system to create test data, mask it if necessary and even find sensitive data based on some format. The tool was due for quite some time.&lt;br /&gt;&lt;br /&gt;Again, I really need to collect my thoughts and sort through all that information overload I was subjected to at OOW. This was the best OOW ever.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: #990000; font-size: large;"&gt;Update on April 29th, 2011&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I knew I had to wrap my head around these&amp;nbsp;announcements&amp;nbsp;and sort through the features available in the engineered machines. And I did exactly that. I presented a paper in the same name - Rise of the Machines - in Collaborate 2012, the annual conference of the Independent Oracle Users Group.&amp;nbsp;&lt;a href="http://bit.ly/I5mlFR" target="_blank"&gt;Here&amp;nbsp;&lt;/a&gt;is the presentation. In that session I explained the various features of 6 machines - Oracle Database Appliance, Exadata, Exalogic, Sparc Super Cluster, Exalytics and Big Data Appliance, the differences between them and where each one should be used. Please&amp;nbsp;&lt;a href="http://bit.ly/I5mlFR" target="_blank"&gt;download&amp;nbsp;&lt;/a&gt;the session if you want to know more about the topic.&lt;br /&gt;&lt;br class="Apple-interchange-newline" /&gt;</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/1066719611055807534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=1066719611055807534' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/1066719611055807534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/1066719611055807534'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2011/10/rise-of-machines.html' title='Rise of the Machines'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-1050587445345991279</id><published>2011-10-04T03:03:00.001-04:00</published><updated>2011-10-05T03:09:36.806-04:00</updated><title type='text'>Unicode Migration Assistant for Oracle</title><content type='html'>When you want to convert a database created in the default characterset to a multibyte characterset, there were two basic approaches - the safe export/import and the not-for-the-faint-of-the-heart alter database convert internal. In either case you had to follow a string of activities - checking the presence of incompatible values by running csscan, etc.&lt;br /&gt;&lt;br /&gt;There is a new tool from Oracle to make the process&amp;nbsp;infinitesimally simpler - &lt;b&gt;Migration Assistant for Unicode&lt;/b&gt;. It's a GUI tool that you can install on the client. A server side API (installed via a patch) &amp;nbsp;does all the heavy lifting with the client GUI providing a great intuitive interface. You have the steps pretty much laid out for you. But the main strength of the tool is not that. There are two primary&amp;nbsp;differentiators&amp;nbsp;for the tool.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;When you do have a bad character, what can you really do? You can truncate the part of the data. But how do you know how much to truncate? If you truncate aggressively, you may shave off a chunk and lose valuable data; but be miserly and you risk having the bad data in place. This tool will show the data in a separate window allowing you to correct only the affected data; nothing less, nothing more.&lt;/li&gt;&lt;li&gt;When users copy and paste data from some unicode compliant system to Oracle, e.g. from MS Word to a VARCHAR2 field in the database, the characters may look garbled; but given proper characterset they become meaningful. This tool allows you to see the data in many charactersets to identify which one was used to create it in the first place. After that it's a simple matter to reproduce that characters in the proper characterset.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;With these two differentiators in place, the tool has great future. Check out everything on this tool at&amp;nbsp;&lt;a href="http://www.oracle.com/technetwork/database/globalization/dmu/overview/index-330958.html"&gt;http://www.oracle.com/technetwork/database/globalization/dmu/overview/index-330958.html&lt;/a&gt;&amp;nbsp;or just visit the booth at #OOW Demogrounds in Moscone South.&lt;br /&gt;&lt;br /&gt;Oh, did I mention that the tool is free?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/1050587445345991279/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=1050587445345991279' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/1050587445345991279'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/1050587445345991279'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2011/10/unicode-migration-assistant-for-oracle.html' title='Unicode Migration Assistant for Oracle'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-443104265263181117</id><published>2011-10-04T02:23:00.001-04:00</published><updated>2011-10-04T02:23:28.814-04:00</updated><title type='text'>OOW11 Session #2 Exadata Management</title><content type='html'>Thank you all for attending my second session in #OOW11 - Exadata Management. You can download the slide deck here. Important: &lt;span class="Apple-style-span" style="color: red;"&gt;&lt;b&gt;DO NOT CLICK&lt;/b&gt; on this link&lt;/span&gt;; instead, &lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;right click on this link&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;, save the file and then open it.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bit.ly/n2jcwI"&gt;Here &lt;/a&gt;is the slide deck.&lt;br /&gt;&lt;br /&gt;Here are the resources I referred to in the presentation. Please note: URLs could change without my knowledge.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="direction: ltr; language: en-US; margin-bottom: 0pt; margin-left: .38in; margin-top: 7.2pt; mso-line-break-override: none; punctuation-wrap: hanging; text-align: left; text-indent: -.38in; unicode-bidi: embed; word-break: normal;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;•&lt;span style="color: black;"&gt;My Papers&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="O1" style="direction: ltr; language: en-US; margin-bottom: 0pt; margin-left: .81in; margin-top: 6.24pt; mso-line-break-override: none; punctuation-wrap: hanging; text-align: left; text-indent: -.31in; unicode-bidi: embed; word-break: normal;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;–&lt;span style="color: black;"&gt;5-part Linux Commands article series &lt;/span&gt;&lt;span style="color: black;"&gt;&lt;a href="http://bit.ly/k4mKQS"&gt;http://bit.ly/k4mKQS&lt;/a&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="O1" style="direction: ltr; language: en-US; margin-bottom: 0pt; margin-left: .81in; margin-top: 6.24pt; mso-line-break-override: none; punctuation-wrap: hanging; text-align: left; text-indent: -.31in; unicode-bidi: embed; word-break: normal;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;–&lt;span style="color: black;"&gt;4-part Exadata Command Reference article series &lt;/span&gt;&lt;span style="color: black;"&gt;&lt;a href="http://bit.ly/lljFl0"&gt;http://bit.ly/lljFl0&lt;/a&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="direction: ltr; language: en-US; margin-bottom: 0pt; margin-left: .38in; margin-top: 7.2pt; mso-line-break-override: none; punctuation-wrap: hanging; text-align: left; text-indent: -.38in; unicode-bidi: embed; word-break: normal;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;•&lt;span style="color: black;"&gt;OTN Page on Exadata&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="O1" style="direction: ltr; language: en-US; margin-bottom: 0pt; margin-left: .81in; margin-top: 6.24pt; mso-line-break-override: none; punctuation-wrap: hanging; text-align: left; text-indent: -.31in; unicode-bidi: embed; word-break: normal;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;–&lt;span style="color: black;"&gt;&lt;a href="http://www.oracle.com/technetwork/database/exadata/index.html"&gt;http://www.oracle.com/technetwork/database/exadata/index.html&lt;/a&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="direction: ltr; language: en-US; margin-bottom: 0pt; margin-left: .38in; margin-top: 7.2pt; mso-line-break-override: none; punctuation-wrap: hanging; text-align: left; text-indent: -.38in; unicode-bidi: embed; word-break: normal;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;•&lt;span style="color: black;"&gt;Tutorials&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="O1" style="direction: ltr; language: en-US; margin-bottom: 0pt; margin-left: .81in; margin-top: 6.24pt; mso-line-break-override: none; punctuation-wrap: hanging; text-align: left; text-indent: -.31in; unicode-bidi: embed; word-break: normal;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;–&lt;span style="color: black;"&gt;&lt;a href="http://www.oracle.com/technetwork/tutorials/index.html"&gt;http://www.oracle.com/technetwork/tutorials/index.html&lt;/a&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="direction: ltr; language: en-US; margin-bottom: 0pt; margin-left: .38in; margin-top: 7.2pt; mso-line-break-override: none; punctuation-wrap: hanging; text-align: left; text-indent: -.38in; unicode-bidi: embed; word-break: normal;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;•&lt;span style="color: black;"&gt;OTN Exadata Forum&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="O1" style="direction: ltr; language: en-US; margin-bottom: 0pt; margin-left: .81in; margin-top: 6.24pt; mso-line-break-override: none; punctuation-wrap: hanging; text-align: left; text-indent: -.31in; unicode-bidi: embed; word-break: normal;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;–&lt;span style="color: black;"&gt;&lt;a href="https://forums.oracle.com/forums/forum.jspa?forumID=829"&gt;https://forums.oracle.com/forums/forum.jspa?forumID=829&lt;/a&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="O1" style="direction: ltr; language: en-US; margin-bottom: 0pt; margin-left: .81in; margin-top: 6.24pt; mso-line-break-override: none; punctuation-wrap: hanging; text-align: left; text-indent: -.31in; unicode-bidi: embed; word-break: normal;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="direction: ltr; language: en-US; margin-bottom: 0pt; margin-left: .38in; margin-top: 7.2pt; mso-line-break-override: none; punctuation-wrap: hanging; text-align: left; text-indent: -.38in; unicode-bidi: embed; word-break: normal;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Thanks for attending. As always, your feedback will be highly appreciated.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/443104265263181117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=443104265263181117' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/443104265263181117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/443104265263181117'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2011/10/oow11-session-2-exadata-management.html' title='OOW11 Session #2 Exadata Management'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-8513738402303049653</id><published>2011-10-02T22:06:00.000-04:00</published><updated>2011-10-03T13:32:27.555-04:00</updated><title type='text'>OOW11 Presentation: Exadata for Oracle DBAs</title><content type='html'>&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Thank you very much for attending my session "Exadata for Oracle DBAs" at #OOW11 (Oracle Open World), 2011. Here are the links to I mentioned in the presentation:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black;"&gt;5-part Linux Commands article series&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;a href="http://bit.ly/k4mKQS"&gt;http://bit.ly/k4mKQS&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="direction: ltr; margin-bottom: 0pt; margin-top: 0pt; text-align: left; unicode-bidi: embed; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;span style="color: black;"&gt;4-part Exadata Command Reference article series&amp;nbsp;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;a href="http://bit.ly/lljFl0"&gt;http://bit.ly/lljFl0&lt;/a&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="direction: ltr; margin-bottom: 0pt; margin-top: 0pt; text-align: left; unicode-bidi: embed; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="direction: ltr; margin-bottom: 0pt; margin-top: 0pt; text-align: left; unicode-bidi: embed; vertical-align: baseline;"&gt;You can download the Powerpoint show here&amp;nbsp;&lt;a href="http://bit.ly/nH0rpK"&gt;http://bit.ly/nH0rpK&lt;/a&gt;&amp;nbsp;(&lt;b&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;please don't click&lt;/span&gt;&lt;/b&gt;. Right click and download it to watch)&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Update&lt;/b&gt;: If you have downloaded the slides earlier, please redownload. I corrected a small inaccuracy - the compression is handled by compute nodes; decompression can be offloaded to the cells. Thanks to Greg Rahn for pointing it out.&lt;br /&gt;&lt;br /&gt;&lt;div style="direction: ltr; language: en-US; margin-bottom: 0pt; margin-top: 0pt; mso-line-break-override: restrictions; punctuation-wrap: simple; text-align: left; unicode-bidi: embed; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-family: Times;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="direction: ltr; language: en-US; margin-bottom: 0pt; margin-top: 0pt; mso-line-break-override: restrictions; punctuation-wrap: simple; text-align: left; unicode-bidi: embed; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-family: Times;"&gt;Of course, please remember that your feedback - good or bad - is always valued.&lt;/span&gt;&lt;/div&gt;&lt;div style="direction: ltr; language: en-US; margin-bottom: 0pt; margin-top: 0pt; mso-line-break-override: restrictions; punctuation-wrap: simple; text-align: left; unicode-bidi: embed; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-family: Times;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/8513738402303049653/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=8513738402303049653' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/8513738402303049653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/8513738402303049653'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2011/10/oow11-presentation-exadata-for-oracle.html' title='OOW11 Presentation: Exadata for Oracle DBAs'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-7580496864125239244</id><published>2011-08-29T19:24:00.000-04:00</published><updated>2011-08-29T19:24:15.234-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Connection Manager CMAN Oracle Network'/><title type='text'>Setting Up Oracle Connection Manager</title><content type='html'>&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;b&gt;The Problem&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It seems really simple. We have an Oracle database (on all nodes of a full rack Exadata, to be exact), which a lot of end-users connect to through apps designed in a rather adhoc and haphazard manner - on Excel spreadsheets, Access forms, TOAD reports and other assorted tools. We want to control the access from these machines and streamline them.&lt;br /&gt;&lt;br /&gt;The database machine sits behind a firewall. To allow the adhoc tools accessing the database from the client machines mean we have to change the firewall rules. Had it been one or two clients, it would have been reasonable; but with 1000+ client machines, it becomes impractical. So I was asked to provide an alternative solution.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;b&gt;The Solution&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is not a unique problem; it's the same problem when the machines need to access resources that exist across firewalls. The easy solution is to punch a hole through the firewall to allow that access; but is not desirable for obvious security reasons. A better solution, often implemented, is to have a proxy server. The proxy sits between the two layers of access and can access the servers behind the firewall. Clients make the request to the proxy which it passes on to the server.&lt;br /&gt;&lt;br /&gt;Such a proxy solves the problem; but we are looking for a simpler solution. Does one exist?&lt;br /&gt;&lt;br /&gt;Yes, it does. The answer is &lt;i&gt;Connection Manager&lt;/i&gt; from Oracle. Among its many functions, one stands out - it acts as a proxy between the different layers of access and passes through the request. It's not a separate product; but is an option in the Oracle Client software (not the database or grid infrastructure software). This &amp;nbsp;option is not automatically installed. When installing the client software, choose "Custom" and explicitly select "Connection Manager" from the list.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;The Architecture&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Let's quickly go through the architecture of tool. Assume there are three hosts:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;client1 - the machine where the client runs and wants to connect to the database&lt;/li&gt;&lt;li&gt;dbhost1 - the machine where the database instance runs&lt;/li&gt;&lt;li&gt;cmhost1 - the machine where the Connection Manager process runs&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Here is a rough network diagram of the three machines&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-edR-GsWU6-8/TlvyPnogSOI/AAAAAAAAAkc/Qap9UyIVw-g/s1600/CM1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="340" src="http://2.bp.blogspot.com/-edR-GsWU6-8/TlvyPnogSOI/AAAAAAAAAkc/Qap9UyIVw-g/s640/CM1.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;From client1 you can reach cmhost1 but not dbhost1:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;C:\&amp;gt;ping dbhost1&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Ping request could not find host dbhost1. Please check the name and try again.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Or, if the host is known but not reachable, you will notice a message like this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;C:\&amp;gt;ping dbhost1&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Pinging dbhost1 [192.168.104.31] with 32 bytes of data:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Request timed out.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;However, you can ping the dbhost1 from cmhost1 and cmhost1 from client1.&lt;br /&gt;&lt;br /&gt;Normally the TNS entry at the client machine would have looked like this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;TNS_REG =&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; (DESCRIPTION =&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; (ADDRESS =&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (PROTOCOL = TCP)(HOST = dbhost1)(PORT = 1521)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; (CONNECT_DATA =&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (SERVICE_NAME=srv1)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; )&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;However, this will not work since the client does not even know the routing for dbhost1. Instead the client connects to the CM host. The connection manager has two processes&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The Connection Manager Admin Process (cmadmin)&lt;/li&gt;&lt;li&gt;One or more Connection Manager Gateway Processes (cmgw)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The CMGW processes allows the client connections to come in through them. The admin process manages the gateways. We will cover more on that later.&lt;br /&gt;&lt;br /&gt;After setting up the CM processes, you will need to rewrite the TNSNAMES.ORA in the following way:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;TNS_CM =&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; (DESCRIPTION =&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; (SOURCE_ROUTE = YES)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; (ADDRESS =&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (PROTOCOL = TCP)(HOST = cmhost1)(PORT = 1950)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; (ADDRESS =&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (PROTOCOL = TCP)(HOST = dbhost1)(PORT = 1521)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; (CONNECT_DATA =&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (SERVICE_NAME=srv1)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; )&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; )&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;How it Works&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note the special parameter:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SOURCE_ROUTE = YES&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This tells the client connection request to attempt the first address listed first and only then attempt the next one. This is different from load balance setups where you would expect the client tool to pick one of the addresses at random. So the client attempts this address first:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;(PROTOCOL = TCP)(HOST = cmhost1)(PORT = 1950)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is the listener for Connection Manager. The clients are allowed to connect to the port 1950 (the port where CM listener listens on) on the host cmhost1.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After that the connection attempts the second address&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;(PROTOCOL = TCP)(HOST = dbhost1)(PORT = 1521)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, it will fail since the client does not have access to the port 1521 of the host dbhost1. This is where CM comes in. The client does not make the request; CM does on behalf of the client connection that just came in. The connection manager (running on cmhost1) makes the request with that address. Since the host cmhost1 can access dbhost1 on port 1521, that connection request goes through successfully. When the response comes back from the database, CM passes it back to the original client.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A single CM connection can handle many client connection requests.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Setting Up&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now that you know how CM works, let's see how to enable it, step by step.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;(1) Install CM, if you don't have already. Check for a file cmctl under $ORACLE_HOME/bin. If you have it, CM may have been installed already. If not, install CM by running the installer from Oracle Client (not Database or Grid Infra) software. Choose Custom Install and explicitly choose Connection Manager.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;(2) Go to $OH/network/admin (remember the $OH of the client software home; not the database home)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;(3) You need to create a configuration file called cman.ora. Instead of creating it from scratch, go to the samples subdirectory and copy the cman.ora sample file back into the admin directory.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;(4) In the file cman.ora, make the changes to the following lines. Of course, I assumed cmhost1 as the server running Connection Manager process. Substitute by whatever name you choose for the CM server. I also assumed you would use port 1950 for the CM listener. It does not have to be. Whatever you choose will need to be opened in the firewall.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The lines you are changing will be at the beginning and the end of the cman.ora file.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;cman_cmhost1 =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;(configuration=&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; (address=(protocol=tcp)(host=cmhost1)(port=1950))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; (parameter_list =&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;# conn_stats &amp;nbsp;= connect_statistics&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;(rule_list=&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; (rule=&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; (src=*)(dst=*)(srv=*)(act=accept)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; (action_list=(aut=off)(moct=0)(mct=0)(mit=0)(conn_stats=on))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Keep the remaining lines as is, for now. I will explain the meaning of these parameters later.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;(5) Start the CM command line interface by executing "cmctl"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;# cmctl&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CMCTL for Linux: Version 11.2.0.1.0 - Production on 29-AUG-2011 15:16:01&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Copyright (c) 1996, 2009, Oracle. &amp;nbsp;All rights reserved.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Welcome to CMCTL, type "help" for information.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CMCTL&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This will show a prompt "CMCTL&amp;gt;". Here you will enter different admin commands for the CM processes, much like LSNRCTL command line interpreter.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;(6) Start the administration process by typing "administer"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CMCTL&amp;gt; administer&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Current instance CMAN_cmhost1 is not yet started&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;div&gt;Connections refer to (address=(protocol=tcp)(host=cmhost1)(port=1950)).&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;The command completed successfully.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CMCTL:CMAN_cmhost1&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note how the prompt changed showing the name of the CM.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;(7) Start the connection manager processes by issuing "startup"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CMCTL&amp;gt; startup&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Starting Oracle Connection Manager instance CMAN_cmhost1.proligence.com. Please wait...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;TNS-04077: WARNING: No password set for the Oracle Connection Manager instance.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CMAN for Linux: Version 11.2.0.1.0 - Production&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Status of the Instance&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;----------------------&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Instance name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cman_cmhost1.proligence.com&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Version &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CMAN for Linux: Version 11.2.0.1.0 - Production&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Start date &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;29-AUG-2011 17:25:48&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Uptime &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 days 0 hr. 0 min. 9 sec&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Num of gateways started &amp;nbsp; 2&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Average Load level &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Log Level &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OFF&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Trace Level &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OFF&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Instance Config file &amp;nbsp; &amp;nbsp; &amp;nbsp;/opt/oracle/product/11gR2/client1/network/admin/cman.ora&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Instance Log directory &amp;nbsp; &amp;nbsp;/opt/oracle/product/11gR2/client1/network/log&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Instance Trace directory &amp;nbsp;/opt/oracle/product/11gR2/client1/network/trace&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;The command completed successfully.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;(8) If everything goes well, you should see the CM status&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CMCTL:CMAN_cmhost1&amp;gt; show status&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Status of the Instance&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;----------------------&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Instance name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cman_cmhost1&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Version &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CMAN for Linux: Version 11.2.0.1.0 - Production&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Start date &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30-JUN-2011 13:26:16&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Uptime &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;60 days 2 hr. 15 min. 10 sec&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Num of gateways started &amp;nbsp; 2&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Average Load level &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Log Level &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ADMIN&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Trace Level &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OFF&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Instance Config file &amp;nbsp; &amp;nbsp; &amp;nbsp;/opt/oracle/product/11gR2/client1/network/admin/cman.ora&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Instance Log directory &amp;nbsp; &amp;nbsp;/opt/oracle/product/11gR2/client1/network/log&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Instance Trace directory &amp;nbsp;/opt/oracle/product/11gR2/client1/network/trace&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If it does not start, refer to the troubleshooting section later in this blog.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;(9) Make the TNSNAMES.ORA file change at the client as shown earlier.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;(10) Make the connection using this new TNS connection alias:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;C:\&amp;gt; sqlplus arup/arup@TNS_CM&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You should be able to connect to the database server now. Note, you still can't access the database host directly. If you use the regular TNS connect string - TNS_REG - you will fail. This new connection was established through the connection manager.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;(11) Check the number of connections coming through the CM, using CMCTL tool:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CMCTL:CMAN_cmhost1&amp;gt; show connections&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Number of connections: 1.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;The command completed successfully.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The output shows there is one connection through the CM listener. As you connect more, you will see the number next to "&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Number of connections:&lt;/span&gt;" increasing.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;That's it. You have successfully configured Connection Manager interface.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Fine Tuning&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the previous setup I asked you to enter some values without really explaining the significance of them. Let's go through them.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One of the powerful features of the CM interface is to act as sort of a firewall, i.e. allow connections from/to certain hosts and for specific services. You can define these inside the RULES_LIST section as shown below:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;(rule_list=&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; (rule=&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; (src=x)(dst=x)(srv=*)(act=accept)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; (action_list=(aut=off)(moct=0)(mct=0)(mit=0)(conn_stats=on))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here are the parameters and what they mean:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;src = the source server where the connection request would come from. If you want to leave it unrestricted, use "*", as a wildcard.&lt;/li&gt;&lt;li&gt;dst = the destination server, which is probably the database server the request would go to. Again, unrestricted access would be given as "*".&lt;/li&gt;&lt;li&gt;srv = the service. enter "*" for all types of services.&amp;nbsp;&lt;/li&gt;&lt;li&gt;act = the action, e.g. accept, reject or drop the request&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On src and dst parameters you can give hostnames, IP addresses as well as wildcards. You would use this section to allow or deny the access between different servers, making it a really powerful firewall-like tool.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The action_list parameter allows you to fine tune the actions on the connection.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;aut = whether the Oracle Advanced Security Option&amp;nbsp;authentication filter should be applied. The value shown here is OFF, means this is not to be applied.&lt;/li&gt;&lt;li&gt;moct = after how long the outbound connection established should timeout. The value set here is 0, means the outbound connection is never to be timed out.&lt;/li&gt;&lt;li&gt;mct = after how long the session should disconnect. The value is 0, i.e. never.&lt;/li&gt;&lt;li&gt;mit = the timeout duration for idle connections&lt;/li&gt;&lt;li&gt;conn_stats = whether the connection statistics be maintained.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note the use of&amp;nbsp;parentheses. You can use different rules and actions for each combination of sources and destinations. It allows you to finetune the access. For instance, database D1 is highly secure and you would want ASO filter; but not database D2. For the request coming from the same client, you can have a different set of actions for each destination. For D1, the more secure database host, you can establish various timeouts.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;b&gt;CMCTL Primer&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now that you know about the CMAN.ORA file, let's see the&amp;nbsp;activities&amp;nbsp;you can perform in CMCTL. The first command you should explore should be "help".&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CMCTL&amp;gt; help&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;The following operations are available&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;An asterisk (*) denotes a modifier or extended command:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;administer &amp;nbsp; &amp;nbsp; &amp;nbsp;close* &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;exit &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;quit &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;reload &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;resume* &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; save_passwd &amp;nbsp; &amp;nbsp; set* &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;show* &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; shutdown &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sleep &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; startup &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;suspend* &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can get help on a specific command as well:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CMCTL&amp;gt; help administer&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;administer [&lt;cman instance=""&gt;] [using &lt;password&gt;] - Sets up a context for administering the given Oracle Connection Manager instance&lt;/password&gt;&lt;/cman&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Two&amp;nbsp;commands&amp;nbsp;you will be using a lot are - SHOW and SET.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CMCTL&amp;gt; help SHOW&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;The following operations are available after show&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;An asterisk (*) denotes a modifier or extended command:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;all &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; connections &amp;nbsp; &amp;nbsp; defaults &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;events &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;gateways &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;parameters &amp;nbsp; &amp;nbsp; &amp;nbsp;rules &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; services &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;status &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;version &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CMCTL&amp;gt; help set&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;The following operations are available after set&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;An asterisk (*) denotes a modifier or extended command:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;aso_authentication_filter &amp;nbsp; &amp;nbsp; connection_statistics &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;event &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; idle_timeout &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;inbound_connect_timeout &amp;nbsp; &amp;nbsp; &amp;nbsp; log_directory &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;log_level &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; outbound_connect_timeout &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;password &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;session_timeout &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;trace_directory &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; trace_level &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Most of these modifiers are self explanatory, e.g. show status will show you the status of CM; show connections will show connections established through CM, etc.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;b&gt;Troubleshooting&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Of course things may not go well the first time. Don't despair. You can perform extensive diagnostics and enable logging and tracing.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The most common error may come during the startup:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;TNS-04012: Unable to start Oracle Connection Manager instance.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Unfortunately it's a generic, catch-all error. The most common reason is an incorrectly constructed CMAN.ORA file, e.g. with non-identifiable hostnames and port numbers, log/trace directories that do not yet exist, invalid parameters and values or even mismatched parantheses. It's difficult to guess what caused the issue. The best option for you is to copy the sample CMAN.ORA file and replace the values with your own, paying special attention to the directory names.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Another cause of this error is not using Fully Qualified Names. For instance, you must use cmhost1.proligence.com instead of "cmhost1".&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Sometimes the issues still linger. You can perform extensive diagnostics by using extended tracing and logging. To enable logging and tracing, you have to set the parameters in CMAN.ORA:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;log_level : set to SUPPORT&lt;/div&gt;&lt;div&gt;trace_level : set to SUPPORT&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The default for both is OFF, means no logging and tracing.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When enabled, CM emits tracings and logging in the appropriate directories that may lead to the source of the problem. Here is an excerpt from the log:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;(LOG_RECORD=(TIMESTAMP=29-AUG-2011 16:22:26)(EVENT=CMAN.ORA contains no rule for local CMCTL connection)(Add (rule=(src=cmhost1)(dst=127.0.0.1)(srv=cmon)(act=accept)) in rule_list)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This shows clearly the issue. We have to make the appropriate entry to make CM work. You can also enable these dynamically&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CMCTL:CMAN_cmhost1.proligence.com&amp;gt; set trace_level support&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CMAN_cmhost1.proligence.com parameter trace_level set to support.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;The command completed successfully.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Takeaways&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Connection Manager is a great product form Oracle Network family of products that can, among many things, perform as a connection&amp;nbsp;concentrator from multiple client requests, act as a rule based mini-firewall for the database requests and act as a proxy between different access domains. Here you learned how to set it up, fine tune the parameters and manage it effectively. Hope you liked it. As always, please provide your feedback.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/7580496864125239244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=7580496864125239244' title='29 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/7580496864125239244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/7580496864125239244'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2011/08/setting-up-oracle-connection-manager.html' title='Setting Up Oracle Connection Manager'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-edR-GsWU6-8/TlvyPnogSOI/AAAAAAAAAkc/Qap9UyIVw-g/s72-c/CM1.jpg' height='72' width='72'/><thr:total>29</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-5469095606249510975</id><published>2011-07-24T23:27:00.000-04:00</published><updated>2012-05-04T10:49:13.486-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Role Privilege Discrepancy'/><title type='text'>Difference between Select Any Dictionary and Select_Catalog_Role</title><content type='html'>When you want to give a user the privilege to select from data&amp;nbsp;dictionary and dynamic performance views such as V$DATAFILE, you have two options:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;grant select any dictionary to &lt;user&gt;&lt;user&gt;;&lt;/user&gt;&lt;/user&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;grant select_catalog_role to &lt;user&gt;&lt;/user&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;user&gt;;&lt;/user&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Did you ever wonder why there are two options for accomplishing the same objective? Is one of them redundant? Won't it make sense for Oracle to have just one privilege? And, most important, do these two privileges produce the same result?&lt;br /&gt;&lt;br /&gt;The short answer to the last question is -- &lt;b&gt;&lt;i&gt;no&lt;/i&gt;&lt;/b&gt;; these two do not produce the same result. Since they are fundamentally different, there is a place of each of these. One is not a replacement for the other. In this blog I will explain the subtle but important differences between the two seemingly similar privileges and how to use them properly.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Create the Test Case&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;First let me&amp;nbsp;demonstrate&amp;nbsp;the effects by a small example. Create two users called SCR and SAD:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; create user scr identified by scr;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; create user sad identified by sad;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Grant the necessary privileges to these users, taking care to grant a different one to each user.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; grant create session, select any dictionary to sad;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Grant succeeded.&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; grant create session, select_catalog_role to scr;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Grant succeeded.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Let's test to make sure these privileges work as expected:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; connect sad/sad&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Connected.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; select * from v$session;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&amp;nbsp;... a bunch of rows come here ...&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; connect scr/scr&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Connected.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; select * from v$datafile;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&amp;nbsp;... a bunch of rows come here ...&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Both users have the privilege to select from the dictionary views as we expected. So, what is the difference between these two privileges?&amp;nbsp;To understand that, let's create a procedure on the dictionary tables/views on each schema. Since we will create the same procedure twice, let's first create a script which we will call p.sql. Here is the script:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;create or replace procedure p as&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; l_num number;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;begin&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; select count(1)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; into l_num&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; from v$session;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;end;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;/&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;The procedure is very simple; it merely counts the number of connected sessions by querying V$SESSION.&amp;nbsp;When you connect as SAD and create the procedure by executing p.sql:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; @p.sql&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Procedure created.&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;The procedure was created properly; but when you connect as SCR and execute the script:&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; @p.sql&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Warning: Procedure created with compilation errors.&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; show error&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Errors for PROCEDURE P:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;LINE/COL ERROR&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;-------- ------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;4/2 &amp;nbsp; &amp;nbsp; &amp;nbsp;PL/SQL: SQL Statement ignored&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;6/7 &amp;nbsp; &amp;nbsp; &amp;nbsp;PL/SQL: ORA-00942: table or view does not exist&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;That must be perplexing. We just saw that the user has the privilege to select from the V$SESSION view. You can double check that by selecting from the view one more time. So, why did it report ORA-942: table does not exist?&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Not All Privileges have been Created Equal&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The answer lies in the way Oracle performs compilations. To compile a code with a named object, the user must have been granted privileges by direct grants; not through the roles. Selecting or performing DML statements do not care how the privileges were received. The SQL will work as long as the privileges are there. The privilege SELECT ANY DICTIONARY is a &lt;i&gt;system privilege&lt;/i&gt;, similar to create session or unlimited tablespace. This is why the user SAD, which had the system privilege, could successfully compile the &amp;nbsp; procedure P.&lt;br /&gt;&lt;br /&gt;The user SCR had the role&amp;nbsp;SELECT_CATALOG_ROLE, which allowed it to&amp;nbsp;SELECT from V$SESSION but not to create the procedure. Remember, to create another object on the base object, the user must have the direct grant on the base object; not through a role. Since SCR had the role not the direct grant on V$DATAFILE, it can't compile the procedure.&lt;br /&gt;&lt;br /&gt;So while both the&amp;nbsp;privileges&amp;nbsp;allow the users to select from v$datafile, the role does not allow the users to create objects; the system privilege does.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Why the Role?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now that you know how the privileges are different, you maybe wondering why the role is even there. It seems that the system grant can do everything and there is no need for a role. Not quite.The role has a very different purpose. Roles provide privileges; but only when they are enabled. To see what roles are enabled in a session, use this query:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; connect scr/oracle&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Connected.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; select * from session_roles&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; 2 &amp;nbsp;/&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;ROLE&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SELECT_CATALOG_ROLE&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;HS_ADMIN_SELECT_ROLE&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;2 rows selected.&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We see that two roles - SELECT_CATALOG_ROLE and HS_ADMIN_SELECT_ROLE - have been enabled in the session. The first one was granted to the user. The other one is granted to the first one; so that was also enabled.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Just because a role was granted to the user does not necessarily mean that the role would be enabled. The roles which are marked DEFAULT by the user will be enabled; the others will not be. Let's see that with an example.&amp;nbsp;As SYS user, execute the following:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; alter user scr default role none;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;User altered.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now connect as SCR user and see which roles have been enabled:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; connect scr/oracle&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; select * from session_roles;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;no rows selected&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;None of the roles have been enabled. Why? That's &amp;nbsp;because none of the roles are default for the user (effected by the alter user statement by SYS). At this point when you select from a dynamic performance view:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; select * from v$datafile;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;select * from v$datafile&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; *&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;ERROR at line 1:&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;ORA-00942: table or view does not exist&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You will get this error because the role is not enabled, or active. Without the role the user does not have any privilege to select from the data dictionary or dynamic performance view. To enable the role, the user has to execute the SET ROLE command:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; set role SELECT_CATALOG_ROLE;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Role set.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Checking the enabled roles:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; select * from session_roles;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;ROLE&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SELECT_CATALOG_ROLE&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;HS_ADMIN_SELECT_ROLE&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;2 rows selected.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Now the roles have been enabled. Since the roles are not default, the user must&amp;nbsp;explicitly&amp;nbsp;enable them using the SET ROLE command. This is a very important characteristic of the roles. We can control how the user will get the privilege. Merely granting a role to a user will not enable the role; the user's action is required and that can be done&amp;nbsp;programmatically. In security conscious environments, you may want to take advantage of that property. A user does not always have the to have to privilege; but when needed it will be able to do so.&lt;br /&gt;&lt;br /&gt;The SET ROLE command is an SQL*Plus command. To call it from SQL, use this:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;begin&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp;dbms_session.set_role ('SELECT_CATALOG_ROLE');&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;end;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;You can also set a password for the role. So it will be set only when the correct password is given;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; alter role SELECT_CATALOG_ROLE identified by l &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; 2 &amp;nbsp;/&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Role altered.&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To set the role, you have to give the correct password:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; set role SELECT_CATALOG_ROLE identified by l;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Role set.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you give the wrong password:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; set role SELECT_CATALOG_ROLE identified by fl&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; 2 &amp;nbsp;/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;set role SELECT_CATALOG_ROLE identified by fl&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;*&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;ERROR at line 1:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;ORA-01979: missing or invalid password for role 'SELECT_CATALOG_ROLE'&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can also revoke the execute&amp;nbsp;privilege&amp;nbsp;on dbms_session from public. After that the user will not be able to use it to set the role. You can construct another wrapper procedure to call it. Inside the wrapper, you can have all sort of checks and balances to make sure the call is acceptable.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We will close this discussion with a tip. How do you know which roles are default? Simply use the following query:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SQL&amp;gt; select GRANTED_ROLE, DEFAULT_ROLE&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; 2 &amp;nbsp;from dba_role_privs&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; 3 &amp;nbsp;where GRANTEE = 'SCR';&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;GRANTED_ROLE &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DEF&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;------------------------------ ---&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SELECT_CATALOG_ROLE &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NO&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;Update&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Thanks to Randolph Geist (http://www.blogger.com/profile/13463198440639982695) and Pavel Ruzicka&amp;nbsp;(http://www.blogger.com/profile/04746480312675833301) for pointing out yet another important difference. SELECT ANY DICTIONARY allows select from all SYS owner tables such as TAB$, USER$, etc. This is not possible in the SELECT_CATALOG_ROLE. This difference may seem trivial; but is actually quite important in some cases. For instance, latest versions of Oracle do not show the password column from DBA_USERS; but the hashed password is visible in USER$ table. It's not possible to reverse engineer the password from the hash value; but it is possible to match it to a similar entry and guess the password. A user with the system privilege will be able to do that; but a user with the role will not be.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In this blog entry I started with a simple question - what is the difference between two seemingly similar privileges - SELECT ANY DICTIONARY and SELECT_CATALOG_ROLE. The former is a system privilege, which remains active throughout the sessions and allows the user to create stored objects on objects on which it has privileges as a result of the grant. The latter is not a system grant; it's a role which does not allow the grantee to build stored objects on the granted objects. The role can also be non-default which means the grantee must execute a set role or equivalent command to enable it. The role can also be password protected, if desired.&lt;br /&gt;&lt;br /&gt;The core&amp;nbsp;message&amp;nbsp;you should get from this is that roles are different from privileges. Privileges allow you to build stored objects such as procedures on the objects on which the privilege is based. Roles do not.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/5469095606249510975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=5469095606249510975' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/5469095606249510975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/5469095606249510975'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2011/07/difference-between-select-any.html' title='Difference between Select Any Dictionary and Select_Catalog_Role'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4096575.post-5644705418379053540</id><published>2011-07-24T18:05:00.000-04:00</published><updated>2011-07-24T18:05:59.197-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DMA Exadata Administration Management'/><title type='text'>Who Manages the Exadata Machine?</title><content type='html'>For organizations that just procured an Exadata machine, one of the big questions is bound to be about the group supporting it. Who should it be - the DBAs, Sys Admins, Network Admins, or some blend of multiple teams?&lt;br /&gt;&lt;br /&gt;The conventional Oracle database system is a combination of multiple distinct components - servers, managed by system admins; storage units, managed by SAN admins; network components such as switches and routers, managed by network admins; and, of course, the database itself, managed by the DBAs. Exadata has &lt;i&gt;all &lt;/i&gt;those components - servers, storage (as cell servers), infiniband network, ethernet network, flash disks, the whole nine yards; but packaged inside a single physical frame representing a single logical unit - a typical &lt;i&gt;engineered&lt;/i&gt; system. (For a description of the components inside the Exadata system, please see my &lt;a href="http://bit.ly/lljFl0"&gt;4-part article series on Oracle Technology Network&lt;/a&gt;)&amp;nbsp;None of these conventional technology groups posses the skillsets to the manage all these components. That leads to a difficult but important decision - how the organization should assign the operational&amp;nbsp;responsibilities.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Choices&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;There are two choices for organizations to assign&amp;nbsp;administrative&amp;nbsp;responsibilities.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;b&gt;Distributed &lt;/b&gt;- Have these individual groups manage the respective components, e.g. Sys Admins managing the Linux servers, the storage admins managing the storage cells, network admins managing the network components and finally DBAs managing the database and the cluster.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Consolidated &lt;/b&gt;- Create a specialized group - Database Machine Administrator (DMA) and have one of these groups expand the skillset to include the other non-familiar areas.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Each option has its own pros and cons. Let's examine them and see if we can get the right fit for our specific case.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Distributed Management&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Under this model each component of Exadata is managed as an independent entity by a group traditionally used to manage that type of infrastructure. For instance, the system admins would manage the Linux OS, overseeing all aspects of it such as creation of users to applying the patches and RPMs. The storage and database would be managed likewise by the specialist teams.&lt;br /&gt;&lt;br /&gt;The benefit of this solution is its seeming simplicity - components are managed by their respective specialists without a need for advanced training. The only need for training is for storage, where the Exadata Storage Server commands are new and specific to Exadata.&lt;br /&gt;&lt;br /&gt;While this approach seems a nobrainer on surface, it may not be so in reality. Exadata is not just something patched up from these components; it is an &lt;i&gt;engineered &lt;/i&gt;system. There is a huge meaning behind that qualifier. These components are not designed to act alone; they are put together to make the entire structure a better database machine. And, note the stress here - not an application server, not a fileserver, not a mail server; not a general purpose server - but a database machine alone. This means the individual components - the compute nodes, the storage servers, the disks, the flashdisk cards and more - are tuned to achieve that overriding objective. Any incremental tuning in any specific component has to &amp;nbsp;be within the framework of the entire frame; otherwise it may fail to produce the desired result, or worse, produce undesirable result.&lt;br /&gt;&lt;br /&gt;For instance the disks where the database resides are attached to the storage cell servers; not the database compute nodes. The cell servers, or Cells run Oracle Enterprise Linux, which is very similar to Red Hat Linux. Under this model of administration, the system admins are&amp;nbsp;responsible&amp;nbsp;for managing the operating system. A system admin looks at the host and determines that it is under tuned since the filesystem cache is very low. In a normal Linux system, that would have been a correct observation; but in Exadata, the database is in ASM and a filesystem cache is less important. On the other hand, the Cells need the memory to place the Storage Indexes on the disk contents. Placing a large filesystem cache not only produce nothing to help the filesystem; but actually hurt the performance for the paging of Storage Indexes.&lt;br /&gt;&lt;br /&gt;This is just one example of how the engineered systems are closely interrelated. Assuming they are separate and assigning multiple groups with different skillsets may not work effectively.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Database Machine Administrator&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This is leads to the other approach - making a single group responsible for the&amp;nbsp;entire&amp;nbsp;frame from storage to the database. The single group would be able to understand the impact of the changes in one component to the overall effectiveness of the rack and will be in a better position to plan and manage. The single role that performs the management of Exadata is known as &lt;i&gt;Database Machine Administrator&lt;/i&gt; (&lt;b&gt;DMA&lt;/b&gt;).&lt;br /&gt;&lt;br /&gt;I can almost hear the questions firing off inside your brain. The most likely question probably is whether it is even possible to have a single skillset that encompasses storage, system, database and network.&lt;br /&gt;&lt;br /&gt;Yes, it definitely is. Remember, the advantages of an engineered system do not stop at being a carefully coordinated individual components. Another advantage is the lack of controls in those components. There are less knobs to turn on each component in an Exadata system. Take for instance the Operating System. There are two types of servers - the compute nodes and the cells. In the cells, the activity performed by a system admin is severely limited - almost to the point of being none. On the compute nodes, the activities are limited as well. The only allowable activities are - setting up users, setting up email relays, possibly setting up an NFS mount and handful of more. This can easily be done by a non-expert. One does not have to a System Admin to manage the servers.&lt;br /&gt;&lt;br /&gt;Consider storage, the other&amp;nbsp;important&amp;nbsp;component. Traditionally storage administrators perform critical functions such as adding disks, carving out LUNs, managing replication for DR and so on. These functions are irrelevant in Exadata. For instance, the disks are preallocated in Exadata, the LUNs are created at installation time, there is no replication since the DR is by Data Guard which at the Oracle database level. One need not be a storage expert to the perform the tasks in Exadata. Additionally the Storage Admins&amp;nbsp;are experts in the specific brand of storage, e.g. EMC VMax or IBM XiV. In Exadata, the storage is different from all the other brands your storage admins may be managing. They have to learn about the Exadata storage anyway; so why not have someone else, specifically the DMA learn?&lt;br /&gt;&lt;br /&gt;Consider Network. In Exadata the network components are very limited since it is only for the components inside the rack. This reduces the flexibility of the configuration compared to a regular general purpose network configuration. the special kind of hardware used in Exadata - Infiniband - requires some special skills which the network ops folks may have to learn anyway. So, why not the DMAs instead of them? Besides, Oracle already provides a lot of tools to manage this layer.&lt;br /&gt;&lt;br /&gt;That leaves the most visible component - the database which is, after all, the heart and soul of Exadata. This layer is amenable to a&amp;nbsp;considerable&amp;nbsp;degree of tuning and the depth of skills in this layer is vital to managing Exadata effectively. Transferring the skills needed here to a non-DBA group or individual is difficult, if not impossible. This makes the DBA group the most natural choice for evolving into the DMA role after absorbing the relevant other skills. The other skills are not necessarily at par with the administrator of the respective components. For instance the DMA does not need to be a full scale Linux system admin; but just needs to know a few relevant concepts, commands and tools to perform the job well. Network management is Exadata is a fraction of the skills expected from a network admin. The storage management in cell servers are new to any group; so the DMA will find that as easy as any other group, if not easier.&lt;br /&gt;&lt;br /&gt;By understanding the available knobs on all the constituent components of Exadata, the DMA can be better prepared to be an effective administrator of the Exadata system; not by divvying up the activities to individual groups which are generally&amp;nbsp;autonomous. The advantages are&amp;nbsp;particularly&amp;nbsp;seen when troubleshooting or patching Exadata. Hence, I submit here for your consideration - a new role called DMA (Database Machine Administrator) for the management of Exadata. The role should have the following skillsets:&lt;br /&gt;&lt;br /&gt;60% Database Administration&lt;br /&gt;20% Cell Administration&lt;br /&gt;15% Linux Administration&lt;br /&gt;5% Miscellaneous (Infiniband, network, etc.)&lt;br /&gt;&lt;br /&gt;I have written an article series on Oracle Technology Network - &lt;a href="http://bit.ly/k4mKQS"&gt;Linux for Oracle DBAs&lt;/a&gt;. This 5-part article series has all the commands an concepts the Oracle DBA should understand about Linux. I have also written a 4 part article series - &lt;a href="http://bit.ly/lljFl0"&gt;Commanding Exadata&lt;/a&gt; - for DBAs to learn the 20% cell administration. With these two , you will have&amp;nbsp;everything&amp;nbsp;you need to be a DMA. Scroll down to the bottom of this page and click on "&lt;a href="http://arup.blogspot.com/p/collection-of-some-of-my-very-popular.html"&gt;Collection of Some of My Very Popular Web Articles&lt;/a&gt;" to locate all these articles and more.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In this blog entry, I argued for creating &amp;nbsp;a single role to manage the Exadata system instead of multiple groups managing individual parts. Here are the reasons in a nutshell:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Exadata is an engineered system where all the components play collaboratively instead of as islands. Managing them separately may be ineffective and detrimental.&lt;/li&gt;&lt;li&gt;The support organizations of components such as Systems, storage, DBA, etc. in an organizations are designed with a generic purpose in mind. Exadata is not generic. Its management needs unprecedented close coordination among various groups which may be new to the organization and perhaps difficult to implement.&lt;/li&gt;&lt;li&gt;The needed skillsets are mostly database centric; other components have very little to manage.&lt;/li&gt;&lt;li&gt;These other skills are easy to add to the DBA skills making the natural transition to the DMA role.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Best of luck in becoming a DMA and implementing Exadata.</content><link rel='replies' type='application/atom+xml' href='http://arup.blogspot.com/feeds/5644705418379053540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4096575&amp;postID=5644705418379053540' title='16 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/5644705418379053540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4096575/posts/default/5644705418379053540'/><link rel='alternate' type='text/html' href='http://arup.blogspot.com/2011/07/who-manages-exadata-machine.html' title='Who Manages the Exadata Machine?'/><author><name>Arup Nanda</name><uri>https://plus.google.com/114261203241807570467</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>16</thr:total><georss:featurename>6 Grenier Dr, Danbury, CT 06810, USA</georss:featurename><georss:point>41.3646537 -73.49163479999999</georss:point><georss:box>41.3646487 -73.49163529999998 41.3646587 -73.49163429999999</georss:box></entry></feed>