<?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>OraQA &#187; Concepts</title>
	<atom:link href="http://oraqa.com/category/concepts/feed/" rel="self" type="application/rss+xml" />
	<link>http://oraqa.com</link>
	<description>Oracle Question and Answer</description>
	<lastBuildDate>Tue, 06 Jul 2010 00:08:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to avoid primary key collision on multiple sites</title>
		<link>http://oraqa.com/2007/02/08/how-to-avoid-primary-key-collision-on-multiple-sites/</link>
		<comments>http://oraqa.com/2007/02/08/how-to-avoid-primary-key-collision-on-multiple-sites/#comments</comments>
		<pubDate>Thu, 08 Feb 2007 17:22:01 +0000</pubDate>
		<dc:creator>Claudiu Ariton</dc:creator>
				<category><![CDATA[Concepts]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://oraqa.com/2007/02/08/how-to-avoid-primary-key-collision-on-multiple-sites/</guid>
		<description><![CDATA[This article provides several comparative methods to avoid primary key conflicts across multiple sites.
1. Add an offset to primary key
Site 1 &#8211; create sequence test_seq start with 1 increment by 1;
Site 2 &#8211; create sequence test_seq start with 10000000 increment by 1;
Advantages:
 a) Primary key datatype remains number
Disadvantages:
 a) On site 2,3&#8230; &#8211; the primary [...]]]></description>
			<content:encoded><![CDATA[<p>This article provides several comparative methods to avoid primary key conflicts across multiple sites.</p>
<p><strong>1. Add an offset to primary key</strong></p>
<p>Site 1 &#8211; create sequence test_seq start with 1 increment by 1;<br />
Site 2 &#8211; create sequence test_seq start with 10000000 increment by 1;</p>
<p>Advantages:<br />
 a) Primary key datatype remains number</p>
<p>Disadvantages:<br />
 a) On site 2,3&#8230; &#8211; the primary key becomes too large (as size on disk)<br />
 b) Can have primary keys conflicts, over the time, if the start value for site 2,3.. is setting initially too low</p>
<p><strong>2. Concatenate a unique identifier to the current primary key (eg: SITE name)</strong></p>
<p>Advantages:<br />
 a) Can&#8217;t have primary key conflicts over the time<br />
 b) Simple to add another site<br />
 c) Can add unlimited number of site</p>
<p>Disadvantages:<br />
 a) Possible current application code changing to deal with this method<br />
 b) The primary key datatype becomes varchar2 instead of number</p>
<p><strong>3. Composite primary key</strong> (worst than method 2 because it is necessary to change the current application code)</p>
<p><strong>4. Intercalated sequences</strong> (the best method)</p>
<p>Site 1 &#8211; create sequence test_seq start with 1 increment by 10;<br />
Site 2 &#8211; create sequence test_seq start with 2 increment by 10;</p>
<p>Advantages:<br />
 a) Can&#8217;t have primary key conflicts over the time<br />
 b) Simple to add another site<br />
 c) No current application code changing<br />
 d) Primary key datatype remains number with small size</p>
<p>Disadvantages:<br />
 a) Can add maximum 10 sites (the value of increment by)</p>
<p><strong>5. Use SYS_GUID to generate primary key</strong></p>
<p>Advantages:<br />
 a) SYS_GUID generates and returns a globally and randomly-dispersed unique identifier</p>
