<?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/"
	>

<channel>
	<title>Techno Oracle</title>
	<atom:link href="http://www.technooracle.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.technooracle.com</link>
	<description>Oracle information centre</description>
	<lastBuildDate>Sat, 26 Mar 2011 09:53:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Partitioning in oracle</title>
		<link>http://www.technooracle.com/oracle-tutorials/partition-by-oracle/</link>
		<comments>http://www.technooracle.com/oracle-tutorials/partition-by-oracle/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 09:53:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[oracle partition]]></category>
		<category><![CDATA[oracle partitioned tables]]></category>
		<category><![CDATA[oracle table partition]]></category>
		<category><![CDATA[partition by oracle]]></category>

		<guid isPermaLink="false">http://www.technooracle.com/?p=415</guid>
		<description><![CDATA[Partitioning the Tables in Oracle database is an important aspect when it comes to Performance Management.As the number of rows in table increases,The performance impacts wil increase Backup and recovery process may take longer time than usal and sql queries that affecting entire table will take loger time. we can reduce the performance issue causing [...]]]></description>
			<content:encoded><![CDATA[<p>Partitioning the Tables in Oracle database is an important aspect when it comes to Performance Management.As the number of rows in table increases,The performance impacts wil increase<br />
Backup and recovery process may take longer time than usal and sql queries that affecting entire table will take loger time.<br />
we can reduce the performance issue causing by large tables through separating the rows of a single table into<br />
multiple parts. Dividing a table’s data in this manner is called partitioning the table.the table that is partitioned is called a partitioned table, and the parts are called partitions.<br />
By splitting a large table’s rows across multiple smaller partitions,</p>
<ul>
<li>The performance of queries against the tables may improve because Oracle may have to search only one partition (one part of the table) instead of the entire table to resolve a query.</li>
<li>The table may be easier to manage. Because the partitioned table’s data is stored in multiple parts, it may be easier to load and delete data in the partitions than in the large table.</li>
<li>Backup and recovery operations may perform better. Because the partitions are smaller than the partitioned table, you may have more options for backing up and recovering the partitions than you would have for a single large table.</li>
</ul>
<p>In Oracle we can partition a table by the following methods</p>
<h2>Range Partitioning</h2>
<p>Tables are partitioned by ranges of values.useful when dealing with data that has logical ranges  		into which it can be distributed.</p>
<p>eg:</p>
<p><strong>create table Library</strong><br />
<strong>(      Title VARCHAR2(100) primary key,</strong><br />
<strong> Publisher VARCHAR2(20),</strong><br />
<strong> CategoryName VARCHAR2(20),</strong><br />
<strong> Rating VARCHAR2(2),</strong><br />
<strong> references CATEGORY(CategoryName)</strong><br />
<strong>)</strong><br />
<strong>partition by range (CategoryName)</strong></p>
<p>table will be partitioned based on the values in the CategoryName</p>
<h2>Hash Partitioning</h2>
<p>A hash partition determines the physical placement of data by performing a hash function on the values of the partition key.In hash partitioning, consecutive values of the partition key are not generally stored in the same<br />
partition. Hash partitioning distributes a set of records over a greater set of partitions than range partitioning does, potentially decreasing the likelihood for I/O contention.</p>
<p>To create a hash partition, use the partition by hash clause in place of partition by range</p>
<p>eg:</p>
<p><strong>create table </strong><strong> Library</strong><br />
<strong>(      Title VARCHAR2(100) primary key,</strong><br />
<strong> Publisher VARCHAR2(20),</strong><br />
<strong> CategoryName VARCHAR2(20),</strong><br />
<strong> Rating VARCHAR2(2),</strong><br />
<strong> references CATEGORY(CategoryName)</strong><br />
<strong>)</strong><br />
<strong>partition by hash (CategoryName)</strong><br />
<strong>partitions 16</strong>;</p>
<p>Use hash  		partitioning if your data does not easily lend itself to range partitioning, but you would like to partition for performance and manageability reasons.</p>
<h2>List Partitioning</h2>
<p>In list partitioning, you tell Oracle all the possible values and designate the partitions into which the corresponding rows should be inserted.</p>
<p><strong>create table </strong><strong> Library</strong><br />
<strong>(      Title VARCHAR2(100) primary key,</strong><br />
<strong> Publisher VARCHAR2(20),</strong><br />
<strong> CategoryName VARCHAR2(20),</strong><br />
<strong> Rating VARCHAR2(2),</strong><br />
<strong> references CATEGORY(CategoryName)</strong><br />
<strong>)</strong><br />
<strong>partition by list (CategoryName)</strong></p>
<h2>Creating Subpartitions</h2>
<p>You can create subpartitions—that is, partitions of partitions. You can use subpartitions to combine all types of partitions: range partitions, list partitions, and hash partitions. For example, you can use hash partitions in combination with range partitions, creating hash partitions of the range<br />
partitions. For very large tables, this composite partitioning may be an effective way of separating the data into manageable and tunable divisions.</p>
<h2>Indexing Partitions</h2>
<p>When you create a partitioned table, you should create an index on the table. The index may be partitioned according to the same range values used to partition the table. In the following listing,</p>
<p>create index index_library<br />
on  library(CategoryName)<br />
local<br />
(partition PART1<br />
tablespace PART1_NDX_TS,<br />
partition PART2<br />
tablespace PART2_NDX_TS);</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technooracle.com/oracle-tutorials/partition-by-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using SQL statements in C</title>
		<link>http://www.technooracle.com/oracle-tutorials/use-sql-in-c-cplusplus/</link>
		<comments>http://www.technooracle.com/oracle-tutorials/use-sql-in-c-cplusplus/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 14:18:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Pro *C]]></category>
		<category><![CDATA[C SQL]]></category>
		<category><![CDATA[c sql connection]]></category>
		<category><![CDATA[c sql tutorial]]></category>
		<category><![CDATA[embedded sql c]]></category>

		<guid isPermaLink="false">http://www.technooracle.com/?p=413</guid>
		<description><![CDATA[The Standards for C,C++ and  SQL were designed to enable  Application portability.To achieve this portability it is necessary that both platforms must confirm to the international standards.The SQL/2 standard supports embedding sql statements in other languages.Oracle&#8217;s embedded SQL environment is called Pro*C.This Tutorial shows how to embed sql statements in C or C++. A C [...]]]></description>
			<content:encoded><![CDATA[<p>The Standards for C,C++ and  SQL were designed to enable  Application portability.To achieve this portability it is necessary that both platforms must confirm to the international standards.The SQL/2 standard supports embedding sql statements in other languages.Oracle&#8217;s embedded SQL environment is called <strong>Pro*C</strong>.This Tutorial shows how to embed sql statements in C or C++.</p>
<p>A C or C++  program that uses sql statements compiled in 3 steps</p>
<p>1.<strong>Pro*C</strong> precompiler recognizes the SQL statements in the program.</p>
<p>2.<strong>Pro*C</strong> precompiler replace the SQL statements with appropriate function call in SQL runtime library.</p>
<p>3.The compiler compiles the code as normal C or C++ code and produce the Executable.<br />
<span id="more-413"></span></p>
<h2><span style="color: #000080;">Use of C in SQL :Syntax</span></h2>
<p><strong>EXEC SQL <em>sql_statement</em>;</strong></p>
<p>All sql statements in the program should start with <strong>EXEC SQL </strong>and should ends with a ;(semi colon).</p>
<p>There is a restriction that You should declare the variables before executable statements.</p>
<h3><span style="color: #000080;"><strong>Declaring Host Variables</strong></span></h3>
<p>The C datatypes that can be used with Oracle include:</p>
<ol> char<br />
char[n]<br />
int<br />
short<br />
long<br />
float<br />
double<br />
VARCHAR[n]</ol>
<p>A host variable reference must be prefixed with a colon &#8220;:&#8221; in SQL statements, but should not be prefixed with a colon in C statements.</p>
<p>Example</p>
<p>//use of Host variables in C program<br />
int main()<br />
{<br />
int emp_no;<br />
char *emp_name;</p>
<p>EXEC SQL INSERT INTO emp(empno, ename)<br />
VALUES(:emp_no,:emp_name);<br />
}</p>
<h3><span style="color: #000080;"><strong>Declaring Pointers</strong></span></h3>
<p>int main()<br />
{<br />
int *emp_no;<br />
char *emp_name;</p>
<p>//result will be written into *emp_no<br />
EXEC SQL SELCT field_name INTO :emp_no WHERE &#8212;-</p>
<p>}</p>
<h3><span style="color: #000080;"><strong>Declaring Arrays</strong></span></h3>
<p>int emp_number[50];<br />
char name[50][11];<br />
/* &#8230; */<br />
EXEC SQL INSERT INTO emp(emp_number, name)<br />
VALUES (:emp_number, :emp_name);</p>
<h2><span style="color: #000080;">Embed C in SQL:SAMPLE PROGRAM</span></h2>
<p>/* Begin program */</p>
<p>EXEC SQL INCLUDE SQLCA;</p>
<p>EXEC SQL BEGIN DECLARE SECTION<br />
emp_name VARCHAR2(20)<br />
emp_number integer<br />
EXEC SQL END DECLARE SECTION</p>
<p>EXEC SQL WHENEVER SQLERROR STOP</p>
<p>EXEC SQL CONNECT frans</p>
<p>/* Formulate query */</p>
<p>EXEC SQL SELECT employee_name,employee_number<br />
INTO emp_name,emp_number<br />
FROM employees<br />
WHERE emp_number = 185678</p>
<p>/* Print emp_name and emp_number */</p>
<p>EXEC SQL DISCONNECT</p>
<p>/* End program */</p>
<p><strong>Program Explanation</strong></p>
<table border="1" width="100%">
<tbody>
<tr>
<td>EXEC SQL INCLUDE SQLCA</td>
<td>Incorporates SQL&#8217;s error handling mechanism (SQL Communications Area).</td>
</tr>
<tr>
<td>DECLARE SECTION</td>
<td>Host variables must be declared to SQL prior to their use in any embedded SQL statements</td>
</tr>
<tr>
<td>EXEC SQL WHENEVER SQLERROR STOP</td>
<td>An error handling mechanism must precede all executable embedded SQL statements in a program.</td>
</tr>
<tr>
<td>EXEC SQL CONNECT personnel</td>
<td>Initiates access to the data base. A CONNECT statement must precede any references to a database.</td>
</tr>
<tr>
<td>EXEC SQL SELECT</td>
<td>SQL select statement</td>
</tr>
<tr>
<td>EXEC SQL DISCONNECT</td>
<td>close connection between the program and the database.</td>
</tr>
</tbody>
</table>
<h3><span style="color: #000080;">List of Embedded SQL Statements in C</span></h3>
<table border="1" width="100%">
<tbody>
<tr>
<td colspan="2" align="CENTER"><strong>Declarative Statements</strong></td>
</tr>
<tr>
<td><tt>EXEC SQL ARRAYLEN</tt></td>
<td>To use host arrays with PL/SQL</td>
</tr>
<tr>
<td><tt>EXEC SQL BEGIN DECLARE SECTION</tt></p>
<p><tt>EXEC SQL END DECLARE SECTION</tt></td>
<td>To declare host variables</td>
</tr>
<tr>
<td><tt>EXEC SQL DECLARE</tt></td>
<td>To name Oracle objects</td>
</tr>
<tr>
<td><tt>EXEC SQL INCLUDE</tt></td>
<td>To copy in files</td>
</tr>
<tr>
<td><tt>EXEC SQL TYPE</tt></td>
<td>To equivalence datatypes</td>
</tr>
<tr>
<td><tt>EXEC SQL VAR</tt></td>
<td>To equivalence variables</td>
</tr>
<tr>
<td><tt>EXEC SQL WHENEVER</tt></td>
<td>To handle runtime errors</td>
</tr>
<tr>
<td colspan="2" align="CENTER"><strong>Executable Statements</strong></td>
</tr>
<tr>
<td><tt>EXEC SQL ALLOCATE</tt></td>
<td rowspan="14">To define and control Oracle data</td>
</tr>
<tr>
<td><tt>EXEC SQL ALTER</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL ANALYZE</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL AUDIT</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL COMMENT</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL CONNECT</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL CREATE</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL DROP</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL GRANT</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL NOAUDIT</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL RENAME</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL REVOKE</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL TRUNCATE</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL CLOSE</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL DELETE</tt></td>
<td rowspan="8">To query and manipulate Oracle data</td>
</tr>
<tr>
<td><tt>EXEC SQL EXPLAIN PLAN</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL FETCH</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL INSERT</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL LOCK TABLE</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL OPEN</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL SELECT</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL UPDATE</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL COMMIT</tt></td>
<td rowspan="4">To process transactions</td>
</tr>
<tr>
<td><tt>EXEC SQL ROLLBACK</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL SAVEPOINT</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL SET TRANSACTION</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL DESCRIBE</tt></td>
<td rowspan="3">To use dynamic SQL</td>
</tr>
<tr>
<td><tt>EXEC SQL EXECUTE</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL PREPARE</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL ALTER SESSION</tt></td>
<td rowspan="2">To control sessions</td>
</tr>
<tr>
<td><tt>EXEC SQL SET ROLE</tt></td>
</tr>
<tr>
<td><tt>EXEC SQL EXECUTE</tt></p>
<p><tt>END-EXEC</tt></td>
<td>To embed PL/SQL blocks</td>
</tr>
</tbody>
</table>
<p><strong>The following rules apply to embedded SQL statements in C:</strong></p>
<p>*  Do not split the<strong> EXEC SQL</strong> keyword pair between lines.</p>
<p>* You must use the SQL statement terminator. If you do not use it,This may cause indeterminate errors.</p>
<p>* <strong>C/C++</strong> comments can be placed before the statement initializer or after the statement terminator.<br />
* Multiple<strong> SQL</strong> statements and<strong> C/C++</strong> statements may be placed on the same line.<br />
* The <strong>SQL</strong> precompiler leaves carriage returns, line feeds, and TABs in a quoted string as is.<br />
* <strong>SQL</strong> comments are allowed on any line that is part of an embedded<strong> SQL </strong>statement. These comments are not allowed in dynamically executed statements.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technooracle.com/oracle-tutorials/use-sql-in-c-cplusplus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UTL_FILE_DIR in Oracle</title>
		<link>http://www.technooracle.com/oracle-tutorials/utl_file_dir-in-oracle/</link>
		<comments>http://www.technooracle.com/oracle-tutorials/utl_file_dir-in-oracle/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 18:10:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Initialization Parameters]]></category>

		<guid isPermaLink="false">http://www.technooracle.com/?p=411</guid>
		<description><![CDATA[UTL_FILE_DIR parameter allow you to specify one or more directories where you can do input/output operations in PL SQL.These file can be written and can be read using UTL_FILE Package. syntax for setting UTL_FILE_DIR is alter system set UTL_FILE_DIR = '/tmp' scope=spfile; Specifying multiple directories in the spfile alter system set utl_file_dir='/tmp/dir1','/tmp/dir2','/tmp' scope=spfile In the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UTL_FILE_DIR </strong>parameter allow you to specify one or more directories where you can do input/output operations in <strong>PL SQL.</strong>These file can be written and can be read using <strong>UTL_FILE</strong> Package.</p>
<h3>syntax for setting UTL_FILE_DIR is</h3>
<pre>alter system set UTL_FILE_DIR = '/tmp' scope=spfile;
<h3>Specifying multiple directories in the <a href="http://www.adp-gmbh.ch/ora/admin/spfile.html"></a>spfile</h3>

alter system set utl_file_dir='/tmp/dir1','/tmp/dir2','/tmp' scope=spfile
</pre>
<p>In the past(upto Oracle 8i), accessible directories for the <code>UTL_FILE</code> functions were specified in the initialization file using the <code>UTL_FILE_DIR</code> parameter. The disadvantage of the init param is that if it is used, it is valid for all <strong>USERS</strong> in the database. There is no way (other than totally disable utl_file for someone) to selectively restrict directories to someone.</p>
<p>From Oracle 9i, <code>UTL_FILE_DIR</code> access is not recommended. It is recommended that you use the <strong><code>CREATE DIRECTORY</code></strong> feature, which replaces <strong><code>UTL_FILE_DIR</code></strong>. Directory objects offer more flexibility and control to the <code><strong>UTL_FILE</strong></code><strong></strong> access.Moreover directories can be maintained dynamically (that is, without shutting down the database), and are consistent with other Oracle tools. <code>CREATE DIRECTORY</code> privilege is granted only to <code>SYS</code> and <code>SYSTEM</code> by default.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technooracle.com/oracle-tutorials/utl_file_dir-in-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use DECODE for IF/ELSE Selection</title>
		<link>http://www.technooracle.com/oracle-tutorials/use-decode-for-ifelse-selection/</link>
		<comments>http://www.technooracle.com/oracle-tutorials/use-decode-for-ifelse-selection/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 14:04:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Tuning]]></category>

		<guid isPermaLink="false">http://www.technooracle.com/?p=378</guid>
		<description><![CDATA[Programmers often need a way to count and/or add up variable conditions for a group of rows. The DECODE statement provides a very efficient way of doing this. Because DECODE is rather complex, few programmers take the time to learn to use this statement to full advantage. The following statement uses DECODE to count the [...]]]></description>
			<content:encoded><![CDATA[<p>Programmers often need a way to count and/or add up variable conditions for a group of rows. The DECODE statement provides a very efficient way of doing this. Because DECODE is rather complex, few programmers take the time to learn to use this statement to full advantage. The following statement uses DECODE to count the number of first, second, and third placings a racehorse has run:</p>
<p>SELECT</p>
<p>horse_name, to_char(sum(decode(position,1,1,0))),<br />
to_char(sum(decode(position,2,1,0))), to_char(sum(decode(position,3,1,0)))<br />
FROM winners<br />
GROUP BY horse_name</p>
<p>In the sum(decode(position,2,1,0)) construct, we are saying that if the horse&#8217;s finishing position is 2 (second), add one to the count of seconds. The results of this statement appear as follows:<br />
Horse<br />
Firsts<br />
Seconds<br />
Thirds<br />
Wild Charm<br />
1<br />
2<br />
2<br />
The alternative statement without the decode involves scanning the table three times, rather than once, as in the previous statement.</p>
<p>SELECT horse_name<br />
, count(w1.position)<br />
, count(w2.position)<br />
, count(w3.position)<br />
FROM winners w1, winners w2, winners w3<br />
WHERE w1.horse_name = w2.horse_name<br />
AND w2.horse_name = w3.horse_name<br />
AND w1.position = 1<br />
AND w2.position = 2<br />
AND w3.position = 3<br />
GROUP BY horse_name;</p>
<p><strong> YHAWUFX3V4PW</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.technooracle.com/oracle-tutorials/use-decode-for-ifelse-selection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DBMS_ALERT Package</title>
		<link>http://www.technooracle.com/oracle-tutorials/dbms_alert-package/</link>
		<comments>http://www.technooracle.com/oracle-tutorials/dbms_alert-package/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 11:27:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Packages]]></category>
		<category><![CDATA[DBMS_ALERT]]></category>
		<category><![CDATA[DBMS_ALERT package]]></category>

		<guid isPermaLink="false">http://www.technooracle.com/?p=407</guid>
		<description><![CDATA[you can use alerts to notify you about an event for informational purposes. The DBMS_ALERT package is typically a one-way asynchronous communication that is triggered when a transaction commits. Unless a transaction commits, no information is sent to the alert. This means that a waiting procedure or application remains idle until the desired transaction commits. [...]]]></description>
			<content:encoded><![CDATA[<p>you can use alerts to notify you about an event for informational<br />
purposes. The DBMS_ALERT package is typically a one-way asynchronous communication that is triggered when a transaction commits. Unless a transaction commits, no information is sent to the alert. This means that a waiting procedure or application remains idle until the desired transaction commits. Because alerts provide one-way communication, they have limited usage.</p>
<h2>Setting up ALERT using DBMS_ALERT</h2>
<p>Use the following Order to setting  up an alert</p>
<p><strong>REGISTER-</strong>to record your interest in a particular alert.</p>
<p><strong>WAITTONE</strong>-wait for a specific alert.</p>
<p><strong>WAITANY-</strong>wait for any of  your registred alerts<br />
<strong> </strong></p>
<p><strong>SIGNAL-</strong>use this when the condition for the alert is met and the transaction has been committed.</p>
<h2>Using SIGNAL to Issue an Alert</h2>
<p>The Syntax for the SIGNAL Procedure</p>
<pre><strong>PROCEDURE SIGNAL(alert_name IN VARCHAR2,message_sent IN VARCHAR2);</strong></pre>
<p>alert_name can be a maximum of 30 characters, and it is not case sensitive. &#8220;message_sent&#8221; can be up to 1,800 characters, which allows for a generous concatenation of text, variable names, and so on. This message is sent to the waiting session.It is common for multiple sessions to concurrently issue signals on the same alert. In this case, as each session issues the alert, it blocks all other concurrent sessions until it commits.The net effect of this behavior is that alerts can cause transactions to become serialized.</p>
<h2>Registering for an Alert</h2>
<p>Before you can even search for an alert, you must register the alert you want to monitor,which adds you to the master registration list. You take this first step by using the  REGISTER procedure.</p>
<p>Syntax for using REGISTER procedure</p>
<p><strong>PROCEDURE REGISTER(alert_name IN VARCHAR2);</strong></p>
<p>alert_name is the name of the alert to monitor.</p>
<h2>Waiting for a Specific Alert</h2>
<p>If you want to monitor one alert, use the <strong>WAITONE</strong> Procedure<br />
The Syntax for the WAITONE Procedure</p>
<p><strong>PROCEDURE WAITONE(alert_name IN VARCHAR2,alert_message OUT VARCHAR2,alert_status OUT INTEGER,timeout IN NUMBER DEFAULT maxwait);</strong></p>
<h2>Waiting for Any Registered Alert</h2>
<p>WAITANY procedure allows you to constantly monitor for any alert for which you have registered in the current session.</p>
<p>The Syntax for the WAITANY Procedure</p>
<p><strong>PROCEDURE WAITANY(alert_name OUT VARCHAR2, alert_message OUT VARCHAR2, alert_status OUT INTEGER,timeout IN NUMBER DEFAULT maxwait);</strong></p>
<h2>Removing One Alert</h2>
<p>To remove only one specific alert from the registration list, use the REMOVE procedure.</p>
<p>The Syntax for the REMOVE Procedure</p>
<p><strong>PROCEDURE REMOVE(alert_name IN VARCHAR2);</strong></p>
<h2>Removing All Alerts</h2>
<p>You can remove all registered alerts from the current session by placing a call to the procedure REMOVEALL procedure is as follows: <strong></strong></p>
<p><strong>PROCEDURE REMOVEALL;</strong></p>
<p>After the procedure is executed, all registered alerts are deleted. An implicit COMMIT is executed with this call.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technooracle.com/oracle-tutorials/dbms_alert-package/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle 11g:Automatic Storage Management</title>
		<link>http://www.technooracle.com/oracle-tutorials/using-oracle-asm/</link>
		<comments>http://www.technooracle.com/oracle-tutorials/using-oracle-asm/#comments</comments>
		<pubDate>Sat, 01 Jan 2011 13:43:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle ASM]]></category>
		<category><![CDATA[oracle 10g asm]]></category>
		<category><![CDATA[oracle 11 g asm]]></category>
		<category><![CDATA[oracle asm]]></category>
		<category><![CDATA[oracle asm commands]]></category>
		<category><![CDATA[oracle asm documentation]]></category>
		<category><![CDATA[oracle asm tutorial]]></category>
		<category><![CDATA[oracle rac asm]]></category>
		<category><![CDATA[setup oracle asm]]></category>

		<guid isPermaLink="false">http://www.technooracle.com/?p=404</guid>
		<description><![CDATA[Automatic Storage Management (ASM) provides a centralized way to manage Oracle Database disk storage.In this,we will discuss what ASM is, how to configure an ASM instance, how to manage an ASM instance, and finally, how to use ASM from within an Oracle database. What is ASM? ASM is designed to simplify Oracle database storage administration. Database [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste">Automatic Storage Management (ASM) provides a centralized way to manage Oracle Database disk storage.In this,we will discuss what ASM is, how to configure an ASM instance, how to manage an ASM instance, and finally, how to use ASM from within an Oracle database.</div>
<h2><strong>What is ASM?</strong></h2>
<div id="_mcePaste">
<ul>
<li>ASM is designed to simplify Oracle database storage administration. Database environments have become  more complex, with large numbers of (and larger) data files,storage area networks (SANs), and high-availability requirements.</li>
<li>ASM is somewhat like a logical volume manager, allowing you to reduce the management of Oracle files into ASM disk groups. It also provides redundancy configurations, re-balancing operations, and, when installed on top of cluster ware, the ability to share database-related files.</li>
<li>ASM stores files in disk groups, which are logical entities made up of one or more physical disk drives. ASM is good for more than just storing database datafiles.</li>
<li>In an ASM instance, you can store database datafiles, online redo logs, archived redo logs, backup files, and data-pump dump files as well as change-tracking files and control files of one or several Oracle databases, though these databases and the ASM instance must have affinity to a given machine or cluster.</li>
<li>ASM also provides the ability to locate the flash recovery area on an ASM disk group, so your backups to disk can be made to ASM.</li>
</ul>
</div>
<p><span id="more-404"></span></p>
<h2>Features of ASM</h2>
<ul>
<li>Automatic software d NN ata striping (RAID-0)</li>
<li>Load balancing across physical disks</li>
<li>Software RAID-1 data redundancy with double or triple mirrors</li>
<li>Elimination of fragmentation</li>
<li> Simplification of file management via support for Oracle Managed Files (OMF)</li>
<li> Ease of maintenance</li>
</ul>
<h3>Creating the ASM Instance</h3>
<p>To create the ASM instance with the DBCA, do the following:</p>
<ul>
<li> Start the Oracle DBCA.</li>
<li> The DBCA presents a list of options for you to choose from. Select Configure Automatic Storage Management and click Next.</li>
<li> The DBCA then prompts you for the SYS password for the new ASM instance to be created. Enter the password for the SYS account.</li>
<li> Oracle then creates the ASM instance. A new window appears giving you the option to create new disk groups. You can choose to create disk groups or you can click Finish to complete the ASM instillation.</li>
<li> The name of the resulting instance will be +ASM. You can log into the ASM instance</li>
</ul>
<p>from SQL*Plus, as shown in this example:</p>
<p>C:\Documents and Settings\technooracle&gt;Set ORACLE_SID=+ASM</p>
<p>C:\Documents and Settings\technooracle&gt;Sqlplus sys/Robert as sysasm</p>
<p>SQL*Plus: Release 11.1.0.6.0 &#8211; Production on Mon Jul 14 19:55:33 2008</p>
<p>Copyright (c) 1982, 2007, Oracle. All rights reserved.</p>
<p>Connected to:</p>
<p>Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 – Production</p>
<p>With the Partitioning, OLAP and Data Mining options</p>
<p>SQL&gt; select instance_name from v$instance;</p>
<p>INSTANCE_NAME</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>+asm</p>
<h3>Starting and Stopping the ASM Instance</h3>
<p>Starting an ASM Instance</p>
<p>Starting an ASM instance is quite easy, as shown in this exercise.</p>
<p>1. The name of the resulting instance will be +ASM. You can log into the ASM instance</p>
<p>2. Now, start the ASM instance with the startup command:</p>
<p>SQL&gt; startup</p>
<p>ASM instance started</p>
<p>Total System Global Area 83886080 bytes</p>
<p>Fixed Size 1247420 bytes</p>
<p>Variable Size 57472836 bytes</p>
<p>ASM Cache 25165824 bytes</p>
<p>Shutting down the ASM instance is just as easy. A shutdown immediate, shutdown abort, or just a plain shutdown will do fine. If you execute a normal or immediate shutdown command on an ASM instance, that shutdown will fail if there is any database using that ASM instance. An error will be returned and the ASM instance will stay up. As a result, before you shut down the ASM instance, you will need to shut down all databases using that ASM instance.<br />
You can perform a shutdown abort on the ASM instance. This will cause the ASM instance to shut down immediately and all of the associated databases will be shut down in an inconsistent state. This will require instance recovery when the databases are restarted, which can increase the time it takes to reopen the database. Oracle recommends that you not use the shutdown abort command when stopping an ASM instance.</p>
<p><span style="font-family: arial, serif; line-height: normal;">The options for the <code>STARTUP</code> command are:</span></p>
<ul>
<li><code>FORCE</code> &#8211; Performs a <code>SHUTDOWN ABORT</code> before restarting the ASM instance.</li>
<li><code>MOUNT</code> &#8211; Starts the ASM instance and mounts the disk groups specified by the <code>ASM_DISKGROUPS</code> parameter.</li>
<li><code>NOMOUNT</code> &#8211; Starts the ASM instance without mounting any disk groups.</li>
<li><code>OPEN</code> &#8211; This is not a valid option for an ASM instance.</li>
</ul>
<p>The options for the <code>SHUTDOWN</code> command are:</p>
<ul>
<li><code>NORMAL</code> &#8211; The ASM instance waits for all connected ASM instances and SQL sessions to exit then shuts down.</li>
<li><code>IMMEDIATE</code> &#8211; The ASM instance waits for any SQL transactions to complete then shuts down. It doesn&#8217;t wait for sessions to exit.</li>
<li><code>TRANSACTIONAL</code> &#8211; Same as <code>IMMEDIATE</code>.</li>
<li><code>ABORT</code> &#8211; The ASM instance shuts down instantly.</li>
</ul>
<h3>What is supported in ASM</h3>
<p>Only Oracle files are supported:</p>
<p>* Database files<br />
* Control files<br />
* Online redo log files<br />
* Archived redo log files<br />
* Flash recovery area files<br />
* RMAN files (image copy and backup)</p>
<p>These files are NOT supported:</p>
<p>* Installation files (in ORACLE_HOME, CRS_HOME)<br />
* ORACLE_BASE files( including alert log, trace files, etc)<br />
* CRS voting disk and OCR files<br />
* Output data from UTL_FILE<br />
* Any user or application specific files(e.g. XML or Java files)<br />
* Oracle 9i external table files</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technooracle.com/oracle-tutorials/using-oracle-asm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using SQL Trace in oracle</title>
		<link>http://www.technooracle.com/oracle-tutorials/using-sql-trace-in-oracle/</link>
		<comments>http://www.technooracle.com/oracle-tutorials/using-sql-trace-in-oracle/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 17:32:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Tuning]]></category>
		<category><![CDATA[oracle trace]]></category>
		<category><![CDATA[oracle trace sql]]></category>
		<category><![CDATA[SQL Trace]]></category>
		<category><![CDATA[sql trace oracle]]></category>

		<guid isPermaLink="false">http://www.technooracle.com/?p=401</guid>
		<description><![CDATA[SQL Trace causes trace files to be produced by Oracle Database. Various items of interest are generated into trace files. This information comprises details of CPU and I/O needs plus parsing and execution information, processed rows, commits, and rollbacks. The output in trace files is more or less impossible to interpret by hand. Setting up [...]]]></description>
			<content:encoded><![CDATA[<p>SQL Trace causes trace files to be produced by Oracle Database. Various items of interest are generated into trace files. This information comprises details of CPU and I/O needs plus parsing and execution information, processed rows, commits, and rollbacks. The output in trace files is more or less impossible to interpret by hand.</p>
<h2><span style="color: #0000ff;">Setting up SQL Trace</span></h2>
<p>SQL Trace can be configured for instance-level use or for a  session, for a session either within a current open session or from one session  to another. Setting instance-wide tracing can cause serious performance  problems. It is better for performance to enable tracing only from a current  session or for a specific session. Not using instance-wide tracing can miss a  lot of useful information. I am using instance-level tracing since I am not  working on a production server database. Start by setting the TIMED_STATISTICS,  TIMED_OS_STATISTICS, and MAX_DUMP_FILE_SIZE parameters.</p>
<pre>TIMED_STATISTICS = TRUE
TIMED_OS_STATISTICS = 5
MAX_DUMP_FILE_SIZE = 1M</pre>
<p><!-- more Continue Reading --></p>
<p>The effect on performance of setting the TIMED_STATISTICS  parameter is negligible. The parameters previously shown enable collection of  statistics including CPU and I/O statistics. TIMED_STATISTICS writes information  to both trace files plus the V$SYSSTATS and V$SESSSTATS performance views.  TIMED_OS_STATISTICS is a timing mechanism for statistics collection, triggering  system statistics collection periodically.</p>
<p>The MAX_DUMP_FILE_SIZE parameter will truncate each trace file in  the USER_DUMP_DEST directory, the default target directory for trace files,  usually the $ORACLE_BASE/admin/$ORACLE_SID/ udump directory.</p>
<p>Next set the SQL_TRACE parameter to switch on SQL Trace. The  TRACE_ENABLED parameter could also be set to TRUE but we will avoid that.  Setting TRACE_ENABLED tends to produce copious amounts of detail, more relevant  to Oracle support personnel than anything else.</p>
<pre>SQL_TRACE = TRUE</pre>
<p>Trace files contain generated statistics. In past versions of  Oracle trace levels could be set. Oracle9<em>i</em> Database has a  new parameter called STATISTICS_LEVEL which can be set to BASIC, TYPICAL, or  ALL. The default is TYPICAL. Setting ALL would incur significant overhead and a  noticeable effect on performance. In my database I will set the STATISTICS_LEVEL  parameter to ALL to gather as much information as possible. Note that setting  this parameter to ALL automatically sets the TIMED_OS_STATISTICS parameter to  5.</p>
<pre>STATISTICS_LEVEL = ALL</pre>
<h3><span style="color: #0000ff;">Session-Level Tracing</span></h3>
<p>Specific sessions can be traced. Tracing at the session level can help to remove tracing overhead from the database in general and focus on a specific session. Personally I have never seen the value in using the session level of tracing. There is far too much information produced. There are easier ways of tracking down problems than using session-level tracing. This command traces the current session. Tracing a specific session may be most applicable to tracking down some really nasty SQL code such as in a pre-release application, or one which should not have been released, or perhaps in an ad hoc SQL environment.</p>
<p>ALTER SESSION SET SQL_TRACE = TRUE;</p>
<p>This command will trace a session other than the current session, someone else&#8217;s session.</p>
<p>DBMS_SYSTEM_SET_SQL_TRACE_IN SESSION(SID, SERIAL#, TRUE);</p>
<div>
<h3><span style="color: #0000ff;">Finding  Trace Files</span></h3>
<p>One of the biggest problems with trace files is finding  them. Many files can be generated. You could find the files applicable to  specific processes by including tags in your SQL code such as SELECT &#8216;my trace file&#8217; FROM DUAL; or by  checking datestamps in the operating system. Typically a trace file is named in  the following format:</p>
<pre>$ORACLE_SID_ora_<span style="font-family: symbol;">&lt;</span>pid<span style="font-family: symbol;">&gt;</span>.trc</pre>
<p>&#8220;pid&#8221; represents the process ID of the process which generated the  trace file. The process ID can be found with the following query, which finds  the process identifier using the process and session addresses and the session  auditing identifier as the session identifier.</p>
<pre>SELECT spid FROM v$process
WHERE addr = (SELECT paddr FROM v$session
      WHERE audsid = USERENV('sessionid'));<a name="656"></a></pre>
</div>
<h2><span style="color: #0000ff;">Using SQL Trace</span></h2>
<p>So the next logical step is to make use of SQL Trace. I have now set up my Oracle Database configuration parameter file (init.ora) with various parameter changes.</p>
<p>TIMED_STATISTICS = TRUE<br />
TIMED_OS_STATISTICS=5<br />
MAX_DUMP_FILE_SIZE = 1M<br />
SQL_TRACE = TRUE<br />
STATISTICS_LEVEL = ALL<br />
Now I bounce my database to instantiate these configuration parameter changes.</p>
<p>Tip  Some of these parameters can be updated online using the ALTER SYSTEM command.</p>
<p>The next step is starting up my highly active concurrent database scripting (see Appendix B). These scripts use the DBMS_JOBS package to repetitively execute a slew of database changes to my Accounts schema, from multiple concurrently executed database jobs using the DBMS_JOBS package. Since I am running sessions using the DBMS_JOBS package I have to be able to find trace files for each session. So let&#8217;s change the process identifier query to access multiple sessions, and find a trace file that way. So how do I find the appropriate sessions? Log into a database administrator user such as SYSTEM and execute a query something like this.</p>
<p>SELECT audsid, username, saddr, paddr, sid, serial#<br />
FROM v$session WHERE username = &#8216;ACCOUNTS&#8217; AND audsid != 0;<br />
Then I change my process identifier finding query and find a filename.</p>
<p>SELECT &#8216;c:\oracle\admin\test\udump\test_ora_&#8217;||spid||&#8217;.trc&#8217;<br />
&#8220;Trace File&#8221;<br />
FROM v$process<br />
WHERE addr = (<br />
SELECT paddr FROM V$SESSION<br />
WHERE username = &#8216;ACCOUNTS&#8217; AND audsid != 0);<br />
Trace File<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
c:\oracle\admin\test\udump\test_ora_972.trc</p>
<p>Trace files can look like the gibberish shown below. Not really very easy to interpret is it? Yes that is sarcastic; certainly the very lowest form of wit but apt in this case. This is where TKPROF comes into play.</p>
<p>======================<br />
PARSING IN CURSOR #3 len=56 dep=1 uid=0 oct=3 lid=0<br />
tim=13822711723 hv=4049165760 ad=&#8217;67f67898&#8242;<br />
select order#,columns,types from access$ where d_obj#=:1<br />
END OF STMT<br />
PARSE #3:c=0,e=145,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=4,<br />
tim=13822711703<br />
EXEC #3:c=0,e=136,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=4,<br />
tim=13822714183<br />
FETCH #3:c=0,e=114,p=0,cr=3,cu=0,mis=0,r=1,dep=1,og=4,<br />
tim=13822714826<br />
FETCH #3:c=0,e=78,p=0,cr=2,cu=0,mis=0,r=1,dep=1,og=4,<br />
tim=13822715459<br />
FETCH #3:c=0,e=67,p=0,cr=2,cu=0,mis=0,r=1,dep=1,og=4,<br />
tim=13822716065<br />
FETCH #3:c=0,e=64,p=0,cr=2,cu=0,mis=0,r=1,dep=1,og=4,<br />
tim=13822716662<br />
FETCH #3:c=0,e=65,p=0,cr=2,cu=0,mis=0,r=1,dep=1,og=4,<br />
tim=13822717260<br />
FETCH #3:c=0,e=42,p=0,cr=1,cu=0,mis=0,r=0,dep=1,og=4,<br />
tim=13822717850<br />
STAT #3 id=1 cnt=5 pid=0 pos=1 obj=97 op=&#8217;TABLE ACCESS BY<br />
INDEX ROWID ACCESS$ &#8216;<br />
STAT #3 id=2 cnt=5 pid=1 pos=1 obj=129 op=&#8217;INDEX RANGE<br />
SCAN I_ACCESS1 &#8216;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technooracle.com/oracle-tutorials/using-sql-trace-in-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exception Handling in Oracle PL/SQL</title>
		<link>http://www.technooracle.com/oracle-tutorials/oracle-plsql-exception-handling-tips/</link>
		<comments>http://www.technooracle.com/oracle-tutorials/oracle-plsql-exception-handling-tips/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 16:44:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Exception Handling]]></category>

		<guid isPermaLink="false">http://www.technooracle.com/?p=399</guid>
		<description><![CDATA[There are number of reasons due to which run time errors may be raised during the execution of a PL/SQL block. With PL/SQL, a mechanism called exception handling lets you &#8220;bulletproof&#8221; your program so that it can continue operating in the presence of errors. When an error occurs, an exception is raised; normal execution is [...]]]></description>
			<content:encoded><![CDATA[<h2><span style="font-weight: normal; font-size: 13px;">There are number of reasons due to which run time errors may be raised during the execution of a PL/SQL block. </span><span style="font-weight: normal; font-size: 13px;">With PL/SQL, a mechanism called exception handling lets you &#8220;bulletproof&#8221; your program so that it can continue operating in the presence of errors.</span></h2>
<h2><span style="font-weight: normal; font-size: 13px;">When an error occurs, an exception is raised; normal execution is stopped and control is transferred to an exception-handling section of PL/SQL program. A specific section can be defined in the program to handle exceptions. Separate subroutines called exception handlers can be created to perform all exception processing. Once an exception is raised and control is transferred to the exception part of a program, it cannot return to the execution part of the<br />
program.</span></h2>
<p><span id="more-399"></span></p>
<p><strong>Overview of  Exception handling  in  oracle PL/SQL</strong></p>
<p style="text-align: left;">Errors are handles in two ways, one is to trap the error and other is to propagate to the calling environment.</p>
<p style="text-align: left;">1.<strong>Trapping an exception</strong></p>
<p style="text-align: left;">If the exception is raised in the executable section of the block, processing branches to the corresponding exception handler in the exception section of the block. If PL/SQL successfully handles the exception, then the exception does not propagate to the enclosing block or environment. The<br />
PL/SQL block terminates successfully as shown in figure</p>
<p style="text-align: center;"><img class="aligncenter" src="http://www.technooracle.com/wp-content/uploads/2010/06/trapping-exception.png" alt="Trapping Exception" width="265" height="244" /></p>
<p style="text-align: left;">2.<strong>Propagating an Exception</strong></p>
<p style="text-align: left;">If the exception is raised in the executable section of the block and there is no corresponding exception handler, the PL/SQL block terminates with failure and the exception is propagated to the calling environment</p>
<h3>The Basic syntax for using Exceptions</h3>
<p><strong>Syntax<br />
EXCEPTION<br />
WHEN exception1 [OR exception2 ………] THEN<br />
statement1;<br />
statement2;<br />
[WHEN exception3 [OR exception4 ………] THEN<br />
statement1;<br />
statement2;<br />
..…………..]<br />
[WHEN OTHERS THEN<br />
statement1;<br />
statement2;<br />
……..]</strong></p>
<p>Statement</p>
<p>It is one ore more PL/SQL or SQL statements</p>
<p>Others<br />
It is an optional exception-handling clause that traps unspecified exceptions.</p>
<p>WHEN OTHERS Exception Handler<br />
The exception-handling section traps only those exceptions specified; any other exceptions are not trapped unless you use the OTHERS exception handler.This traps any exception not yet handled.For this reason, OTHERS is the last exception handlerdefined. The OTHERS handler traps all exceptions not already trapped.</p>
<h3>Some Guidelines to Trap Exception</h3>
<p>&gt;&gt; Begin the exception-handling section of the block with the keyword EXCEPTION.<br />
&gt;&gt; Define several exception handlers, each with its own set of<br />
actions, for the block.<br />
&gt;&gt; When an exception occurs, PL/SQL processes only one handler<br />
before leaving the block.<br />
&gt;&gt;Place the OTHERS clause after all other exception-handling<br />
clauses.<br />
&gt;&gt;You can have at most one OTHERS clause.<br />
&gt;&gt; Exceptions cannot appear in assignment statements or SQL<br />
statements.</p>
<h4>Exception Handling Example 1</h4>
<p><code> </code></p>
<p><code><strong>Declare</strong></code></p>
<p><code></p>
<p style="padding-left: 30px;"><strong>n_emp_salary number(10)=0;</strong></p>
<p><strong>BEGIN</strong></p>
<p style="padding-left: 30px;"><strong>n_emp_salary number=n_emp_salary number/10;</strong></p>
<p><strong>EXCEPTION</strong></p>
<p style="padding-left: 30px;"><strong>WHEN ZERO_DIVIDE THEN</strong></p>
<p style="padding-left: 60px;"><strong>DBMS_OUTPUT.PUT_LINE('Zero Divide Error');rong&gt;</strong></p>
<p><strong>END;</strong></p>
<p></code></p>
<p><code><strong>/</strong></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.technooracle.com/oracle-tutorials/oracle-plsql-exception-handling-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Relational Database Management System(RDBMS)</title>
		<link>http://www.technooracle.com/oracle-tutorials/introduction-to-rdbms/</link>
		<comments>http://www.technooracle.com/oracle-tutorials/introduction-to-rdbms/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 07:56:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[RDBMS]]></category>

		<guid isPermaLink="false">http://www.technooracle.com/?p=397</guid>
		<description><![CDATA[RDBMS stands for Relational Database Management System.In  RDBMS data is structured in database tables, fields and records.RDBMS store the data into collection of tables, which might be related by common fields (database table columns). RDBMS also provide relational operators to manipulate the data stored into the database tables. Most RDBMS use SQL  as database query [...]]]></description>
			<content:encoded><![CDATA[<p>RDBMS stands for Relational Database Management System.In   RDBMS data is  structured in database tables, fields and records.RDBMS store the data into collection of tables, which might be related   by common fields (database table columns). RDBMS also provide relational   operators to manipulate the data stored into the database tables. Most   RDBMS use SQL  as database query language.</p>
<h2>RDBMS Characteristics</h2>
<ul>
<li>RDMS Supports relational data structure.</li>
<li>RDBMS has Data Manipulation Language at least as powerful as the relational algebra.</li>
<li>Data is stored in a set of tables.</li>
<li>Tables are joined by relational links.</li>
<li>RDBMS Reduces Duplication of data in database(Normalization).</li>
<li>Allows greater flexibility and efficiency.</li>
<li>in RDBMS Each table must have a unique references for each record called Primary key.</li>
<li>Replicating  these into other tables creates the Foreign Key.</li>
<li>These foreign keys form the Relationship that link the tables together.</li>
<li>Each RDBMS table  consists of database table rows. Each database table row consists of one  or more database table fields.</li>
<li>In RDBMS data need only be updated once as it would only have been entered once.</li>
<li>RDBMS eliminates the problems in using Flat file databases</li>
</ul>
<p>Edgar Codd introduced the relational database model.The most popular RDBMS are MS SQL Server, DB2, Oracle and MySQL.</p>
<h2>Advantages of  RDBMS</h2>
<ul>
<li> Highly secured</li>
<li> Supports data independence</li>
<li>Avoids data redundancy</li>
<li>Uses OOPs concept.</li>
<li>Multiple users can access which is not possible in DBMS.</li>
<li> Avoids data  redundancy problems using NORMAL FORMS</li>
<li> It performs all DML  operations which is not possible with ordineray DBMS (it performs only  INSERT n RETRIEVE)</li>
<li> Supports data Independence.</li>
<li> finally it supports  DDBMS concepts too and so on.</li>
<li>Avoid Reduntnat data.</li>
<li>Avoid Typographical errors.</li>
</ul>
<div>
<div>
<p><a href="http://wiki.answers.com/Q/Advantages_of_rdbms_and_any_aptitude_questions_on_rdmbs_are_available#ixzz18YgLeUqp"><br />
</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.technooracle.com/oracle-tutorials/introduction-to-rdbms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pseudocolumns in SQL</title>
		<link>http://www.technooracle.com/oracle-tutorials/pseudocolumns-in-sql/</link>
		<comments>http://www.technooracle.com/oracle-tutorials/pseudocolumns-in-sql/#comments</comments>
		<pubDate>Sat, 18 Dec 2010 09:50:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SQL tutorials]]></category>
		<category><![CDATA[Pseudo column]]></category>
		<category><![CDATA[pseudo columns]]></category>
		<category><![CDATA[pseudo columns in oracle]]></category>
		<category><![CDATA[Pseudocolumns]]></category>
		<category><![CDATA[Pseudocolumns in SQL]]></category>

		<guid isPermaLink="false">http://www.technooracle.com/?p=395</guid>
		<description><![CDATA[Pseudocolumns are not really columns in a table; they just have characteristics of columns. These pseudocolumns will return values when referenced just like real table columns. However, you cannot do any other DML or DDL statements on these pseudocolumns. Pseudocolumns are primarily used to give the programmer more tools to use in his code. They [...]]]></description>
			<content:encoded><![CDATA[<p>Pseudocolumns are not really columns in a table; they just have characteristics of columns. These pseudocolumns will return values when referenced just like real table columns. However, you cannot do any other DML or DDL statements on these pseudocolumns. Pseudocolumns are primarily used to give the programmer more tools to use in his code. They provide a convenient way to obtain information about different aspects of the database. The following are the Pseudocolumns we will discuss:</p>
<p><strong>1.CURRVAL</strong></p>
<p><strong> 2.NEXTVAL</strong></p>
<p><strong>3.ROWID</strong></p>
<p><strong>4.ROWNUM.</strong></p>
<p><span id="more-395"></span></p>
<h2>CURRVAL and NEXTVAL Pseudocolumns</h2>
<p>The CURRVAL and NEXTVAL pseudocolumns are used in conjunction with sequences. The CURRVAL pseudocolumn returns the current value of the referenced sequence. The NEXTVAL pseudocolumn, when referenced, will increment the sequence value and then return the new sequence value.</p>
<p>To reference the CURRVAL and NEXTVAL pseudocolumns, the SQL dot notation must be used.</p>
<p>For example, the following statement will insert a new record into the Employee<br />
table.<br />
This insert statement will use the next increment of the emp_id_seq sequence for the value to be inserted into the emp_id column.</p>
<pre>INSERT into employee</pre>
<pre>VALUES (emp_id_seq.NEXTVAL,’Stanton Bernard’);</pre>
<p>This sample code inserts a single record into the Employee table. The employee<br />
id is created and provide by the emp_id_seq sequence number. The employee<br />
name is hard coded and provide in the insert statement.</p>
<h2>ROWID Pseudocolumns</h2>
<p>The ROWID pseudocolumn represents the binary address of a row in a table. You can use variables of type UROWID to store rowids in a readable format. In the following example,<br />
you declare a variable named emp_row_id for that purpose:</p>
<p>DECLARE</p>
<pre>emp_row_id UROWID;</pre>
<p>When you select or fetch a rowid into a UROWID variable, you can use the function ROWIDTOCHAR, which converts the binary value to an 18-byte character string. Then, you can compare the UROWID variable to the ROWID pseudocolumn in the WHERE clause of an UPDATE or DELETE statement to identify the latest row fetched from a cursor.</p>
<h2>ROWNUM Pseudocolumns</h2>
<p>The ROWNUM pseudocolumn refers to the order in which data was retrieved from a table.For example, ROWNUM of 1 indicates that row was the first row retrieved from the table.</p>
<p>Likewise, ROWNUM of 2333 refers to 2333rd row retrieved from the table. ROWNUM values are assigned when the fetch occurs and are not affected by the ORDER BY clause.</p>
<p>The most common usage of the ROWNUM pseudocolumn is in the WHERE clause statement. For example, you may want to do an interactive select on a table until the ROWNUM is equal to some constant.<br />
In this example, the interaction will continue until the ROWNUM is greater than 100.</p>
<pre>DECLARE</pre>
<pre>CURSOR c1 IS SELECT sal</pre>
<pre>FROM employee</pre>
<pre>WHERE sal &gt; 500 AND ROWNUM &lt; 100;</pre>
<p>The above cursor declaration code uses the ROWNUM pseudocolumn in the WHERE clause. The ROWNUM is used to limit the number of records processed to the first 99 records in the table.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technooracle.com/oracle-tutorials/pseudocolumns-in-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

