<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Mohib Alvi</title>
	<atom:link href="http://mohibalvi.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mohibalvi.wordpress.com</link>
	<description>Technology Blog</description>
	<lastBuildDate>Sat, 04 Jun 2011 11:10:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mohibalvi.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Mohib Alvi</title>
		<link>http://mohibalvi.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mohibalvi.wordpress.com/osd.xml" title="Mohib Alvi" />
	<atom:link rel='hub' href='http://mohibalvi.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Recovery Manager Features</title>
		<link>http://mohibalvi.wordpress.com/2011/04/27/recovery-manager-features/</link>
		<comments>http://mohibalvi.wordpress.com/2011/04/27/recovery-manager-features/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 02:35:34 +0000</pubDate>
		<dc:creator>mohibalvi</dc:creator>
				<category><![CDATA[Backup and Recovery]]></category>
		<category><![CDATA[RMAN backup and recovery]]></category>
		<category><![CDATA[RMAN]]></category>
		<category><![CDATA[RMAN features]]></category>

		<guid isPermaLink="false">https://mohibalvi.wordpress.com/2011/04/27/recovery-manager-features/</guid>
		<description><![CDATA[RMAN is an Oracle utility that you use to manage the backup, restore, and recovery operations on Oracle databases. RMAN has a powerful command language that is independent of the operating system. RMAN provides several features not available when you make user-managed backups with operating system commands. Frequently executed operations can be stored as scripts [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=377&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>RMAN is an Oracle utility that you use to manage the backup, restore, and recovery operations on Oracle databases. RMAN has a powerful command language that is independent of the operating system.   </p>
<p>RMAN provides several features not available when you make user-managed backups with   <br />operating system commands.</p>
<ul>
<li>Frequently executed operations can be stored as scripts in the database.</li>
<li>With block change tracking enabled in the database RMAN can limit incremental backups to recording only those blocks that have changed since the previous backup. </li>
<li>RMAN can be used to manage the size of backup pieces and save time by parallelizing the backup operation.</li>
<li>RMAN can recover an individual corrupt data block or set of data blocks within a data file rather than restoring and recovering the entire data file.</li>
<li>RMAN operations can be integrated with the Oracle Database Scheduler to automate     <br />backup operations.</li>
<li>You can use RMAN to detect block corruption. The information relating to the block     <br />corruption that is detected during backup can be obtained by using the      <br />V$BACKUP_CORRUPTION and V$COPY_CORRUPTION dynamic views.</li>
<li>RMAN provides performance enhancements such as:     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8211; Automatic parallelization of backup, restore, and recovery operations      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8211; No generation of extra redo during online database backups      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8211; Backups can be restricted to limit reads per file, per second to avoid interfering&#160;&#160; with OLTP work      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; -&#160; Prevention of flooding of any one file with reads and writes while still keeping a tape drive streaming, using multiplexing</li>
<li>RMAN has a media management API to work seamlessly with third-party media     <br />management tools interfacing with storage devices providing increased speed and      <br />reliability.</li>
<li>Under the user-managed method you need to keep track of all database files and backups. In a recovery situation you must locate backups for each data file, copy them to the correct place using operating system commands, and choose which redo log files to apply. RMAN manages these tasks automatically. </li>
</ul>
<br />Filed under: <a href='http://mohibalvi.wordpress.com/category/backup-and-recovery/'>Backup and Recovery</a>, <a href='http://mohibalvi.wordpress.com/category/backup-and-recovery/rman-backup-and-recovery/'>RMAN backup and recovery</a> Tagged: <a href='http://mohibalvi.wordpress.com/tag/rman/'>RMAN</a>, <a href='http://mohibalvi.wordpress.com/tag/rman-backup-and-recovery/'>RMAN backup and recovery</a>, <a href='http://mohibalvi.wordpress.com/tag/rman-features/'>RMAN features</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohibalvi.wordpress.com/377/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohibalvi.wordpress.com/377/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohibalvi.wordpress.com/377/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohibalvi.wordpress.com/377/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mohibalvi.wordpress.com/377/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mohibalvi.wordpress.com/377/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mohibalvi.wordpress.com/377/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mohibalvi.wordpress.com/377/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohibalvi.wordpress.com/377/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohibalvi.wordpress.com/377/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohibalvi.wordpress.com/377/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohibalvi.wordpress.com/377/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohibalvi.wordpress.com/377/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohibalvi.wordpress.com/377/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=377&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mohibalvi.wordpress.com/2011/04/27/recovery-manager-features/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef5ff240dbc6a355cf764b046b1d4954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mohibalvi</media:title>
		</media:content>
	</item>
		<item>
		<title>Reading Alert Log</title>
		<link>http://mohibalvi.wordpress.com/2011/04/22/reading-alert-log/</link>
		<comments>http://mohibalvi.wordpress.com/2011/04/22/reading-alert-log/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 03:17:34 +0000</pubDate>
		<dc:creator>mohibalvi</dc:creator>
				<category><![CDATA[Performance Monitoring and Maintenance]]></category>
		<category><![CDATA[ADR]]></category>
		<category><![CDATA[ALert Log]]></category>
		<category><![CDATA[diagnostic dest]]></category>
		<category><![CDATA[oracle 11g]]></category>

		<guid isPermaLink="false">https://mohibalvi.wordpress.com/?p=369</guid>
		<description><![CDATA[With Oracle 10g, external table was required to read alert log  but luckily Oracle 11g created a system table that can be used to access alert log from SQL:  X$DBGALERTEXT. Oracle reads the log.xml from alert directory (which contains all the data what alert.log does), parses it and returns the details back as rows. Beginning [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=369&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>With Oracle 10g, external table was required to read alert log  but luckily Oracle 11g created a system table that can be used to access alert log from SQL:  <strong>X$DBGALERTEXT</strong>. Oracle reads the <em>log.xml</em> from alert directory (which contains all the data what alert.log does), parses it and returns the details back as rows.</p>
<p>Beginning with Release 11g, the alert log file is written as XML formatted and as a text file (as in previous releases). The default location of both these files is the new ADR home (Automatic Diagnostic Respository, another dump dest in 11g).</p>
<p>The database, Automatic Storage Management (ASM), Cluster Ready Services (CRS), and other Oracle products or components store all diagnostic data in the ADR.</p>
<p>The ADR is set by using the DIAGNOSTIC_DEST initialization parameter. If this parameter is omitted, then, the default location of ADR is, &#8216;$ORACLE_HOME/log&#8217;</p>
<p>The location of an ADR home is given by the following path, which starts at the ADR base directory:</p>
<p><em>$ORACLE_BASE/diag/product_type/product_id/insance_id</em></p>
<p><strong>v$diag_info</strong> can be queried to check ADR locations, including ADR BASE and ADR home.</p>
<p>Within the ADR home directory are subdirectories:<br />
<strong></strong></p>
<p><strong>alert</strong>       &#8211; XML formatted alertlog<br />
<strong>trace      </strong>- Files and text alert.log file<br />
<strong>cdump </strong> &#8211; core files</p>
<p>message_text can have multiple lines of ORA- errors and related tracing file information, but for monitoring only need first error code.</p>
<pre class="brush: sql;">
SELECT        record_id, substr(message_text, instr(message_text,'ORA-'),
              instr(message_text,chr(10),1,2)-instr(message_text,'ORA-') ) message_text
FROM          &lt;strong&gt;X$DBGALERTEXT&lt;/strong&gt;
WHERE         originating_timestamp &gt; sysdate-1
              AND message_text like '%ORA-%'
ORDER BY  record_id desc
</pre>
<p><strong><em>Query to get errors for the past day:</em></strong></p>
<pre class="brush: sql;">&lt;/span&gt;
&lt;pre&gt;SELECT  distinct    originating_timestamp,   message_text
FROM    X$DBGALERTEXT
WHERE   originating_timestamp &gt; sysdate-1
AND     (  message_text = 'ORA-00600'  OR
           message_text like '%Fatal%'
        )
</pre>
<p><strong><em>Query to get errors for the last 10 minutes:</em></strong></p>
<pre class="brush: sql;">&lt;/span&gt;
&lt;pre&gt;SELECT         rownum       “line”,    message_text “error”
FROM           X$DBGALERTEXT
WHERE          originating_timestamp &gt; (sysdate – 10/1440)  AND
               message_text like ‘%ORA-%’
ORDER BY       originating_timestamp;
</pre>
<p><span style="font-family:'Times New Roman';font-size:small;"><br />
</span></p>
<h2>Links:</h2>
<p><a href="http://blog.tanelpoder.com/2009/03/21/oracle-11g-reading-alert-log-via-sql/">Oracle 11g Reading Alert Log Via SQL</a></p>
<p><a href="http://laurentschneider.com/wordpress/2008/04/alert-log-in-xml-format.html">Note: 1072547.1 &#8211; How To Edit, Read, and Query the Alert.Log</a></p>
<p><code><a href="http://oracledbatips.com/oracle/11g/Oracle_11g_Automatic_Diagnostic_Repository.html"><strong>Oracle 11g Automatic Diagnostic Repository</strong></a></code></p>
<br />Filed under: <a href='http://mohibalvi.wordpress.com/category/performance-monitoring-and-maintenance/'>Performance Monitoring and Maintenance</a> Tagged: <a href='http://mohibalvi.wordpress.com/tag/adr/'>ADR</a>, <a href='http://mohibalvi.wordpress.com/tag/alert-log/'>ALert Log</a>, <a href='http://mohibalvi.wordpress.com/tag/diagnostic-dest/'>diagnostic dest</a>, <a href='http://mohibalvi.wordpress.com/tag/oracle-11g/'>oracle 11g</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohibalvi.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohibalvi.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohibalvi.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohibalvi.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mohibalvi.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mohibalvi.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mohibalvi.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mohibalvi.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohibalvi.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohibalvi.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohibalvi.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohibalvi.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohibalvi.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohibalvi.wordpress.com/369/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=369&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mohibalvi.wordpress.com/2011/04/22/reading-alert-log/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef5ff240dbc6a355cf764b046b1d4954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mohibalvi</media:title>
		</media:content>
	</item>
		<item>
		<title>Backup Concepts</title>
		<link>http://mohibalvi.wordpress.com/2011/04/17/backup-concepts/</link>
		<comments>http://mohibalvi.wordpress.com/2011/04/17/backup-concepts/#comments</comments>
		<pubDate>Sun, 17 Apr 2011 17:51:32 +0000</pubDate>
		<dc:creator>mohibalvi</dc:creator>
				<category><![CDATA[Backup and Recovery]]></category>
		<category><![CDATA[Logical Backup Export Import]]></category>
		<category><![CDATA[RMAN backup and recovery]]></category>
		<category><![CDATA[User Managed Backup Recovery]]></category>
		<category><![CDATA[image copies]]></category>
		<category><![CDATA[backup sets]]></category>
		<category><![CDATA[full backup]]></category>
		<category><![CDATA[incremental backup]]></category>
		<category><![CDATA[Database backup]]></category>
		<category><![CDATA[offline backup]]></category>
		<category><![CDATA[online backup]]></category>
		<category><![CDATA[partial backup]]></category>
		<category><![CDATA[whole database backup]]></category>

		<guid isPermaLink="false">https://mohibalvi.wordpress.com/2011/04/17/backup-concepts/</guid>
		<description><![CDATA[Database Backup &#160; A whole database backup includes all data files and at least one control file. Full backups make a copy of every data block within the files being backed up that contains data. Partial database backups may include zero or more tablespaces, zero or more data files, and may or may not include [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=368&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>Database Backup</h2>
<p>&#160;</p>
<p>A <strong>whole database backup</strong> includes all data files and at least one control file.</p>
<p><strong>Full backups</strong> make a copy of every data block within the files being backed up that contains data. </p>
<p> <strong>Partial database backups</strong> may include zero or more tablespaces, zero or more data files, and may or may not include a control file.   <br /> 
<p>&#160;</p>
<p><strong>Incremental backups</strong> make a copy of all data blocks that have changed since some previous backup. Oracle Database 10g supports two levels of incremental backup (0-1). A <em><strong>level 0</strong></em> or <strong>baseline backup</strong> is equivalent to a full backup and contains all data blocks. A <strong>level 1</strong> incremental backs up all database blocks changed since the level 0 backup. To restore using incremental backups, the baseline backup must first be restored, and then the incremental.     </p>
<p><strong>Offline backups</strong> or <strong>Cold backups</strong>(also known as consistent backups) are taken while the database is not open. They are consistent because at the time of the backup, the SCN data file headers matches the SCN in the control files.     </p>
<p><strong>Online backups </strong>(also known as<strong> hot</strong> or inconsistent backups) are taken while the database is open. The backups are inconsistent because with the database open there is no guarantee that the data files are synchronized with the control files. Inconsistent backups require recovery in order to be used. For online backup, ARCHIVELOG mode should be enabled.</p>
<p>&#160;</p>
<h3><font color="#0000ff">Modes of Backups</font></h3>
<h4>i. ARCHIVELOG</h4>
<blockquote><p>If the database is in noarchive log mode, online redo logs can be overwritten without making sure they are saved. This implies that a database cannot be recovered fully (it can be rolled forward to the last transaction) even if backups were made.</p>
</blockquote>
<h4>ii. NOARCHIVELOG</h4>
<blockquote><p>If the database is in log archive mode, the database makes sure that online redo logs are not overwritten before they have been archived. Database can be recovered to the last </p>
</blockquote>
<h3><font color="#0000ff"></font></h3>
<h3><font color="#0000ff">Types of Backups</font></h3>
<h4>i. Physical Backup</h4>
<p>Physical backups are backups of the physical files used in storing and recovering your database, such as datafiles, control files, and archived redo logs. </p>
<h4>ii. Logical Backup</h4>
<p>Logical backups contain logical data (tables or stored procedures) exported from a database with an<em> <strong>Oracle export</strong></em> utility and stored in a binary file, for later re-importing into a database using the corresponding <em><strong>Oracle import</strong></em> utility.</p>
<p>&#160;</p>
<h3><font color="#0000ff">Backup Types based on Physical Backup</font></h3>
<p>For performing backup and recovery based on physical backups, you have two solutions available:</p>
<ul>
<li><a name="1015945"></a><strong><a href="http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10735/glossary.htm#433291"><strong>Recovery Manager (RMAN)</strong></a></strong>, a tool (with command-line client and Enterprise Manager GUI interfaces) that integrates with sessions running on the Oracle server to perform a range of backup and recovery activities, as well as maintaining a repository of historical data about your backups </li>
<li><a name="1015959"></a>The traditional <strong><a href="http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10735/glossary.htm#433691"><strong>user-managed backup and recovery</strong></a></strong>, where you directly manage the files that make up your database with a mixture of host operating system commands and SQL*Plus backup and recovery-related capabilities</li>
</ul>
<p> <a name="1015960"></a>
<p>Recovery Manager isthe preferred solution for database backup and recovery. It can perform the same types of backup and recovery available through user-managed methods more easily, provides a common interface for backup tasks across different host operating systems, and offers a number of backup techniques not available through user-managed methods.</p>
<p>&#160;</p>
<h3><font color="#0000ff">Image Copies and Backup Sets</font></h3>
<p>&#160;</p>
<p><strong><em>Image copies</em></strong> are duplicates of data or archived log files (similar to simply copying the files using OS commands).    </p>
<p><strong><em>Backup sets</em></strong> are copies of one or more data or archived log files. With backup sets, empty data locks are not stored, thereby causing backup sets to use less space on disk or tape. Backup sets an be compressed to further reduce the space requirements of the backup.    </p>
<p>Image copies must be backed up to disk whereas Backup sets can be sent to disk or directly to tape.   </p>
<br />Filed under: <a href='http://mohibalvi.wordpress.com/category/backup-and-recovery/'>Backup and Recovery</a>, <a href='http://mohibalvi.wordpress.com/category/backup-and-recovery/logical-backup-export-import/'>Logical Backup Export Import</a>, <a href='http://mohibalvi.wordpress.com/category/backup-and-recovery/rman-backup-and-recovery/'>RMAN backup and recovery</a>, <a href='http://mohibalvi.wordpress.com/category/backup-and-recovery/user-managed-backup-recovery/'>User Managed Backup Recovery</a> Tagged: <a href='http://mohibalvi.wordpress.com/tag/backup-sets/'>backup sets</a>, <a href='http://mohibalvi.wordpress.com/tag/database-backup/'>Database backup</a>, <a href='http://mohibalvi.wordpress.com/tag/full-backup/'>full backup</a>, <a href='http://mohibalvi.wordpress.com/tag/image-copies/'>image copies</a>, <a href='http://mohibalvi.wordpress.com/tag/incremental-backup/'>incremental backup</a>, <a href='http://mohibalvi.wordpress.com/tag/offline-backup/'>offline backup</a>, <a href='http://mohibalvi.wordpress.com/tag/online-backup/'>online backup</a>, <a href='http://mohibalvi.wordpress.com/tag/partial-backup/'>partial backup</a>, <a href='http://mohibalvi.wordpress.com/tag/whole-database-backup/'>whole database backup</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohibalvi.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohibalvi.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohibalvi.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohibalvi.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mohibalvi.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mohibalvi.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mohibalvi.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mohibalvi.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohibalvi.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohibalvi.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohibalvi.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohibalvi.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohibalvi.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohibalvi.wordpress.com/368/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=368&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mohibalvi.wordpress.com/2011/04/17/backup-concepts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef5ff240dbc6a355cf764b046b1d4954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mohibalvi</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle Database Architecture</title>
		<link>http://mohibalvi.wordpress.com/2011/03/19/oracle-database-architecture/</link>
		<comments>http://mohibalvi.wordpress.com/2011/03/19/oracle-database-architecture/#comments</comments>
		<pubDate>Sat, 19 Mar 2011 04:36:56 +0000</pubDate>
		<dc:creator>mohibalvi</dc:creator>
				<category><![CDATA[Oracle Architecture]]></category>
		<category><![CDATA[Process Architecture]]></category>
		<category><![CDATA[Storage Architecture]]></category>
		<category><![CDATA[control files]]></category>
		<category><![CDATA[data block]]></category>
		<category><![CDATA[data files]]></category>
		<category><![CDATA[database architecture]]></category>
		<category><![CDATA[extent]]></category>
		<category><![CDATA[online redo log files]]></category>
		<category><![CDATA[oracle background process]]></category>
		<category><![CDATA[oracle database 10g architecture]]></category>
		<category><![CDATA[oracle instance]]></category>
		<category><![CDATA[oracle logical strucutre]]></category>
		<category><![CDATA[oracle physical structure]]></category>
		<category><![CDATA[segment]]></category>
		<category><![CDATA[tablespace]]></category>

		<guid isPermaLink="false">https://mohibalvi.wordpress.com/2011/03/19/oracle-database-architecture/</guid>
		<description><![CDATA[&#160; Database Architecture&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; An Oracle database server consists of an Oracle database and an Oracle instance. Oracle Database architecture is based on physical and logical structures.&#160; &#160; Oracle Database Physical Structure Oracle database consists of physical files to store information. Basically there are three types of physical files required for database: Core Files: Data Files&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=364&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="width:310px;display:block;float:right;margin:1em;" class="zemanta-img">
<p style="font-size:.8em;" class="zemanta-img-attribution"></p></div>
<p>&#160;</p>
<h1>Database Architecture&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </h1>
<p>An Oracle database server consists of an Oracle database and an Oracle instance.</p>
<p>Oracle Database architecture is based on physical and logical structures.&#160; </p>
<p>&#160;</p>
<h2>Oracle Database Physical Structure </h2>
<p>Oracle database consists of physical files to store information. Basically there are three types of physical files required for database:</p>
<h3>Core Files:</h3>
<ul>
<li><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/physical.htm#i2004">Data Files</a>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Contains all the data of database </li>
<li><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/physical.htm#i10135">Control Files</a>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Contains data about database(metadata) </li>
<li><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/intro.htm#sthref43">Redo Log Files</a>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Contains all changes made to data, allows recovery</li>
</ul>
<h3>Other Files</h3>
<ul>
<li><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/startup.htm#sthref1837">Parameter File</a>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Defines how instance will be configured when it starts up </li>
<li><a href="http://www.adp-gmbh.ch/ora/admin/password_file.html">Password File</a>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Allow users to connect remotely to the database </li>
<li><a href="http://wp.me/p7kL7-1K">Archive Log Files</a>&#160;&#160; Contains history of redo log files </li>
<li><a href="http://www.adp-gmbh.ch/ora/misc/trace_files.html">Trace Files</a>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Contains messages written by server and background process </li>
<li><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/manproc.htm#sthref729">Alert File</a>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Special trace file, chronological log of messages and errors&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </li>
</ul>
<blockquote><p><img src="http://jameszone.jamesfallen.com/oracle/notes/Oracle_Physical_Database_Structure.jpg" width="526" height="300" /></p>
</blockquote>
<p>&#160;</p>
<p>&#160;</p>
<h2>Oracle Database Logical Structure</h2>
<p>Oracle database is divided into logical storage units known as Tablespaces, which can be used to group related logical structures together. Logical structure mainly consists of following structures starting with the bigger unit and going down to the smallest.</p>
<ul>
<li><a class="zem_slink" title="Tablespace" href="http://en.wikipedia.org/wiki/Tablespace" rel="wikipedia">Tablespace</a> </li>
<li>Segments </li>
<li><a class="zem_slink" title="Extent (file systems)" href="http://en.wikipedia.org/wiki/Extent_%28file_systems%29" rel="wikipedia">Extents</a> </li>
<li>Data blocks</li>
</ul>
<h3>Tablespace</h3>
<p>Each database is logically divided into one or more tablespaces. One or more datafiles are explicitly created for each tablespace to physically store the data of all logical structures in a tablespace. The combined size of the datafiles in a tablespace is the total storage capacity of the tablespace. </p>
<h3>Segment</h3>
<p>Tablespace consists of one or more segments. A segment is a set of extents allocated for a certain logical structure stored in the same tablespace. The segments can be of one of following types: </p>
<ul>
<li>Data segment&#160; (stores user data within the database) </li>
<li>Index Segment (store Indexes) </li>
<li>Temporary Segment ( stores rollback segment) </li>
<li>Rollback/Undo segment (created when sql statement needs a temporary work area)<em></em></li>
</ul>
<h3>Extent</h3>
<p>An extent is a specific number of contiguous data blocks, obtained in a single allocation, used to store a specific type of information in one data file. </p>
<h3>Data Blocks</h3>
<p>Oracle database data is stored in data blocks(at the lowest logical level).&#160; One data block corresponds to a specific number of bytes of physical database space on disk(default 8K). The standard block size is specified by the DB_BLOCK_SIZE initialization parameter. </p>
<p>Oracle Data blocks are the smallest unit of I/O in the database and they are mapped to OS block on the storage device </p>
<p>&#160;</p>
<p>&#160;</p>
<p><img src="http://ocp-certification.com/wp-content/uploads/2009/08/dtbs.gif" width="535" height="226" /></p>
<p>&#160;</p>
<h2>Oracle Instance </h2>
<p>Oracle instance is comprised of memory structures and background processes that are required to perform different tasks to keep the instance and database running. Instance does not exist until database is started, which involves reading initialization parameter file and configuring instance according to the information within the parameter file. </p>
<h3><font color="#0000ff">Memory Structures</font></h3>
<p>Instance has two major memory structures:</p>
<ul>
<li><strong><a class="zem_slink" title="System Global Area" href="http://en.wikipedia.org/wiki/System_Global_Area" rel="wikipedia">System Global Area</a></strong> (SGA):&#160; stores information in memory shared by processes in Oracle </li>
<li><strong><a class="zem_slink" title="Oracle Database" href="http://www.oracle.com/" rel="homepage">Program Global Area</a> </strong>(PGA): contains information private to a particular process</li>
</ul>
<h3><font color="#0000ff"><a class="zem_slink" title="Background process" href="http://en.wikipedia.org/wiki/Background_process" rel="wikipedia">Background Processes</a></font></h3>
<p>Oracle creates a set of background processes for an instance that&#160; manage the memory structures, asynchronously perform I/O to write data to disk, and do general housekeeping.   <br />The most common background processes are the following:</p>
<ul>
<li><strong>System monitor (SMON)</strong>: Performs crash recovery when the instance starts after a failure </li>
<li><strong><a class="zem_slink" title="Process Monitor" href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx" rel="homepage">Process monitor</a> (PMON)</strong>: Performs process cleanup when a user process fails </li>
<li><strong>Database writer (DBWn)</strong>: Writes modified blocks from the database buffer cache to the files on disk </li>
<li><strong>Checkpoint (<a class="zem_slink" title="CKPT-FM" href="http://www.energy997.ca/" rel="homepage">CKPT</a>)</strong>: Signals DBWn at checkpoints and updates all of the data files and control files of the database to indicate the most recent checkpoint </li>
<li><strong>Log writer (LGWR)</strong>: Writes redo log entries to disk </li>
<li><strong>Archiver (ARCn)</strong>: Copies the redo log files to archival storage when the log files are full or a log switch occurs</li>
</ul>
<p><img src="http://azerdark.files.wordpress.com/2010/05/less01_db_architecture_mb32.jpg?w=563&#038;h=311" width="563" height="311" /></p>
<p>&#160;</p>
<div class="zemanta-related">
<h6 style="font-size:1em;" class="zemanta-related-title">Related articles</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://samadhandba.wordpress.com/2011/02/17/oracle-9i-architecture/">Oracle 9i Architecture</a> (samadhandba.wordpress.com) </li>
<li class="zemanta-article-ul-li"><a href="http://knol.google.com/k/oracle-10g-architecture-with-diagram#Oracle_SQL_Rewriting_(2D)_Faster_Performance">Oracle 10g R2 Architecture (detailed with respect to SQL Rewrite)</a></li>
</ul></div>
<br />Filed under: <a href='http://mohibalvi.wordpress.com/category/oracle-architecture/'>Oracle Architecture</a>, <a href='http://mohibalvi.wordpress.com/category/oracle-architecture/process-architecture/'>Process Architecture</a>, <a href='http://mohibalvi.wordpress.com/category/oracle-architecture/storage-architecture/'>Storage Architecture</a> Tagged: <a href='http://mohibalvi.wordpress.com/tag/control-files/'>control files</a>, <a href='http://mohibalvi.wordpress.com/tag/data-block/'>data block</a>, <a href='http://mohibalvi.wordpress.com/tag/data-files/'>data files</a>, <a href='http://mohibalvi.wordpress.com/tag/database-architecture/'>database architecture</a>, <a href='http://mohibalvi.wordpress.com/tag/extent/'>extent</a>, <a href='http://mohibalvi.wordpress.com/tag/online-redo-log-files/'>online redo log files</a>, <a href='http://mohibalvi.wordpress.com/tag/oracle-background-process/'>oracle background process</a>, <a href='http://mohibalvi.wordpress.com/tag/oracle-database-10g-architecture/'>oracle database 10g architecture</a>, <a href='http://mohibalvi.wordpress.com/tag/oracle-instance/'>oracle instance</a>, <a href='http://mohibalvi.wordpress.com/tag/oracle-logical-strucutre/'>oracle logical strucutre</a>, <a href='http://mohibalvi.wordpress.com/tag/oracle-physical-structure/'>oracle physical structure</a>, <a href='http://mohibalvi.wordpress.com/tag/segment/'>segment</a>, <a href='http://mohibalvi.wordpress.com/tag/tablespace/'>tablespace</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohibalvi.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohibalvi.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohibalvi.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohibalvi.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mohibalvi.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mohibalvi.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mohibalvi.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mohibalvi.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohibalvi.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohibalvi.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohibalvi.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohibalvi.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohibalvi.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohibalvi.wordpress.com/364/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=364&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mohibalvi.wordpress.com/2011/03/19/oracle-database-architecture/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef5ff240dbc6a355cf764b046b1d4954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mohibalvi</media:title>
		</media:content>

		<media:content url="http://jameszone.jamesfallen.com/oracle/notes/Oracle_Physical_Database_Structure.jpg" medium="image" />

		<media:content url="http://ocp-certification.com/wp-content/uploads/2009/08/dtbs.gif" medium="image" />

		<media:content url="http://azerdark.files.wordpress.com/2010/05/less01_db_architecture_mb32.jpg" medium="image" />
	</item>
		<item>
		<title>Shutdown Hangup Scenario</title>
		<link>http://mohibalvi.wordpress.com/2011/03/06/shutdown-hangup-scenario/</link>
		<comments>http://mohibalvi.wordpress.com/2011/03/06/shutdown-hangup-scenario/#comments</comments>
		<pubDate>Sun, 06 Mar 2011 01:13:15 +0000</pubDate>
		<dc:creator>mohibalvi</dc:creator>
				<category><![CDATA[Oracle Errors]]></category>
		<category><![CDATA[Shutdown and Startup Errors]]></category>
		<category><![CDATA[Fix Oracle Hanging]]></category>
		<category><![CDATA[hanganalyze]]></category>
		<category><![CDATA[ORA-01012 not logged on]]></category>
		<category><![CDATA[ORA-01031 Insufficient privileges]]></category>
		<category><![CDATA[ORA-24324 service handle not initialized]]></category>
		<category><![CDATA[oracle 11g]]></category>
		<category><![CDATA[Oracle Hanging]]></category>
		<category><![CDATA[Oradebug]]></category>
		<category><![CDATA[shutdown immediate hangup]]></category>
		<category><![CDATA[shutdown normal hangup]]></category>

		<guid isPermaLink="false">https://mohibalvi.wordpress.com/?p=323</guid>
		<description><![CDATA[If Shutdown normal or shutdown immediate hangs and you try to connect as sys, it would get you connected either as idle instance or simply connected which is in reality a fake connection. In a particular scenario, I changed ORACLE_HOME from EM and then issued simple “SHUTDOWN” command which took a long time to complete. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=323&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If Shutdown normal or shutdown immediate hangs and you try to connect as sys, it would get you connected either as idle instance or simply connected which is in reality a fake connection. In a particular scenario, I changed ORACLE_HOME from EM and then issued simple “SHUTDOWN” command which took a long time to complete. I tried to issue “shutdown immediate” and “shutdown abort” commands and found following errors.</p>
<pre class="brush: sql;">

C:\Users\ACE&gt;sqlplus
SQL*Plus: Release 11.2.0.1.0 Production on Sat Mar 5 19:52:01 2011

Enter user-name: sys as sysdba
Enter password:
Connected.
SQL&gt;  shutdown immediate
ORA-24324: service handle not initialized
ORA-24323:  value not allowed
ORA-01090: shutdown in progress - connection is not  permitted
</pre>
<pre class="brush: sql;">

SQL&gt; shutdown abort
ORA-01031: insufficient privileges
</pre>
<pre class="brush: sql;">

SQL&gt; select instance from v$instance;
select instance from  v$instance
* ERROR at line 1: ORA-01012: not logged on
Process ID:  0
Session ID: 0 Serial number: 0
</pre>
<p><span style="font-family:&quot;">In this scenario it did &#8220;connect / as sysdba&#8221;, but in actually failed to connect. Then, when I<br />
tried  to shutdown abort, you got ORA-1031 cause you weren&#8217;t actually connected.<br />
It&#8217;s interesting to note that if you connect as sysdba, and the connection is successful, you see something like:&#8221;Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 &#8211; 64bit<br />
Production With the Partitioning, OLAP and Data Mining options&#8221;If you fail to connect, cause process table is full, you&#8217;ll  get: &#8220;Connected.&#8221;<br />
So, &#8220;Connected.&#8221; means you *failed* to connect!</span></p>
<p><a href="http://arjudba.blogspot.com/2009/11/ora-01012-not-logged-on.html">ORA-01012: not logged on</a> (check this link for another reason why Oracle shows &#8220;not logged on&#8221; error)</p>
<p><span style="font-family:&quot;">&nbsp;</p>
<p></span></p>
<p><strong> </strong></p>
<p>Although shutdow abort causes instance recovery but it becomes necessary if you want to accomplish a repetitive task at a given time in a specific time. You can combine it with restricted startup and then again shutdown with immediate option and better run it through a script.</p>
<pre class="brush: bash;">

#!/bin/ksh
# Source the db.env to set the Oracle environment

export ORACLE_SID
ORACLE_HOME=`cat /etc/oratab|grep ^$ORACLE_SID:|cut -f2 -d':'`
export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH
export PATH

shutdown abort;
startup restrict;
shutdown immediate;
</pre>
<p><strong>Debugging a hung database</strong></p>
<p>Starting with Oracle 11g,  SQL*Plus has a new option called “prelim” . This option is very useful for running oradebug and other utilities that do not require a real connection to the database.</p>
<pre class="brush: sql;">

C:\ACE&gt; sqlplus –prelim

SQL&gt;

or

SQL&gt; set _prelim on
SQL&gt; connect / as sysdba
</pre>
<p>Run <em><strong>oradebug</strong></em> commands to diagnose a hung database  issue using the</p>
<p>new <strong><a href="http://www.dba-oracle.com/t_hanganalyze_trace_files.htm">hanganalyze</a></strong> utility:</p>
<pre class="brush: sql;">

SQL&gt; oradebug hanganalyze

Wait for some time to identify process state changes.

SQL&gt; oradebug hanganalyze

Open a separate SQL session and immediately generate a system state dump.

SQL&gt; alter session set events 'immediate trace name SYSTEMSTATE level 10';
</pre>
<h3>Further Reading:</h3>
<p><a href="http://www.dba-oracle.com/t_fix_hanging.htm" target="_blank">Fix Oracle Hanging</a></p>
<br />Filed under: <a href='http://mohibalvi.wordpress.com/category/oracle-issues/oracle-errors/'>Oracle Errors</a>, <a href='http://mohibalvi.wordpress.com/category/oracle-issues/shutdown-and-startup-errors/'>Shutdown and Startup Errors</a> Tagged: <a href='http://mohibalvi.wordpress.com/tag/fix-oracle-hanging/'>Fix Oracle Hanging</a>, <a href='http://mohibalvi.wordpress.com/tag/hanganalyze/'>hanganalyze</a>, <a href='http://mohibalvi.wordpress.com/tag/ora-01012-not-logged-on/'>ORA-01012 not logged on</a>, <a href='http://mohibalvi.wordpress.com/tag/ora-01031-insufficient-privileges/'>ORA-01031 Insufficient privileges</a>, <a href='http://mohibalvi.wordpress.com/tag/ora-24324-service-handle-not-initialized/'>ORA-24324 service handle not initialized</a>, <a href='http://mohibalvi.wordpress.com/tag/oracle-11g/'>oracle 11g</a>, <a href='http://mohibalvi.wordpress.com/tag/oracle-hanging/'>Oracle Hanging</a>, <a href='http://mohibalvi.wordpress.com/tag/oradebug/'>Oradebug</a>, <a href='http://mohibalvi.wordpress.com/tag/shutdown-immediate-hangup/'>shutdown immediate hangup</a>, <a href='http://mohibalvi.wordpress.com/tag/shutdown-normal-hangup/'>shutdown normal hangup</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohibalvi.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohibalvi.wordpress.com/323/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohibalvi.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohibalvi.wordpress.com/323/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mohibalvi.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mohibalvi.wordpress.com/323/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mohibalvi.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mohibalvi.wordpress.com/323/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohibalvi.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohibalvi.wordpress.com/323/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohibalvi.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohibalvi.wordpress.com/323/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohibalvi.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohibalvi.wordpress.com/323/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=323&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mohibalvi.wordpress.com/2011/03/06/shutdown-hangup-scenario/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef5ff240dbc6a355cf764b046b1d4954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mohibalvi</media:title>
		</media:content>
	</item>
		<item>
		<title>Performance Monitoring</title>
		<link>http://mohibalvi.wordpress.com/2011/02/25/performance-monitoring/</link>
		<comments>http://mohibalvi.wordpress.com/2011/02/25/performance-monitoring/#comments</comments>
		<pubDate>Fri, 25 Feb 2011 05:56:33 +0000</pubDate>
		<dc:creator>mohibalvi</dc:creator>
				<category><![CDATA[Data Dictionary]]></category>
		<category><![CDATA[Performance Tuning]]></category>
		<category><![CDATA[Performance Views]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dynamic performance views]]></category>

		<guid isPermaLink="false">https://mohibalvi.wordpress.com/?p=314</guid>
		<description><![CDATA[List of Common Oracle Metrics Monitoring Methodologies &#160; Reactive Proactive Reactive monitoring is not a recommend approach but at times it becomes inevitable. Oracle 10g provide tools that aid in proactively monitoring database. Server-generated alerts and Automated Database Diagnostic Monitor(AADM) are going to be discussed in another post. &#160; Database and Instance Metrics Performance measurements [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=314&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.dba-oracle.com/metric_menu.htm">List of Common Oracle Metrics</a></p>
<h1>Monitoring Methodologies</h1>
<p>&#160;</p>
<ul>
<li><font size="4" face="Verdana">Reactive </font></li>
<li><font size="4" face="Verdana">Proactive</font> </li>
</ul>
<p><font size="2" face="Arial">Reactive monitoring is not a recommend approach but at times it becomes inevitable. Oracle 10g </font>provide tools that aid in proactively monitoring database. Server-generated alerts and Automated Database Diagnostic Monitor(AADM) are going to be discussed in another post.</p>
<p>&#160;</p>
<h2>Database and Instance Metrics</h2>
<p>Performance measurements are commonly referred as <strong>databases metrics</strong> which is basically the rate of change of cumulative statistic that need to be monitored. Metrics are indicators of the health of various database targets. Excerpt from <a href="http://www.rampant-books.com/book_0302_oracle10g.htm">Oracle Database 10g New Features by Rampant TechPress</a></p>
<p>“The Metrics are the statistics derived from base statistics. They represent the delta values between the snapshot periods. Metrics are used by internal components (clients) for system health monitoring, problem detection and self-tuning. There are hundreds of different measurement points available to monitor database system.</p>
<p>Each metric is also associated with a metric name. You can query the view v$metricname to find the names of all the metrics. </p>
<blockquote><p><em><font color="#0000ff">SQL&gt; select METRIC_NAME, METRIC_UNIT from v$metricname;</font></em> &quot; </p>
</blockquote>
<p>&#160;</p>
<table border="1" cellspacing="0" cellpadding="2" width="584">
<tbody>
<tr>
<td valign="top" width="200"><font color="#0000ff"><strong>Metric&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </strong></font></td>
<td valign="top" width="382"><font color="#0000ff"><strong>Description&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </strong></font></td>
</tr>
<tr>
<td valign="top" width="200">Event Class Metrics</td>
<td valign="top" width="382">Metrics collected on the wait event class level. e.g.&#160; DB_TIME_WAITING</td>
</tr>
<tr>
<td valign="top" width="200">Event Metrics</td>
<td valign="top" width="382">Metrics collected on various wait events</td>
</tr>
<tr>
<td valign="top" width="200">File Metrics Long Duration</td>
<td valign="top" width="382">Metrics collected at the file level. e.g. AVERAGE_FILE_WRITE_TIME</td>
</tr>
<tr>
<td valign="top" width="200">Service Metrics</td>
<td valign="top" width="382">Metrics collected at the service level. e.g. CPU_TIME_PER_CALL</td>
</tr>
<tr>
<td valign="top" width="200">Session Metrics Short Duration</td>
<td valign="top" width="382">Metrics collected at the session level. e.g. BLOCKED_USERS</td>
</tr>
<tr>
<td valign="top" width="200">System Metrics Short Duration</td>
<td valign="top" width="382">Metrics collected at the system level</td>
</tr>
<tr>
<td valign="top" width="200">Tablespae Metrics</td>
<td valign="top" width="382">Metrics collected at the Tablespace level e.g. TABLESPACE_PCT_FULL</td>
</tr>
</tbody>
</table>
<h2>&#160;</h2>
<h2>Viewing Metrics</h2>
<p>The new MMON background process collects database metrics continuously and automatically saves them in the SGA for one hour.It also transfers the memory version of AWR stats to disk on regular basis(in snapshots). Performance metrics are available through </p>
<ul>
<li>Data Dictionary </li>
<li>Dynamic Performance Views </li>
<li>Optimizer Statistics </li>
</ul>
<h3>Data Dictionary Metrics</h3>
<p>Data dictionary metrics provide information about space consumption and object status. Database indexes and stored procedures both need to be VALID to be used.</p>
<p>Unusable indexes always require DBA intervention to restore them to a valid state. Invalid    <br />PL/SQL objects will normally recompile automatically the first time they are called, but     <br />sometimes require DBA intervention in cases where the automatic recompilation fails. </p>
<p><em>Compiling PL/SQL procedures and Packages</em></p>
<p>Indexes can become unusable due to normal maintenance operations on tables. Unusable indexes can be rebuild to make them valid.</p>
<p><em>Rebuilding Indexes</em></p>
<h3>&#160;</h3>
<h3>Viewing In-Memory Metrics</h3>
<p>All system related metrics saved in memory and they can be viewed using dynamic performance views. Most of the cumulative statistics can be viewed through following: </p>
<ul>
<li>V$SYSSTAT </li>
<li>V$SESSSTAT </li>
<li>V$SYSMETRIC </li>
<li>V$SYSMETRIC_HISTORY </li>
</ul>
<p>Example of few system metrics maintained in V$SYSMETRIC view:</p>
<ul>
<li>Buffer Cache Hit Ratio </li>
<li>CPU Usage Per Sec </li>
<li>Disk Sort Per Sec </li>
<li>Host CPU Utilization (%) </li>
<li>Library Cache Hit Ratio </li>
<li>SQL Service Response Time </li>
<li>Shared Pool Free (%) </li>
</ul>
<h3>Viewing Saved Metrics</h3>
<p>After every 60 min, MMON places metric info from SGA to disk through AWR snapshot mechanism. The metric data that AWR collects through MMON is permanently stored in DBA_HIST_* views like </p>
<ul>
<li>DBA_HIST_SERVICE_NAME </li>
<li>DBA_HIST_SESSMETRIC_HISTORY </li>
</ul>
<h3>Optimizer Statistics</h3>
<p>Optimizer statistics for tables and indexes are stored in the data dictionary. These statistics are not intended to provide real-time data. They provide the optimizer a statistically correct snapshot of data storage and distribution which the optimizer uses to make decisions on how to access data.    </p>
<p>Metrics collected include:</p>
<ul>
<li>Size of the table or index in database blocks </li>
<li>Number of rows </li>
<li>Average row size and chain count (tables only) </li>
<li>Height and number of deleted leaf rows (indexes only) </li>
</ul>
<p>As data is inserted, deleted, and modified these values change. The performance impact of    <br />maintaining real-time data distribution statistics would be prohibitive, so these statistics are updated by periodically gathering statistics on tables and indexes.</p>
<br />Filed under: <a href='http://mohibalvi.wordpress.com/category/data-dictionary/'>Data Dictionary</a>, <a href='http://mohibalvi.wordpress.com/category/performance-tuning/'>Performance Tuning</a>, <a href='http://mohibalvi.wordpress.com/category/data-dictionary/performance-views/'>Performance Views</a>, <a href='http://mohibalvi.wordpress.com/category/uncategorized/'>Uncategorized</a> Tagged: <a href='http://mohibalvi.wordpress.com/tag/data-dictionary/'>Data Dictionary</a>, <a href='http://mohibalvi.wordpress.com/tag/dynamic-performance-views/'>dynamic performance views</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohibalvi.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohibalvi.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohibalvi.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohibalvi.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mohibalvi.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mohibalvi.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mohibalvi.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mohibalvi.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohibalvi.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohibalvi.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohibalvi.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohibalvi.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohibalvi.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohibalvi.wordpress.com/314/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=314&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mohibalvi.wordpress.com/2011/02/25/performance-monitoring/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef5ff240dbc6a355cf764b046b1d4954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mohibalvi</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL LOADER CONCEPTS</title>
		<link>http://mohibalvi.wordpress.com/2011/02/14/sql-loader-concepts/</link>
		<comments>http://mohibalvi.wordpress.com/2011/02/14/sql-loader-concepts/#comments</comments>
		<pubDate>Mon, 14 Feb 2011 04:52:52 +0000</pubDate>
		<dc:creator>mohibalvi</dc:creator>
				<category><![CDATA[Oracle Utilities]]></category>
		<category><![CDATA[SQL Loader and External Tables]]></category>
		<category><![CDATA[control file]]></category>
		<category><![CDATA[conventional path load]]></category>
		<category><![CDATA[direct path load]]></category>
		<category><![CDATA[fixed record format]]></category>
		<category><![CDATA[sql loader]]></category>
		<category><![CDATA[sql loader control file]]></category>
		<category><![CDATA[SQL*loader]]></category>
		<category><![CDATA[stream record format]]></category>
		<category><![CDATA[variable record format]]></category>

		<guid isPermaLink="false">https://mohibalvi.wordpress.com/?p=282</guid>
		<description><![CDATA[SQL*Loader is a bulk loader utility used for moving data from external files(flat files) into the Oracle database. SQL*Loader reads from a data file(s)(usually a flat file) and a control file(file that contains description of the data to be loaded and it has nothing to do with database control files) . During loading , process [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=282&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>SQL*Loader is a bulk loader utility used for moving data from external files(flat files) into the Oracle database.</p>
<p>SQL*Loader reads from a <strong>data file</strong>(s)(usually a flat file) and a <strong>control file</strong>(file that contains description of the data to be loaded and it has nothing to do with <a href="http://www.dbtalks.com/UploadFile/anjudidi/510/">database control files</a>) . During loading , process information regarding loading is written to <strong>log file</strong>, bad rows are to <strong>bad file</strong> and discarded rows to the <strong>discard file</strong>.</p>
<p><strong>SQL*Loader environment</strong></p>
<p><img src="http://oreilly.com/catalog/orsqlloader/chapter/osl_0101.gif" alt="" /></p>
<h3>SQL*Loader Control File</h3>
<p>The control file is a text file that contains DDL instructions and provides the following information to SQL*Loader:</p>
<ul>
<li>The name and location of the input data file</li>
<li>The format of the records in the input data file</li>
<li>The name of the table(s) to be loaded</li>
<li>Table and field list information</li>
<li>SQL*Loader configuration(memory management, record rejection criteria, interrupted .</li>
<li>The names and locations of bad file and  discard file</li>
</ul>
<h4>SQL*Loader Options:</h4>
<p>Following are few commonly used Options in control file:</p>
<p><code> </code></p>
<pre><code> SKIP = <em>n (Number of records to be skipped before loading)</em></code>
<code><em> </em> ERRORS = <em>n (Number of erroneous records allowed )
</em> ROWS =<em> n (Number of rows before committing )</em></code>
<code><em> </em> DIRECT = {TRUE | FALSE}
 PARALLEL = {TRUE | FALSE}</code></pre>
<p><code> </code></p>
<p>&nbsp;</p>
<p><code>If there is a small amount of data then its possible for the control file to contain the actual data to be loaded. This is achieved by using BEGINDATA clause before the actual data in the control file.</code></p>
<p><code> <a href="http://download.oracle.com/docs/cd/B10501_01/server.920/a96652/ch10.htm#1006689">Case Study for simple control file including data</a></code></p>
<h3>SQL*Loader Input Data Files</h3>
<p>SQL*Loader reads data from one or more files organized as records in one of three formats:</p>
<ul>
<li>Fixed-record format</li>
<li>Variable-record format</li>
<li>Stream-record format</li>
</ul>
<h4>Fixed-Record Format</h4>
<p>A file is in fixed-record format when all records in a data file are the same byte length.</p>
<p><span style="font-family:'Arial Special G1';"> <em><span style="font-size:small;">INFILE  ‘filename’ &#8220;fix  n&#8221;</span></em></span></p>
<p>The following example shows a control file that specifies a fixed-record format data file. The data file contains 2 physical records. The first record is [0001, abcd], which is exactly nine</p>
<p>bytes long (using a single-byte character set) and the carriage return is the tenth byte.</p>
<blockquote><p><span style="text-decoration:underline;"><strong>Control File:</strong></span></p>
<p>load data</p>
<p>infile ‘example.dat’    &#8220;fix 10&#8243;</p>
<p>into table example</p>
<p>fields terminated by ’,’</p>
<p>(col1, col2)</p>
<p><span style="text-decoration:underline;"><strong>input.dat:</strong></span></p>
<p>0001,abcd</p>
<p>0002,fghi</p></blockquote>
<h4>Variable-Record Format</h4>
<p>A file is in variable-record format when the length of each record in a character field is included at the beginning of each record in the data file.<br />
<span style="font-family:'Arial Special G1';"> <em><span style="font-size:small;">INFILE  ‘filename’ &#8220;var  n&#8221;   (n is the number of bytes in record length field)</span></em></span></p>
<p>The following example tells SQL*Loader to look for data in the</p>
<p>input.dat data file and to expect variable-record format where the record length fields are 3</p>
<p>bytes long. The example.dat data file consists of two physical records. The first is specified</p>
<p>to be 009 ( nine) bytes long, the second is 010 bytes long (including a one-character</p>
<p>newline).</p>
<blockquote><p><span style="text-decoration:underline;"><strong>Control File:</strong></span></p>
<p>load data</p>
<p>infile ‘example.dat’     &#8220;var 3“</p>
<p>into table example</p>
<p>fields terminated by ’,’ optionally enclosed by ’&#8221;’</p>
<p>(col1 char(5),col2 char(7))</p>
<p><span style="text-decoration:underline;"><strong>input.dat:</strong></span></p>
<p>009hello,cd,</p>
<p>010world,im,</p></blockquote>
<h4>Stream-Record Format</h4>
<p>A file is in stream-record format when the records are not specified by size; instead SQL*Loader forms records by scanning for the record terminator.</p>
<blockquote><p><em><span style="font-size:small;">INFILE  ‘filename’ &#8220;str terminator_string&#8221;</span></em></p></blockquote>
<p>The following example illustrates loading data in stream-record format where the terminator string is specified using a character string, ’|\n’.</p>
<blockquote><p><span style="text-decoration:underline;"><strong>Control File:</strong></span></p>
<p>load data</p>
<p>infile ‘example.dat’   &#8220;str ’|\n’“</p>
<p>into table example</p>
<p>fields terminated by ’,’ optionally enclosed by ’&#8221;’</p>
<p>(col1 char(5), col2 char(7))</p>
<p><strong><span style="text-decoration:underline;">input.dat:</span></strong></p>
<p>hello,world,|</p>
<p>james,bond,|</p></blockquote>
<p>* Filler fields in control file are fields that have names but they are not loaded into the table.</p>
<h2>Loading Methods</h2>
<p>SQL*Loader provides two methods for loading data:</p>
<p>• Conventional path</p>
<p>• Direct path</p>
<h3>Conventional Path Load</h3>
<p>Conventional path load builds an array of rows to be inserted and uses the SQL INSERT statement to load the data. During conventional path loads, input records are parsed based on field specifications, and an array of records is built and inserted into the table specified in the control file.</p>
<h3>Direct Path Load</h3>
<p>A direct path load builds blocks of data in memory and saves these blocks directly into the extents allocated for the table being loaded. Online redo log file entries are not generated unless the database is in ARCHIVELOG mode. Direct path loads use the field specifications to build whole Oracle blocks of data, and write the blocks directly to Oracle data files above the high water mark.</p>
<p>The high-water mark is the highest point to which data has been written into the table so far. Direct path load bypasses the database buffer cache and accesses the SGA only for extent management and adjustment of the high-water mark.</p>
<p><span style="font-family:'Bernard MT Condensed';font-size:medium;">Comparing Direct and Conventional Path Loads</span></p>
<table border="1" cellspacing="2" cellpadding="4" width="569">
<tbody>
<tr>
<td width="273" valign="top"><span style="font-family:'Arial Black';font-size:small;"><span style="color:#0000ff;"> Conventional Load </span></span></td>
<td width="288" valign="top"><span style="color:#0000ff;font-family:'Arial Black';font-size:small;"> Direct Path Load </span></td>
</tr>
<tr>
<td width="273" valign="top"><span style="font-family:Verdana;font-size:small;">Uses COMMIT to make changes permanent</span></td>
<td width="288" valign="top"><span style="font-family:Verdana;font-size:small;">Uses data saves</span></td>
</tr>
<tr>
<td width="273" valign="top"><span style="font-family:Verdana;font-size:small;">Redo entries always generated</span></td>
<td width="288" valign="top"><span style="font-family:Verdana;font-size:small;">Generates redo only under specific conditions</span></td>
</tr>
<tr>
<td width="273" valign="top"><span style="font-family:Verdana;font-size:small;">Enforces all constraints</span></td>
<td width="288" valign="top"><span style="font-family:Verdana;font-size:small;">Enforces only PRIMARY KEY, UNIQUE, and NOT NULL</span></td>
</tr>
<tr>
<td width="273" valign="top"><span style="font-family:Verdana;font-size:small;">INSERT triggers fire</span></td>
<td width="288" valign="top"><span style="font-family:Verdana;font-size:small;">INSERT triggers do not fire</span></td>
</tr>
<tr>
<td width="273" valign="top"><span style="font-family:Verdana;font-size:small;">Can load into clustered tables</span></td>
<td width="288" valign="top"><span style="font-family:Verdana;font-size:small;">Cannot load into clustered tables</span></td>
</tr>
<tr>
<td width="273" valign="top"><span style="font-family:Verdana;font-size:small;">Other users can make changes to tables</span></td>
<td width="289" valign="top"><span style="font-family:Verdana;font-size:small;">Other users cannot make changes to tables</span></td>
</tr>
<tr>
<td width="273" valign="top"><span style="font-family:Verdana;font-size:small;">INSERT Triggers are fired</span></td>
<td width="289" valign="top"><span style="font-family:Verdana;font-size:small;">INSERT Triggers disabled at start and enabled at the end</span></td>
</tr>
<tr>
<td width="273" valign="top"><span style="font-family:Verdana;font-size:small;">Does not lock the table being loaded into so other transactions can change the table</span></td>
<td width="289" valign="top"><span style="font-family:Verdana;font-size:small;">Locks table in Exclusive mode except </span><span style="font-family:Verdana;font-size:small;">when several parallel direct load sessions are used concurrently</span></td>
</tr>
</tbody>
</table>
<h2>Comparing Direct and Conventional Path Loads</h2>
<h3>Method of Saving Data</h3>
<p>Conventional path loads use SQL processing and a database COMMIT for saving data. The</p>
<p>insertion of an array of records is followed by a commit operation.Direct path loads use data saves to write blocks of data to Oracle data files. The following features differentiate a data save from a COMMIT:</p>
<blockquote><p>• During a data save, only full database blocks are written to the database.</p>
<p>• The blocks are written after the high-water mark of the table.</p>
<p>• After a data save, the high-water mark is moved.</p>
<p>• Internal resources are not released after a data save.</p>
<p>• A data save does not end the transaction.</p>
<p>• Indexes are not updated at each data save.</p></blockquote>
<h3>Logging Changes</h3>
<p>Conventional path loading generates redo entries similar to any DML statement. When using a direct path load, redo entries are not generated if:<br />
• The database is in NOARCHIVELOG mode</p>
<p>• The database is in ARCHIVELOG mode, but logging is disabled.</p>
<p>Logging can be disabled by setting the NOLOGGING attribute for the table or by using the UNRECOVERABLE clause in the control file.</p>
<p><a href="http://sshailesh.wordpress.com/2009/05/03/conventional-path-load-and-direct-path-load-simple-to-use-in-complex-situations/">Conventional Vs Direct Path Load</a> (from Shailesh’s Blog )</p>
<h2><span style="text-decoration:underline;">Useful  Links:</span></h2>
<p><a href="http://www.dba-oracle.com/tips_sqlldr_loader.htm">Maximizing SQL*Load Performance</a>( from Burleson Consulting )</p>
<p><a href="http://www.orafaq.com/wiki/SQL*Loader_FAQ">Oracle FAQ on Orafaq</a></p>
<p><a href="http://oreilly.com/catalog/orsqlloader/chapter/ch01.html">Intro to SQL*Loader by O’Reilly</a></p>
<p><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_concepts.htm#i1005437">Oracle SQL Loader Concepts on Oracle Site</a></p>
<br />Filed under: <a href='http://mohibalvi.wordpress.com/category/oracle-utilities/'>Oracle Utilities</a>, <a href='http://mohibalvi.wordpress.com/category/oracle-utilities/sql-loader-and-external-tables/'>SQL Loader and External Tables</a> Tagged: <a href='http://mohibalvi.wordpress.com/tag/control-file/'>control file</a>, <a href='http://mohibalvi.wordpress.com/tag/conventional-path-load/'>conventional path load</a>, <a href='http://mohibalvi.wordpress.com/tag/direct-path-load/'>direct path load</a>, <a href='http://mohibalvi.wordpress.com/tag/fixed-record-format/'>fixed record format</a>, <a href='http://mohibalvi.wordpress.com/tag/sql-loader/'>sql loader</a>, <a href='http://mohibalvi.wordpress.com/tag/sql-loader-control-file/'>sql loader control file</a>, <a href='http://mohibalvi.wordpress.com/tag/sqlloader/'>SQL*loader</a>, <a href='http://mohibalvi.wordpress.com/tag/stream-record-format/'>stream record format</a>, <a href='http://mohibalvi.wordpress.com/tag/variable-record-format/'>variable record format</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohibalvi.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohibalvi.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohibalvi.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohibalvi.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mohibalvi.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mohibalvi.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mohibalvi.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mohibalvi.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohibalvi.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohibalvi.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohibalvi.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohibalvi.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohibalvi.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohibalvi.wordpress.com/282/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=282&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mohibalvi.wordpress.com/2011/02/14/sql-loader-concepts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef5ff240dbc6a355cf764b046b1d4954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mohibalvi</media:title>
		</media:content>

		<media:content url="http://oreilly.com/catalog/orsqlloader/chapter/osl_0101.gif" medium="image" />
	</item>
		<item>
		<title>Common Oracle TNS Errors</title>
		<link>http://mohibalvi.wordpress.com/2010/12/21/common-oracle-tns-errors/</link>
		<comments>http://mohibalvi.wordpress.com/2010/12/21/common-oracle-tns-errors/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 01:48:00 +0000</pubDate>
		<dc:creator>mohibalvi</dc:creator>
				<category><![CDATA[Oracle TNS]]></category>
		<category><![CDATA[common TNS errors]]></category>
		<category><![CDATA[Oracle Net Services]]></category>
		<category><![CDATA[TNS]]></category>
		<category><![CDATA[TNS Errors]]></category>

		<guid isPermaLink="false">https://mohibalvi.wordpress.com/2010/12/21/common-oracle-tns-errors/</guid>
		<description><![CDATA[In this post , I am trying to cover common TNS errors and possible corrective measures. ORA-12154: TNS:could not resolve service name SQL&#62; connect SYSTEM/manager@DEV ERROR: ORA-12154: TNS:could not resolve service name The most common TNS error mostly due to multiple ORACLE HOME, tnsnames.ora and sqlnet.ora conflicts. Check that the instance or database name is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=279&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this post , I am trying to cover common TNS errors and possible corrective measures.</p>
<p><span style="font-family:Calibri;font-size:small;"> </span></p>
<h3><span style="font-family:Calibri;"><strong> </strong></span></h3>
<h3><strong>ORA-12154: TNS:could not resolve service name</strong></h3>
<p><span style="font-family:Calibri;font-size:small;">SQL&gt; connect </span><a href="mailto:SYSTEM/manager@DEV"><span style="font-family:Calibri;font-size:small;">SYSTEM/manager@DEV</span></a><span style="font-size:small;"><span style="font-family:Calibri;"><br />
ERROR: </span><span style="font-family:Calibri;">ORA-12154: TNS:could not resolve service name</span></span></p>
<p><span style="font-family:Calibri;font-size:small;">The most common TNS error mostly due to multiple ORACLE HOME, tnsnames.ora and sqlnet.ora conflicts.</span></p>
<ul>
<li><span style="font-family:Calibri;font-size:small;">Check that the instance or database name is being typed in correctly. Check ORACLE_SID,ORACLE_HOME </span></li>
<li><span style="font-family:Calibri;font-size:small;">Make sure listener is up and running </span></li>
<blockquote><p><span style="font-family:Calibri;font-size:small;"> lsnrctl &gt; status           if down then </span></p></blockquote>
<p><span style="font-family:Calibri;"><span style="font-size:small;"> <em>lsnrctl &gt; start </em></span></span></p>
<li><span style="font-family:Calibri;font-size:small;">PING the server to see if network is up</span></li>
<p><span style="font-family:Calibri;font-size:small;"> ping 168.192.1.22</span></p>
<li><span style="font-family:Calibri;font-size:small;">TNSPING the server and then try connecting</span></li>
<p><span style="font-family:Calibri;font-size:small;"> tnsping DEV</span></p>
<li><span style="font-family:Calibri;font-size:small;">Check the tns names.ora file to validate that the instance name has been entered correctly. Make sure that all entries are properly terminated with parenthesis.</span></li>
<li><span style="font-family:Calibri;font-size:small;">Validate the domain name entry in sqlnet.ora is not conflicting with the full database name resolution. </span></li>
<li><span style="font-family:Calibri;font-size:small;">If nothings works, delete and recreate the entry to eliminate any character or control character issues.</span></li>
</ul>
<p><a href="http://www.dba-oracle.com/t_ora_12154_tns_resolve_service_name.htm">For more details on ORA-12154 causes and actions</a></p>
<p>&nbsp;</p>
<h3>TNS-03505: Failed to resolve name</h3>
<p><span style="font-family:Calibri;font-size:small;">Message 3511 not found; product=network; facility=TNS<br />
TNS-03505: Failed to resolve name</span></p>
<p><span style="font-family:Calibri;font-size:small;"> </span></p>
<p><span style="font-family:Calibri;font-size:small;">This is quite similar to the above error so you have to again check the environmental variables like ORACLE_HOME and PATH and make sure their values are set correctly.<br />
</span><span style="font-family:Calibri;font-size:small;">The issue usually occurs when the tns entiries we provide has some unwanted characters or spaces etc.Please also check the tns entry(alias) is pointing to the correct database with sid hostname.</span></p>
<p><span style="font-family:Calibri;font-size:small;"> </span></p>
<p><span style="font-family:Calibri;font-size:small;"><a href="http://www.dba-oracle.com/t_tns_03505_failed_to_resolve_name.htm">For more details on TNS-03505 reasons and remedy actions</a></span></p>
<h4>ORA-12537: TNS: connection closed error</h4>
<p><span style="font-family:Calibri;font-size:small;">It happens if the connection has been closed most likely due to the following reasons:</span></p>
<ul>
<li><span style="font-family:Calibri;font-size:small;">Firewall has disconnected idle connections </span></li>
<li><span style="font-family:Calibri;font-size:small;">Configuration problem in sqlnet.ora or listener.ora</span></li>
<li><span style="font-family:Calibri;font-size:small;">Time out occurred on client connection</span></li>
<li><span style="font-family:Calibri;font-size:small;">Path name that is too long for the Oracle TNS client on windows</span></li>
</ul>
<p>Try the following to fix this issue:</p>
<ol>
<li>Install the exe in a shorter named directory.</li>
<li> Modify the TNS Names entry so that it is shorter.</li>
<li>Replace domain names with IP Addresses if that shortens and vice versa.</li>
<li>Remove any parameters from the entry that are not needed.</li>
<li>Patch the Database Listener to the most recent version</li>
</ol>
<p><a href="http://www.oradev.com/ORA-12537_TNS_connection_closed.jsp">For more details on ORA-12537 reasons and remedy actions</a></p>
<p>&nbsp;</p>
<h4>Troubleshooting Tips from the Field for Oracle Net Services</h4>
<p>Here are some tips you may find helpful when you are having difficulty diagnosing network problems from Oracle documentation:</p>
<ul>
<li>Use the node or network address during configuration instead of the name of the server computer
<p>This eliminates any internal lookup problems and make the connection slightly faster.</li>
<li>If you are using TCP/IP addresses, use the IP address rather than host name
<p>For example, change the (<code>HOST=</code><code>server_name</code>) line in the <code>tnsnames.ora</code> file with the internet address, for example (<code>HOST=198.32.3.5</code>).</li>
<li>Perform a loopback test
<p>Perform a loopback test on the server as described in <a href="http://download.oracle.com/docs/cd/B19306_01/network.102/b14212/connect.htm#i430612">&#8220;Testing Configuration on the Database Server&#8221;</a>. If the test passes, <code>ftp</code> the <code>tnsnames.ora</code> and <code>sqlnet.ora</code> files to the client.</li>
<li>Check what is between you and the server
<p>If it is a wide area network (WAN), identify any intermediate systems that may not work correctly. If all computers are fine, the problem may be a timing issue.</li>
<li>Verify whether or not there is a timing issue
<p>Timing issues are associated with an <code>ORA-12535</code> error in the client log files.</p>
<p>To resolve this, try speeding up the connection by using exact addresses instead of names and increase the <code>INBOUND_CONNECT_TIMEOUT_</code><code>listener_name</code> parameter in the <code>listener.ora</code> file. The default value for this parameter is 10 seconds.</li>
<li>Determine which Oracle applications are failing
<p>SQL*Plus may work, but CASE tools may not. If you determine the problem is a data volume issue, try to transfer a large (5 MB) file with the base connectivity.</li>
</ul>
<p>&nbsp;</p>
<h2><a href="http://www.stanford.edu/dept/itss/docs/oracle/10gR2/network.102/b14212/troublestng.htm#i440403">Resolving most common Error messages for Oracle Net Services</a></h2>
<p>&nbsp;</p>
<p><span style="font-family:Calibri;font-size:x-small;"> </span></p>
<br />Filed under: <a href='http://mohibalvi.wordpress.com/category/oracle-network/oracle-tns/'>Oracle TNS</a> Tagged: <a href='http://mohibalvi.wordpress.com/tag/common-tns-errors/'>common TNS errors</a>, <a href='http://mohibalvi.wordpress.com/tag/oracle-net-services/'>Oracle Net Services</a>, <a href='http://mohibalvi.wordpress.com/tag/tns/'>TNS</a>, <a href='http://mohibalvi.wordpress.com/tag/tns-errors/'>TNS Errors</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohibalvi.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohibalvi.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohibalvi.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohibalvi.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mohibalvi.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mohibalvi.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mohibalvi.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mohibalvi.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohibalvi.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohibalvi.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohibalvi.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohibalvi.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohibalvi.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohibalvi.wordpress.com/279/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=279&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mohibalvi.wordpress.com/2010/12/21/common-oracle-tns-errors/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef5ff240dbc6a355cf764b046b1d4954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mohibalvi</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle Parameter Files</title>
		<link>http://mohibalvi.wordpress.com/2010/12/05/oracle-parameter-files/</link>
		<comments>http://mohibalvi.wordpress.com/2010/12/05/oracle-parameter-files/#comments</comments>
		<pubDate>Sun, 05 Dec 2010 02:22:23 +0000</pubDate>
		<dc:creator>mohibalvi</dc:creator>
				<category><![CDATA[Initialization parameters]]></category>
		<category><![CDATA[Oracle Concepts]]></category>
		<category><![CDATA[basic parameters]]></category>
		<category><![CDATA[hidden parameters]]></category>
		<category><![CDATA[parameter files]]></category>
		<category><![CDATA[PFILE]]></category>
		<category><![CDATA[SPFILE]]></category>

		<guid isPermaLink="false">https://mohibalvi.wordpress.com/2010/12/05/oracle-parameter-files/</guid>
		<description><![CDATA[Parameter Files Oracle must read either an initialization parameter file or a server parameter file(SPFILE) to start an instance. These files contain list of initialization parameters and a value for each parameter. Server Parameter Files Initialization Parameter Files&#160; In the platform-specific default location, Oracle Database locates your initialization parameter file by examining filenames in the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=278&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font size="3" face="Calibri"></font></p>
<h2>Parameter Files</h2>
<p>Oracle must read either an initialization parameter file or a server    <br />parameter file(SPFILE) to start an instance. These files contain list of initialization parameters and a value for each parameter.</p>
<ul>
<li>
<p><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams003.htm#i1124404">Server Parameter Files</a></p>
</li>
<li>
<p><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams003.htm#i1124407">Initialization Parameter Files</a>&#160;</p>
</li>
</ul>
<p>In the platform-specific default location, Oracle Database locates your initialization parameter file by examining filenames in the following order: </p>
<ul>
<li><code>spfile</code><code>$ORACLE_SID</code>.<code>ora</code> </li>
<li><code>spfile.ora</code> </li>
<li><code>init</code><code>$ORACLE_SID</code>.<code>ora</code> </li>
</ul>
<h2>Initialization Parameters</h2>
<pre>&#160;</pre>
<p>Initialization parameters are divided into two groups: basic and advanced. In the majority of cases, it is necessary to set and tune only the basic parameters to get reasonable performance. In rare situations, modification to the advanced parameters may be needed for optimal performance. </p>
<p><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams004.htm">Complete List of Initialization Parameters (10g)</a></p>
<h3>Basic Parameters</h3>
<p>There are about 29 basic parameters. Only a few of these parameters must be explicitly set because the default values are adequate in the majority of cases.</p>
<table border="1" cellspacing="0" cellpadding="2" width="528">
<tbody>
<tr>
<td valign="top" width="287">DB_DOMAIN</td>
<td valign="top" width="239">NLS_LANGUAGE</td>
</tr>
<tr>
<td valign="top" width="285">DB_NAME , DB_UNIQUE_NAME</td>
<td valign="top" width="241">NLS_TERRITORY</td>
</tr>
<tr>
<td valign="top" width="284">DB_RECOVERY_FILE_DEST</td>
<td valign="top" width="242">OPEN_CURSORS</td>
</tr>
<tr>
<td valign="top" width="283">DB_RECOVERY_FILE_DEST_SIZE</td>
<td valign="top" width="243">PGA_AGGREGATE_TARGET</td>
</tr>
<tr>
<td valign="top" width="282">DB_CREATE_ONLINE_LOG_DEST_n</td>
<td valign="top" width="244">PROCESSES</td>
</tr>
<tr>
<td valign="top" width="281">COMPATIBLE</td>
<td valign="top" width="245">REMOTE_LISTENER</td>
</tr>
<tr>
<td valign="top" width="281">CONTROL_FILES</td>
<td valign="top" width="245">REMOTE_LOGIN_PASSWORDFILE</td>
</tr>
<tr>
<td valign="top" width="281">CLUSTER_DATABASE</td>
<td valign="top" width="245">ROLLBACK_SEGMENTS</td>
</tr>
<tr>
<td valign="top" width="281">DB_BLOCK_SIZE</td>
<td valign="top" width="245">SESSIONS</td>
</tr>
<tr>
<td valign="top" width="281">DB_CREATE_FILE_DEST</td>
<td valign="top" width="245">SGA_TARGET</td>
</tr>
<tr>
<td valign="top" width="281">INSTANCE_NUMBER</td>
<td valign="top" width="245">SHARED_SERVERS</td>
</tr>
<tr>
<td valign="top" width="281">JOB_QUEUE_PROCESSES</td>
<td valign="top" width="245">STAR_TRANSFORMATION_ENABLED</td>
</tr>
<tr>
<td valign="top" width="281">LOG_ARCHIVE_DEST_n</td>
<td valign="top" width="245">UNDO_MANAGEMENT</td>
</tr>
<tr>
<td valign="top" width="281">LOG_ARCHIVE_DEST_STATE_n</td>
<td valign="top" width="246">UNDO_TABLESPACE</td>
</tr>
</tbody>
</table>
<p>&#160;&#160;<br />
<h3>Advanced Parameters</h3>
<p>Other than basic parameters, several parameters are used for database tuning and other advance services. Few examples of parameters</p>
<pre>SESSION_CACHED_CURSORS</pre>
<pre>CURSOR_SHARING</pre>
<pre>DB_KEEP_CACHE_SIZE</pre>
<pre>OPEN_LINKS</pre>
<pre>AUDIT_FILE_DEST</pre>
<pre>JAVA_POOL_SIZE</pre>
<pre>LARGE_POOL_SIZE</pre>
<pre>STREAMS_POOL_SIZE</pre>
<pre>QUERY_REWRITE_ENABLED</pre>
<pre>&#160;</pre>
<h3>Hidden/Undocumented Parameters</h3>
<p>Hidden parameters should only be used as the last resort and preferably when advised by Oracle Support.</p>
<p><font face="Courier New">_abort_recovery_on_join</font></p>
<p><font face="Courier New">_alert_message_purge</font></p>
<p><font face="Courier New">_backup_io_pool_size</font></p>
<p><font face="Courier New">_cursor_plan_enabled</font></p>
<p><font face="Courier New">_log_checkpoint_recovery_check</font></p>
<p><a href="http://www.orafaq.com/parms/index1020.htm#HIDDEN">Complete List of Hidden Parameters(10g)</a></p>
<p>&#160;</p>
<h2>Viewing and Changing Parameters Settings</h2>
<p><font size="2"></font></p>
<ul>
<li><font size="2">SHOW PARAMETERS command from SQL*PLUS can be used to to view parameter values </font>
<ul>
<li><font color="#0000ff" size="2">SQL&gt; SHOW PARAMTERS CONTROL_FILES<br />
          <br /></font></li>
</ul>
</li>
<li><font size="2">V$PARAMETER, V$PARAMETER2 views is used to display current parameter values</font> </li>
<li><font size="2">V$SPPARAMETER view is used to display contents of server parameter file.</font> </li>
</ul>
<h3>CHANGING PARAMETER VALUES&#160; </h3>
<p>&#160; PFILE can be edited with any text editor but the SPFILE is a binary file and its parameter values can be changed using “ALTER SYSTEM SET” and “ALTER SYSTEM RESET”commands.</p>
<p><em>Removing a Parameter from SPFILE:</em>&#160;</p>
<table border="1" cellspacing="0" cellpadding="2" width="523">
<tbody>
<tr>
<td valign="top" width="521">
<p><font color="#0000ff" size="2">SQL&gt; ALTER SYSTEM RESET timed_statistics SCOPE=SPFILE SID=‘*’;<br />
            <br /></font></p>
</td>
</tr>
</tbody>
</table>
<p>&#160;</p>
<p>Parameter Setting to SPFILE / Memory/ Both</p>
<table border="1" cellspacing="0" cellpadding="2" width="400">
<tbody>
<tr>
<td valign="top" width="400">
<pre><font color="#0000ff" face="Georgia">SQL&gt; ALTER SYSTEM SET open_cursors=300 SCOPE=SPFILE;

SQL&gt; ALTER SYSTEM SET timed_statistics=TRUE SCOPE=BOTH SID='*';</font></pre>
</td>
</tr>
</tbody>
</table>
<p><font color="#0000ff"></font>&#160;</p>
<p><font size="2">The scope parameter can be set to SPFILE, MEMORY or BOTH. Memory is default if PFILE was used at STARTUP and BOTH is default if SPFILE was used at STARTUP. </font></p>
<ul>
<li><font size="2">MEMORY:&#160; The parameter value is set for the current instance only.</font> </li>
<li><font size="2">SPFILE: The parameter value is updated in SPFILE and takes effect at next STARTUP.</font> </li>
<li><font size="2">BOTH: The parameter value is set for current instance and persists to the SPFILE</font></li>
</ul>
<p>
  </p>
<pre></pre>
<br />Filed under: <a href='http://mohibalvi.wordpress.com/category/oracle-architecture/initialization-parameters/'>Initialization parameters</a>, <a href='http://mohibalvi.wordpress.com/category/oracle-concepts/'>Oracle Concepts</a> Tagged: <a href='http://mohibalvi.wordpress.com/tag/basic-parameters/'>basic parameters</a>, <a href='http://mohibalvi.wordpress.com/tag/hidden-parameters/'>hidden parameters</a>, <a href='http://mohibalvi.wordpress.com/tag/initialization-parameters/'>Initialization parameters</a>, <a href='http://mohibalvi.wordpress.com/tag/parameter-files/'>parameter files</a>, <a href='http://mohibalvi.wordpress.com/tag/pfile/'>PFILE</a>, <a href='http://mohibalvi.wordpress.com/tag/spfile/'>SPFILE</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohibalvi.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohibalvi.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohibalvi.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohibalvi.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mohibalvi.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mohibalvi.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mohibalvi.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mohibalvi.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohibalvi.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohibalvi.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohibalvi.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohibalvi.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohibalvi.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohibalvi.wordpress.com/278/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=278&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mohibalvi.wordpress.com/2010/12/05/oracle-parameter-files/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef5ff240dbc6a355cf764b046b1d4954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mohibalvi</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle Shutdown Concepts</title>
		<link>http://mohibalvi.wordpress.com/2010/11/28/oracle-shutdown-concepts/</link>
		<comments>http://mohibalvi.wordpress.com/2010/11/28/oracle-shutdown-concepts/#comments</comments>
		<pubDate>Sun, 28 Nov 2010 00:40:57 +0000</pubDate>
		<dc:creator>mohibalvi</dc:creator>
				<category><![CDATA[Oracle Concepts]]></category>
		<category><![CDATA[Oracle DBA]]></category>
		<category><![CDATA[shutdown abort]]></category>
		<category><![CDATA[shutdown immediate]]></category>
		<category><![CDATA[shutdown normal]]></category>

		<guid isPermaLink="false">https://mohibalvi.wordpress.com/2010/11/28/oracle-shutdown-concepts/</guid>
		<description><![CDATA[Shut down the database to make operating system offline backups of all physical structures and to have modified static initialization parameters take effect when restarted. SHUTDOWN [NORMAL &#124; TRANSACTIONAL &#124; IMMEDIATE &#124; ABORT ] SHUTDOWN NORMAL Normal is the default shutdown mode.Normal database shutdown proceeds with the following conditions: • No new connections can be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=263&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Shut down the database to make operating system offline backups of all physical structures and to have modified static initialization parameters take effect when restarted.</p>
<blockquote><p>SHUTDOWN [NORMAL | TRANSACTIONAL | IMMEDIATE | ABORT ]</p></blockquote>
<h2><span style="color:#808000;">SHUTDOWN NORMAL</span></h2>
<p>Normal is the default shutdown mode.Normal database shutdown proceeds with the<br />
following conditions:</p>
<p>• No new connections can be made.<br />
• The Oracle server waits for all users to disconnect before completing the shutdown.<br />
• Database and redo buffers are written to disk.<br />
• Background processes are terminated, and the SGA is removed from memory.<br />
• Oracle closes and dismounts the database before shutting down the instance.<br />
• The next startup does not require an instance recovery.</p>
<p><span style="color:#0000ff;"> </span></p>
<div id="codeSnippetWrapper" style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:97.5%;">
<p style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span style="color:#0000ff;">SQL</span>&gt; <span style="color:#0000ff;">shutdown</span></p>
<p style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span style="color:#0000ff;">Database</span> closed.</p>
<p style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span style="color:#0000ff;">Database</span> dismounted.</p>
<p style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;">ORACLE instance shut down.</p>
<p style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span style="color:#0000ff;">SQL</span>&gt;</p>
</div>
<pre>
<pre><span style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;line-height:19px;white-space:normal;font-size:20px;font-weight:bold;">
</span>
<span style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;line-height:19px;white-space:normal;font-size:20px;font-weight:bold;color:#808000;">SHUTDOWN TRANSACTIONAL</span></pre>
</pre>
<p>A transactional shutdown prevents clients from losing work. A transactional database</p>
<p>shutdown proceeds with the following conditions:</p>
<p>• No client can start a new transaction on this particular instance.<br />
• A client is disconnected when the client ends the transaction that is in progress.<br />
• When all transactions have finished, a shutdown occurs immediately.<br />
• The next startup does not require an instance recovery.</p>
<p><span style="color:#0000ff;"> </span></p>
<div id="codeSnippetWrapper" style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:97.5%;">
<p style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span style="color:#0000ff;">SQL</span>&gt; <span style="color:#0000ff;">shutdown</span> transactional</p>
<p style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span style="color:#0000ff;">Database</span> closed.</p>
<p style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span style="color:#0000ff;">Database</span> dismounted.</p>
<p style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;">ORACLE instance shut down.</p>
<p style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span style="color:#0000ff;">SQL</span>&gt;</p>
</div>
<h2></h2>
<h2><span style="color:#808000;">SHUTDOWN IMMEDIATE</span></h2>
<p>Immediate database shutdown proceeds with the following conditions:</p>
<p>• Current SQL statements being processed by Oracle are not completed.<br />
• The Oracle server does not wait for the users, who are currently connected to the database, to disconnect.<br />
• Oracle rolls back active transactions and disconnects all connected users.<br />
• Oracle closes and dismounts the database before shutting down the instance.<br />
• The next startup does not require an instance recovery.</p>
<p><span style="color:#0000ff;"> </span></p>
<div id="codeSnippetWrapper" style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:97.5%;">
<p style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span style="color:#0000ff;">SQL</span>&gt; <span style="color:#0000ff;">shutdown</span> immediate</p>
<p style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span style="color:#0000ff;">Database</span> closed.</p>
<p style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span style="color:#0000ff;">Database</span> dismounted.</p>
<p style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;">ORACLE instance shut down.</p>
<p style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span style="color:#0000ff;">SQL</span>&gt;</p>
</div>
<h2></h2>
<h2><span style="color:#808000;">SHUTDOWN ABORT</span></h2>
<p>If no shutdown option works then database instance can be shutdown using abort option. Aborting an instance proceeds with the following conditions:</p>
<p>• Current SQL statements being processed by the Oracle server are immediately terminated.<br />
• Oracle does not wait for users currently connected to the database to disconnect.<br />
• Database and redo buffers are not written to disk.<br />
• Uncommitted transactions are not rolled back.<br />
• The instance is terminated without closing the files.<br />
• The database is not closed or dismounted.<br />
• The next startup requires instance recovery, which occurs automatically.<br />
<span style="color:#0000ff;"> </span></p>
<div id="codeSnippetWrapper" style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:97.5%;">
<p style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span style="color:#0000ff;">SQL</span>&gt; <span style="color:#0000ff;">shutdown</span> abort</p>
<p style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;">ORACLE instance shut down.</p>
<p style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span style="color:#0000ff;">SQL</span>&gt;</p>
</div>
<p>All shutdown options except ABORT are clean shutdown where no instance recovery is required. Shutdown abort is a dirty shutdown as it requires instance recovery before getting back up.</p>
<br />Filed under: <a href='http://mohibalvi.wordpress.com/category/oracle-concepts/'>Oracle Concepts</a>, <a href='http://mohibalvi.wordpress.com/category/oracle-dba/'>Oracle DBA</a> Tagged: <a href='http://mohibalvi.wordpress.com/tag/shutdown-abort/'>shutdown abort</a>, <a href='http://mohibalvi.wordpress.com/tag/shutdown-immediate/'>shutdown immediate</a>, <a href='http://mohibalvi.wordpress.com/tag/shutdown-normal/'>shutdown normal</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohibalvi.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohibalvi.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohibalvi.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohibalvi.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mohibalvi.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mohibalvi.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mohibalvi.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mohibalvi.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohibalvi.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohibalvi.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohibalvi.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohibalvi.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohibalvi.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohibalvi.wordpress.com/263/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=263&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mohibalvi.wordpress.com/2010/11/28/oracle-shutdown-concepts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef5ff240dbc6a355cf764b046b1d4954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mohibalvi</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle Streams Basics (10g)</title>
		<link>http://mohibalvi.wordpress.com/2010/11/13/oracle-streams/</link>
		<comments>http://mohibalvi.wordpress.com/2010/11/13/oracle-streams/#comments</comments>
		<pubDate>Sat, 13 Nov 2010 22:24:56 +0000</pubDate>
		<dc:creator>mohibalvi</dc:creator>
				<category><![CDATA[Streams]]></category>
		<category><![CDATA[capture process]]></category>
		<category><![CDATA[dequeue]]></category>
		<category><![CDATA[LCR]]></category>
		<category><![CDATA[logical change record]]></category>
		<category><![CDATA[messages]]></category>
		<category><![CDATA[Oracle Streams]]></category>
		<category><![CDATA[stage messages]]></category>
		<category><![CDATA[stream queue]]></category>
		<category><![CDATA[user messages]]></category>
		<category><![CDATA[user-enqueued message]]></category>

		<guid isPermaLink="false">https://mohibalvi.wordpress.com/2010/11/13/oracle-streams/</guid>
		<description><![CDATA[What Is Streams? Oracle Streams captures database changes at a source database, stages the changes, propagates the changes to one or more destination databases, and then applies the changes at the destination database(s). Using Oracle Streams, enterprise systems can capture, propagate, and apply information as follows: Within an Oracle database Between two Oracle databases Among [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=258&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2><strong>What Is Streams?</strong></h2>
<p>Oracle Streams captures database changes at a source database, stages the changes, propagates the changes to one or more destination databases, and then applies the changes at the destination database(s). Using Oracle Streams, enterprise systems can capture, propagate, and apply information as follows:</p>
<ul>
<li>Within an Oracle database </li>
<li>Between two Oracle databases </li>
<li>Among multiple Oracle databases </li>
<li>Between an Oracle database and a non-Oracle database </li>
</ul>
<p>Oracle9i Database introduced the Change Data Capture (CDC) feature.</p>
<p>Oracle 10g introduces Asynchronous Change Data Capture, which instead of using triggers uses the database log files to capture changes and apply them to collection tables. Asynchronous requires both source and destination databases to be Oracle 10g.</p>
<p>&#160;</p>
<h3><font>Streams Features</font></h3>
<ul>
<li>Distinct capture/propagation/apply services </li>
<li>Message Queueing (via AQ) </li>
<li>Publish Subscribe </li>
<li>Rules based Capture/Transform/Apply </li>
<li>Database integration </li>
<li>Easy configuration </li>
<li>Flexible </li>
<li>Inline transformations </li>
</ul>
<p>&#160;</p>
<h2><font>Streams Overview</font></h2>
<p>There are three basic tasks of a stream</p>
<ul>
<li>Capture </li>
<li>Staging /Propagation </li>
<li>Apply / Consumption </li>
</ul>
<h4><font>Capture Process:</font></h4>
<ul>
<li>A capture process captures a database change(DML or DDL changes from Redo logs) and converts it into a specific message format called a <a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28321/strms_glossary.htm#CHDEJJAF">logical change record (LCR)</a> or <a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28321/strms_capture.htm#CACIDFHD">user messages</a>. </li>
<li>After capturing an LCR, a capture process enqueues a message containing the LCR into a <a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28321/strms_glossary.htm#CHDIDCDI">queue</a>(local or remote). </li>
<li>Captured LCRs can be sent to queues in the same database or other databases by propagations. </li>
<li>A capture process running on source database is a local capture process while if it runs on a remote database, the capture process is a downstream capture process. (Check Local and Downstream Capture for Details </li>
</ul>
<p><em><font color="#d19049">Further Readings:</font></em>&#160; <a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14229/strms_capture.htm#i1013269">Local and DownStream Capture</a>(10g) , <a href="http://download.oracle.com/docs/cd/E14072_01/server.112/e10704/strms_capture.htm#CACJJIAH">Summary of Information Capture Information in Oracle 11g</a></p>
<h4><font>Staging Process:</font></h4>
<ul>
<li>Oracle Streams uses <a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28321/strms_glossary.htm#CHDIDCDI">queue</a>s to stage <a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28321/strms_glossary.htm#CHDFHHGJ">message</a>s. Staged messages can be consumed or propagated, or both. </li>
<li>Staged messages can be consumed by an <a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28321/strms_glossary.htm#CHDJBHJC">apply process</a>, a <a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28321/strms_glossary.htm#CHDDGHHB">messaging client</a>, or a user application. </li>
<li>A running apply process implicitly dequeues messages, but messaging clients and user applications explicitly dequeue messages. </li>
</ul>
<p><font color="#d19049"><em>Further Readings: </em><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14229/strms_prop.htm#i1006210">Message Propagation between Queues</a>, </font></p>
<h4><font>Propagation Process:</font></h4>
<ul>
<li>Oracle Streams uses&#160; Oracle scheduler jobs to propagate messages between two queues.</li>
<li> A <a href="http://download.oracle.com/docs/cd/E14072_01/server.112/e10704/strms_glossary.htm#CHDEICIC">propagation</a> is always between a <a href="http://download.oracle.com/docs/cd/E14072_01/server.112/e10704/strms_glossary.htm#CHDCGACA">source queue</a> and a <a href="http://download.oracle.com/docs/cd/E14072_01/server.112/e10704/strms_glossary.htm#CHDHJHJD">destination queue</a>.</li>
<li>Only one propagation is allowed between a particular source queue and a particular destination queue. </li>
<li>A single source queue can propagate messages to multiple destination queues, and a single destination queue can receive messages from multiple source queues. A single propagation can propagate <a href="http://download.oracle.com/docs/cd/E14072_01/server.112/e10704/strms_glossary.htm#CHDJDFAD">LCR</a>s and <a href="http://download.oracle.com/docs/cd/E14072_01/server.112/e10704/strms_glossary.htm#CHDDIHEC">user message</a>s.</li>
<li>A <a href="http://download.oracle.com/docs/cd/E14072_01/server.112/e10704/strms_glossary.htm#CHDEICIC">propagation</a> either propagates or discards <a href="http://download.oracle.com/docs/cd/E14072_01/server.112/e10704/strms_glossary.htm#CHDFHHGJ">message</a>s based on <a href="http://download.oracle.com/docs/cd/E14072_01/server.112/e10704/strms_glossary.htm#CHDIFFCF">rule</a>s defined.</li>
<li>A propagation can be queue-to-queue or queue-to-database link. Propagation to the remote queue uses database links over Oracle Net Services.</li>
</ul>
<h4><font>Apply/Consumption Process:</font></h4>
<ul>
<li>An apply process dequeues <a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14229/strms_glossary.htm#CHDFHHGJ">message</a>s (LCR or user messages) from a specific <a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14229/strms_glossary.htm#CHDIDCDI">queue</a>.&#160; </li>
<li>An apply process either applies each message directly or passes it as a parameter to an apply handler.&#160; </li>
<li> A<a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14229/strms_glossary.htm#CHDFJGIB">user-enqueued message</a> dequeued by an apply process is of type <code>ANYDATA</code> and can contain any message, including an LCR or a <a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14229/strms_glossary.htm#CHDDIHEC">user message</a>.</li>
<li>An apply process can only dequeue messages from an <code>ANYDATA</code> queue, not a <a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14229/strms_glossary.htm#CHDBGAAH">typed queue</a>.</li>
</ul>
<p><font color="#d19049"><em>Further Readings: </em><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14229/strms_apply.htm#i1006187">Message Processing with Apply Process</a></font></p>
<h2><font>Streams Process Architecture </font></h2>
<p>In simple five steps the whole Streams process is as follows:</p>
<ul>
<li>Capture changes at a database(source/target)</li>
<li>Enqueue events in a queue</li>
<li>Propagate events from one queue to another</li>
<li>Dequeue events</li>
<li>Apply events at a database</li>
</ul>
<h2><font>Streams Rules</font></h2>
<ul>
<li>Rule is a database object that enables a client to perform an action when an event occurs and a condition is satisfied.</li>
<li>Rules are used to control which information to share and where to share it. </li>
<li>Rules can be used during capture, propagate and apply process.</li>
<li>Rule consists of Rule condition and optionally evaluation context and Action extent . It can be defined in three levels: </li>
<ol>
<li>Table</li>
<li>Schema</li>
<li>Global</li>
</ol>
</ul>
<h2><font>Database Configuration</font></h2>
<blockquote><p>Following parameters should be set at each site:</p>
<ul>
<li>COMPATIBLE</li>
<li>PROCESSES</li>
<li>SHARED_POOL_SIZE</li>
<li>STREAMS_POOL_SIZE</li>
<li>TIMED_STATISTICS</li>
</ul>
<p>DB parameters that must be set at source site:</p>
<ul>
<li>LOG_ARCHIVE_DEST_n</li>
<li>LOG_ARCHIVE_DEST_STATE_n</li>
<li>REMOTE_ARCHIVE_ENABLE</li>
<li>UNDO_RETENTION</li>
</ul>
<p>DB parameters specific to propagation:</p>
<ul>
<li>GLOBAL_NAMES</li>
<li>JOB_QUEUE_PROCESSES</li>
</ul>
</blockquote>
<p>Databases capturing changes via Streams must be in archived mode whereas databases applying changes are not required in archived mode.</p>
<h2><font>Oracle Streams Administration Tools</font></h2>
<h3><font>Oracle-Supplied PL/SQL Packages</font></h3>
<blockquote><p><a href="http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_strm_a.htm#ARPLS305">DBMS_STREAMS_ADM Package</a></p>
<p><a href="http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_cap_a.htm#ARPLS302">DBMS_CAPTURE_ADM Package</a></p>
<p><a href="http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_prop_a.htm#ARPLS320">DBMS_PROPAGATION_ADM Package</a></p>
<p><a href="http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_apply.htm#ARPLS300">DBMS_APPLY_ADM Package</a></p>
<p><a href="http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_strmsg.htm#ARPLS523">DBMS_STREAMS_MESSAGING Package</a></p>
<p><a href="http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_rule_a.htm#ARPLS304">DBMS_RULE_ADM Package</a></p>
<p><a href="http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_rule.htm#ARPLS303">DBMS_RULE Package</a></p>
<p><a href="http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_strm.htm#ARPLS332">DBMS_STREAMS Package</a></p>
<p><a href="http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_stsp_a.htm#ARPLS551">DBMS_STREAMS_TABLESPACE_ADM</a></p>
<p><a href="http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_st_aut.htm#ARPLS514">DBMS_STREAMS_AUTH Package</a></p>
</blockquote>
<h3><font></font></h3>
<h3><font>Streams Data Dictionary Views</font></h3>
<blockquote><h4>Streams Static Data Dictionary Views</h4>
</blockquote>
<ul>
<ul>
<ul>
<li><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_3030.htm#REFRN23005">DBA_APPLY</a></li>
<li><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_3063.htm#REFRN23031">DBA_CAPTURE</a></li>
<li><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_4076.htm#REFRN23240">DBA_RULES</a></li>
<li><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_4129.htm#REFRN23475">DBA_STREAMS_RULES</a></li>
<li><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_4130.htm#REFRN23258">DBA_STREAMS_SCHEMA_RULES</a></li>
<li><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_4131.htm#REFRN23259">DBA_STREAMS_TABLE_RULES</a></li>
</ul>
</ul>
</ul>
<blockquote><h3>Streams Dynamic Performance Views</h3>
</blockquote>
<ul>
<ul>
<ul>
<li>
<p><code><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_1057.htm#REFRN30317"><font face="Calibri">V$BUFFERED_QUEUES</font></a></code></p>
</li>
<li>
<p><code><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_1058.htm#REFRN30318"><font face="Calibri">V$BUFFERED_SUBSCRIBERS</font></a></code></p>
</li>
<li>
<p><code><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2024.htm#REFRN30352"><font face="Calibri">V$PROPAGATION_RECEIVER</font></a></code></p>
</li>
<li>
<p><code><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2025.htm#REFRN30353"><font face="Calibri">V$PROPAGATION_SENDER</font></a></code></p>
</li>
<li>
<p><code><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2071.htm#REFRN30307"><font face="Calibri">V$RULE</font></a></code></p>
</li>
<li>
<p><code><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2072.htm#REFRN30218"><font face="Calibri">V$RULE_SET</font></a></code></p>
</li>
<li>
<p><code><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2140.htm#REFRN30269"><font face="Calibri">V$STREAMS_CAPTURE</font></a></code></p>
</li>
<li>
<p><code><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2141.htm#REFRN30324"><font face="Calibri">V$STREAMS_POOL_ADVICE</font></a></code></p>
</li>
<li>
<p><code><a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2142.htm#REFRN30415"><font face="Calibri">V$STREAMS_TRANSACTION</font></a></code></p>
</li>
</ul>
</ul>
</ul>
<h3><font>Oracle Enterprise Manager Console</font></h3>
<p>Oracle provides a Streams tool in the Oracle Enterprise Manager Console to help configure , administer and monitor Streams environments.</p>
<br />Filed under: <a href='http://mohibalvi.wordpress.com/category/streams/'>Streams</a> Tagged: <a href='http://mohibalvi.wordpress.com/tag/capture-process/'>capture process</a>, <a href='http://mohibalvi.wordpress.com/tag/dequeue/'>dequeue</a>, <a href='http://mohibalvi.wordpress.com/tag/lcr/'>LCR</a>, <a href='http://mohibalvi.wordpress.com/tag/logical-change-record/'>logical change record</a>, <a href='http://mohibalvi.wordpress.com/tag/messages/'>messages</a>, <a href='http://mohibalvi.wordpress.com/tag/oracle-streams/'>Oracle Streams</a>, <a href='http://mohibalvi.wordpress.com/tag/stage-messages/'>stage messages</a>, <a href='http://mohibalvi.wordpress.com/tag/stream-queue/'>stream queue</a>, <a href='http://mohibalvi.wordpress.com/tag/user-messages/'>user messages</a>, <a href='http://mohibalvi.wordpress.com/tag/user-enqueued-message/'>user-enqueued message</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohibalvi.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohibalvi.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohibalvi.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohibalvi.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mohibalvi.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mohibalvi.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mohibalvi.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mohibalvi.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohibalvi.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohibalvi.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohibalvi.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohibalvi.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohibalvi.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohibalvi.wordpress.com/258/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=258&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mohibalvi.wordpress.com/2010/11/13/oracle-streams/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef5ff240dbc6a355cf764b046b1d4954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mohibalvi</media:title>
		</media:content>
	</item>
		<item>
		<title>Starting and Altering Database</title>
		<link>http://mohibalvi.wordpress.com/2010/10/24/starting-and-altering-database/</link>
		<comments>http://mohibalvi.wordpress.com/2010/10/24/starting-and-altering-database/#comments</comments>
		<pubDate>Sun, 24 Oct 2010 01:06:54 +0000</pubDate>
		<dc:creator>mohibalvi</dc:creator>
				<category><![CDATA[Oracle DBA]]></category>
		<category><![CDATA[alter database]]></category>
		<category><![CDATA[startup]]></category>
		<category><![CDATA[startup mount]]></category>

		<guid isPermaLink="false">https://mohibalvi.wordpress.com/2010/10/24/starting-and-altering-database/</guid>
		<description><![CDATA[Starting Up a Database There are different states in which database can start up. The following scenarios describe different stages of starting up an instance starting with shutdown. &#160; SHUTDOWN NOMOUNT MOUNT OPEN &#160; Starting the Instance (NOMOUNT) An instance is started in the NOMOUNT stage only during database creation or the re-creationof control files.Starting [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=257&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>Star<a name="sthref491"></a><a name="sthref492"></a>ting Up a Database</h2>
<p>There are different states in which database can start up. The following scenarios describe different stages of starting up an instance starting with shutdown.
<p>&nbsp;
<p>SHUTDOWN
<p>NOMOUNT
<p>MOUNT
<p>OPEN
<p>&nbsp;<br />
<h3>Starting the Instance (NOMOUNT)</h3>
<p>An instance is started in the NOMOUNT stage only during database creation or the re-creation<br />of control files.<br />Starting an instance includes the following tasks:</p>
<p>• Reading the initialization file from $ORACLE_HOME/dbs in the following order:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; First spfileSID.ora<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; If not found then, spfile.ora<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; If not found then, initSID.ora<br />• Allocating the SGA<br />• Starting the background processes<br />• Opening the alertSID.log file and the trace files</p>
<p><em>STARTUP NOMOUNT </em>
<p>Specifying the PFILE parameter with STARTUP overrides the default behavior</p>
<p><a name="i1006154"></a>
<p><a name="sthref493"></a>
<pre><em>STARTUP NOMOUNT PFILE = /u01/oracle/dbs/init.ora</em></pre>
<h5>&nbsp;</h5>
<h3>Mounting the Database (MOUNT)</h3>
<p>To perform specific maintenance operations, you start an instance and mount a database but<br />do not open the database.</p>
<p>For example, the database must be mounted but not open during the following tasks:<br />• Renaming data files (data files for an offline tablespace can be renamed when the<br />database is open)<br />• Enabling and disabling online redo log file archiving options<br />• Performing full database recovery<br />Mounting a database includes the following tasks:<br />• Associating a database with a previously started instance<br />• Locating and opening the control files specified in the parameter file<br />• Reading the control files to obtain the names and status of the data files and online<br />redo log files. However, no checks are performed to verify the existence of the data<br />files and online redo log files at this time.</p>
<p><em>STARTUP MOUNT</em></p>
<p>&nbsp;</p>
<h3>Opening the Database (OPEN)</h3>
<p></p>
<p>Normal database operation means that an instance is started and the database is mounted and<br />open. Opening the database includes the following tasks:</p>
<p>• Opening the online data files<br />• Opening the online redo log files</p>
<p>If any of the data files or online redo log files are not present when you attempt to open the<br />database, the Oracle server returns an error. Oracle server verifies that all the data files and online redo log<br />files can be opened and checks the consistency of the database. If necessary, the SMON<br />background process initiates instance recovery.</p>
<h5><em>STARTUP</em></h5>
<p>&nbsp;</p>
<h3>Restricting Access to an Instance at Startup</h3>
<p><a name="sthref544"></a><a name="sthref545"></a>You can start an instance, and optionally mount and open a database, in restricted mode so that the instance is available only to administrative personnel (not general database users). Use this mode of instance startup when you need to accomplish one of the following tasks:</p>
<ul>
<li>
<p>Perform an export or import of data</p>
<li>
<p>Perform a data load (with SQL*Loader)</p>
<li>
<p>Temporarily prevent typical users from using data</p>
<li>
<p>Perform certain migration or upgrade operations</p>
</li>
</ul>
<p><em>STARTUP RESTRICT</em></p>
<h3>&nbsp;</h3>
<h3>Forcing Instance to Start / Instance with Media Recovery</h3>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; You cannot shut down the current instance with the <code>SHUTDOWN NORMAL</code>, <code>SHUTDOWN IMMEDIATE</code>, or <code>SHUTDOWN TRANSACTIONAL</code> commands. Use the <code>STARTUP</code> command with the <code>FORCE</code> clause:
<pre>STARTUP FORCE</pre>
<p>If media recovery is required, start by using the <code>STARTUP</code> command with the <code>RECOVER</code> clause:<a name="sthref559"></a><a name="sthref560"></a>
<pre>STARTUP OPEN RECOVER</pre>
<pre>&nbsp;</pre>
<h2>Altering Database Availability</h2>
<p><a name="sthref567"></a>You can alter the availability of a database. You may want to do this in order to restrict access for maintenance reasons or to make the database read only. The following sections explain how to alter the availability of a database:</p>
<p>&nbsp;
<p>Database can be altered to mount state from nomount state but cannot be altered directly to open state.
<pre>ALTER DATABASE MOUNT;</pre>
<p>To open a mounted database, use <a name="sthref574"></a>the <code>ALTER DATABASE</code> statement with the <code>OPEN</code> clause:
<pre>ALTER DATABASE OPEN;</pre>
<p>&nbsp;
<p>Opening a database in read-only mode enables you to query an open database while eliminating any potential for online data content changes.
<pre>ALTER DATABASE OPEN READ ONLY;
</pre>
<p>You can also open a database in read/write mode as follows which is the default mode:
<pre>ALTER DATABASE OPEN READ WRITE;</pre>
<br />Filed under: <a href='http://mohibalvi.wordpress.com/category/oracle-dba/'>Oracle DBA</a> Tagged: <a href='http://mohibalvi.wordpress.com/tag/alter-database/'>alter database</a>, <a href='http://mohibalvi.wordpress.com/tag/startup/'>startup</a>, <a href='http://mohibalvi.wordpress.com/tag/startup-mount/'>startup mount</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohibalvi.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohibalvi.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohibalvi.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohibalvi.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mohibalvi.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mohibalvi.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mohibalvi.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mohibalvi.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohibalvi.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohibalvi.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohibalvi.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohibalvi.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohibalvi.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohibalvi.wordpress.com/257/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=257&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mohibalvi.wordpress.com/2010/10/24/starting-and-altering-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef5ff240dbc6a355cf764b046b1d4954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mohibalvi</media:title>
		</media:content>
	</item>
		<item>
		<title>Increasing Recovery Area Size</title>
		<link>http://mohibalvi.wordpress.com/2009/09/17/increasing-recovery-area-size/</link>
		<comments>http://mohibalvi.wordpress.com/2009/09/17/increasing-recovery-area-size/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 12:34:06 +0000</pubDate>
		<dc:creator>mohibalvi</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mohibalvi.wordpress.com/?p=244</guid>
		<description><![CDATA[To verify this run the following query. It will show the size of the recovery area and how full it is: set lines 100 col name format a60 select name , floor(space_limit / 1024 / 1024) "Size MB" , ceil(space_used / 1024 / 1024) "Used MB" from v$recovery_file_dest order by name / To fix the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=244&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To verify this run the following query.  It will show the size of the recovery area and how full it is:</p>
<pre>set lines 100
col name format a60
select	name
,	floor(space_limit / 1024 / 1024) "Size MB"
,	ceil(space_used  / 1024 / 1024) "Used MB"
from	v$recovery_file_dest
order by name
/</pre>
<p>To fix the problem, you need to either make the flash recovery area larger, or remove some files from it.</p>
<p>If you have the disk space available, make the recovery area larger:</p>
<pre>alter system set db_recovery_file_dest_size=&lt;size&gt; scope=both
/</pre>
<p>To remove files you must use <a class="zem_slink" title="RMAN" rel="wikipedia" href="http://en.wikipedia.org/wiki/RMAN">RMAN</a>. Manually moving or <a class="zem_slink" title="File deletion" rel="wikipedia" href="http://en.wikipedia.org/wiki/File_deletion">deleting files</a> will have no effect as oracle will be unaware. The obvious choice is to backup and remove some archive <a class="zem_slink" title="Data logging" rel="wikipedia" href="http://en.wikipedia.org/wiki/Data_logging">log files</a>. However, if you usually write your RMAN <a class="zem_slink" title="Backup" rel="wikipedia" href="http://en.wikipedia.org/wiki/Backup">backups</a> to disk, this could prove tricky. RMAN will attempt to write the backup to the flash recovery area&#8230;which is full. You could try sending the backup elsewhere using a command such as this:</p>
<pre>rman target / catalog user/pass@rmancat

run {
allocate channel t1 type disk;
backup archivelog all delete input format '/&lt;temp backup location&gt;/arch_%d_%u_%s';
release channel t1;
}</pre>
<p>This will backup all archive log files to a location of your choice and then remove them.</p>
<p>http://www.shutdownabort.com/errors/ORA-19809.php</p>
<div class="zemanta-pixie" style="margin-top:10px;height:15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border:medium none;float:right;" src="http://img.zemanta.com/zemified_c.png?x-id=09c57e1f-ee5c-422c-a50f-ce24c327cb72" alt="Enhanced by Zemanta" /></a></div>
<br />Posted in Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohibalvi.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohibalvi.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohibalvi.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohibalvi.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mohibalvi.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mohibalvi.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mohibalvi.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mohibalvi.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohibalvi.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohibalvi.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohibalvi.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohibalvi.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohibalvi.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohibalvi.wordpress.com/244/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=244&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mohibalvi.wordpress.com/2009/09/17/increasing-recovery-area-size/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef5ff240dbc6a355cf764b046b1d4954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mohibalvi</media:title>
		</media:content>

		<media:content url="http://img.zemanta.com/zemified_c.png?x-id=09c57e1f-ee5c-422c-a50f-ce24c327cb72" medium="image">
			<media:title type="html">Enhanced by Zemanta</media:title>
		</media:content>
	</item>
		<item>
		<title>Recommended init parameters for Websphere Portal</title>
		<link>http://mohibalvi.wordpress.com/2009/08/20/recommended-init-parameters-for-websphere-portal/</link>
		<comments>http://mohibalvi.wordpress.com/2009/08/20/recommended-init-parameters-for-websphere-portal/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 10:24:12 +0000</pubDate>
		<dc:creator>mohibalvi</dc:creator>
				<category><![CDATA[Initialization parameters]]></category>
		<category><![CDATA[Application]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[IBM WebSphere]]></category>
		<category><![CDATA[Init]]></category>

		<guid isPermaLink="false">http://mohibalvi.wordpress.com/?p=241</guid>
		<description><![CDATA[Recommended init parameters for IBM Websphere Portal wspprd.__db_cache_size=587202560 wspprd.__java_pool_size=16777216 wspprd.__large_pool_size=16777216 wspprd.__shared_pool_size=939524096 wspprd.__streams_pool_size=33554432 *.compatible=&#8217;10.2.0.3.0&#8242; *.db_block_size=8192 *.db_cache_size=524288000 *.db_domain=&#8221; *.db_file_multiblock_read_count=16 *.db_files=1024 *.db_recovery_file_dest=&#8217;/wspprd/oracle/product/10.2.0/flash_recovery_area&#8217; *.db_recovery_file_dest_size=2147483648 *.job_queue_processes=10 *.open_cursors=1600 *.pga_aggregate_target=314572800 *.pre_page_sga=TRUE *.processes=600 *.sessions=665 *.sga_max_size=1610612736 *.sga_target=1610612736 *.shared_pool_size=536870912 *.db_writer_processes=20 *.sort_area_size=65536 *.cursor_space_for_time=TRUE *.session_cached_cursors=500 *.log_checkpoints_to_alert=TRUE *.log_checkpoint_interval=0 *.log_checkpoint_timeout=0 *.fast_start_mttr_target=3600 *.log_buffer=419430400 Related articles by Zemanta Creating Oracle Database for Websphere Portal (mohibalvi.wordpress.com) Posted in Initialization parameters Tagged: Application, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=241&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color:#008000;">Recommended init parameters for IBM Websphere Portal</span></strong></p>
<p>wspprd.__db_cache_size=587202560<br />
wspprd.__java_pool_size=16777216<br />
wspprd.__large_pool_size=16777216<br />
wspprd.__shared_pool_size=939524096<br />
wspprd.__streams_pool_size=33554432<br />
*.compatible=&#8217;10.2.0.3.0&#8242;<br />
*.db_block_size=8192<br />
*.db_cache_size=524288000<br />
*.db_domain=&#8221;<br />
*.db_file_multiblock_read_count=16<br />
*.db_files=1024<br />
*.db_recovery_file_dest=&#8217;/wspprd/oracle/product/10.2.0/flash_recovery_area&#8217;<br />
*.db_recovery_file_dest_size=2147483648<br />
*.job_queue_processes=10<br />
*.open_cursors=1600<br />
*.pga_aggregate_target=314572800<br />
*.pre_page_sga=TRUE<br />
*.processes=600<br />
*.sessions=665<br />
*.sga_max_size=1610612736<br />
*.sga_target=1610612736<br />
*.shared_pool_size=536870912<br />
*.db_writer_processes=20<br />
*.sort_area_size=65536<br />
*.cursor_space_for_time=TRUE<br />
*.session_cached_cursors=500<br />
*.log_checkpoints_to_alert=TRUE<br />
*.log_checkpoint_interval=0<br />
*.log_checkpoint_timeout=0<br />
*.fast_start_mttr_target=3600<br />
*.log_buffer=419430400</p>
<h6 class="zemanta-related-title" style="font-size:1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://mohibalvi.wordpress.com/2009/06/19/creating-oracle-database-for-websphere-portal/">Creating Oracle Database for Websphere Portal</a> (mohibalvi.wordpress.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top:10px;height:15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border:medium none;float:right;" src="http://img.zemanta.com/zemified_c.png?x-id=c83b7e73-ba30-4daf-b2c1-92ea1bd74999" alt="Enhanced by Zemanta" /></a></div>
<br />Posted in Initialization parameters Tagged: Application, Database, IBM, IBM WebSphere, Init <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohibalvi.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohibalvi.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohibalvi.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohibalvi.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mohibalvi.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mohibalvi.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mohibalvi.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mohibalvi.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohibalvi.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohibalvi.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohibalvi.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohibalvi.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohibalvi.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohibalvi.wordpress.com/241/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=241&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mohibalvi.wordpress.com/2009/08/20/recommended-init-parameters-for-websphere-portal/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef5ff240dbc6a355cf764b046b1d4954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mohibalvi</media:title>
		</media:content>

		<media:content url="http://img.zemanta.com/zemified_c.png?x-id=c83b7e73-ba30-4daf-b2c1-92ea1bd74999" medium="image">
			<media:title type="html">Enhanced by Zemanta</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Server 2008 Backup</title>
		<link>http://mohibalvi.wordpress.com/2009/08/04/sql-server-2008-backup/</link>
		<comments>http://mohibalvi.wordpress.com/2009/08/04/sql-server-2008-backup/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 15:13:56 +0000</pubDate>
		<dc:creator>mohibalvi</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[FAQs  Help  and Tutorials]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Microsoft SQL Server]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[Transaction log]]></category>

		<guid isPermaLink="false">http://mohibalvi.wordpress.com/?p=234</guid>
		<description><![CDATA[Backup Types SQL Server 2008 allows you to create four different types of backups: Full Backups Differential Backups Transaction log Backups Filegroup Backups Full Backups A full backup captures all pages within a database that contain data. Pages that do not contain data are not included in the backup. Because it is more common to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=234&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Backup Types</strong></p>
<p><a class="zem_slink" title="Microsoft SQL Server" rel="homepage" href="http://www.microsoft.com/sqlserver">SQL Server 2008</a> allows you to create four different types of backups:</p>
<ul>
<li>Full Backups</li>
<li>Differential Backups</li>
<li>Transaction log Backups</li>
<li>Filegroup Backups</li>
</ul>
<p><strong>Full Backups</strong></p>
<p>A full backup captures all pages within a <a class="zem_slink" title="Database" rel="wikipedia" href="http://en.wikipedia.org/wiki/Database">database</a> that contain data. Pages that do not</p>
<p>contain data are not included in the backup.</p>
<p>Because it is more common to back up a database than to restore one, the backup engine</p>
<p>is optimized for the backup process. When a backup is initiated, the backup engine grabs</p>
<p>pages from the <a class="zem_slink" title="Data file" rel="wikipedia" href="http://en.wikipedia.org/wiki/Data_file">data files</a> as quickly as possible, without regard to the order of pages. Because</p>
<p>the backup process is not concerned with the ordering of pages, multiple threads can be used</p>
<p>to write pages to your <a class="zem_slink" title="Backup" rel="wikipedia" href="http://en.wikipedia.org/wiki/Backup">backup device</a>.</p>
<p>Because changes canbe made to the database while a backup is running, SQL Server needs to be able to accommodate the changes while also ensuring that backups are consistent for restore purposes. To ensure both <a class="zem_slink" title="Concurrency control" rel="wikipedia" href="http://en.wikipedia.org/wiki/Concurrency_control">concurrent access</a> and backup consistency, SQL Server performs the steps of the backup procedure as follows:</p>
<p>1. Locks the database, blocking all <a class="zem_slink" title="Database transaction" rel="wikipedia" href="http://en.wikipedia.org/wiki/Database_transaction">transactions</a></p>
<p>2. Places a mark in the <a class="zem_slink" title="Transaction log" rel="wikipedia" href="http://en.wikipedia.org/wiki/Transaction_log">transaction log</a></p>
<p>3. Releases the database lock</p>
<p>4. Extracts all pages in the data fi les and writes them to the backup device</p>
<p>5. Locks the database, blocking all transactions</p>
<p>6. Places a mark in the transaction log</p>
<p>7. Releases the database lock</p>
<p>8. Extracts the portion of the log between the marks and appends it to the backup</p>
<p>The only operations that are not allowed during a full backup are</p>
<ul>
<li>Adding or removing a database file</li>
<li>Shrinking a database</li>
</ul>
<p>The only two parameters required for a backup are the name of the database and the</p>
<p>backup device. When you specify a disk backup device, a directory and a fi le name can</p>
<p>be specifi ed. If a directory is not specifi ed, SQL Server performs a backup to disk and writes</p>
<p>the file to the default backup directory configured for the instance. Although most backups</p>
<p>are written to a single disk file or a single tape device, you can specify up to <strong>64 backup</strong></p>
<p><strong>devices</strong>. When you specify more than one backup device, SQL Server stripes the backup</p>
<p>across each of the devices specified.</p>
<h6 class="zemanta-related-title" style="font-size:1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://mohibalvi.wordpress.com/2009/08/04/sql-server-2008-backup/">SQL Server 2008 Backup</a> (mohibalvi.wordpress.com)</li>
<li class="zemanta-article-ul-li"><a href="http://msdn.microsoft.com/en-us/evalcenter/ee315247.aspx">Get the SQL Server 2008 R2 August Community Technology Preview</a> (msdn.microsoft.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top:10px;height:15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border:medium none;float:right;" src="http://img.zemanta.com/zemified_c.png?x-id=6a62f050-f760-4342-8dee-79b704718fda" alt="Enhanced by Zemanta" /></a></div>
<br />Posted in SQL Server, Uncategorized Tagged: Backup, Database, FAQs  Help  and Tutorials, Microsoft, Microsoft SQL Server, SQL Server, SQL Server 2008, Transaction log <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohibalvi.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohibalvi.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohibalvi.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohibalvi.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mohibalvi.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mohibalvi.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mohibalvi.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mohibalvi.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohibalvi.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohibalvi.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohibalvi.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohibalvi.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohibalvi.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohibalvi.wordpress.com/234/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=234&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mohibalvi.wordpress.com/2009/08/04/sql-server-2008-backup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef5ff240dbc6a355cf764b046b1d4954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mohibalvi</media:title>
		</media:content>

		<media:content url="http://img.zemanta.com/zemified_c.png?x-id=6a62f050-f760-4342-8dee-79b704718fda" medium="image">
			<media:title type="html">Enhanced by Zemanta</media:title>
		</media:content>
	</item>
		<item>
		<title>How to debug a Shell Script on Unix or Lunix</title>
		<link>http://mohibalvi.wordpress.com/2009/07/03/debug-shell-script/</link>
		<comments>http://mohibalvi.wordpress.com/2009/07/03/debug-shell-script/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 08:07:38 +0000</pubDate>
		<dc:creator>mohibalvi</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[korn shell]]></category>
		<category><![CDATA[bash shell]]></category>
		<category><![CDATA[debugging shell script]]></category>
		<category><![CDATA[debug]]></category>

		<guid isPermaLink="false">http://mohibalvi.wordpress.com/2009/07/03/debug-shell-script/</guid>
		<description><![CDATA[How to debug a Shell Script Use -x option to debug a shell script Run a shell script with -x option. This is valid for bash shell scripts as well. $ ksh -x tesh.sh$ ksh -v test.sh Use of set builtin command korn shell offers debugging options which can be turn on or off using [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=229&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1 style="color:rgb(0,51,0);" class="entry-title">How to debug a Shell Script </h1>
<p>Use -x option to debug a shell script
<p>Run a shell script with -x option. This is valid for bash shell scripts as well.</p>
<p><strong></strong></p>
<p><strong>$ ksh -x tesh.sh<br />$ ksh -v test.sh<br /></strong></p>
<h2 style="color:rgb(102,0,0);">Use of set builtin command</h2>
<p>
<p>korn shell offers debugging options which can be turn on or off using set command.</p>
<p>=&gt; <strong>set -x</strong>  : Display commands and their arguments as they are executed.</p>
<p>=&gt; <strong>set -v</strong>  : Display shell input lines as they are read.</p>
<p>
<p>You can use above two command in shell script itself:</p>
<p>
<blockquote>
<pre>&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;#!/bin/ksh&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;clear&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;# turn on debug mode&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;set -x&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;for f in *&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;do&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;   file $f&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;done&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;# turn OFF debug mode&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;set +x&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;ls&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;# more commands&lt;/span&gt;
</pre>
</blockquote>
<p>
<p>You can replace standard</p>
<blockquote><p><code style="color:rgb(0,0,153);">#!/bin/ksh</code><br style="color:rgb(0,0,153);" /></p></blockquote>
<p><span style="color:rgb(0,0,153);"><br /></span>with (for debugging)</p>
<blockquote><p><code style="color:rgb(0,0,153);font-weight:bold;">#!/bin/ksh -xv</code></p></blockquote>
<p>
<h2 style="color:rgb(102,0,0);">Use of intelligent DEBUG function</h2>
<p>
<p>Add special variable _DEBUG. Set to `on&#8217; when you need to debug a script:</p>
<p><code></code></p>
<blockquote><p style="color:rgb(0,0,153);font-weight:bold;"><code>_DEBUG="on"</code></p>
</blockquote>
<p>
<p>Put the following function at the beginning of the script:</p>
<p>
<blockquote>
<blockquote>
<pre>function DEBUG()&lt;br /&gt;{&lt;br /&gt; [ "$_DEBUG" == "on" ] &amp;&amp;  $@ || :&lt;br /&gt;}</pre>
</blockquote>
</blockquote>
<p>
<p>Now wherever you need debugging simply use DEBUG function</p>
<p><code></code></p>
<blockquote><blockquote>
<p><code style="font-weight:bold;">DEBUG echo "File is $filename"</code><br style="font-weight:bold;" /><span style="font-weight:bold;"><br /></span></p>
</blockquote>
<p style="color:rgb(0,0,153);">OR</p>
<p><code></code></p>
<blockquote><p style="font-family:arial;font-weight:bold;"><code>DEBUG set -x</p>
<p>Cmd1</p>
<p>Cmd2</p>
<p>DEBUG set +x</p>
<p></code></p>
</blockquote>
</blockquote>
<p>
<p>When debugging done and before moving  a script to production set _DEBUG to off</p>
<p>No need to delete debug lines.</p>
<blockquote><blockquote>
<p style="font-family:arial;"><code>_DEBUG="off" # set to anything but not to 'on'</code></p>
</blockquote>
</blockquote>
<p>
<p>Sample script:</p>
<p>
<blockquote>
<blockquote>
<pre style="font-weight:bold;">&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;#!/bin/bash&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;_DEBUG="on"&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;function DEBUG()&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;{&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt; [ "$_DEBUG" == "on" ] &amp;&amp;  $@ || :&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;}&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;DEBUG echo 'Reading files'&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;for i in *&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;do&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;  grep 'something' $i &gt; /dev/null&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;  [ $? -eq 0 ] &amp;&amp; echo "Found in $i file" || :&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;done&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;DEBUG set -x&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;a=2&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;b=3&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;c=$(( $a + $b ))&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;DEBUG set +x&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;echo "$a + $b = $c"&lt;/span&gt;&lt;br /&gt;</pre>
</blockquote>
</blockquote>
<p>
<p>Save and run the script:</p>
<p><code></code></p>
<blockquote><p><code style="color:rgb(0,0,153);">$ ./script.sh</code></p>
</blockquote>
<p style="font-weight:bold;">Output:</p>
<p>
<blockquote>
<blockquote>
<pre style="font-weight:bold;">&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;Reading files&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;Found in xyz.txt file&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;+ a=2&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;+ b=3&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;+ c=5&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;+ DEBUG set +x&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;+ '[' on == on ']'&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;+ set +x&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153); font-weight: bold;" /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;2 + 3 = 5&lt;/span&gt;&lt;br /&gt;</pre>
</blockquote>
</blockquote>
<p>
<p>Now set DEBUG to off</p>
<blockquote><blockquote><code style="color:rgb(0,0,153);font-weight:bold;">_DEBUG="off"</code><br style="font-weight:bold;" /></p></blockquote>
</blockquote>
<p></p>
<p>Run script:</p>
<blockquote><p><code style="font-weight:bold;color:rgb(0,0,153);">$ ./script.sh</code></p></blockquote>
<p>Output:</p>
<p>
<blockquote>
<blockquote>
<pre>&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;Found in xyz.txt file&lt;/span&gt;&lt;br style="font-weight: bold; color: rgb(0, 0, 153);" /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;2 + 3 = 5&lt;/span&gt;&lt;br /&gt;</pre>
</blockquote>
</blockquote>
<p>
<p>You can also try to use DEBUG as an alias instead of function. </p>
<p style="font-weight:bold;text-decoration:underline;"></p>
<p><big><big>Links</big></big></p>
<p><a href="http://docstore.mik.ua/orelly/unix/ksh/ch09_02.htm">Korn Shell Debugger by OReilly</a></p>
<p><a href="http://bashdb.sourceforge.net/">Bash Debugger Project</a></p>
<p class="scribefire-powered">Powered by <a href="http://www.scribefire.com/">ScribeFire</a>.</p>
<br />Posted in Uncategorized Tagged: bash shell, debug, debugging shell script, korn shell <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohibalvi.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohibalvi.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohibalvi.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohibalvi.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mohibalvi.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mohibalvi.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mohibalvi.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mohibalvi.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohibalvi.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohibalvi.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohibalvi.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohibalvi.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohibalvi.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohibalvi.wordpress.com/229/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=229&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mohibalvi.wordpress.com/2009/07/03/debug-shell-script/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef5ff240dbc6a355cf764b046b1d4954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mohibalvi</media:title>
		</media:content>
	</item>
		<item>
		<title>Join Types NL,Hash and Sort-Merge</title>
		<link>http://mohibalvi.wordpress.com/2009/06/28/join-types-nlhash-and-sort-merge/</link>
		<comments>http://mohibalvi.wordpress.com/2009/06/28/join-types-nlhash-and-sort-merge/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 02:13:50 +0000</pubDate>
		<dc:creator>mohibalvi</dc:creator>
				<category><![CDATA[SQL Joins]]></category>
		<category><![CDATA[Cache]]></category>
		<category><![CDATA[Hash function]]></category>
		<category><![CDATA[hash semi join]]></category>
		<category><![CDATA[Hash table]]></category>
		<category><![CDATA[hash-join]]></category>
		<category><![CDATA[Join]]></category>
		<category><![CDATA[nested loop]]></category>
		<category><![CDATA[optimizer]]></category>
		<category><![CDATA[Order by]]></category>
		<category><![CDATA[sort-merge]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://mohibalvi.wordpress.com/?p=210</guid>
		<description><![CDATA[Click the following link of Sachin for Join Types Nested Loops, Hash and Sort Merge Join Types by Sachin Previously, i copied most of the important points from his post for my own request but now deleting as the author does not like it. Related articles by Zemanta Optimization of Joins Posted in SQL Joins [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=210&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Click the following link of Sachin for Join Types Nested Loops, Hash and Sort Merge</p>
<p><a title="Join Types by Sachin" href="http://oracle-online-help.blogspot.com/2007/03/nested-loops-hash-join-and-sort-merge.html">Join Types by Sachin</a></p>
<p>Previously, i copied most of the important points from his post for my own request but now deleting as the author does not like it.</p>
<p><strong>Related articles by Zemanta</strong></p>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://www-camden.rutgers.edu/HELP/Documentation/Oracle/server.815/a67781/c20c_joi.htm"> Optimization of Joins<br />
</a></li>
</ul>
<div class="zemanta-pixie" style="margin-top:10px;height:15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/e3470395-edb6-4da2-9696-b0bcc7a69b99/"><img class="zemanta-pixie-img" style="border:medium none;float:right;" src="http://img.zemanta.com/reblog_b.png?x-id=e3470395-edb6-4da2-9696-b0bcc7a69b99" alt="Reblog this post [with Zemanta]" /></a></div>
<br />Posted in SQL Joins Tagged: Cache, Hash function, hash semi join, Hash table, hash-join, Join, nested loop, optimizer, Order by, sort-merge, sql <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohibalvi.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohibalvi.wordpress.com/210/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohibalvi.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohibalvi.wordpress.com/210/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mohibalvi.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mohibalvi.wordpress.com/210/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mohibalvi.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mohibalvi.wordpress.com/210/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohibalvi.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohibalvi.wordpress.com/210/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohibalvi.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohibalvi.wordpress.com/210/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohibalvi.wordpress.com/210/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohibalvi.wordpress.com/210/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=210&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mohibalvi.wordpress.com/2009/06/28/join-types-nlhash-and-sort-merge/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef5ff240dbc6a355cf764b046b1d4954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mohibalvi</media:title>
		</media:content>

		<media:content url="http://img.zemanta.com/reblog_b.png?x-id=e3470395-edb6-4da2-9696-b0bcc7a69b99" medium="image">
			<media:title type="html">Reblog this post [with Zemanta]</media:title>
		</media:content>
	</item>
		<item>
		<title>Optimize Joins and Query Plan Changes</title>
		<link>http://mohibalvi.wordpress.com/2009/06/25/optimize-joins-and-query-plan-changes/</link>
		<comments>http://mohibalvi.wordpress.com/2009/06/25/optimize-joins-and-query-plan-changes/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 10:03:45 +0000</pubDate>
		<dc:creator>mohibalvi</dc:creator>
				<category><![CDATA[Performance Tuning]]></category>
		<category><![CDATA[SQL Optimization]]></category>
		<category><![CDATA[STATISTICS]]></category>
		<category><![CDATA[autotrace]]></category>
		<category><![CDATA[cardinalities]]></category>
		<category><![CDATA[cbo]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[explain plan]]></category>
		<category><![CDATA[hash semi join]]></category>
		<category><![CDATA[histograms]]></category>
		<category><![CDATA[index probe]]></category>
		<category><![CDATA[index range scan]]></category>
		<category><![CDATA[Join]]></category>
		<category><![CDATA[nested loops]]></category>
		<category><![CDATA[Oracle Database]]></category>
		<category><![CDATA[Order by]]></category>
		<category><![CDATA[predicate]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[query joins]]></category>
		<category><![CDATA[rbo]]></category>
		<category><![CDATA[Select]]></category>
		<category><![CDATA[semi joins]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://mohibalvi.wordpress.com/?p=204</guid>
		<description><![CDATA[Joins and Query Plans Details of the article can be viewed at ask Tom Below are two queries posted by a user on askTom site. &#60;/pre&#62;1) SELECT distinct D.deptno, D.dname FROM dept D, emp E WHERE E.deptno = D.deptno ORDER BY D.deptno; 2) SELECT D.deptno, D.dname FROM dept D WHERE EXISTS ( SELECT 1 FROM [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=204&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><big><big><span style="font-weight:bold;">Joins and Query Plans </span><br style="font-weight:bold;" /></big></big><span> </span><br />
Details of the article can be viewed at <a href="http://www.oracle.com/technology/oramag/oracle/06-may/o36asktom.html">ask Tom</a><br />
<span style="font-family:monospace;">Below are two queries posted by a user on askTom site.<br />
</span></p>
<pre>&lt;/pre&gt;1) SELECT distinct D.deptno, D.dname
    FROM dept D, emp E
        WHERE E.deptno = D.deptno
        ORDER BY D.deptno;

2) SELECT D.deptno, D.dname
    FROM dept D
        WHERE EXISTS
                 (
                 SELECT 1
                 FROM emp E
                 WHERE E.deptno = D.deptno
                 )
        ORDER BY D.deptno;

&lt;span style="color: rgb(0, 0, 0); font-family: verdana;"&gt;&lt;span&gt;In general, you should phrase the queries in the manner  that says it best. If one set of joins were particularly efficient to use in all  cases, Oracle would not have implemented the rest of them! &lt;/span&gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 0); font-family: verdana;" /&gt;&lt;br style="color: rgb(0, 0, 0); font-family: verdana;" /&gt;&lt;span style="color: rgb(0, 0, 0); font-family: verdana;"&gt;&lt;span&gt;In general, you use a join when you need data from more  than one table in the ultimate SELECT list. Here you need data only from DEPT,  so it is unlikely that you would consider a join. You would instead consider  using either WHERE EXISTS or WHERE IN. (The cost-based optimizer [CBO] sees them  as more or less equivalent—you might, too.)&lt;/span&gt;&lt;/span&gt;&lt;br style="color: rgb(0, 0, 0); font-family: verdana;" /&gt;
&lt;span&gt;I would write the query as either&lt;/span&gt;

&lt;pre&gt;select deptno, dname
  from dept
 where exists
   ( select NULL
       from emp
      where emp.deptno
         = dept.deptno )
 order by deptno;</pre>
<p><span>or</span></p>
<pre>select deptno, dname&lt;br /&gt;  from dept&lt;br /&gt; where deptno in &lt;br /&gt;( select deptno &lt;br /&gt;    from emp )&lt;br /&gt; order by deptno;</pre>
<p><span>In both cases, the optimizer would employ either a semi join, which you cannot specify but the optimizer may perform (it stops joining after the first hit), or an index probe using NESTED LOOPS into EMP to test for row existence.</span></p>
<p><span>This example demonstrates, in general, what happens. When the optimizer detects that DEPT is small and EMP is large, it index-probes the large EMP table for each row in DEPT. On the other hand, if it deems DEPT to be large, the optimizer will do a pure semi join in bulk, with no indexes. I&#8217;m using a copy of the EMP and DEPT tables for the test:</span></p>
<pre>SQL&gt; create table emp as&lt;br /&gt;  2  select * from scott.emp;&lt;br /&gt;Table created.&lt;br /&gt;&lt;br /&gt;SQL&gt; create table dept as&lt;br /&gt;  2  select * from scott.dept;&lt;br /&gt;Table created.&lt;br /&gt;&lt;br /&gt;SQL&gt; create index emp_deptno_idx&lt;br /&gt;  2  on emp(deptno);&lt;br /&gt;Index created.</pre>
<p><span>Then I set the first representative statistics. I use SET_TABLE_STATS to make EMP appear large, with 1,000,000 rows, and DEPT appear small, with only 100 rows. Additionally, I tell the optimizer about the index I envision having on EMP(DEPTNO). Because Oracle Database 10<em>g</em> Release 2 computes statistics on an index creation by default, I start by removing any existing statistics on this index and putting in place statistics that might be more representative:</span></p>
<pre> &lt;br /&gt;SQL&gt; begin&lt;br /&gt;  2   dbms_stats.set_table_stats&lt;br /&gt;  3   ( user,&lt;br /&gt;  4    'EMP',&lt;br /&gt;  5    numrows =&gt; 1000000,&lt;br /&gt;  6    numblks =&gt; 100000 );&lt;br /&gt;  7   dbms_stats.delete_index_stats&lt;br /&gt;  8   ( user,&lt;br /&gt;  9    'EMP_DEPTNO_IDX' );&lt;br /&gt; 10   dbms_stats.set_index_stats&lt;br /&gt; 11   ( user,&lt;br /&gt; 12    'EMP_DEPTNO_IDX',&lt;br /&gt; 13     numrows =&gt; 1000000,&lt;br /&gt; 14     numdist =&gt; 10000,&lt;br /&gt; 15     numlblks =&gt;10000 );&lt;br /&gt; 16   dbms_stats.set_column_stats&lt;br /&gt; 17   ( user,&lt;br /&gt; 18    'EMP',&lt;br /&gt; 19    'DEPTNO',&lt;br /&gt; 20     DISTCNT =&gt; 10000 );&lt;br /&gt; 21   dbms_stats.set_table_stats&lt;br /&gt; 22   ( user,&lt;br /&gt; 23    'DEPT',&lt;br /&gt; 24     numrows=&gt; 100,&lt;br /&gt; 25     numblks =&gt; 100 );&lt;br /&gt; 26  end;&lt;br /&gt; 27  /</pre>
<p><span>When using the CBO with a large EMP and a small DEPT, Oracle Database might use a plan such as the one in Listing 1. The optimizer opts to read every row in DEPT and then performs an index range scan—the index probe into the EMP table—to see if the row exists in the other table. Because I have relatively few index probes to perform (about 100 is what the optimizer thinks) and because the EMP table is large, the optimizer uses this plan in both the WHERE IN and WHERE EXISTS cases.</span></p>
<p><span>Code Listing 1:</span><span> CBO plan  with large EMP and small DEPT</span></p>
<pre>SQL&gt; set autotrace traceonly explain&lt;br /&gt;SQL&gt; select deptno, dname&lt;br /&gt;  2    from dept where deptno  in&lt;br /&gt;  3    ( select deptno&lt;br /&gt;  4        from emp )&lt;br /&gt;  5   order by deptno;&lt;br /&gt;&lt;br /&gt;Execution Plan&lt;br /&gt;-----------------------------------------------------------&lt;br /&gt;Plan hash value: 3383088615&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------&lt;br /&gt;|  Id |	Operation	| Name	        |   Rows | Bytes  |&lt;br /&gt;-----------------------------------------------------------&lt;br /&gt;|   0 |SELECT STATEMENT	|		|   100	 |  3500  |&lt;br /&gt;|   1 |SORT ORDER BY	|		|   100	 |  3500  |&lt;br /&gt;|   2 |NESTED LOOPS SEMI|		|   100	 |  3500  | &lt;br /&gt;|   3 |TABLE ACCESS FULL| DEPT	        |   100	 |  2200  | &lt;br /&gt;|*  4 |INDEX RANGE SCAN	| EMP_DEPTNO_IDX|  1000K |    12M |&lt;br /&gt;-----------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Predicate Information (identified by operation id):&lt;br /&gt;-----------------------------------------------------------&lt;br /&gt;&lt;br /&gt;   4 - access("DEPTNO"="DEPTNO")&lt;br /&gt;&lt;br /&gt;SQL&gt; select deptno, dname&lt;br /&gt;  2    from dept where exists&lt;br /&gt;  3    ( select null&lt;br /&gt;  4        from emp&lt;br /&gt;  5       where emp.deptno =&lt;br /&gt;  6            dept.deptno )&lt;br /&gt;  7   order by deptno;&lt;br /&gt;&lt;br /&gt;Execution Plan&lt;br /&gt;------------------------------------------------------------&lt;br /&gt;Plan hash value: 3383088615&lt;br /&gt;&lt;br /&gt;------------------------------------------------------------&lt;br /&gt;|  Id |	Operation	 | Name	         |   Rows | Bytes  |&lt;br /&gt;------------------------------------------------------------&lt;br /&gt;|   0 |	SELECT STATEMENT |	         |   100  |  3500  |&lt;br /&gt;|   1 | SORT ORDER BY	 |		 |   100  |  3500  |&lt;br /&gt;|   2 | NESTED LOOPS SEMI|		 |   100  |  3500  |&lt;br /&gt;|   3 | TABLE ACCESS FULL| DEPT	         |   100  |  2200  |&lt;br /&gt;|*  4 | INDEX RANGE SCAN | EMP_DEPTNO_IDX|  1000K |    12M |&lt;br /&gt;------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Predicate Information (identified by operation id):&lt;br /&gt;------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;   4 - access("EMP"."DEPTNO"="DEPT"."DEPTNO")</pre>
<p><span>Compare that with the RBO plan, shown in Listing 2. When using the RBO, the developer must ask, &#8220;What size will EMP and DEPT be?&#8221; and, depending on the answer, choose either WHERE IN or WHERE EXISTS to get an &#8220;optimal&#8221; plan. The RBO comes up with two different plans based solely on how the question was asked, not on how large the amount of data was. This is one of the major advantages of the CBO over the RBO: Developers don&#8217;t have to know how to write the best query in all cases—which is not to say that they don&#8217;t need to learn SQL! They just do not have to figure out minutiae such as where they should use WHERE IN versus WHERE EXISTS.</span></p>
<p><span>Code Listing 2:</span><span> RBO  plan</span></p>
<pre>SQL&gt; select /*+ RULE */&lt;br /&gt;  2    deptno, dname&lt;br /&gt;  3    from dept where deptno  in&lt;br /&gt;  4    ( select deptno&lt;br /&gt;  5        from emp )&lt;br /&gt;  6   order by deptno;&lt;br /&gt;&lt;br /&gt;Execution Plan&lt;br /&gt;-------------------------------------&lt;br /&gt;Plan hash value: 1932208647&lt;br /&gt;&lt;br /&gt;-------------------------------------&lt;br /&gt;|  Id |	Operation	 | Name	    |&lt;br /&gt;-------------------------------------&lt;br /&gt;|   0 | SELECT STATEMENT |	    |&lt;br /&gt;|   1 | MERGE JOIN       |	    |&lt;br /&gt;|   2 | SORT JOIN	 |	    |&lt;br /&gt;|   3 | TABLE ACCESS FULL| DEPT     |&lt;br /&gt;|*  4 | SORT JOIN	 |	    |&lt;br /&gt;|   5 | VIEW		 | VW_NSO_1 |			&lt;br /&gt;|   6 | SORT UNIQUE	 |          |&lt;br /&gt;|   7 | TABLE ACCESS FULL| EMP	    |&lt;br /&gt;-------------------------------------&lt;br /&gt;&lt;br /&gt;Predicate Information (identified by operation id):&lt;br /&gt;-------------------------------------&lt;br /&gt;&lt;br /&gt;   4 - access("DEPTNO"="$nso_col_1")&lt;br /&gt;       filter("DEPTNO"="$nso_col_1")&lt;br /&gt;&lt;br /&gt;Note&lt;br /&gt;----------&lt;br /&gt;   - rule based optimizer used (consider using cbo)&lt;br /&gt;&lt;br /&gt;SQL&gt; select /*+ RULE */&lt;br /&gt;  2    deptno, dname&lt;br /&gt;  3    from dept where exists&lt;br /&gt;  4    ( select null&lt;br /&gt;  5        from emp&lt;br /&gt;  6       where emp.deptno =&lt;br /&gt;  7            dept.deptno )&lt;br /&gt;  8   order by deptno;&lt;br /&gt;&lt;br /&gt;Execution Plan&lt;br /&gt;----------------------------------------&lt;br /&gt;Plan hash value: 4109416194&lt;br /&gt;&lt;br /&gt;----------------------------------------&lt;br /&gt;| Id | Operation	| Name	       |&lt;br /&gt;----------------------------------------&lt;br /&gt;|  0 | SELECT STATEMENT	|	       |&lt;br /&gt;|  1 | SORT ORDER BY	|	       |&lt;br /&gt;|* 2 | FILTER		|	       |&lt;br /&gt;|  3 | TABLE ACCESS FULL| DEPT 	       |&lt;br /&gt;|* 4 | INDEX RANGE SCAN	| EMP_DEPTNO_ID|&lt;br /&gt;----------------------------------------&lt;br /&gt;&lt;br /&gt;Predicate Information (identified by operation id):&lt;br /&gt;----------------------------------------&lt;br /&gt;&lt;br /&gt;   2 - filter( EXISTS (SELECT 0 FROM "EMP" "EMP" WHERE&lt;br /&gt;                "EMP"."DEPTNO"=:B1))&lt;br /&gt;   4 - access("EMP"."DEPTNO"=:B1)</pre>
<p><span>Now, back to the CBO. As the amount of data in DEPT increases—and the optimizer decides that it will have to perform significantly more index probes into the EMP table—the query plans change. They go from using NESTED LOOPS and INDEX RANGE SCANS to more-efficient bulk operations. To see this, I tell the optimizer that DEPT is much larger now</span></p>
<pre>SQL&gt; begin&lt;br /&gt;  2     dbms_stats.set_table_stats&lt;br /&gt;  3     ( user,&lt;br /&gt;  4      'DEPT',&lt;br /&gt;  5       numrows=&gt; 100000,&lt;br /&gt;  6       numblks =&gt; 10000 );&lt;br /&gt;  7  end;&lt;br /&gt;  8  /</pre>
<p><span>and then rerun the queries and review the resulting plans, as shown in Listing 3. As you can see, the optimizer, in both cases, now chooses to perform full scans and a nice big hash semi join—a join that stops after the first match—instead of using an index probe, because it would have to use the index 100,000 times.</span></p>
<p><span>Code Listing 3:</span><span> CBO plan  with larger DEPT</span></p>
<pre>SQL&gt; set autotrace traceonly explain&lt;br /&gt;SQL&gt; select deptno, dname&lt;br /&gt;  2    from dept where deptno  in&lt;br /&gt;  3    ( select deptno&lt;br /&gt;  4        from emp )&lt;br /&gt;  5   order by deptno;&lt;br /&gt;&lt;br /&gt;Execution Plan&lt;br /&gt;-----------------------------------------------------------------&lt;br /&gt;Plan hash value: 3127359958&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------------&lt;br /&gt;| Id |	Operation	    | Name	     |	 Rows |  Bytes	|	&lt;br /&gt;-----------------------------------------------------------------&lt;br /&gt;|  0 |	SELECT STATEMENT    |		     |   100K |  3417K	|	&lt;br /&gt;|  1 |  SORT ORDER BY	    |		     |   100K |  3417K	|&lt;br /&gt;|* 2 |  HASH JOIN SEMI	    |		     |   100K |  3417K	|&lt;br /&gt;|  3 |  TABLE ACCESS FULL   | DEPT	     |   100K |  2148K	|	&lt;br /&gt;|  4 |  INDEX FAST FULL SCAN| EMP_DEPTNO_IDX |   1000K|    12M	|&lt;br /&gt;-----------------------------------------------------------------&lt;br /&gt;Predicate Information (identified by operation id):&lt;br /&gt;-----------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;   2 - access("DEPTNO"="DEPTNO")&lt;br /&gt;&lt;br /&gt;SQL&gt; select deptno, dname&lt;br /&gt;  2    from dept where exists&lt;br /&gt;  3    ( select null&lt;br /&gt;  4        from emp&lt;br /&gt;  5       where emp.deptno =&lt;br /&gt;  6            dept.deptno )&lt;br /&gt;  7   order by deptno;&lt;br /&gt;&lt;br /&gt;Execution Plan&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;Plan hash value: 3127359958&lt;br /&gt;&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;| Id |	Operation	    | Name	    |	Rows |   Bytes|	&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;|  0 |	SELECT STATEMENT    |		    |   100K |  3417K |	&lt;br /&gt;|  1 |  SORT ORDER BY	    |		    |   100K |  3417K | &lt;br /&gt;|* 2 |  HASH JOIN SEMI	    |		    |   100K |  3417K | &lt;br /&gt;|  3 |  TABLE ACCESS FULL   | DEPT	    |   100K |  2148K |	&lt;br /&gt;|  4 |  INDEX FAST FULL SCAN| EMP_DEPTNO_IDX|   1000K|    12M |	&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Predicate Information (identified by operation id):&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;   2 - access("EMP"."DEPTNO"="DEPT"."DEPTNO")</pre>
<p><span>Another important thing to note about these examples is that the RBO never performed a semi join, as the CBO did. The RBO has a very limited set of access paths and join operations available—it simply doesn&#8217;t know how to do a semi join and won&#8217;t use that join operation. Instead it performs operations such as the SORT DISTINCT it did in Listing 2, which is much less efficient than the cost-based plan in this case. Another reason to abandon the RBO in favor of the CBO!</span></p>
<p><big><big><span style="font-weight:bold;">Why Does My Plan Change? </span><br style="font-weight:bold;" /></big></big><span style="font-weight:bold;">I have noticed that gathering statistics against tables where none of the data has changed can cause the query plans against those tables to change. For example, one day I gather statistics, run some queries, and save the query plans in a report. The next day, I gather statistics (but I have not modified any of the data in any table) and I discover that the plans are different. What could cause that? The new query plans were better, but I would like to understand how this could be.</span><br style="font-weight:bold;" /><br />
<span>This change is likely due to the default value of the  METHOD_OPT parameter used with DBMS_STATS. In Oracle Database 10<em>g</em>, the METHOD_OPT parameter defaults to a SIZE AUTO. After you ran a query, the database remembered the predicates and updated a dictionary table, SYS.COL_USAGE$. Then, the next time you ran DBMS_STATS to gather statistics on these tables, DBMS_STATS queried that table to find out what columns should have <a href="http://en.wikipedia.org/wiki/Oracle_histograms">histograms</a> collected automatically, based on past query workload. It looked at your predicates and said, &#8220;Hmm, these columns are candidates for <a href="http://en.wikipedia.org/wiki/Oracle_histograms">histograms</a> based on the queries the end users have been running.&#8221;</span></p>
<p><span>You can see this easily with a relatively small example. I start out by creating a small table with some skewed data in a column named ID and gathering the default set of statistics on it. The data in the ID column is such that for the values 0 through 4, about 20 percent of the table will be retrieved, but for the value 99, only a single row will be returned. I&#8217;m using this exaggerated example just to see the plans change:</span></p>
<pre>SQL&gt; create table t&lt;br /&gt;  2  as&lt;br /&gt;  3  select mod(rownum,5) id, a.*&lt;br /&gt;  4    from all_objects a;&lt;br /&gt;Table created.&lt;br /&gt;SQL&gt; update t&lt;br /&gt;  2     set id = 99&lt;br /&gt;  3   where rownum = 1;&lt;br /&gt;1 row updated.&lt;br /&gt;&lt;br /&gt;SQL&gt; create index t_idx on t(id);&lt;br /&gt;Index created.&lt;br /&gt;&lt;br /&gt;SQL&gt; begin&lt;br /&gt;  2   dbms_stats.gather_table_stats&lt;br /&gt;  3   ( user, 'T' );&lt;br /&gt;  4  end;&lt;br /&gt;  5  /&lt;br /&gt;&lt;br /&gt;SQL&gt; select column_name, count(*)&lt;br /&gt;  2    from user_tab_histograms&lt;br /&gt;  3   where table_name = 'T'&lt;br /&gt;  4     and column_name = 'ID'&lt;br /&gt;  5   group by column_name;&lt;br /&gt;&lt;br /&gt;COLUMN_NAME   COUNT(*)&lt;br /&gt;-----------   ------------&lt;br /&gt;ID                  2</pre>
<p><span>So, right now, the ID column doesn&#8217;t have complete histograms, by default—just two buckets, as shown by the query against USER_TAB_HISTOGRAMS. To understand the skewed nature of the data, I need a <a href="http://en.wikipedia.org/wiki/Oracle_histograms">histogram</a> with more than just two buckets; the two entries in USER_TAB_HISTOGRAMS tell the optimizer only the high and low values right now. </span></p>
<p><span>The optimizer knows the high value (99), the low value (0), the number of distinct values (6 in this case), and the number of rows in my table T (50,119 when I tested). Given those facts, the optimizer will believe that WHERE ID = will return about 50,119/6, or 8,353 rows. Sure enough, when I query with ID=1 or ID=99, I observe the results in Listing 4. </span></p>
<p><span>Code Listing 4:</span><span> CBO  plans when ID=1 and ID=99</span></p>
<pre>SQL&gt; set autotrace traceonly explain&lt;br /&gt;SQL&gt; select *&lt;br /&gt;  2    from t&lt;br /&gt;  3   where id = 1;&lt;br /&gt;&lt;br /&gt;----------------------------------------------------------------------------&lt;br /&gt;|  Id |	Operation	 | Name	|  Rows	|  Bytes|   Cost (%CPU)	|  Time	   |&lt;br /&gt;----------------------------------------------------------------------------&lt;br /&gt;|   0 |	SELECT STATEMENT |	|  8353	|   783K|   163	(2)	| 00:00:02 |&lt;br /&gt;|*  1 | TABLE ACCESS FULL| T	|  8353	|   783K|   163	(2)	| 00:00:02 |&lt;br /&gt;----------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;SQL&gt; select *&lt;br /&gt;  2    from t&lt;br /&gt;  3   where id = 99;&lt;br /&gt;&lt;br /&gt;Execution Plan&lt;br /&gt;----------------------------------------------------------------------------&lt;br /&gt;Plan hash value: 1601196873&lt;br /&gt;&lt;br /&gt;----------------------------------------------------------------------------&lt;br /&gt;|  Id |	Operation	 | Name	|   Rows |  Bytes|  Cost (%CPU)	| Time	   |&lt;br /&gt;----------------------------------------------------------------------------&lt;br /&gt;|   0 |	SELECT STATEMENT |	|   8353 |   783K|   163 (2)	| 00:00:02 |&lt;br /&gt;|*  1 | TABLE ACCESS FULL| T	|   8353 |   783K|   163 (2)	| 00:00:02 |&lt;br /&gt;----------------------------------------------------------------------------</pre>
<p><span>Now, I immediately gather statistics, using the same  command as before:</span></p>
<pre>SQL&gt; begin&lt;br /&gt;  2   dbms_stats.gather_table_stats&lt;br /&gt;  3   ( user, 'T' );&lt;br /&gt;  4  end;&lt;br /&gt;  5  /&lt;br /&gt;SQL&gt; select column_name, count(*)&lt;br /&gt;  2    from user_tab_histograms&lt;br /&gt;  3   where table_name = 'T'&lt;br /&gt;  4     and column_name = 'ID'&lt;br /&gt;  5   group by column_name;&lt;br /&gt;&lt;br /&gt;COLUMN_NAME   COUNT(*)&lt;br /&gt;------------  -----------&lt;br /&gt;ID                  5</pre>
<p><span>Note, however, that I have more than two buckets for my  <a href="http://en.wikipedia.org/wiki/Oracle_histograms">histograms</a>. DBMS_STATS, using the AUTO setting, gathered more information here. If I were to query the SYS.COL_USAGE$ table right now, I would discover that a new row was added, indicating that I have some queries in my system that use equality predicates against this particular database column. That is the &#8220;magic&#8221; that caused DBMS_STATS to change how it gathered statistics and caused a dramatic change in my resulting query plans, as shown in Listing 5. </span></p>
<p><span>Code Listing 5:</span><span> New CBO  plans when ID=1 and ID=99</span></p>
<pre>  2    from t&lt;br /&gt;  3   where id = 1;&lt;br /&gt;&lt;br /&gt;Execution Plan&lt;br /&gt;----------------------------------------------------------------------------&lt;br /&gt;Plan hash value: 1601196873&lt;br /&gt;&lt;br /&gt;----------------------------------------------------------------------------&lt;br /&gt;| Id |	Operation	 | Name	|  Rows	|  Bytes|  Cost (%CPU)	| Time	   |&lt;br /&gt;----------------------------------------------------------------------------&lt;br /&gt;|  0 |	SELECT STATEMENT |	|  10260|   961K|   164	(2)	| 00:00:02 |&lt;br /&gt;|* 1 |  TABLE ACCESS FULL| T	|  10260|   961K|   164	(2)	| 00:00:02 |&lt;br /&gt;----------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;SQL&gt; select *&lt;br /&gt;  2    from t&lt;br /&gt;  3   where id = 99;&lt;br /&gt;&lt;br /&gt;Execution Plan&lt;br /&gt;----------------------------------------------------------------------------------------&lt;br /&gt;Plan hash value: 470836197&lt;br /&gt;&lt;br /&gt;----------------------------------------------------------------------------------------&lt;br /&gt;| Id |  Operation	           | Name    | Rows |  Bytes|  Cost (%CPU)  |  Time    |&lt;br /&gt;----------------------------------------------------------------------------------------&lt;br /&gt;|  0 |  SELECT STATEMENT	   |	     | 1    |    96	|   2	(0) | 00:00:01 |&lt;br /&gt;|  1 |  TABLE ACCESS BY INDEX ROWID|	T    | 1    |    96	|   2	(0) | 00:00:01 |&lt;br /&gt;|* 2 |  INDEX RANGE SCAN	   |	T_IDX| 1    |   	|   1	(0) | 00:00:01 |&lt;br /&gt;----------------------------------------------------------------------------------------</pre>
<p><span>Note how the <a href="http://www.orafaq.com/wiki/Cardinality">cardinalities </a>are very different—8,353 changed to either 10,260 or 1. The resulting change in estimated cardinality led to a change in the overall cost of the first query plan and resulted in an entirely different (but better) query plan in the second case.</span></p>
<p><span>This is a significant fact for a DBA to be aware of. As the queries submitted by your end users change over time, the AUTO feature of statistics gathering could change what statistics are gathered over time as well. Unless you understand this feature, enabled by default in Oracle Database 10<em>g</em>, it can look as if inexplicable magic is happening in your  database.</span></p>
<div>Related articles by Zemanta:</p>
<ul>
<li><a href="http://www.adp-gmbh.ch/ora/sql/join/join_methods.html"> Join Methods in Oracle</a></li>
<li><a href="http://download.oracle.com/docs/cd/B10501_01/server.920/a96533/optimops.htm#39473"><span style="text-decoration:underline;">Introduction to the Optimizer</span></a></li>
</ul>
</div>
<p>Powered by <a href="http://www.scribefire.com/">ScribeFire</a>.</p>
<div style="margin-top:10px;height:15px;"><a title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/d8a89442-6cbb-4dc0-b132-f9a1359f2e56/"><img style="border:medium none;float:right;" src="http://img.zemanta.com/reblog_b.png?x-id=d8a89442-6cbb-4dc0-b132-f9a1359f2e56" alt="Reblog this post [with Zemanta]" /></a></div>
<br />Posted in Performance Tuning, SQL Optimization, STATISTICS Tagged: autotrace, cardinalities, cbo, Database, explain plan, hash semi join, histograms, index probe, index range scan, Join, nested loops, Oracle Database, Order by, predicate, Programming, query joins, rbo, Select, semi joins, sql <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohibalvi.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohibalvi.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohibalvi.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohibalvi.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mohibalvi.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mohibalvi.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mohibalvi.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mohibalvi.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohibalvi.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohibalvi.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohibalvi.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohibalvi.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohibalvi.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohibalvi.wordpress.com/204/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=204&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mohibalvi.wordpress.com/2009/06/25/optimize-joins-and-query-plan-changes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef5ff240dbc6a355cf764b046b1d4954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mohibalvi</media:title>
		</media:content>

		<media:content url="http://img.zemanta.com/reblog_b.png?x-id=d8a89442-6cbb-4dc0-b132-f9a1359f2e56" medium="image">
			<media:title type="html">Reblog this post [with Zemanta]</media:title>
		</media:content>
	</item>
		<item>
		<title>Unicode Characterset in Oracle</title>
		<link>http://mohibalvi.wordpress.com/2009/06/20/unicode-characterset-in-oracle/</link>
		<comments>http://mohibalvi.wordpress.com/2009/06/20/unicode-characterset-in-oracle/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 08:10:53 +0000</pubDate>
		<dc:creator>mohibalvi</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mohibalvi.wordpress.com/2009/06/20/unicode-characterset-in-oracle/</guid>
		<description><![CDATA[Before starting this post let&#8217;s have an idea about unicode. Unicode is a Universal encoding scheme which is designed to include far more characters than the normal character set, in fact, Unicode wants to be able to list ALL characters. So, with unicode support in oracle data from any languages can be stored and retrieved [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=202&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Before starting this post let&#8217;s have an idea about unicode. <a class="zem_slink" title="Unicode" href="http://en.wikipedia.org/wiki/Unicode" rel="wikipedia">Unicode</a> is a Universal encoding scheme which is designed to include far more characters than the normal character set, in fact, Unicode wants to be able to list ALL characters. So, with unicode support in oracle data from any languages can be stored and retrieved from oracle.     <br />Oracle supports unicode within many of the character sets starting from Oracle 7.     <br />Below is the list of character sets that is used to support unicode in oracle.     </p>
<p>&#160;</p>
<h5>Database Character Set Statement of Direction</h5>
<p>A list of character sets has been compiled in <a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14225/applocaledata.htm#CIAEICDE">Table A-4, &quot;Recommended ASCII Database Character Sets&quot;</a> and <a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14225/applocaledata.htm#CIAJAGCB">Table A-5, &quot;Recommended EBCDIC Database Character Sets&quot;</a> that Oracle Corporation strongly recommends for usage as the database character set. Other Oracle-supported character sets that do not appear on this list can continue to be used in <a class="zem_slink" title="Oracle Database" href="http://en.wikipedia.org/wiki/Oracle_Database" rel="wikipedia">Oracle Database</a> 10g Release 2, but may be desupported in a future release. Starting with the next major functional release after Oracle Database 10g Release 2, the choice for the database character set will be limited to this list of recommended character sets for new system deployment. Customers will still be able to migrate their existing databases in the next major functional release after Oracle Database 10g Release 2 even if the character set is not on the recommended list. However, Oracle suggests that customers migrate to a recommended character set as soon as possible. At the top of the list of character sets Oracle recommends for all new system deployment is the Unicode character set AL32UTF8. </p>
<p><a name="sthref145"></a></p>
<h5>Choosing Unicode as a Database Character Set</h5>
<p>Oracle Corporation recommends using Unicode for all new system deployments. Migrating legacy systems eventually to Unicode is also recommended. Deploying your systems today in Unicode offers many advantages in usability, compatibility, and extensibility. Oracle Database&#8217;s comprehensive support enables you to deploy high-performing systems faster and more easily while utilizing the advantages of Unicode. Even if you do not need to support multilingual data today or have any requirement for Unicode, it is still likely to be the best choice for a new system in the long run and will ultimately save you time and money as well as give you competitive advantages. See <a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14225/ch6unicode.htm#g1014017">Chapter 6, &quot;Supporting Multilingual Databases with Unicode&quot;</a> for more information about Unicode. </p>
<p><a name="i1007017"></a></p>
<p><a name="sthref146"></a></p>
<h5>Choosing a National Character Set</h5>
<p>A national character set <a name="sthref147"></a><a name="sthref148"></a>is an alternate character set that enables you to store Unicode character data in a database that does not have a Unicode database character set. Other reasons for choosing a national character set are: </p>
<ul>
<li>
<p>The properties of a different <a class="zem_slink" title="Character encoding" href="http://en.wikipedia.org/wiki/Character_encoding" rel="wikipedia">character encoding</a> scheme may be more desirable for extensive character processing operations.</p>
</li>
<li>
<p>Programming in the national character set is easier.</p>
</li>
</ul>
<p><a class="zem_slink" title="SQL" href="http://en.wikipedia.org/wiki/SQL" rel="wikipedia">SQL</a> <code>NCHAR</code>, <code>NVARCHAR2</code>, and <code>NCLOB</code> datatypes have been redefined to support Unicode data only. You can use either the UTF8 or the AL 16UTF16 character set. The default is AL16UTF16. </p>
<p>&#160;</p>
<h4>Character <a name="sthref1959"></a>Sets</h4>
<p><a title="http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14225/applocaledata.htm#i635016" href="http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14225/applocaledata.htm#i635016">http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14225/applocaledata.htm#i635016</a></p>
<p>Oracle-supported character sets are listed in the following sections according to three broad categories. </p>
<ul>
<li>
<p><a href="http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14225/applocaledata.htm#i635047">Recommended Database Character Sets</a></p>
</li>
<li>
<p><a href="http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14225/applocaledata.htm#i635342">Other Character Sets</a></p>
</li>
<li>
<p><a href="http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14225/applocaledata.htm#i636345">Client-Only Character Sets</a></p>
</li>
</ul>
<p>In addition, common character set subset/superset combinations are listed. Some character sets can only be used with certain <a class="zem_slink" title="Data type" href="http://en.wikipedia.org/wiki/Data_type" rel="wikipedia">data types</a>. For example, the AL16UTF16 character set can only be used as an <code>NCHAR</code> character set, and not as a database character set. </p>
<p>&#160;</p>
<p><strong>Can You use AL16UTF16 as NLS_CHARACTERSET?</strong> </p>
<p>No, AL16UTF16 can only be used as NLS_NCHAR_CHARACTERSET in 9i and above. Trying to create a database with&#160; a AL16UTF16 NLS_CHARACTERSET will fail. </p>
<p>(Source of this answer is <a href="http://repettas.wordpress.com/2008/05/16/national-character-set-in-oracle-9i-and-10g/">REPETTAS WORDPRESS BLOG</a> )</p>
<p>&#160;</p>
<p>1) AL24UTFFSS: </p>
<p>This character set was the first Unicode character set supported by Oracle. The AL24UTFFSS encoding scheme was based on the Unicode 1.1 standard, which is now obsolete. This unicode character set was used between oracle version 7.2 to 8.1.    </p>
<p>&#160;</p>
<p>2) <a title="UTF-8" href="http://en.wikipedia.org/wiki/UTF-8">UTF-8</a>:</p>
<p>UTF8 was the <a class="zem_slink" title="UTF-8" href="http://en.wikipedia.org/wiki/UTF-8" rel="wikipedia">UTF-8</a> encoded character set in Oracle8 and 8i. It followed the     <br />Unicode 2.1 standard between Oracle 8.0 and 8.1.6, and was upgraded to Unicode     <br />version 3.0 for oracle versions 8.1.7, 9i, 10g and 11g. If supplementary characters are inserted into in a UTF8 database encoded with Unicode version 3.0, then the actual data will be treated as 2 separate undefined characters, occupying 6 bytes in storage. So for fully support of supplementary characters use AL32UTF8 character set instead of UTF8.     </p>
<p>3) UTFE: </p>
<p>UTFE has the same properties as UTF8 on ASCII based platforms. As of UTF8 it is used in different oracle versions.    </p>
<p>&#160;</p>
<p>4) AL32UTF8: </p>
<p>This is the UTF-8 encoded character set introduced in Oracle9i.    <br />In Oracle 9.2 AL32UTF8 implemented unicode 3.1,     <br />in 10.1 it implemented the Unicode 3.2 standard,     <br />in Oracle 10.2 it supports the Unicode 4.01 standard and     <br />in Oracle 11.1 it supports the Unicode 5.0.     <br />AL32UTF8 was introduced to provide support for the newly defined supplementary characters. All supplementary characters are stored as 4 bytes in AL32UTF8. As while designed UTF-8 there was no concept of supplementary characters therefore UTF8 has a maximum of 3 bytes per character.     </p>
<p>5) AL16UTF16: This is the first UTF-16 encoded character set in Oracle. It was introduced in Oracle9i as the default national character set (NLS_NCHAR_CHARACTERSET). It also provides support for the newly defined supplementary characters. All supplementary characters are stored as 4 bytes.    <br />As with AL32UTF8, the plan is to keep enhancing AL16UTF16 as     <br />necessary to support future version of the Unicode standard.     <br />AL16UTF16 cannot be used as a database character set (NLS_CHARACTERSET), it is only used as the national character set (NLS_NCHAR_CHARACTERSET).     <br />Like, AL32UTF8 In Oracle 9.0 AL16UTF16 implemented unicode 3.0,     <br />in Oracle 9.2 it implemented unicode 3.1,     <br />in 10.1 it implemented the Unicode 3.2 standard,     <br />in Oracle 10.2 it supports the Unicode 4.01 standard and     <br />in Oracle 11.1 it supports the Unicode 5.0.</p>
</p>
</p>
</p>
</p>
</p>
</p>
</p>
</p>
</p>
</p>
</p>
<div style="margin-top:10px;height:15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/ec87cc6d-d6bb-408c-8632-e0b12a4ee304/"><img style="float:right;border-style:none;" class="zemanta-pixie-img" alt="Reblog this post [with Zemanta]" src="http://img.zemanta.com/reblog_e.png?x-id=ec87cc6d-d6bb-408c-8632-e0b12a4ee304" /></a></div>
<br />Posted in Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohibalvi.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohibalvi.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohibalvi.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohibalvi.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mohibalvi.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mohibalvi.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mohibalvi.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mohibalvi.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohibalvi.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohibalvi.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohibalvi.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohibalvi.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohibalvi.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohibalvi.wordpress.com/202/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=202&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mohibalvi.wordpress.com/2009/06/20/unicode-characterset-in-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef5ff240dbc6a355cf764b046b1d4954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mohibalvi</media:title>
		</media:content>

		<media:content url="http://img.zemanta.com/reblog_e.png?x-id=ec87cc6d-d6bb-408c-8632-e0b12a4ee304" medium="image">
			<media:title type="html">Reblog this post [with Zemanta]</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating Oracle Database for Websphere Portal</title>
		<link>http://mohibalvi.wordpress.com/2009/06/19/creating-oracle-database-for-websphere-portal/</link>
		<comments>http://mohibalvi.wordpress.com/2009/06/19/creating-oracle-database-for-websphere-portal/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 06:46:52 +0000</pubDate>
		<dc:creator>mohibalvi</dc:creator>
				<category><![CDATA[Database Creation]]></category>
		<category><![CDATA[Portals]]></category>
		<category><![CDATA[jvm]]></category>
		<category><![CDATA[oracle database creation]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[websphere portal]]></category>

		<guid isPermaLink="false">http://mohibalvi.wordpress.com/2009/06/19/creating-oracle-database-for-websphere-portal/</guid>
		<description><![CDATA[Considerations before Creating database for Websphere Portal View some important considerations before setting up Oracle databases to work with WebSphere Portal. For information about creating databases, refer to the Oracle product documentation. For information on the recommended database architecture and the databases you will need to create, see the Planning for Oracle topic. Be sure [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=198&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3><font color="#808000"><strong>Considerations before Creating database for Websphere <a class="zem_slink" title="Portal (video game)" href="http://en.wikipedia.org/wiki/Portal_%28video_game%29" rel="wikipedia">Portal</a></strong></font></h3>
<p>View some important considerations before setting up Oracle databases to work with <a class="zem_slink" title="IBM WebSphere" href="http://en.wikipedia.org/wiki/IBM_WebSphere" rel="wikipedia">WebSphere</a> Portal. </p>
<p>For information about creating databases, refer to the Oracle product documentation. For information on the recommended database architecture and the databases you will need to create, see the Planning for Oracle topic. Be sure that all databases to be used with WebSphere Portal are created as <a class="zem_slink" title="Unicode" href="http://en.wikipedia.org/wiki/Unicode" rel="wikipedia">UNICODE</a> character set databases. </p>
<p>If you are using remote Oracle databases, you must also copy the ojdbc14.jar file from the remote Oracle server to the WebSphere Portal machine. The typical location is the <var>oracle_home</var>/jdbc/lib directory. Record the copy location on your local machine for future reference. </p>
<p>When creating Oracle databases for use with WebSphere Portal, you should consider the following information: </p>
<ul>
<li>The Oracle databases must be created manually before configuring WebSphere Portal. </li>
<li>All databases must be created using UNICODE Database and National <a class="zem_slink" title="Character encoding" href="http://en.wikipedia.org/wiki/Character_encoding" rel="wikipedia">character sets</a> such as UTF8, AL32UTF8, or AL16UTF16. </li>
<li>It is recommended that all databases to be used with WebSphere Portal are configured in Dedicated Server Mode. </li>
<li>Determine if your Oracle server will be remote or local to the WebSphere Portal installation. </li>
<li>If using an earlier version of Oracle (9i), ensure that Oracle <a class="zem_slink" title="Java Virtual Machine" href="http://en.wikipedia.org/wiki/Java_Virtual_Machine" rel="wikipedia">JVM</a> is also installed. </li>
<li>After installing the <a class="zem_slink" title="Database management system" href="http://en.wikipedia.org/wiki/Database_management_system" rel="wikipedia">database software</a> for WebSphere Portal, you will need to set the buffer pools allocated to the <a class="zem_slink" title="Oracle Database" href="http://www.oracle.com/" rel="homepage">Oracle database</a> in order for WebSphere Portal to communicate with the Java Content Repository database. Use the following recommended values as a guide. Refer to <a href="http://otn.oracle.com/documentation/">Oracle product documentation</a> for information on how to set the buffer pools. Recommended initial buffer pool sizes:<br />
<blockquote>
<pre><strong><font color="#0000ff">db_block_size = 8192
db_cache_size = 300M
db_files = 1024
log_buffer = 65536
open_cursors = 1500
pga_aggregate_target = 200M
pre_page_sga = true
processes = 300
shared_pool_size = 200M</font></strong></pre>
</blockquote>
</li>
</ul>
</p>
</p>
</p>
<div style="margin-top:10px;height:15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/ec87cc6d-d6bb-408c-8632-e0b12a4ee304/"><img style="float:right;border-style:none;" class="zemanta-pixie-img" alt="Reblog this post [with Zemanta]" src="http://img.zemanta.com/reblog_e.png?x-id=ec87cc6d-d6bb-408c-8632-e0b12a4ee304" /></a></div>
<br />Posted in Database Creation, Portals Tagged: jvm, oracle database creation, unicode, websphere portal <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohibalvi.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohibalvi.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohibalvi.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohibalvi.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mohibalvi.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mohibalvi.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mohibalvi.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mohibalvi.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohibalvi.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohibalvi.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohibalvi.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohibalvi.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohibalvi.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohibalvi.wordpress.com/198/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohibalvi.wordpress.com&amp;blog=1748097&amp;post=198&amp;subd=mohibalvi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mohibalvi.wordpress.com/2009/06/19/creating-oracle-database-for-websphere-portal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ef5ff240dbc6a355cf764b046b1d4954?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mohibalvi</media:title>
		</media:content>

		<media:content url="http://img.zemanta.com/reblog_e.png?x-id=ec87cc6d-d6bb-408c-8632-e0b12a4ee304" medium="image">
			<media:title type="html">Reblog this post [with Zemanta]</media:title>
		</media:content>
	</item>
	</channel>
</rss>
