<?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: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-7650323825349493997</id><updated>2012-02-20T02:35:32.063-08:00</updated><title type='text'>Expert Oracle</title><subtitle type='html'>The intention for this blog is to provide a forum to exchange information, ideas and expertise about relational database and application development products from Oracle. My goal is to provide a professional environment to share this knowledge and experience with individuals from around the world.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://expert-oracle.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://expert-oracle.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jignesh Kariya</name><uri>http://www.blogger.com/profile/13788638237047053842</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>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7650323825349493997.post-5170116574386794826</id><published>2008-10-15T08:11:00.000-07:00</published><updated>2008-10-15T08:12:22.160-07:00</updated><title type='text'>Oracle SQL Developer Data Modeling - Early Adopter Release</title><content type='html'>SQL Developer Data Modeling offers a full spectrum of data and database modeling tools and utilities, including Entity Relationship modeling, Relational (Database Design), Data Type and Multidimensional modeling, full forward and reverse engineering and code generation. It includes importing from and exporting to a variety of sources and targets, provides a variety of formatting options and validates the models through a predefined set of Design Rules.&lt;br /&gt;&lt;br /&gt;SQL Developer Data Modeling can connect to any Oracle Database version 9.2.0.1 and later, and is platform independent. Initially available as a standalone product, with future releases available as an extension to Oracle SQL Developer. The first Early Adopter release is stand alone and file-based only.  For download and additional information, please click &lt;a href="http://www.oracle.com/technology/products/database/sql_developer/files/Modeling.html?rssid=rss_otn_soft"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7650323825349493997-5170116574386794826?l=expert-oracle.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expert-oracle.blogspot.com/feeds/5170116574386794826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7650323825349493997&amp;postID=5170116574386794826' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/5170116574386794826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/5170116574386794826'/><link rel='alternate' type='text/html' href='http://expert-oracle.blogspot.com/2008/10/oracle-sql-developer-data-modeling.html' title='Oracle SQL Developer Data Modeling - Early Adopter Release'/><author><name>Jignesh Kariya</name><uri>http://www.blogger.com/profile/13788638237047053842</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-7650323825349493997.post-1113900629711765964</id><published>2008-10-09T04:01:00.000-07:00</published><updated>2008-10-09T04:06:06.607-07:00</updated><title type='text'>An easier way to write Mediawiki pages</title><content type='html'>One of my colleague has circulated email for MediaWiki.  Following is extract from his email :&lt;br /&gt;&lt;br /&gt;For any of you that struggle with the wiki syntax, as I do, you might find it easier to use OpenOffice, a free alternative to Microsoft Office. Writer (their version of Word) will export in MediaWiki format. So you can write your document in OpenOffice, then export to MediaWiki. As you can also open Word documents in Writer then export them. This is quite handy if you want to create a document that you can send out, but also share on the wiki.&lt;br /&gt;&lt;br /&gt;You can download it here: http://www.openoffice.org/&lt;br /&gt;&lt;br /&gt;A couple of limitations I've found are:&lt;br /&gt;&lt;br /&gt;1. Image support is, well, non existant really. If you have an image in your document, it'll put a placeholder in the wiki text, but no more. But it's a start I guess.&lt;br /&gt;&lt;br /&gt;2. Tables are all set with a default class="prettytable". None of the border or other such formatting settings are created. However, the data is in the right places (which is always the bit that gives me a headache) so adding border="1" at the top etc isn't too traumatic once the table is there.&lt;br /&gt;&lt;br /&gt;3. Certain text sections get exported wrapped in &lt;nowiki&gt; tags. The best example is that if you have a snippet of XML in a document, it'll wrap that in &lt;nowiki&gt; so that the XML tags aren't interpreted. This makes using the wiki code syntax highlighter* a little harder, but it's not too hard to strip out the &lt;nowiki&gt; and then wrap with a &lt;source&gt; tag instead.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7650323825349493997-1113900629711765964?l=expert-oracle.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expert-oracle.blogspot.com/feeds/1113900629711765964/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7650323825349493997&amp;postID=1113900629711765964' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/1113900629711765964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/1113900629711765964'/><link rel='alternate' type='text/html' href='http://expert-oracle.blogspot.com/2008/10/easier-way-to-write-mediawiki-pages.html' title='An easier way to write Mediawiki pages'/><author><name>Jignesh Kariya</name><uri>http://www.blogger.com/profile/13788638237047053842</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-7650323825349493997.post-624755065935380081</id><published>2008-01-15T06:10:00.000-08:00</published><updated>2008-01-15T07:06:42.976-08:00</updated><title type='text'>SQL Deployment</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Example of Directory Structure &amp; SQL Scripts&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Set up a directory structure, e.g.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_e4dVXkFZ6PI/R4zClbzDzMI/AAAAAAAAABU/2tKenb-rjfE/s1600-h/General+SQL+Directory+Structure+v0.1.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_e4dVXkFZ6PI/R4zClbzDzMI/AAAAAAAAABU/2tKenb-rjfE/s400/General+SQL+Directory+Structure+v0.1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5155709621805239490" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Note :&lt;/span&gt; The "sql" folder *MUST* contain at least following scripts :&lt;br /&gt;&lt;code&gt;&lt;br /&gt; 1.  declare.sql&lt;br /&gt; 2.  rollout.sql&lt;br /&gt; 3.  rollout_all.sql&lt;br /&gt; 4.  recompile_invalid_objects.sql&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Note :&lt;/span&gt; The "sql" folder *MUST* contain atleast one sub-folder with schema name: &lt;br /&gt;&lt;code&gt;&lt;br /&gt; eg.  SCOTT&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;SQL Scripts&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;sql/declare.sql&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This script is used to declare database connect string and substitute passwords&lt;br /&gt;&lt;code&gt;&lt;br /&gt; REM Defining Connection Details&lt;br /&gt; DEFINE connect_string = orcl10g.world&lt;br /&gt; DEFINE SCOTT_password = tiger&lt;br /&gt; DEFINE HR_password = hr&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;sql/rollout.sql&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;* 'rollout.sql' runs declare.sql which DEFINE's substitution variables for all passwords (and for the db connect string). It then connects to each database user in turn and runs the rollout scripts for each schema. &lt;br /&gt;&lt;br /&gt;* This script is used to install SQL for particular release (Following example is for Release 2) &lt;br /&gt;&lt;code&gt;&lt;br /&gt; @../../2007.12.2.0/sql/declare.sql&lt;br /&gt; spool ../../2007.12.2.0/sql/rollout.spl&lt;br /&gt; Prompt Deploying scripts for Release 2&lt;br /&gt; connect SCOTT/&amp;SCOTT_password@&amp;connect_string&lt;br /&gt; sho user&lt;br /&gt; PROMPT Connected as SCOTT on &amp;connect_string&lt;br /&gt; @../../2007.12.2.0/sql/SCOTT/rollout.sql&lt;br /&gt; @../../2007.12.2.0/sql/recompile_invalid_objects.sql&lt;br /&gt; connect HR/&amp;HR_password@&amp;connect_string&lt;br /&gt; sho user&lt;br /&gt; PROMPT Connected as HR on &amp;connect_string&lt;br /&gt; @../../2007.12.2.0/sql/HR/rollout.sql&lt;br /&gt; @../../2007.12.2.0/sql/recompile_invalid_objects.sql&lt;br /&gt; PROMPT Scripts deployed for Release 2&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;sql/rollout_all.sql&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;* The @../../ in the paths works fine on both windows and unix. We have used @../../script.sql so that we can successfully rollout all the releases by running single 'rollout_all.sql' script. &lt;br /&gt;&lt;br /&gt;* This script is used to install everything *upto* particular release. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;span style="font-style:italic;"&gt;Example of rollout_all.sql for release 2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the following example, it will deploy SQL scripts for release 1 and 2.&lt;br /&gt;&lt;code&gt;&lt;br /&gt; @../../2007.12.1.0/sql/rollout.sql&lt;br /&gt; PROMPT Press any key to deploy release 2 scripts or Ctrl+C to abort&lt;br /&gt; PAUSE&lt;br /&gt; @../../2007.12.2.0/sql/rollout.sql&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;span style="font-style:italic;"&gt;Example of rollout_all.sql for release 3 &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the following example, it will deploy SQL scripts for release 1,2 and 3.&lt;br /&gt;&lt;code&gt;&lt;br /&gt; @../../2007.12.1.0/sql/rollout.sql&lt;br /&gt; PROMPT Press any key to deploy release 2 scripts or Ctrl+C to abort&lt;br /&gt; PAUSE&lt;br /&gt; @../../2007.12.2.0/sql/rollout.sql&lt;br /&gt; PROMPT Press any key to deploy release 3 scripts or Ctrl+C to abort&lt;br /&gt; PAUSE&lt;br /&gt; @../../2007.12.3.0/sql/rollout.sql&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Note :&lt;/span&gt; Please remember to change 'declare.sql' before running above script.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;sql/recompile_invalid_objects.sql&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This script is used to do the following&lt;br /&gt;    * To list invalid objects&lt;br /&gt;    * Try to recompile all invalid objects&lt;br /&gt;    * To list invalid objects which were not compiled successfully&lt;br /&gt;    * To list Objects deployed / re-compiled today&lt;br /&gt;    * To list compilation errors (if any) after deployment &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;prompt +--------------------------------------------+&lt;br /&gt;prompt | List of invalid objects before compilation |   &lt;br /&gt;prompt +--------------------------------------------+&lt;br /&gt;column object_type format a30&lt;br /&gt;column object_name format a30&lt;br /&gt;column invalid_obj_cnt format 999&lt;br /&gt;column error_text format a30 word_wrap&lt;br /&gt;set serveroutput on&lt;br /&gt;set pagesize 80&lt;br /&gt;select object_type&lt;br /&gt;     , count(*) invalid_obj_cnt &lt;br /&gt;from   user_objects&lt;br /&gt;where  status &lt;&gt; 'VALID'&lt;br /&gt;group by object_type&lt;br /&gt;order by 1&lt;br /&gt;/&lt;br /&gt;prompt +--------------------------------------------+&lt;br /&gt;prompt | Recompiling invalid objects                |&lt;br /&gt;prompt +--------------------------------------------+&lt;br /&gt;BEGIN&lt;br /&gt;  FOR cur_rec IN (SELECT object_name,&lt;br /&gt;                         object_type,&lt;br /&gt;                         DECODE(object_type, 'PACKAGE', 1,&lt;br /&gt;                                             'PACKAGE BODY', 2, 2) AS recompile_order&lt;br /&gt;                  FROM   user_objects&lt;br /&gt;                  WHERE  status != 'VALID'&lt;br /&gt;                  ORDER BY 3)&lt;br /&gt;LOOP&lt;br /&gt;  BEGIN&lt;br /&gt;    IF cur_rec.object_type = 'PACKAGE BODY' THEN&lt;br /&gt;      EXECUTE IMMEDIATE 'ALTER PACKAGE "' ||  cur_rec.object_name || '" COMPILE BODY';&lt;br /&gt;    ELSE&lt;br /&gt;      EXECUTE IMMEDIATE 'ALTER ' || cur_rec.object_type ||' "' || cur_rec.object_name || '" COMPILE';&lt;br /&gt;    END IF;&lt;br /&gt;  EXCEPTION&lt;br /&gt;    WHEN OTHERS THEN&lt;br /&gt;      DBMS_OUTPUT.PUT_LINE(cur_rec.object_type || ' : ' || cur_rec.object_name ||' is INVALID');&lt;br /&gt;  END;&lt;br /&gt;END LOOP;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;prompt +--------------------------------------------+&lt;br /&gt;prompt | List of invalid objects after compilation  |&lt;br /&gt;prompt +--------------------------------------------+&lt;br /&gt;select object_type&lt;br /&gt;     , count(*) invalid_obj_cnt &lt;br /&gt;from   user_objects&lt;br /&gt;where  status &lt;&gt; 'VALID'&lt;br /&gt;group by object_type&lt;br /&gt;order by 1&lt;br /&gt;/&lt;br /&gt;prompt +---------------------------------------------+&lt;br /&gt;prompt | List of objects deployed / recompiled today |&lt;br /&gt;prompt +---------------------------------------------+&lt;br /&gt;select object_type &lt;br /&gt;     , object_name &lt;br /&gt;from   user_objects &lt;br /&gt;where  subobject_name is null&lt;br /&gt;and    (created &gt; trunc(sysdate) or last_ddl_time &gt; trunc(sysdate))&lt;br /&gt;order by object_type, object_name&lt;br /&gt;/ &lt;br /&gt;prompt +---------------------------------------------+&lt;br /&gt;prompt | List of Errors                              | &lt;br /&gt;prompt +---------------------------------------------+&lt;br /&gt;select name &lt;br /&gt;     , type &lt;br /&gt;     , 'Line '||line||' Position '||position||' - '||text error_text&lt;br /&gt;from   user_errors &lt;br /&gt;-- where  attribute = 'ERROR' /* Uncomment if deploying to Oracle Database 10g */&lt;br /&gt;order by name&lt;br /&gt;/&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;sql/HR/rollout.sql&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;* Use @@ so that the scripts are picked up relative to the directory of the script being run &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt; @@view.sql&lt;br /&gt; @@procedure.sql&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;sql/SCOTT/rollout.sql&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;* Use @@ so that the scripts are picked up relative to the directory of the script being run &lt;br /&gt;&lt;code&gt;&lt;br /&gt;@@grants.sql&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Example of Deployment Instructions&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Deployment Instructions for Test Environment&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. Edit declare.sql and substitute the correct database connect string and correct passwords&lt;br /&gt;&lt;br /&gt;2. At the command prompt: &lt;br /&gt;&lt;code&gt;&lt;br /&gt; $ cd ../2007.12.1.0/sql                    &lt;br /&gt; $ sqlplus SCOTT/ValidPassword@ValidConnectString&lt;br /&gt; sql&gt; @rollout.sql&lt;br /&gt; sql&gt; exit&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;NB. The connect string on the command line has to work but is otherwise completely ignored&lt;br /&gt;&lt;br /&gt;3. Examine the output (spool file): no errors or warnings should occur &lt;br /&gt;&lt;code&gt;&lt;br /&gt; $ cat rollout.spl&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Deployment Instructions for Live Environment&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. Edit declare.sql and substitute the correct database connect string and correct passwords. We must modify declare.sql of every releases. In the examples given above, we should modify following declare.sql &lt;br /&gt;&lt;code&gt;&lt;br /&gt; ../2007.12.1.0/sql/declare.sql      &lt;br /&gt; ../2007.12.2.0/sql/declare.sql      &lt;br /&gt; ../2007.12.3.0/sql/declare.sql      &lt;br /&gt; ..etc&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;2. At the command prompt:&lt;br /&gt;&lt;code&gt;&lt;br /&gt; $ cd ../2007.12.3.0/sql   -- Change directory to Last release&lt;br /&gt; $ sqlplus SCOTT/ValidPassword@ValidConnectString&lt;br /&gt; sql&gt; @rollout_all.sql            -- Script to rollout SQL scripts of all releases&lt;br /&gt; sql&gt; exit&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;NB. The connect string on the command line has to work but is otherwise completely ignored&lt;br /&gt;&lt;br /&gt;3. Examine the output (spool file): no errors or warnings should occur&lt;br /&gt;&lt;code&gt;&lt;br /&gt; $ cat ../2007.12.1.0/sql/rollout.spl&lt;br /&gt; $ cat ../2007.12.2.0/sql/rollout.spl      &lt;br /&gt; $ cat ../2007.12.3.0/sql/rollout.spl      &lt;br /&gt; .. etc&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;SQL Script Guidelines&lt;/span&gt;&lt;br /&gt;    *  All SQL script *MUST* start with 'prompt .....'&lt;br /&gt;    * SQL script for procedures, functions and packages *MUST* end with 'show error'&lt;br /&gt;    * Script should be saved under unix format. So, if you are using UltraEdit to create / modify your script, please use 'File' -&gt; 'Conversions' -&gt; 'Dos to UNIX'&lt;br /&gt;    * Name of the script should be lower case. The script name should match oracle object name when possible.&lt;br /&gt;    * Package body and package definition should be saved separately.&lt;br /&gt;    * Script file extension : &lt;br /&gt;&lt;code&gt;&lt;br /&gt;      Package Specification   &lt;PackageName&gt;.pks&lt;br /&gt;      Package Body            &lt;PackageName&gt;.pkb&lt;br /&gt;      All other scripts       &lt;ScriptName&gt;.sql&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;To Do / Can be done&lt;/span&gt;&lt;br /&gt;    *  We are creating declare.sql per release. Due to this, live deployment requires changes to all declare.sql. To avoid this, consider amending 'declare.sql' of first release for every subsequent deployment. &lt;br /&gt;    * Consider creating 'PATCH' table per schema. Insert a row with patch_id, timestamp and userid if the patch gets deployed successfully (i.e. without errors). This will allow us to track database changes by querying single table. &lt;br /&gt;    * Consider using Ant scripts for SQL deployment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7650323825349493997-624755065935380081?l=expert-oracle.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expert-oracle.blogspot.com/feeds/624755065935380081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7650323825349493997&amp;postID=624755065935380081' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/624755065935380081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/624755065935380081'/><link rel='alternate' type='text/html' href='http://expert-oracle.blogspot.com/2008/01/sql-deployment.html' title='SQL Deployment'/><author><name>Jignesh Kariya</name><uri>http://www.blogger.com/profile/13788638237047053842</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://3.bp.blogspot.com/_e4dVXkFZ6PI/R4zClbzDzMI/AAAAAAAAABU/2tKenb-rjfE/s72-c/General+SQL+Directory+Structure+v0.1.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7650323825349493997.post-6024347337402013051</id><published>2008-01-15T06:02:00.000-08:00</published><updated>2008-01-15T06:05:23.264-08:00</updated><title type='text'>Useful Unix / Linux scripting links</title><content type='html'>&lt;a href="http://www.oracle.com/technology/pub/articles/calish_system.html"&gt;Guide to Linux System Command Mastery&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/pub/articles/dulaney_test.html"&gt;Improve Your Scripting with the test Command&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/pub/articles/calish_filesys.html"&gt;Guide to Linux Filesystem Mastery&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/pub/articles/saternos_scripting.html"&gt;An Introduction to Linux Shell Scripting for DBAs&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/pub/articles/advanced-linux-commands/part1.html"&gt;Guide to Advanced Linux Command Mastery Part-1&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/pub/articles/advanced-linux-commands/part2.html"&gt;Guide to Advanced Linux Command Mastery Part-2&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/pub/articles/dulaney_awk.html"&gt;AWK: The Linux Administrators' Wisdom Kit&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/pub/articles/dulaney_sed.html"&gt;Using the sed Editor&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7650323825349493997-6024347337402013051?l=expert-oracle.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expert-oracle.blogspot.com/feeds/6024347337402013051/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7650323825349493997&amp;postID=6024347337402013051' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/6024347337402013051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/6024347337402013051'/><link rel='alternate' type='text/html' href='http://expert-oracle.blogspot.com/2008/01/useful-unix-linux-scripting-links.html' title='Useful Unix / Linux scripting links'/><author><name>Jignesh Kariya</name><uri>http://www.blogger.com/profile/13788638237047053842</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-7650323825349493997.post-611216564532137213</id><published>2007-11-15T05:53:00.000-08:00</published><updated>2007-11-15T05:55:04.684-08:00</updated><title type='text'>Download Oracle VM</title><content type='html'>You can download OracleVM  from http://edelivery.oracle.com/oraclevm&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7650323825349493997-611216564532137213?l=expert-oracle.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expert-oracle.blogspot.com/feeds/611216564532137213/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7650323825349493997&amp;postID=611216564532137213' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/611216564532137213'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/611216564532137213'/><link rel='alternate' type='text/html' href='http://expert-oracle.blogspot.com/2007/11/download-oracle-vm.html' title='Download Oracle VM'/><author><name>Jignesh Kariya</name><uri>http://www.blogger.com/profile/13788638237047053842</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-7650323825349493997.post-6888596004767209284</id><published>2007-10-16T06:34:00.000-07:00</published><updated>2007-10-16T06:35:45.261-07:00</updated><title type='text'>Load XML into Database</title><content type='html'>Following is the extract from Oracle SQL &amp; PLSQL Forum (Courtesy Billy Verreynne)&lt;br /&gt;&lt;br /&gt;You can store XML as CLOB or XMLType objects. &lt;br /&gt;&lt;br /&gt;You can easily load XML files into the database as CLOBs using the DBMS_LOB PL/SQL package - it has a load-from-file procedural call that can be made. Very easy to use.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;drop table xml_clob; &lt;br /&gt;drop table my_objects;&lt;br /&gt;-- create a table to store a large XML doc in raw format &lt;br /&gt;create table xml_clob ( doc CLOB ) &lt;br /&gt;/&lt;br /&gt;-- create such a raw XML document, using the ALL_OBJECTS -- table &lt;br /&gt;DECLARE&lt;br /&gt;    CURSOR curxml IS&lt;br /&gt;        SELECT xmlelement("ORA_OBJECT", xmlforest(object_id AS "ID", owner AS "OWNER", object_type AS "TYPE", object_name AS "NAME")) AS "XML_DATA"&lt;br /&gt;        FROM   all_objects&lt;br /&gt;        WHERE  rownum &lt; 100001;&lt;br /&gt;&lt;br /&gt;    xml    XMLTYPE;&lt;br /&gt;    c      CLOB;&lt;br /&gt;BEGIN&lt;br /&gt;    dbms_lob.createtemporary(c, TRUE);&lt;br /&gt;&lt;br /&gt;    OPEN curxml;&lt;br /&gt;&lt;br /&gt;    LOOP&lt;br /&gt;        FETCH curxml&lt;br /&gt;        INTO  xml;&lt;br /&gt;&lt;br /&gt;        EXIT WHEN curxml%NOTFOUND;&lt;br /&gt;  DBMS_LOB.Append( c, xml.GetCLOBVal() ); &lt;br /&gt;        -- dbms_lob.writeappend(c, LENGTH(xml.getclobval()), xml.getclobval());&lt;br /&gt;    END LOOP;&lt;br /&gt;&lt;br /&gt;    CLOSE curxml;&lt;br /&gt;&lt;br /&gt;    INSERT INTO xml_clob&lt;br /&gt;    VALUES      ('&lt;DATASET&gt;' || c || '&lt;/DATASET&gt;'&lt;br /&gt;                );&lt;br /&gt;&lt;br /&gt;    COMMIT;&lt;br /&gt;END;&lt;br /&gt; &lt;br /&gt;/&lt;br /&gt;CREATE TABLE my_objects (obj_id NUMBER,   obj_owner VARCHAR2(30),   obj_type VARCHAR2(19),   obj_name VARCHAR2(30) )&lt;br /&gt; &lt;br /&gt;/&lt;br /&gt;-- call proc with a raw XML clob and have it insert the contents &lt;br /&gt;-- into a relational table &lt;br /&gt;CREATE OR REPLACE PROCEDURE insertobjects(&lt;br /&gt;    xmldoc    IN OUT NOCOPY    CLOB&lt;br /&gt;) IS&lt;br /&gt;BEGIN&lt;br /&gt;    INSERT INTO my_objects&lt;br /&gt;        SELECT extractvalue(VALUE(xml), 'ORA_OBJECT/ID')&lt;br /&gt;             , extractvalue(VALUE(xml), 'ORA_OBJECT/OWNER')&lt;br /&gt;             , extractvalue(VALUE(xml), 'ORA_OBJECT/TYPE')&lt;br /&gt;             , extractvalue(VALUE(xml), 'ORA_OBJECT/NAME')&lt;br /&gt;        FROM   TABLE(SELECT xmlsequence(EXTRACT(XMLTYPE(xmldoc), 'DATASET/*'))&lt;br /&gt;                     FROM   dual) xml;&lt;br /&gt;&lt;br /&gt;    COMMIT;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;-- the test (processing 10,000 XML rows): &lt;br /&gt;set timing on &lt;br /&gt;declare   c CLOB; &lt;br /&gt;BEGIN&lt;br /&gt;    SELECT doc&lt;br /&gt;    INTO   c&lt;br /&gt;    FROM   xml_clob;&lt;br /&gt;&lt;br /&gt;    insertobjects(c);&lt;br /&gt;END;&lt;br /&gt;/ &lt;br /&gt;&lt;br /&gt;set timing offselect count(*) from my_objects; &lt;br /&gt;select * from my_objects where rownum &lt; 4;&lt;br /&gt;--eof&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7650323825349493997-6888596004767209284?l=expert-oracle.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expert-oracle.blogspot.com/feeds/6888596004767209284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7650323825349493997&amp;postID=6888596004767209284' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/6888596004767209284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/6888596004767209284'/><link rel='alternate' type='text/html' href='http://expert-oracle.blogspot.com/2007/10/load-xml-into-database.html' title='Load XML into Database'/><author><name>Jignesh Kariya</name><uri>http://www.blogger.com/profile/13788638237047053842</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-7650323825349493997.post-1764448153728495499</id><published>2007-10-15T07:39:00.000-07:00</published><updated>2007-10-15T08:11:56.967-07:00</updated><title type='text'>Extracting from XML Datatype</title><content type='html'>&lt;code&gt;&lt;br /&gt;&lt;br /&gt;WITH XMLDATA AS&lt;br /&gt;(SELECT xmltype(&lt;br /&gt; '&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;transaction type="IN"&amp;gt;&lt;br /&gt;  &amp;lt;customer id="Cust001"/&amp;gt;&lt;br /&gt;  &amp;lt;product&amp;gt;&lt;br /&gt;    &amp;lt;product_details&amp;gt;&lt;br /&gt;      &amp;lt;orderno&amp;gt;ORD000001&amp;lt;/orderno&amp;gt;&lt;br /&gt;      &amp;lt;orderlineno&amp;gt;000010&amp;lt;/orderlineno&amp;gt;&lt;br /&gt;      &amp;lt;product_code&amp;gt;PRD&amp;lt;/product_code&amp;gt;&lt;br /&gt;      &amp;lt;product_content&amp;gt;&lt;br /&gt;        &amp;lt;URL/&amp;gt;&lt;br /&gt;        &amp;lt;product_one&amp;gt;&lt;br /&gt;          &amp;lt;textType&amp;gt;1&amp;lt;/textType&amp;gt;&lt;br /&gt;          &amp;lt;text/&amp;gt;&lt;br /&gt;          &amp;lt;text1&amp;gt;Surrounding Areas&amp;lt;/text1&amp;gt;&lt;br /&gt;          &amp;lt;iconCreditCards boolean="false"/&amp;gt;&lt;br /&gt;          &amp;lt;messagingEmailAddress&amp;gt;myemailAddress@email.com&amp;lt;/messagingEmailAddress&amp;gt;&lt;br /&gt;        &amp;lt;/product_one&amp;gt;&lt;br /&gt;      &amp;lt;/product_content&amp;gt;&lt;br /&gt;      &amp;lt;live_date&amp;gt;2007-02-21&amp;lt;/live_date&amp;gt;&lt;br /&gt;      &amp;lt;term_date&amp;gt;2008-03-05&amp;lt;/term_date&amp;gt;&lt;br /&gt;      &amp;lt;proposed_start_date&amp;gt;2007-03-07&amp;lt;/proposed_start_date&amp;gt;&lt;br /&gt;    &amp;lt;/product_details&amp;gt;&lt;br /&gt;    &amp;lt;classification code="00001"&amp;gt;&lt;br /&gt;      &amp;lt;branch bf_id="0001"&amp;gt;&lt;br /&gt;        &amp;lt;suppress_address boolean="false"/&amp;gt;&lt;br /&gt;        &amp;lt;branch_override_details&amp;gt;&lt;br /&gt;          &amp;lt;telephone_number prefix="Tel"&amp;gt;01234 567890&amp;lt;/telephone_number&amp;gt;&lt;br /&gt;        &amp;lt;/branch_override_details&amp;gt;&lt;br /&gt;        &amp;lt;organisation_name&amp;gt;SIGNAL&amp;lt;/organisation_name&amp;gt;&lt;br /&gt;        &amp;lt;address_line1&amp;gt;Address Line 1, Some Road&amp;lt;/address_line1&amp;gt;&lt;br /&gt;        &amp;lt;address_line2/&amp;gt;&lt;br /&gt;        &amp;lt;address_line3/&amp;gt;&lt;br /&gt;        &amp;lt;locality&amp;gt;London&amp;lt;/locality&amp;gt;&lt;br /&gt;        &amp;lt;post_town&amp;gt;PostTown&amp;lt;/post_town&amp;gt;&lt;br /&gt;        &amp;lt;postcode&amp;gt;PO1 BO1&amp;lt;/postcode&amp;gt;&lt;br /&gt;        &amp;lt;telephone_number&amp;gt;02314 555000&amp;lt;/telephone_number&amp;gt;&lt;br /&gt;        &amp;lt;telephone_number_2 prefix="Mobile"&amp;gt;07834 123123&amp;lt;/telephone_number_2&amp;gt;&lt;br /&gt;      &amp;lt;/branch&amp;gt;&lt;br /&gt;      &amp;lt;branch bf_id="0002"&amp;gt;&lt;br /&gt;        &amp;lt;suppress_address boolean="true"/&amp;gt;&lt;br /&gt;        &amp;lt;branch_override_details&amp;gt;&lt;br /&gt;          &amp;lt;telephone_number prefix="Tel"&amp;gt;01234 567891&amp;lt;/telephone_number&amp;gt;&lt;br /&gt;        &amp;lt;/branch_override_details&amp;gt;&lt;br /&gt;        &amp;lt;organisation_name&amp;gt;SIGNAL&amp;lt;/organisation_name&amp;gt;&lt;br /&gt;        &amp;lt;address_line1&amp;gt;Adress Line 1, Street Road&amp;lt;/address_line1&amp;gt;&lt;br /&gt;        &amp;lt;address_line2/&amp;gt;&lt;br /&gt;        &amp;lt;address_line3/&amp;gt;&lt;br /&gt;        &amp;lt;locality&amp;gt;Best Locality&amp;lt;/locality&amp;gt;&lt;br /&gt;        &amp;lt;post_town&amp;gt;Wonderful Town&amp;lt;/post_town&amp;gt;&lt;br /&gt;        &amp;lt;postcode&amp;gt;PO1 CD2&amp;lt;/postcode&amp;gt;&lt;br /&gt;        &amp;lt;telephone_number&amp;gt;01189 118118&amp;lt;/telephone_number&amp;gt;&lt;br /&gt;        &amp;lt;telephone_number_2 prefix="Mobile"&amp;gt;07834 123456&amp;lt;/telephone_number_2&amp;gt;&lt;br /&gt;      &amp;lt;/branch&amp;gt;&lt;br /&gt;    &amp;lt;/classification&amp;gt;&lt;br /&gt;  &amp;lt;/product&amp;gt;&lt;br /&gt;&amp;lt;/transaction&amp;gt;'&lt;br /&gt;') XML FROM DUAL)&lt;br /&gt;SELECT &lt;br /&gt;extractValue(xml,'/transaction/customer@id') as CustomerID,&lt;br /&gt;extractValue(xml,'/transaction/product/product_details/live_date') as startDate,&lt;br /&gt;extractValue(xml,'/transaction/product/product_details/orderno') as orderno,&lt;br /&gt;extractValue(xml,'/transaction/product/product_details/product_content/product_one/messagingEmailAddress') as Email,&lt;br /&gt;extractValue(value(d),'/branch@bf_id') branch,&lt;br /&gt;extractValue(value(d),'/branch/suppress_address@boolean') AddressSuppress,&lt;br /&gt;extractValue(value(d),'/branch/branch_override_details/telephone_number@prefix') TelPrefix,&lt;br /&gt;extractValue(value(d),'/branch/branch_override_details/telephone_number') TelNo&lt;br /&gt;FROM   XMLDATA x, &lt;br /&gt;table(xmlsequence(extract(x.xml,'/transaction/product//classification/branch'))) d&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;----------  ----------  ----------  --------------------------  ------  --------------- ----------- -------------&lt;br /&gt;CUSTOMERID STARTDATE ORDERNO     EMAIL                     BRANCH ADDRESSSUPPRESS TELPREFIX TELNO&lt;br /&gt;----------  ----------  ----------  --------------------------  ------  --------------- ----------- -------------&lt;br /&gt;Cust001     2007-02-21 ORD000001 myemailAddress@email.com 0001 false         Tel         01234 567890&lt;br /&gt;Cust001     2007-02-21 ORD000001 myemailAddress@email.com 0002 true         Tel         01234 567891&lt;br /&gt;----------  ----------  ----------  --------------------------  ------  --------------- ----------- -------------&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7650323825349493997-1764448153728495499?l=expert-oracle.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expert-oracle.blogspot.com/feeds/1764448153728495499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7650323825349493997&amp;postID=1764448153728495499' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/1764448153728495499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/1764448153728495499'/><link rel='alternate' type='text/html' href='http://expert-oracle.blogspot.com/2007/10/extracting-from-xml-datatype.html' title='Extracting from XML Datatype'/><author><name>Jignesh Kariya</name><uri>http://www.blogger.com/profile/13788638237047053842</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-7650323825349493997.post-3612793354809232189</id><published>2007-10-15T04:39:00.000-07:00</published><updated>2009-11-19T03:27:51.009-08:00</updated><title type='text'>PIVOT Table using XML</title><content type='html'>&lt;strong&gt;Rows to Column&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I want to get output of multiple rows into single variable seperated by comma. How can I achieve that. There is also requirement of using dynamic sql as table and column will be known at runtime only.&lt;br /&gt;&lt;br /&gt;Here is the example :&lt;br /&gt;&lt;code&gt;&lt;br /&gt;select rtrim(dbms_xmlgen.getxmltype('select empno '','' e from EMP WHERE DEPTNO = '&amp;p_deptno).extract('//text()'),',') x&lt;br /&gt;from dual;&lt;br /&gt;&lt;br /&gt;Enter value for p_deptno: 10&lt;br /&gt;&lt;br /&gt;X&lt;br /&gt;--------------&lt;br /&gt;7782,7839,7934&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Columns to Rows&lt;/strong&gt;&lt;br /&gt;I've got comma seperated values in single row, now I need the output in multiple rows.  How can I get this?&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_e4dVXkFZ6PI/SwUrZF6FpFI/AAAAAAAAACg/DmZgKO2BfuA/s1600/pivot.PNG"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 72px;" src="http://1.bp.blogspot.com/_e4dVXkFZ6PI/SwUrZF6FpFI/AAAAAAAAACg/DmZgKO2BfuA/s320/pivot.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5405774637810689106" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;EMPNO                                                                           &lt;br /&gt;------&lt;br /&gt;7782                                                                            &lt;br /&gt;7839                                                                            &lt;br /&gt;7934                                                                            &lt;br /&gt;&lt;br /&gt;3 rows selected.&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7650323825349493997-3612793354809232189?l=expert-oracle.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expert-oracle.blogspot.com/feeds/3612793354809232189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7650323825349493997&amp;postID=3612793354809232189' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/3612793354809232189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/3612793354809232189'/><link rel='alternate' type='text/html' href='http://expert-oracle.blogspot.com/2007/10/pivot-rows-to-column-using-xml.html' title='PIVOT Table using XML'/><author><name>Jignesh Kariya</name><uri>http://www.blogger.com/profile/13788638237047053842</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://1.bp.blogspot.com/_e4dVXkFZ6PI/SwUrZF6FpFI/AAAAAAAAACg/DmZgKO2BfuA/s72-c/pivot.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7650323825349493997.post-4396285749690403158</id><published>2007-08-15T06:51:00.001-07:00</published><updated>2007-08-15T12:51:34.705-07:00</updated><title type='text'>OCP Oracle Database 11g : New Features for Administrators Exam Guide</title><content type='html'>&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;em&gt;Topics related to above exam follows.....&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;For now... here are some of the cool new features of 11g&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;strong&gt;Case Sensitive Passwords &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Beginning with Oracle Database 11g Release 1, database passwords are case sensitive. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;You can disable this features by setting the SEC_CASE_SENSITIVE_LOGON initialization parameter to FALSE.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:100%;"&gt;Automatic Stats Collection on Tables &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;As you know that you can enable DBMS_STATS to automatically gather statistics for a table by specifying the MONITORING keyword in the CREATE (or ALTER) TABLE statement. But, starting with Oracle Database 11g, the MONITORING and NOMONITORING keywords have been deprecated and statistics are collected automatically. If you do specify these keywords, they are ignored. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Monitoring tracks the approximate number of INSERT, UPDATE, and DELETE operations for the table since the last time statistics were gathered. Information abouthow many rows are affected is maintained in the SGA, until periodically (about everythree hours) SMON incorporates the data into the data dictionary. This data dictionary information is made visible through the DBA_TAB_MODIFICATIONS,ALL_TAB_MODIFICATIONS, or USER_TAB_MODIFICATIONS views. The database uses these views to identify tables with stale statistics.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Arial;"&gt;&lt;strong&gt;Readonly Tables&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;To place a table in read-only mode, you must have the ALTER TABLE privilege on thetable or the ALTER ANY TABLE privilege. In addition, the COMPATIBILE initializationparameter must be set to 11.1.0 or greater.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The following example places the EMP table in read-only mode:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:courier new;"&gt;ALTER TABLE EMP READ ONLY;&lt;/span&gt; &lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The following example returns the table to read/write mode:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;ALTER TABLE EMP READ WRITE;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;strong&gt;Invisible Indexes&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;An invisible index is an index that is ignored by the optimizer unless you explicitly set the OPTIMIZER_USE_INVISIBLE_INDEXES initialization parameter to TRUE at the session or system level. Making an index invisible is an alternative to making it unusable or dropping it.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Using invisible indexes, you can do the following: &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;Test the removal of an index before dropping it. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Altering Indexes &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Use temporary index structures for certain operations or modules of an application without affecting the overall application.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;To create an invisible index, use the SQL statement CREATE INDEX with theINVISIBLE clause. The following statement creates an invisible index named IND_EMP_DEPT for the DEPT column of the EMP table:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:100%;"&gt;CREATE INDEX ind_emp_dept ON emp(dept)INVISIBLE;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;To make an invisible index visible, issue this statement: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;ALTER INDEX ind_emp_dept VISIBLE; &lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;To make a visible index invisible, issue this statement: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;ALTER INDEX ind_emp_dept INVISIBLE; &lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;To check whether an index is visible or invisible, query the dictionary views&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:arial;"&gt;USER[ALL][DBA]_INDEXES&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:100%;"&gt;For example, to determine if above index is invisible, issue the following query:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;font-size:100%;"&gt;&lt;br /&gt;SELECT INDEX_NAME, VISIBILITY FROM&lt;br /&gt;USER_INDEXES WHERE INDEX_NAME = 'IND_EMP_DEPT';&lt;br /&gt;&lt;br /&gt;INDEX_NAME    VISIBILITY &lt;br /&gt;------------- ----------&lt;br /&gt;IND_EMP_DEPT  VISIBLE &lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7650323825349493997-4396285749690403158?l=expert-oracle.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expert-oracle.blogspot.com/feeds/4396285749690403158/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7650323825349493997&amp;postID=4396285749690403158' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/4396285749690403158'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/4396285749690403158'/><link rel='alternate' type='text/html' href='http://expert-oracle.blogspot.com/2007/08/ocp-oracle-database-11g-new-features.html' title='OCP Oracle Database 11g : New Features for Administrators Exam Guide'/><author><name>Jignesh Kariya</name><uri>http://www.blogger.com/profile/13788638237047053842</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-7650323825349493997.post-2374830573087861785</id><published>2007-08-14T14:14:00.000-07:00</published><updated>2007-08-15T12:06:39.090-07:00</updated><title type='text'>Partitioning Limitations</title><content type='html'>&lt;span style="font-family:arial;"&gt;I was trying to reverse engineer the schema using Visual Paradigm for UML 6.0 Professional Edition and identified that it doesn't work with partitioned tables. However, this is a restriction / bug in Visual Paradigm.&lt;br /&gt;To list out few limitations of Partitioning :&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:arial;"&gt;In 9i, you can not create index organized table with List Partitioning (however in 10g, you can)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;"&gt;In 9i, you can not Fast Refresh materialized views after truncating partitions on base table. You have to have range or composite (implies range) especially in this case. But In 10g, you can i.e. range OR list (or composite)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;"&gt;You have to disable referential integrity between partitioned tables if you want to drop old partitions. Even if you drop child partition first, followed by its parent table partition, currently results in Oracle error ORA-02266: unique/primary keys in table referenced by enabled foreign keys. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Arial;"&gt;We can not move partitions to tablespace with different block size using ALTER TABLE MOVE command&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7650323825349493997-2374830573087861785?l=expert-oracle.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expert-oracle.blogspot.com/feeds/2374830573087861785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7650323825349493997&amp;postID=2374830573087861785' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/2374830573087861785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/2374830573087861785'/><link rel='alternate' type='text/html' href='http://expert-oracle.blogspot.com/2007/08/partitioning-limitations.html' title='Partitioning Limitations'/><author><name>Jignesh Kariya</name><uri>http://www.blogger.com/profile/13788638237047053842</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-7650323825349493997.post-2417035150149971391</id><published>2007-08-14T13:32:00.000-07:00</published><updated>2007-08-14T13:44:43.456-07:00</updated><title type='text'>Drop partitions</title><content type='html'>&lt;span style="font-family:arial;"&gt;Back to basics... &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-family:arial;"&gt;"I want to drop the partitions however I dont want to rebuild the local indexes. I have enforced referential integrity on tables.. How can I achive this?"&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;1. Use deferrable FK constraints&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;2. disable the constraints before dropping partitions&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;3. Enable constraint with 'NOVALIDATE' clause after dropping partitions.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-family:arial;"&gt;But what if I have indexes on FK constraints?&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;You can use 'KEEP INDEX' caluse at the time of disabling the constraints.&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;em&gt;&lt;/em&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7650323825349493997-2417035150149971391?l=expert-oracle.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://expert-oracle.blogspot.com/feeds/2417035150149971391/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7650323825349493997&amp;postID=2417035150149971391' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/2417035150149971391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7650323825349493997/posts/default/2417035150149971391'/><link rel='alternate' type='text/html' href='http://expert-oracle.blogspot.com/2007/08/drop-partitions.html' title='Drop partitions'/><author><name>Jignesh Kariya</name><uri>http://www.blogger.com/profile/13788638237047053842</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></feed>