<p>Disadvantages:<br />
 a) RAW datatype instead of number (there are some RAW datatype restrictions)<br />
 b) Current application code changing</p>
]]></content:encoded>
			<wfw:commentRss>http://oraqa.com/2007/02/08/how-to-avoid-primary-key-collision-on-multiple-sites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What are datafiles?</title>
		<link>http://oraqa.com/2006/11/05/what-are-datafiles/</link>
		<comments>http://oraqa.com/2006/11/05/what-are-datafiles/#comments</comments>
		<pubDate>Mon, 06 Nov 2006 06:35:10 +0000</pubDate>
		<dc:creator>Eddie Awad</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Concepts]]></category>

		<guid isPermaLink="false">http://oraqa.com/2006/11/05/what-are-datafiles/</guid>
		<description><![CDATA[Every Oracle database has one or more physical datafiles. The datafiles contain all the database data. The data of logical database structures, such as tables and indexes, is physically stored in the datafiles allocated for a database.

A datafile can be associated with only one database.
Datafiles can have certain characteristics set to let them automatically extend [...]]]></description>
			<content:encoded><![CDATA[<p>Every Oracle database has one or more physical datafiles. The datafiles contain all the database data. The data of logical database structures, such as tables and indexes, is physically stored in the datafiles allocated for a database.</p>
<ul>
<li>A datafile can be associated with only one database.</li>
<li>Datafiles can have certain characteristics set to let them automatically extend when the database runs out of space.</li>
<li>One or more datafiles form a logical unit of database storage called a tablespace.</li>
</ul>
<p>Data in a datafile is read, as needed, during normal database operation and stored in the memory cache of Oracle. Modified or new data is not necessarily written to a datafile immediately. To reduce the amount of disk access and to increase performance, data is pooled in memory and written to the appropriate datafiles all at once.</p>
<p>Sources and resources:</p>
<ul>
<li><a href="http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14220/intro.htm#sthref35">Documentation</a></li>
<li><a href="http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14220/physical.htm#sthref558">Overview of datafiles</a></li>
<li><a href="http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14231/dfiles.htm#ADMIN012">Managing datafiles</a></li>
<li><a href="http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:32939838390113">Moving datafiles</a></li>
<li><a href="http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1301001918937">Datafile changes &amp; backup</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://oraqa.com/2006/11/05/what-are-datafiles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is the difference between a database and an instance?</title>
		<link>http://oraqa.com/2006/02/02/what-is-the-difference-between-a-database-and-an-instance/</link>
		<comments>http://oraqa.com/2006/02/02/what-is-the-difference-between-a-database-and-an-instance/#comments</comments>
		<pubDate>Thu, 02 Feb 2006 14:59:33 +0000</pubDate>
		<dc:creator>Eddie Awad</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Concepts]]></category>

		<guid isPermaLink="false">http://oraqa.com/2006/02/02/what-is-the-difference-between-a-database-and-an-instance/</guid>
		<description><![CDATA[To understand the difference between a database and an instance, we need to know the basic definition of each and the relationship between them.
Definition:

A database is a set of files stored on disk.
An instance is a collection of Oracle background processes and shared memory.

Relationship:

An instance can mount and open one and only one database.
A database [...]]]></description>
			<content:encoded><![CDATA[<p>To understand the difference between a database and an instance, we need to know the basic definition of each and the relationship between them.</p>
<p>Definition:</p>
<ul>
<li>A database is a set of files stored on disk.</li>
<li>An instance is a collection of Oracle background processes and shared memory.</li>
</ul>
<p>Relationship:</p>
<ul>
<li>An instance can mount and open one and only one database.</li>
<li>A database may be mounted and opened by one or more instances.</li>
</ul>
<p>For example, in the case of Real Application Clusters (or RAC) a database is usually mounted and opened by many instances.</p>
<p>Related documentation: <a href="http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14220/intro.htm#sthref83">Instance</a>, <a href="http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14220/intro.htm#sthref11">Database</a></p>
]]></content:encoded>
			<wfw:commentRss>http://oraqa.com/2006/02/02/what-is-the-difference-between-a-database-and-an-instance/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to see the database version?</title>
		<link>http://oraqa.com/2006/01/09/how-to-see-the-database-version/</link>
		<comments>http://oraqa.com/2006/01/09/how-to-see-the-database-version/#comments</comments>
		<pubDate>Mon, 09 Jan 2006 15:24:40 +0000</pubDate>
		<dc:creator>Radoslav Rusinov</dc:creator>
				<category><![CDATA[Concepts]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://oradot.com/qa/?p=11</guid>
		<description><![CDATA[To view components and their versions, loaded into the database:
SELECT comp_name, status, version FROM dba_registry;
To view version numbers of core library components, including the database:
SELECT banner FROM v$version;
To display options that are installed (the value column is &#8216;FALSE&#8217; if the option is not installed)
SELECT parameter, value FROM v$option;
]]></description>
			<content:encoded><![CDATA[<p>To view components and their versions, loaded into the database:</p>
<pre>SELECT comp_name, status, version FROM dba_registry;</pre>
<p>To view version numbers of core library components, including the database:</p>
<pre>SELECT banner FROM v$version;</pre>
<p>To display options that are installed (the value column is &#8216;FALSE&#8217; if the option is not installed)</p>
<pre>SELECT parameter, value FROM v$option;</pre>
]]></content:encoded>
			<wfw:commentRss>http://oraqa.com/2006/01/09/how-to-see-the-database-version/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How do I see who is currently connected?</title>
		<link>http://oraqa.com/2006/01/08/how-do-i-see-who-is-currently-connected/</link>
		<comments>http://oraqa.com/2006/01/08/how-do-i-see-who-is-currently-connected/#comments</comments>
		<pubDate>Sun, 08 Jan 2006 13:30:44 +0000</pubDate>
		<dc:creator>Robert Vollman</dc:creator>
				<category><![CDATA[Concepts]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://oradot.com/qa/?p=9</guid>
		<description><![CDATA[
SELECT username, program FROM v$session WHERE username IS NOT NULL;

]]></description>
			<content:encoded><![CDATA[<pre>
SELECT username, program FROM v$session WHERE username IS NOT NULL;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://oraqa.com/2006/01/08/how-do-i-see-who-is-currently-connected/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How do I tell in which database I am?</title>
		<link>http://oraqa.com/2006/01/08/how-do-i-tell-in-which-database-i-am/</link>
		<comments>http://oraqa.com/2006/01/08/how-do-i-tell-in-which-database-i-am/#comments</comments>
		<pubDate>Sun, 08 Jan 2006 13:00:08 +0000</pubDate>
		<dc:creator>Robert Vollman</dc:creator>
				<category><![CDATA[Concepts]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://oradot.com/qa/?p=8</guid>
		<description><![CDATA[
select name from v$database;

or

select instance_name, host_name from v$instance;

or 

SELECT SYS_CONTEXT(â€˜USERENVâ€™,â€™DB_NAMEâ€™) FROM DUAL;

]]></description>
			<content:encoded><![CDATA[<pre>
select name from v$database;
</pre>
<p>or</p>
<pre>
select instance_name, host_name from v$instance;
</pre>
<p>or </p>
<pre>
SELECT SYS_CONTEXT(â€˜USERENVâ€™,â€™DB_NAMEâ€™) FROM DUAL;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://oraqa.com/2006/01/08/how-do-i-tell-in-which-database-i-am/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
