<?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>dbsnaps &#187; Liron Amitzi</title>
	<atom:link href="http://www.dbsnaps.com/author/liron-amitzi/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dbsnaps.com</link>
	<description>database video tutorials</description>
	<lastBuildDate>Sun, 13 Nov 2011 13:50:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Oracle Wait Event &#8211; db file sequential read</title>
		<link>http://www.dbsnaps.com/oracle/oracle-wait-event-db-file-sequential-read/</link>
		<comments>http://www.dbsnaps.com/oracle/oracle-wait-event-db-file-sequential-read/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 14:35:51 +0000</pubDate>
		<dc:creator>Liron Amitzi</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle - Latest Articles]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[AWR]]></category>
		<category><![CDATA[db file sequential read]]></category>
		<category><![CDATA[db sequential read]]></category>
		<category><![CDATA[sequential]]></category>
		<category><![CDATA[wait event]]></category>

		<guid isPermaLink="false">http://www.dbsnaps.com/?p=415</guid>
		<description><![CDATA[db file sequential read is an important and common wait event in Oracle databases. We'll try to understand what it means.]]></description>
			<content:encoded><![CDATA[<p>There are 2 main I/O related wait events in Oracle: &#8220;db file scattered read&#8221; and &#8220;db file sequential read&#8221;. In this post we will understand the &#8220;db file sequential read&#8221; wait event (to read about &#8220;db file scattered read&#8221; go to the <a href="http://www.dbsnaps.com/uncategorized/oracle-wait-event-db-file-scattered-read" target="_self">db file scattered read</a> post)</p>
<p>A server process is waiting on &#8220;db file sequential read&#8221; wait event after it performs a single block I/O operation and it is waiting for the operating system to complete it.</p>
<p>A single block I/O operation occurs when a server process request a single block for the operating system. This happens during operations such as index unique or range scans, table access by rowid, etc.</p>
<p>Seeing this wait event in the top wait events is expected and doesn&#8217;t mean that something is wrong. Remember, users are working and reading indexes or table blocks from the disk is common. However, if we see that this event is very high and consuming unreasonable time, we need to check our SQL statement, they might need tuning, or might have unnecessary hints such as the &#8220;index&#8221; hint.</p>
<p>To read about analyzing wait events in an AWR report, see my post <a href="http://www.dbsnaps.com/uncategorized/analyzing-oracle-awr-reports-top-5-events" target="_self">analyzing oracle awr reports &#8211; top 5 events</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/oracle-wait-event-db-file-sequential-read/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Oracle Wait Event &#8211; db file scattered read</title>
		<link>http://www.dbsnaps.com/oracle/oracle-wait-event-db-file-scattered-read/</link>
		<comments>http://www.dbsnaps.com/oracle/oracle-wait-event-db-file-scattered-read/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 14:35:18 +0000</pubDate>
		<dc:creator>Liron Amitzi</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle - Latest Articles]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[AWR]]></category>
		<category><![CDATA[db file scattered read]]></category>
		<category><![CDATA[db scattered read]]></category>
		<category><![CDATA[scattered]]></category>
		<category><![CDATA[scattered read]]></category>
		<category><![CDATA[wait event]]></category>

		<guid isPermaLink="false">http://www.dbsnaps.com/?p=405</guid>
		<description><![CDATA[db file scattered read is an important and common wait event in Oracle databases. We'll try to understand what it means.]]></description>
			<content:encoded><![CDATA[<p>There are 2 main I/O related wait events in Oracle: &#8220;db file scattered read&#8221; and &#8220;db file sequential read&#8221;. In this post we will understand the &#8220;db file scattered read&#8221; wait event (to read about &#8220;db file sequential read&#8221; go to the <a href="http://www.dbsnaps.com/uncategorized/oracle-wait-event-db-file-sequential-read" target="_self">db file sequential read</a> post).</p>
<p>A server process is waiting on &#8220;db file scattered read&#8221; wait event after it performs a multiblock I/O operation and it is waiting for the operating system to complete it.</p>
<p>A multiblock I/O operation occurs when the server process asks for a &#8220;chunk&#8221; of blocks and not for a single block. The amount of blocks in the &#8220;chunk&#8221; is determined by the DB_FILE_MULTIBLOCK_READ_COUNT initialization parameter. For example, if the database block size is 8k and DB_FILE_MULTIBLOCK_READ_COUNT is 8, a single multiblock I/O operation will read 8 blocks, which is 64KB of data. The maximum size of a multiblock I/O operation is determined by the   operating system and storage.</p>
<p>When talking about performance, there are several things we need to remember:</p>
<ul>
<li>A server process can perform multiblock I/O operations only in certain cases like full table scans and fast full index scans. It is important to remember that multiblock I/O and DB_FILE_MULTIBLOCK_READ_COUNT are irrelevant to other operations such as index  range/unique scans.</li>
<li>Setting the DB_FILE_MULTIBLOCK_READ_COUNT to a high value will result in less I/O operations (as long as it is not exceeding the operating system and storage limitation).</li>
<li>Setting the DB_FILE_MULTIBLOCK_READ_COUNT to a high value can also result in unwanted full table scans, since a higher value lowers the optimizer cost of full table scans.</li>
<li>Starting in 10gR2, Oracle will determine the best value for the DB_FILE_MULTIBLOCK_READ_COUNT parameter if it is not set. If the parameter is set, Oracle will not automatically set its value.</li>
</ul>
<p>To read about analyzing wait events in an AWR report, see my post <a href="http://www.dbsnaps.com/uncategorized/analyzing-oracle-awr-reports-top-5-events" target="_self">analyzing oracle awr reports &#8211; top 5 events</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/oracle-wait-event-db-file-scattered-read/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Analyzing Oracle AWR reports &#8211; top 5 events</title>
		<link>http://www.dbsnaps.com/oracle/analyzing-oracle-awr-reports-top-5-events/</link>
		<comments>http://www.dbsnaps.com/oracle/analyzing-oracle-awr-reports-top-5-events/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 14:34:23 +0000</pubDate>
		<dc:creator>Liron Amitzi</dc:creator>
				<category><![CDATA[Main-Performance]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle - Latest Articles]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Automatic Workload Repository]]></category>
		<category><![CDATA[AWR]]></category>
		<category><![CDATA[wait event]]></category>

		<guid isPermaLink="false">http://www.dbsnaps.com/?p=393</guid>
		<description><![CDATA[This is the first post related to analyzing AWR reports. We will focus on the "top 5 events" of the page, what is the importance of this part and understanding some of the main wait events.]]></description>
			<content:encoded><![CDATA[<p>This is the first post related to analyzing AWR reports. We will focus on the &#8220;top 5 events&#8221; section,understand its importance and see some of the main wait events.</p>
<p>From Oracle documentation:<br />
<em><strong>&#8220;Wait events are statistics that are incremented by a server process or thread to indicate that it had to wait for an event to complete before being able to continue processing.&#8221;</strong></em></p>
<p>For example, wait events can be related to I/O, locks, memory allocation, etc.</p>
<p>The top events tell us what the server processes wait for the most. Eliminating these wait events will definately reduce execution time, since server processes will not have to wait this time for other operations to complete.</p>
<p>There are many wait event in Oracle databases, this is a list of some important and common wait events:</p>
<ul>
<li>buffer busy waits</li>
<li>free buffer waits</li>
<li><a href="http://www.dbsnaps.com/uncategorized/oracle-wait-event-db-file-scattered-read" target="_self">db file scattered read</a></li>
<li><a href="http://www.dbsnaps.com/uncategorized/oracle-wait-event-db-file-sequential-read" target="_self">db file sequential read</a></li>
<li>enqueue waits</li>
<li>log buffer space</li>
<li>log file sync</li>
</ul>
<p>To identify a performance problem we will check the time spent on each wait event and the average wait time. These numbers can be very different for different wait events, I/O wait events will probably have a low average, while waiting on locking related wait events can take a long time. Don&#8217;t forget to compare the wait time to the AWR report time period, waiting on I/O for an hour may be reasonable if the AWR report was generated on 6 hours period, but may indicate a problem on a 10 minutes report (the waiting time can exceed the total report time, since it is cumulative for all server processes).</p>
<p>The best way to find performance problems is to compare the wait events and the time spent on them to an AWR report from a time period in which the database worked fine. So try to save reports as a baseline for future reference.</p>
<p>In the next posts we&#8217;ll go deeper into analyzing the rest of the AWR report.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/analyzing-oracle-awr-reports-top-5-events/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Oracle Associative Arrays</title>
		<link>http://www.dbsnaps.com/oracle/oracle-associative-arrays/</link>
		<comments>http://www.dbsnaps.com/oracle/oracle-associative-arrays/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 11:44:43 +0000</pubDate>
		<dc:creator>Liron Amitzi</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle - Latest Articles]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[Associative]]></category>
		<category><![CDATA[index by]]></category>

		<guid isPermaLink="false">http://www.dbsnaps.com/?p=241</guid>
		<description><![CDATA[Working with arrays in PL/SQL is not very complicated, this is a sequence of cells we can access by their index.

Sometimes, all we need is to get a value from an index we have, and this index is not a sequence number, but a number that has meaning or even text.]]></description>
			<content:encoded><![CDATA[<p>Working with arrays in PL/SQL is not very complicated, this is a sequence of cells we can access by their index.</p>
<p>Sometimes, all we need is to get a value from an index we have, and this index is not a sequence number, but a number that has meaning or even text. To solve this problem we can use a regular table or temporary table, but these have some overhead and can be affected by other users or operations.</p>
<p>A simple example for this scenario can be coloring the world map in 4 colors (red, green, blue and yellow). In this example each country has a color and we need to know the color for a given country and go over the countries to check if they have a color.</p>
<p>The most effective way to do that is to use associative arrays with varchar2(30) as the index (for the country names) and varchar2(6) and the value (for the colors).</p>
<p>The following code shows how to work with associative arrays, add new cells, check the array length and go over the entire array.</p>
<pre>
<div>
<pre class="brush: sql;">
&lt;pre&gt;declare
   type map_array is table of varchar2(4) index by varchar2(30);
   map map_array;
   idx varchar2(30);
begin
   -- add countries to the array
   map('France'):='blue';
   map('Italy'):='red';

   -- print the number of countries in the arrary
   dbms_output.put_line('There are '||map.count||' countries');

   -- go over the entire array
   idx:=map.first;
   while (idx is not null)
   loop
      dbms_output.put_line('Country '||idx||' is '||map(idx));
      idx:=map.next(idx);
   end loop;

   -- check if a country exists
   idx:='England';
   if (map.exists(idx))
   then
      dbms_output.put_line(idx||' has the color '||map(idx));
   else
      dbms_output.put_line(idx||' does not have a color');
   end if;
end;
</pre>
</div>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/oracle-associative-arrays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bitwise Operators in Oracle</title>
		<link>http://www.dbsnaps.com/oracle/bitwise-operators-in-oracle/</link>
		<comments>http://www.dbsnaps.com/oracle/bitwise-operators-in-oracle/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 10:55:39 +0000</pubDate>
		<dc:creator>Liron Amitzi</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[bitand]]></category>
		<category><![CDATA[bitor]]></category>
		<category><![CDATA[bitwise]]></category>

		<guid isPermaLink="false">http://www.dbsnaps.com/?p=232</guid>
		<description><![CDATA[Working with bit size variables and bitwise operators is quite common in programming, but less common in databases. In Oracle, there is not even a bit datatype. How can we work with bits in Oracle?
]]></description>
			<content:encoded><![CDATA[<p>Working with bit size variables and bitwise operators is quite common in programming, but less common in databases. In Oracle, there is not even a bit datatype. But why do we need using bits in Oracle?</p>
<p>Let&#8217;s take an example where bit can be very useful. An example can be restaurant website, where we need to keep information about the type of food in the restaurants. There are several ways to keep this information (column for each type and 0 or 1 for true and false, or a separate one-to-many table that contains a rows which are restaurant id and food type couple), but we can also use bits to do that. We can decide that Italian food will be the first bit, steakhouse will be the second, pizza is the third and so on. From that we can generate a number that matches the food types in the restaurant. For example, with the type we mentioned, a Italian restaurant that has also pizza will be 101 in binary which is the number 5. A steak house will be 010 which is 2.</p>
<p>This solution requires a very little storage, and it is very easy to handle in the application.</p>
<p>The only problem is that we may need bitwise operators in Oracle for some queries. Oracle supplies the BITAND function, but does not supply any other bitwise functions. We will have to create these for ourselves:</p>
<p><strong>BITOR</strong></p>
<pre>
<div>
<pre class="brush: sql;">
create or replace function bitor (x number, y number)
return number
is
begin
   return (x+y)-bitand(x,y);
end;
</pre>
</div>
</pre>
<p><strong>BITXOR</strong></p>
<pre>
<div>
<pre class="brush: sql;">
&lt;pre&gt;create or replace function bitxor (x number, y number)
return  number
is
begin
   return bitor(x,y)-bitand(x,y);
end;
</pre>
</div>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/bitwise-operators-in-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Temporary Tablespace Free Space</title>
		<link>http://www.dbsnaps.com/oracle/oracle-temporary-tablespace-free-space/</link>
		<comments>http://www.dbsnaps.com/oracle/oracle-temporary-tablespace-free-space/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 12:42:59 +0000</pubDate>
		<dc:creator>Liron Amitzi</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Free space]]></category>
		<category><![CDATA[Temporary Tablespace]]></category>

		<guid isPermaLink="false">http://dbsnaps.oracletutorialvideos.com/?p=150</guid>
		<description><![CDATA[The temporary tablespace in Oracle is used to store data that is temporary and session specific (sort operations, hash joins, temporary tables data, etc.).
Once a session needs to perform a large sort operation]]></description>
			<content:encoded><![CDATA[<p>The temporary tablespace in Oracle is used to store data that is temporary and session specific (sort operations, hash joins, temporary tables data, etc.).<br />
Once a session needs to perform a large sort operation, part of the information is written to the temporary tablespace in a sort segment. The sort segment extents in the temporary tablspace are alloacted once, to prevent the database from performing many allocation and deallocation operations. Instead of deallocating the free extents, when the sort or join is completed, Oracle marks the extents and blocks as free.<br />
This behavior is efficient but prevents us from decreasing the temp file size if large sort segments were allocated. To do so, we&#8217;ll have to create a new temporary tablespace, change the default temporary tablespace to the new tablespace (and if neccesary, users&#8217; default temporary tablespace as well) and drop the old temporary tablespace.</p>
<p>Information about the sort segments can be found in V$SORT_SEGMENT dictionary view. This view contains one row for each sort segment and the following columns:</p>
<p>TOTAL_EXTENTS &#8211; The number of extents allocated to the sort segment</p>
<p>TOTAL_BLOCKS &#8211; The number of blocks allocated to the sort segment</p>
<p>USED_EXTENTS &#8211; number of extents that are currently being used</p>
<p>USED_BLOCKS &#8211; number of blocks that are currently being used</p>
<p>FREE_EXTENTS &#8211; number of extents that are allocated to the segment but currently marked as free</p>
<p>FREE_BLOCKS &#8211; number of blocks that are allocated to the segment but currently marked as free</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/oracle-temporary-tablespace-free-space/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Temporary Tablespace Usage</title>
		<link>http://www.dbsnaps.com/oracle/oracle-temporary-tablespace-usage/</link>
		<comments>http://www.dbsnaps.com/oracle/oracle-temporary-tablespace-usage/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 12:42:02 +0000</pubDate>
		<dc:creator>Liron Amitzi</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Temporary Tablespace]]></category>
		<category><![CDATA[Usage]]></category>

		<guid isPermaLink="false">http://dbsnaps.oracletutorialvideos.com/?p=148</guid>
		<description><![CDATA[The temporary tablespace in Oracle is used to store data that is temporary and session specific (sort operations, hash joins, temporary tables data, etc.).
Users use the same temporary segments in the temporary tablespace to perform the sort operation, joins, etc. How can we tell which users use the temporary tablespace and how much space they use?]]></description>
			<content:encoded><![CDATA[<p>The temporary tablespace in Oracle is used to store data that is temporary and session specific (sort operations, hash joins, temporary tables data, etc.).<br />
Users use the same temporary segments in the temporary tablespace to perform the sort operation, joins, etc. How can we tell which users use the temporary tablespace and how much space they use?</p>
<p>You can find information about usage of the temporary tablespace in the V$SORT_USAGE dictionary view. This view contains the following columns:</p>
<p>USERNAME &#8211; database user name</p>
<p>SESSION_ADDR &#8211; address of the session, can be used to identify the session in V$SESSION according to the SADDR column</p>
<p>SQL_ID &#8211; the identifier of the SQL that requires the sort or join, can be used to identify the SQL from V$SQL according to the SQL_ID column</p>
<p>EXTENTS &#8211; number of extents in the temporary segment being used by this session</p>
<p>BLOCKS &#8211; number of blocks in the temporary segment being used by this session</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/oracle-temporary-tablespace-usage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Active Standby Database tutorial</title>
		<link>http://www.dbsnaps.com/oracle/oracle-active-standby-database/</link>
		<comments>http://www.dbsnaps.com/oracle/oracle-active-standby-database/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 12:28:52 +0000</pubDate>
		<dc:creator>Liron Amitzi</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[High Availability]]></category>
		<category><![CDATA[Main-Availability]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[11g]]></category>
		<category><![CDATA[Physical Active Standby Database]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://dbsnaps.oracletutorialvideos.com/?p=143</guid>
		<description><![CDATA[A physical standby database could always be opened in "read only" mode. The problem was that it didn't apply any archived logs at that time. It could only apply logs when mounted.

Then came Oracle 11g...]]></description>
			<content:encoded><![CDATA[<p>A physical standby database could always be opened in &#8220;read only&#8221; mode. The problem was that it didn&#8217;t apply any archived logs at that time. It could only apply logs when mounted.</p>
<p>Then came Oracle 11g with the &#8220;active standby database&#8221; feature (sometimes referenced as real-time query).</p>
<p>With this feature we can open the database in &#8220;read only&#8221; mode, and can still apply archive logs from the primary.</p>
<p>Let&#8217;s see how it works&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/oracle-active-standby-database/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Oracle Datafile High Watermark</title>
		<link>http://www.dbsnaps.com/oracle/oracle-datafile-high-watermark/</link>
		<comments>http://www.dbsnaps.com/oracle/oracle-datafile-high-watermark/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 12:23:58 +0000</pubDate>
		<dc:creator>Liron Amitzi</dc:creator>
				<category><![CDATA[Main-Administration]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[High Watermark]]></category>

		<guid isPermaLink="false">http://dbsnaps.oracletutorialvideos.com/?p=139</guid>
		<description><![CDATA[Datafiles in Oracle can be resized to a smaller size only if there are no used blocks at the end of the file. If there is a used block at the end of the file we will not be able to reduce it size even if the rest of the file is empty]]></description>
			<content:encoded><![CDATA[<p>Datafiles in Oracle can be resized to a smaller size only if there are no segments at the end of the file. If there is a segment at the end of the file we will not be able to reduce it size even if the rest of the file is empty.</p>
<p>If we knew where is the last used block in the file, we would know the minimum size of the datafile.</p>
<p>Use this query to get the file&#8217;s high water mark:</p>
<pre class="brush: sql;">

select /*+ rule */
a.tablespace_name,
a.file_name,
a.bytes/1024/1024 file_size_MB,
(b.maximum+c.blocks-1)*d.block_size/1024/1024 highwater
from
dba_data_files a,
(select file_id,max(block_id) maximum
from dba_extents
group by file_id) b,
dba_extents c,
    dba_tablespaces d
where a.file_id  = b.file_id
and c.file_id  = b.file_id
and c.block_id = b.maximum
  and d.tablespace_name=a.tablespace_name
order by a.tablespace_name,a.file_name;
</pre>
<pre>The query returns the following columns:

TABLESPACE_NAME - the name of the tablespace

FILE_NAME - the name of the datafile

FILE_SIZE_MB - the current size of the file (in MB)

HIGHWATER - the minimum size that the file can reduced to (in MB)</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/oracle-datafile-high-watermark/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating an Oracle 11g Database tutorial</title>
		<link>http://www.dbsnaps.com/oracle/creating-an-oracle-11g-database/</link>
		<comments>http://www.dbsnaps.com/oracle/creating-an-oracle-11g-database/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 12:16:46 +0000</pubDate>
		<dc:creator>Liron Amitzi</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[11g]]></category>
		<category><![CDATA[Creating Database]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://dbsnaps.oracletutorialvideos.com/?p=137</guid>
		<description><![CDATA[This video will show you how to create an Oracle 11g database]]></description>
			<content:encoded><![CDATA[<p><strong><span style="text-decoration: underline;">In this video we will demonstrate Oracle 11g installation on Linux.</span></strong></p>
<p>When installing Oracle on Linux, there are several prerequisites steps that needs to be completed before the installation process ifself.<br />
The installation GUI is identical to other operating systems, but the steps we need to complete before starting the installation are different.<br />
This video will show you how to install Oracle 11gR1, step by step.</p>
<p>This video shows Oracle 11gR1 installation on Linux Cent OS 5 (which is similar to RedHat 5), but can be used to understand the general Oracle installation on Linux.</p>
<p>You can download the Oracle Database software from OTN:</p>
<ul>
<li><a href="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html" target="_blank">Oracle Database 11g Release 1- OTN</a></li>
</ul>
<p>We will start by checking the requirements for Oracle installation.</p>
<p>1)    <span style="text-decoration: underline;">Checking the memory, SWAP, Kernel version and free space requirements.</span></p>
<p style="padding-left: 30px;"><span style="font-size: 13.3333px;">Memory &#8211; Oracle 11g requires at      least 1GB RAM.<br />
You&#8217;ll be able to check the server&#8217;s memory by executing the command:<br />
<strong> </strong></span></p>
<pre class="brush: bash;">[root ~]grep MemTotal /proc/meminfo</pre>
<p style="padding-left: 30px;"><span style="font-size: 13.3333px;">Swap requirements are specified      in the documentation and based on the RAM.<br />
Check the server&#8217;s SWAP by executing the command:<br />
<strong> </strong></span></p>
<pre class="brush: bash;">[root ~]grep SwapTotal /proc/meminfo</pre>
<p style="padding-left: 30px;"><span style="font-size: 13.3333px;">At least 400Mb are needed in      /tmp directory. In addition, Oracle 11g software requires about 3.5GB.<br />
Check the /tmp available space by executing the command:<br />
<strong> </strong></span></p>
<pre class="brush: bash;">[root ~]df -k /tmp</pre>
<p style="padding-left: 30px;"><span style="font-size: 13.3333px;">Check the server&#8217;s available      space by executing the command:<br />
<strong> </strong></span></p>
<pre class="brush: bash;">[root ~]df -k</pre>
<p style="padding-left: 30px;"><span style="font-size: 13.3333px;">The available column will      display the free space in kilobytes.</span></p>
<p style="padding-left: 30px;"><span style="font-size: 13.3333px;"><br />
</span></p>
<p style="padding-left: 30px;"><span style="font-size: 13.3333px;">The      OS kernel version should be 2.6.18 or higher.<br />
Check the kernel version by executing the command:<br />
<em><strong> </strong></em></span></p>
<pre class="brush: bash;">[root ~] cat /proc/version
OR
[root ~] uname –r</pre>
<p>2)     <span style="text-decoration: underline;">Required Packages</span></p>
<p style="padding-left: 30px;">Oracle 11g software needs several rpm packages to be installed on the server.<br />
You can find the full list of packages in the installation guide:<br />
<a href="http://download.oracle.com/docs/cd/B28359_01/install.111/b32002/pre_install.htm#CHDHFGBJ" target="_blank">http://download.oracle.com/docs/cd/B28359_01/install.111/b32002/pre_install.htm#CHDHFGBJ</a></p>
<p style="padding-left: 30px;">The command &#8220;rpm -qa&#8221; prints the list of all installed packages. With &#8220;grep&#8221; command we will look for specific packages.</p>
<p style="padding-left: 30px;"><strong>Example</strong>: to verify that the gcc package is install, use:</p>
<pre class="brush: bash;">[root ~]rpm –qa | grep gcc</pre>
<p>3)    <span style="text-decoration: underline;">Creating users and groups.</span></p>
<p style="padding-left: 30px;">We will create two new groups: &#8216;dba&#8217; and &#8216;oinstall&#8217; and the &#8216;oracle&#8217; user.</p>
<pre class="brush: bash;">
[root ~] groupadd oinstall
[root ~] groupadd dba
[root ~] useradd -g oinstall -G dba oracle
[root ~] passwd oracle
</pre>
<p>4)    <span style="text-decoration: underline;">Setting Kernel parameters.</span></p>
<p>Open the <em>/etc/sysctl.conf </em>file  and configure the following kernel parameters:</p>
<pre class="brush: bash;">
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
</pre>
<p>Additional information about the kernel parameter can be found in the Documentation:<br />
<a href="http://download.oracle.com/docs/cd/B28359_01/install.111/b32002/pre_install.htm#BABBBDGA" target="_blank">http://download.oracle.com/docs/cd/B28359_01/install.111/b32002/pre_install.htm#BABBBDGA</a></p>
<p>After editing the file, execute the following command to apply the changes.</p>
<pre class="brush: bash;">[root ~] sysctl -p</pre>
<p>5)     <span style="text-decoration: underline;">Add the following lines to the <em>/etc/security/limits.conf</em> file:</span></p>
<pre class="brush: bash;">
oracle              soft    nproc    2047
oracle              hard    nproc   16384
oracle              soft    nofile  1024
oracle              hard    nofile  65536
</pre>
<p><span style="font-size: 13.3333px;">6)    <span style="text-decoration: underline;">Add the following line to the <em>/etc/pam.d/login</em> file:</span></span></p>
<pre class="brush: bash;">
session   required   pam_limits.so
</pre>
<p>7)    <span style="text-decoration: underline;">Add the following lines to the <em>/etc/profile</em> file:</span> This section sets the soft limit for user &#8216;oracle&#8217; upon login:</p>
<pre class="brush: bash;">
if [ $USER = &quot;oracle&quot; ]; then
 if [ $SHELL=&quot;/bin/ksh&quot; ] ; then
    ulimit -p 16384
    ulimit -n 65536
 else
    ulimit -p 16384 -n 65536
 fi
fi
</pre>
<p><span style="line-height: normal; font-size: x-small;"> </span> 8)    <span style="text-decoration: underline;">Creating directories for the Oracle installation:</span> We need to create the directory for Oracle installation. This directory should be owned by user &#8216;oracle&#8217;</p>
<pre class="brush: bash;">
[root ~]mkdir -p /u01/app/oracle/product/11.1.0/db_1
[root ~]chown -R oracle:oinstall /u01
[root ~]chmod -R 775 /u01
</pre>
<p>9)    <span style="text-decoration: underline;">Disable access control:</span></p>
<p style="padding-left: 30px;">Access control does not allow opening X-Windows from any server. We will use xhost command to disable this access control.</p>
<pre class="brush: bash;">[root ~] xhost +</pre>
<p>10)   <span style="text-decoration: underline;">Edit the /etc/profile file:</span></p>
<p style="padding-left: 30px;">We will now connect as user &#8216;oracle&#8217; and configure the environment in the bash_profile file.</p>
<pre class="brush: bash;">
[root ~]su – oracle
[oracle ~]vi .bash_profile
</pre>
<p>We will set the ORACLE_BASE for oracle base directory and ORACLE_SID environment variables. Add the following lines to bash_profile file:</p>
<pre class="brush: bash;">
export ORACLE_HOSTNAME=&lt;SERVER_NAME&gt;
export ORACLE_BASE=/u01/app/oracle;
export ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1;
export ORACLE_SID=orcl;
</pre>
<p><span style="font-size: 13.3333px;">Apply the changes so that the new variables will be set:</span></p>
<pre class="brush: bash;">[oracle ~] . .bash_profile
</pre>
<p><strong><em> </em></strong> <strong><span style="color: #0000ff;">The pre-requirement part is completed. All we have to do now is to start the installation.</span></strong></p>
<p><strong><span style="color: #0000ff;"><br />
</span></strong></p>
<p>11)    <span style="text-decoration: underline;">Navigate to the installation directory and start the installation:</span></p>
<pre class="brush: bash;">
[oracle ~] cd /install/database
[oracle ~] ./runInstaller</pre>
<p><strong>We will skip the installation part as it is quite straightforward, and go to the end of the installation part.</strong></p>
<p>12)    <span style="text-decoration: underline;">Execute configuration scripts as root user:</span></p>
<p style="padding-left: 30px;">At the end of the installation, you&#8217;ll see the &#8220;execute configuration scripts&#8221; wizard window. We should run these scripts as root.  Open a Terminal as root and execute the below scripts”</p>
<pre class="brush: bash;">
[root ~] /u01/app/oracle/oraInventory/orainstRoot.sh
[root ~] /u01/app/oracle/product/11.1.0/db_1/root.sh
</pre>
<p><strong>The installation is now complete.</strong></p>
<p>13)    <span style="text-decoration: underline;">Updating the .bash_profile file with more environment variables:</span></p>
<p style="padding-left: 30px;">The last thing we need to do is updating the .bash_profile file:</p>
<pre class="brush: bash;">[oracle ~] vi .bash_profile</pre>
<p style="padding-left: 30px;">We will set the ORACLE_HOME for oracle home directory and the path environment variables. Add the following lines to bash_profile file:</p>
<pre class="brush: bash;">
export ORACLE_HOSTNAME=&lt;SERVER_NAME&gt;
export ORACLE_BASE=/u01/app/oracle;
export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1;
export ORACLE_SID=orcl;
export PATH=/usr/sbin:$PATH;
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
</pre>
<p style="padding-left: 30px;"><span style="font-size: 13.3333px;">Apply the changes so that the new variables will be set:</span></p>
<pre class="brush: bash;">
[oracle ~]. .bash_profile
</pre>
<p><em>14) </em><span style="text-decoration: underline;">Verify that everything is configured correctly.</span></p>
<pre class="brush: bash;">
[oracle ~] sqlplus / as sysdba

SQL*Plus: Release 11.1.0.1.0 Production on Mon Oct 25 12:26:26 2010

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.1.0.1.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL&gt;exit
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/creating-an-oracle-11g-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

