<?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; Administration</title>
	<atom:link href="http://www.dbsnaps.com/category/oracle/administration/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 11gR2 New Feature &#8211; Deferred Segment Creation</title>
		<link>http://www.dbsnaps.com/oracle/oracle-deferred-segment-creation/</link>
		<comments>http://www.dbsnaps.com/oracle/oracle-deferred-segment-creation/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 12:00:12 +0000</pubDate>
		<dc:creator>Roni Vered</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle - Latest Articles]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[11g2r new features]]></category>
		<category><![CDATA[Deferred Segment Creation]]></category>

		<guid isPermaLink="false">http://www.dbsnaps.com/?p=634</guid>
		<description><![CDATA[In this DBSNAPS tutorial video we will present you a new feature of Oracle database 11gR2: Deferred segment creation.
]]></description>
			<content:encoded><![CDATA[<p>In this DBSNAPS tutorial video we will present you a new feature of Oracle database 11gR2: <strong>Deferred segment creation</strong>.</p>
<p>The script for the demonstration from the tutorial can be downloaded here:<a href="http://www.dbsnaps.com/wp-content/uploads/2010/12/seg_demo.txt">seg_demo</a></p>
<p>Until 11gR2, if you create a table, Oracle database allocates space for initial segment.</p>
<p>The new feature allows you to defer creation of this initial segment until the first row of data is inserted into the table.</p>
<p>In addition to deferring the table’s segment, it also defers the segment creation for LOB columns of the table, indexes created implicitly as part of table creation, and indexes subsequently explicitly created on the table.</p>
<p>By using this feature, large amount of disk space can be saved in case of many unpopulated tables.</p>
<p>A new parameter DEFERRED_SEGMENT_CREATION is created to control the feature. It can be enabled/disabled it at the <strong>session</strong> or <strong>system </strong>level (doesn’t require Instance restart).</p>
<pre class="brush: sql;">
Alter session set deferred_segment_creation=true;

Alter system set deferred_segment_creation=true;
  </pre>
<p>Deferred segment creation is enabled by default. It’s also possible to enable/disable it for <strong>a single table</strong> by specifying the deferred segment creation clause.</p>
<pre class="brush: sql;">
CREATE TABLE.... SEGMENT CREATION IMMEDIATE

CREATE TABLE... SEGMENT CREATION DEFERRED
 </pre>
<p>* A table with deferred segment won’t exist in the *_EXTENTS System view before inserting into it data (as no extent is created)<br />
* A new column was added to the *_TABLES,  *_INDEXES and *_LOBS System views &#8211; SEGMENT_CREATED, whichindicates whether the initial segment was created or not. Its values are ‘YES’ / ’NO’.</p>
<p><strong>One important note</strong> &#8211; All segments related to a table are created when the first row is inserted into it. And that, even if they are not used to store data</p>
<p>Following is a short demo that demonstrates the new features.</p>
<pre class="brush: sql;">
SQL&gt; @c:\seg_demo
====================================================================
Creating a user for the demonstration and granting it privileges:
====================================================================

SQL&gt; CREATE USER seg_demo identified by seg_demo
User created.
SQL&gt; GRANT RESOURCE , CONNECT TO seg_demo
Grant succeeded.
SQL&gt; GRANT SELECT ON V_$PARAMETER TO seg_demo
Grant succeeded.
SQL&gt; CONNECT seg_demo/seg_demo
Connected.

====================================================================
Displaying relevant parameters
====================================================================

SQL&gt; SHOW PARAMETER def
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
deferred_segment_creation            boolean     TRUE
SQL&gt; SHOW PARAMETER compatible
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string      11.2.0.0.0

=========================================================================================
Creating a table. The table will be created without segments for all its related objects
=========================================================================================

SQL&gt; CREATE TABLE test_seg (id number CONSTRAINT id_pk primary key,
2				email VARCHAR2(50)  CONSTRAINT  email_uk unique,
3				name VARCHAR2(30),
4				data CLOB)
5			lob(data) STORE AS TEST_SEG_DATA_LOB
6			(index test_seg_data_lob_ix)
Table created.

=========================================================================================
Displaying relevant information FROM the System views.
=========================================================================================

SQL&gt; SELECT segment_name ,SEGMENT_TYPE
2	FROM user_segments
3 	WHERE segment_name = 'TEST_SEG'

no rows selected

SQL&gt; SELECT segment_name, extent_id, bytes
2 	FROM user_extents

no rows selected

SQL&gt; SELECT table_name, SEGMENT_CREATED
2 	FROM user_tables

TABLE_NAME                     SEGMENT_CREATED
------------------------------ ---------------
TEST_SEG                       NO

SQL&gt; SELECT table_name, index_name, SEGMENT_CREATED
2 	FROM user_indexes

TABLE_NAME                     INDEX_NAME                     SEGMENT_CREATED
------------------------------ ------------------------------ ---------------
TEST_SEG                       ID_PK                          NO
TEST_SEG                       TEST_SEG_DATA_LOB_IX           NO
TEST_SEG                       EMAIL_UK                       NO

SQL&gt; SELECT  TABLE_NAME ,segment_name, SEGMENT_CREATED
2 	FROM user_lobs

TABLE_NAME                     SEGMENT_NAME         SEGMENT_CREATED
------------------------------ -------------------- ---------------
TEST_SEG                       TEST_SEG_DATA_LOB    NO

=========================================================================================
Inserting the first row to the table.
=========================================================================================

SQL&gt; INSERT INTO TEST_SEG VALUES (1,'Roni@@dbsnaps.com','DBSNAPS','Deferred Segment Creation')

1 row created.

SQL&gt; commit

Commit complete.

=========================================================================================
All the relevant segments will be created.
Displaying relevant information FROM the System views.
=========================================================================================

SQL&gt; SELECT segment_name ,SEGMENT_TYPE
2 FROM user_segments

SEGMENT_NAME         SEGMENT_TYPE
-------------------- ------------------
TEST_SEG             TABLE
TEST_SEG_DATA_LOB_IX LOBINDEX
ID_PK                INDEX
EMAIL_UK             INDEX
TEST_SEG_DATA_LOB    LOBSEGMENT

SQL&gt; SELECT segment_name, extent_id, bytes
2 	FROM user_extents

SEGMENT_NAME          EXTENT_ID      BYTES
-------------------- ---------- ----------
TEST_SEG                      0      65536
TEST_SEG_DATA_LOB_IX          0      65536
ID_PK                         0      65536
EMAIL_UK                      0      65536
TEST_SEG_DATA_LOB             0      65536
SQL&gt; SELECT table_name, SEGMENT_CREATED
2 	FROM user_tables

TABLE_NAME                     SEGMENT_CREATED
------------------------------ ---------------
TEST_SEG                       YES

SQL&gt; SELECT table_name, index_name, SEGMENT_CREATED
2 	FROM user_indexes
TABLE_NAME                     INDEX_NAME                     SEGMENT_CREATED
------------------------------ ------------------------------ ---------------
TEST_SEG                       ID_PK                          YES
TEST_SEG                       TEST_SEG_DATA_LOB_IX           YES
TEST_SEG                       EMAIL_UK                       YES
SQL&gt; SELECT  TABLE_NAME ,segment_name, SEGMENT_CREATED
2 	FROM user_lobs

TABLE_NAME                     SEGMENT_NAME         SEGMENT_CREATED
------------------------------ -------------------- ---------------
TEST_SEG                       TEST_SEG_DATA_LOB    YES

=========================================================================================
The parameter can be changed in the System/Session level.
Changing the session settings to deferred_segment_creation=FALSE.
=========================================================================================

ALTER SESSION SET deferred_segment_creation=FALSE

Session altered.

=========================================================================================
While this parameter is set to FALSE, tables will be created with all their segments.
=========================================================================================
prompt
SQL&gt; CREATE TABLE test_seg2 (id number CONSTRAINT id2_pk primary key,
2    			name VARCHAR2(30))

Table created.

=========================================================================================
Displaying relevant information FROM the System views.
=========================================================================================

SQL&gt; SELECT segment_name ,SEGMENT_TYPE
2 	FROM user_segments
3 	WHERE segment_name = 'TEST_SEG2'

SEGMENT_NAME         SEGMENT_TYPE
-------------------- ------------------
TEST_SEG2            TABLE
SQL&gt; SELECT segment_name, extent_id, bytes
2 	FROM user_extents
3 	WHERE segment_name = 'TEST_SEG2'

SEGMENT_NAME          EXTENT_ID      BYTES
-------------------- ---------- ----------
TEST_SEG2                     0      65536

SQL&gt; SELECT table_name, SEGMENT_CREATED
2 	FROM user_tables
3 	WHERE table_name = 'TEST_SEG2'

TABLE_NAME                     SEGMENT_CREATED
------------------------------ ---------------
TEST_SEG2                      YES

SQL&gt; SELECT table_name, index_name, SEGMENT_CREATED
2 	FROM user_indexes
3 	WHERE table_name = 'TEST_SEG2'

TABLE_NAME                     INDEX_NAME                     SEGMENT_CREATED
------------------------------ ------------------------------ ---------------
TEST_SEG2                      ID2_PK                         YES

=========================================================================================
In addition, the feature can be enabled/Disabled for a Single table.
While the parameter is set to TRUE, we will disable the deferred segment creation for a single table .
=========================================================================================

ALTER SESSION SET deferred_segment_creation=TRUE

Session altered.

SQL&gt; CREATE TABLE test_seg3 (id number CONSTRAINT id3_pk primary key,
2	    			name VARCHAR2(30))
3				SEGMENT CREATION IMMEDIATE

Table created.

=========================================================================================
Displaying relevant information FROM the System views.
=========================================================================================

SQL&gt; SELECT segment_name ,SEGMENT_TYPE
2 	FROM user_segments
3 	WHERE segment_name = 'TEST_SEG3'

SEGMENT_NAME         SEGMENT_TYPE
-------------------- ------------------
TEST_SEG3            TABLE

SQL&gt; SELECT segment_name, extent_id, bytes
2 	FROM user_extents
3	WHERE segment_name = 'TEST_SEG3'

SEGMENT_NAME          EXTENT_ID      BYTES
-------------------- ---------- ----------
TEST_SEG3                     0      65536

SQL&gt; SELECT table_name, SEGMENT_CREATED
2 	FROM user_tables
3 	WHERE table_name = 'TEST_SEG3'

TABLE_NAME                     SEGMENT_CREATED
------------------------------ ---------------
TEST_SEG3                      YES

SQL&gt; SELECT table_name, index_name, SEGMENT_CREATED
2 	FROM user_indexes
3 	WHERE table_name = 'TEST_SEG3'

TABLE_NAME                     INDEX_NAME                     SEGMENT_CREATED
------------------------------ ------------------------------ ---------------
TEST_SEG3                      ID3_PK                         YES

=========================================================================================
While the parameter is set to FALSE, we will Enable the deferred segment creation for a single table .
=========================================================================================

SQL&gt; ALTER SESSION SET deferred_segment_creation=FALSE

Session altered.

SQL&gt; CREATE TABLE test_seg4 (id number CONSTRAINT id4_pk primary key,
2         			name VARCHAR2(30))
3  	SEGMENT CREATION DEFERRED

Table created.

=========================================================================================
Displaying relevant information FROM the System views.
=========================================================================================

SQL&gt; SELECT segment_name ,SEGMENT_TYPE
2	FROM user_segments
3 	WHERE segment_name = 'TEST_SEG4'

no rows selected

SQL&gt; SELECT segment_name, extent_id, bytes
2 	FROM user_extents
3 	WHERE segment_name = 'TEST_SEG4'

no rows selected

SQL&gt; SELECT table_name, SEGMENT_CREATED
2 FROM user_tables
3 WHERE table_name = 'TEST_SEG4'

TABLE_NAME                     SEGMENT_CREATED
------------------------------ ---------------
TEST_SEG4                      NO

SQL&gt; SELECT table_name, index_name, SEGMENT_CREATED
2 	FROM user_indexes
3 	WHERE table_name = 'TEST_SEG4'

TABLE_NAME                     INDEX_NAME                     SEGMENT_CREATED
------------------------------ ------------------------------ ---------------
TEST_SEG4                      ID4_PK                         NO

=========================================================================================
The END. Dropping the demonstration user
=========================================================================================

SQL&gt; CONNECT / as sysdba

Connected.

DROP USER seg_demo CASCADE

User dropped.
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/oracle-deferred-segment-creation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parallel New Features in Oracle 11gR2</title>
		<link>http://www.dbsnaps.com/oracle/parallel-new-features-in-oracle-11gr2/</link>
		<comments>http://www.dbsnaps.com/oracle/parallel-new-features-in-oracle-11gr2/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 10:14:40 +0000</pubDate>
		<dc:creator>Oded Raz</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle - Latest Articles]]></category>

		<guid isPermaLink="false">http://www.dbsnaps.com/?p=690</guid>
		<description><![CDATA[Oracle 11gR2 brings us new features related to parallelism. 
The new features are controlled by the PARALLEL_DEGREE_POLICY initialization parameter. Learn how to use these new features to leverage your needs.]]></description>
			<content:encoded><![CDATA[<p>Oracle 11gR2 brings us new features related to parallelism.The new features are controlled by the PARALLEL_DEGREE_POLICY initialization parameter. Learn how to use these new features to leverage your needs.</p>
<h2>Automatic Parallel Degree</h2>
<p>When PARALLEL_DEGREE_POLICY is set to AUTO, automatic parallel degree is enabled. Oracle will evaluate the execution time of the statement, and if it exceeds the value of PARALLEL_MIN_TIME_THRESHOLD parameter (10 seconds by default) Oracle will calculate an automatic degree of parallelism (DOP) for this statement.</p>
<p>Oracle calculates the DOP based on the statement requirements and the load on the server. The DOP can be limited by the parameter PARALLEL_DEGREE_LIMIT:</p>
<ul>
<li>CPU (default) &#8211; will set the maximum DOP to the value of PARALLEL_THREADS_PER_CPU * CPU_COUNT * # of instances.</li>
<li>IO  - will limit the DOP according to the I/O of the system (available only after running DBMS_RESOURCE_MANAGER.CALIBRATE_IO).</li>
<li>Integer value &#8211; will limit the DOP to this integer.</li>
</ul>
<p>When PARALLEL_DEGREE_POLICY is set to LIMITED, Oracle will automatically determine the DOP for the statements. However, statements that are not specified to run in parallel, will run in serial.</p>
<h2>Statement Queuing</h2>
<p>When a statement is executed, Oracle determines the DOP for this statement. If creating the calculated number of parallel processes will cause the total number of active parallel processes in the system to exceed the PARALLEL_SERVERS_TARGET, this statement will be queued.</p>
<p>The queue of statements is based on the simple “first in first out” mechanism. Once there are enough parallel processes available, the statement will start executing.</p>
<p>Using resource manager, we can set priority in the statement queue, timeout for statements and manage the amount of parallel processes for statements.</p>
<h2>In Memory Parallel Execution</h2>
<p>When running a parallel operation, the server process is reading the data from the file using direct operation into its PGA. The data blocks are not cached in the SGA and are not read from it. The in memory parallel execution feature enables the server processes to load the blocks to the SGA and read them from the SGA.</p>
<p>If the object is too large to fit in the buffer cache, Oracle will still use direct read.</p>
<h2>Disable Automatic Parallel Features</h2>
<p>Enabling and disabling the automatic parallel features is made using the PARALLEL_DEGREE_POLICY parameter:</p>
<ul>
<li>AUTO &#8211; all of the above features are enabled.</li>
<li>LIMITED &#8211; in memory parallel execution and statement queuing will be disabled, the automatic DOP will be enabled only for queries that were set to run in parallel.</li>
<li>MANUAL &#8211; disable all the automatic parallel features and revert parallel behavior to pre-11gR2</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/parallel-new-features-in-oracle-11gr2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle &#8211; Writing into the Alert.log file</title>
		<link>http://www.dbsnaps.com/oracle/oracle-writing-into-the-alert-log-file/</link>
		<comments>http://www.dbsnaps.com/oracle/oracle-writing-into-the-alert-log-file/#comments</comments>
		<pubDate>Wed, 29 Sep 2010 16:28:54 +0000</pubDate>
		<dc:creator>Roni Vered</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle - Latest Articles]]></category>
		<category><![CDATA[Alert.log]]></category>
		<category><![CDATA[dbms_system.ksdwrt]]></category>

		<guid isPermaLink="false">http://www.dbsnaps.com/?p=551</guid>
		<description><![CDATA[The Alert.log file is a log that chronological records important information about error messages and exceptions during daily database operations, learn how to insert a manual records into this useful file.]]></description>
			<content:encoded><![CDATA[<p>The Alert.log file is a log that chronological records important information about error messages and exceptions during daily database operations.</p>
<p>In this log file you can find various messages such as: Database Startup and Shutdown, different ORA errors, log switches, pointers to trace files and dump files and more.</p>
<p><span style="font-size: 13.3333px;">The Alert.log is the first place a DBA will go to look for errors in the database.<br />
As many organizations monitor the Alert.log file for errors and exceptions it would have been nice if we could have entered our own errors and messages into the Alert.log. </span></p>
<p><span style="font-size: 13.3333px;">Oracle gives us the option to insert a manual record to the Alert.log and/or to the trace files themselves. </span></p>
<p><span style="font-size: 13.3333px;">The procedure <strong>kdswrt</strong> in <strong>dbms_system </strong>package<strong> </strong>allows us to write own messages in the alert log / trace files or both.<br />
It receives two parameters:</span></p>
<p><span style="font-size: 13.3333px;">-   A number that indicates where do we want to write our message:</span></p>
<ul>
<li>1 &#8211; Writing to a TRACE file.</li>
<li>2 &#8211; Writing to the Alert.log file.</li>
<li>3 &#8211; Writing to both of them.</li>
</ul>
<p><span style="font-size: 13.3333px;"> </span></p>
<p><span style="font-size: 13.3333px;">-   A text string (the message itself).</span></p>
<p><span style="font-size: 13.3333px;"><span style="text-decoration: underline;">USAGE:</span></span><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 25px; font-size: 11.6667px; white-space: pre;"> </span></p>
<pre class="brush: sql;">exec dbms_system.ksdwrt(2, 'ORA-9999: Procedure TEST has ended successfully.);</pre>
<p><span style="font-size: 13.3333px;">The entry in the Alert.log will look like the following:</span><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 25px; font-size: 8.33333px; white-space: pre;"> </span></p>
<pre class="brush: sql;">
Wed Sep 29 10:00:57 2010
Thread 1 advanced to log sequence 7615 (LGWR switch)
Current log# 1 seq# 7615 mem# 0: C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO01.LOG
Wed Sep 29 11:10:15 2010
ORA-9999: Procedure TEST has ended successfully.
Wed Sep 29 11:10:15 2010
Thread 1 advanced to log sequence 7616 (LGWR switch)
Current log# 2 seq# 7616 mem# 0: C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO02.LOG
Wed Sep 29 10:00:57 2010
Thread 1 advanced to log sequence 7615 (LGWR switch)
Current log# 1 seq# 7615 mem# 0: C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO01.LOG
</pre>
<p><span style="font-size: 13.3333px;">It is a very useful feature, as we can use it in our PL/SQL procedures inside the exception handling section or to indicate the procedure’s progression.<br />
Moreover, it can be used inside Unix/Linux shell scripts &#8211; to insert Alert.log messages from various OS scripts.<br />
</span><span style="font-size: 13.3333px;">To see how to run SQL statements from SQLPLUS inside bash scripts, visit our post: <a title="oracle-running-sqlplus-from-unix-bash-scripts" href="http://www.dbsnaps.com/oracle/oracle-running-sqlplus-from-unix-bash-scripts/">oracle-running-sqlplus-from-unix-bash-scripts</a></span></p>
<p>In addition, in Oracle 11g and beyond we are able to directly query the Alert.log file with an SQL statement via the table <strong>X$DBGALERTEXT.</strong></p>
<p>For Example:<span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 21px; font-size: 11.6667px; white-space: pre;"> </span></p>
<pre class="brush: sql;">SELECT message_text FROM X$DBGALERTEXT WHERE rownum &lt; 20;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/oracle-writing-into-the-alert-log-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replicating virtual machines with Oracle databases</title>
		<link>http://www.dbsnaps.com/oracle/replicating-virtual-machines-with-oracle-databases/</link>
		<comments>http://www.dbsnaps.com/oracle/replicating-virtual-machines-with-oracle-databases/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 11:12:44 +0000</pubDate>
		<dc:creator>Roni Vered</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Main-Administration]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle - Latest Articles]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Database Control]]></category>
		<category><![CDATA[emca]]></category>
		<category><![CDATA[virtual machines]]></category>

		<guid isPermaLink="false">http://www.dbsnaps.com/?p=418</guid>
		<description><![CDATA[Virtual machines are used in many organizations due to the simplicity of administration, especially in development environments.

This post will describe how to configure the new replicated machine to work with the Oracle database.]]></description>
			<content:encoded><![CDATA[<p>Virtual machines are used in many organizations due to the simplicity of administration, especially in development environments.</p>
<p>One popular use of virtualization, is creating a MASTER image of one virtual machine and then copy it when necessary.</p>
<p><span style="font-size: 13.3333px">But, what do we do when we need an Oracle Database on this machine. How can we replicate the machine and work with the database.</span></p>
<p><span style="font-size: 13.3333px">Moreover, will the Database itself and the Database Control (Oracle Enterprise Manager) work on the new machine?</span></p>
<p>Below are the steps to configure the database and the Database control in the new machine.<br />
The following steps were performed on Oracle Database 10g Release 2 (10.2.0.4) 64-bit, on CentOS 5 (64-bit) virtual machine :</p>
<p><strong>Database:</strong></p>
<ul>
<li>Change the hostname in the file <strong>$ORACLE_HOME/network/admin/listener.ora</strong><br />
for example:</li>
</ul>
<pre class="brush: plain;">
LISTENER =
   (DESCRIPTION_LIST =
    (DESCRIPTION =
     (ADDRESS = (PROTOCOL = TCP)(HOST = NEW_HOSTNAME)(PORT = 1521))
    )
   )
</pre>
<ul>
<li>Change the hostname in the file <strong>$ORACLE_HOME/network/admin/tnsnames.ora</strong><br />
Please change the hostname in all the relevant entries.<br />
for example:</li>
</ul>
<pre class="brush: plain;">
 ORCL1 =
   (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = NEW_HOSTNAME)(PORT = 1521))
     (CONNECT_DATA =
     (SERVER = DEDICATED)
     (SERVICE_NAME = orcl1)
    )
   )
</pre>
<p><strong>Database Control:</strong></p>
<p>Recreating the Database control repository is needed. without it, the Database Control won&#8217;t start.<br />
In order to recreate the DB control run following commands:</p>
<ul>
<li>Dropping the current DB control&#8217;s settings.<br />
In the &lt;NEW HOSTNAME&gt; please make sure to write the new hostname.</li>
</ul>
<pre class="brush: plain;">
$ emca -deconfig dbcontrol db -repos drop -ORACLE_HOSTNAME &lt;NEW HOSTNAME&gt; -SID &lt;ORACLE_SID&gt; -PORT &lt;Listener's Port&gt; -SYSMAN_PWD &lt;SYSMAN password&gt; -SYS_PWD &lt;SYS password&gt;&lt;/pre&gt;
</pre>
<p><span style="font-size: 11.6667px"> Information in regards the different &#8216;emca&#8217; attributes can be acquire by running &#8216;emca&#8217; without any attribute from the CMD. </span></p>
<pre class="brush: plain;"> $ emca -deconfig dbcontrol db -repos drop -ORACLE_HOSTNAME ORCLSERVER -SID orcl1 -PORT 1521 -SYSMAN_PWD **** -SYS_PWD ****

STARTED EMCA at Jun 17, 2010 7:54:31 PM EM Configuration Assistant, Version 11.2.0.0.2   Production Copyright (c) 2003, 2005, Oracle.  All rights reserved.
Do you wish to continue? [yes(Y)/no(N)]: y

Jun 17, 2010 7:54:49 PM oracle.sysman.emcp.EMConfig   perform
INFO: This operation is being logged at   /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2010_06_17_19_54_31.log.

Jun 17, 2010 7:54:50 PM   oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No   EM-specific actions can be performed.
Jun 17, 2010 7:54:50 PM   oracle.sysman.emcp.ParamsManager checkListenerStatusForDBControl WARNING: Error initializing SQL connection. SQL   operations cannot be performed

Jun 17, 2010 7:54:50 PM oracle.sysman.emcp.EMReposConfig   invoke INFO: Dropping the EM repository (this may take a   while) ...

Jun 17, 2010 7:54:50 PM   oracle.sysman.emcp.EMReposConfig invoke INFO: Repository successfully dropped Enterprise Manager configuration completed
successfully FINISHED EMCA at Jun 17, 2010 7:54:50 PM </pre>
<ul>
<li><span style="font-size: 11.6667px">Recreating the DB control&#8217;s repository.<br />
</span><span style="font-size: 13.3333px">In the &lt;NEW HOSTNAME&gt; please make sure to write the new hostname.</span></li>
</ul>
<pre class="brush: plain;">
$emca -config dbcontrol db -ORACLE_HOSTNAME &lt;NEW HOSTNAME&gt; -SID &lt;ORACLE_SID&gt; -PORT &lt;Listener's  Port&gt; -SYS_PWD &lt;SYSMAN password&gt; -SYSMAN_PWD &lt;SYSMAN  password&gt; -DBSNMP_PWD &lt;DBSNMP password&gt;
</pre>
<p><span style="font-size: 11.6667px">After this step the Database Control&#8217;s repository will be recreated and you will able to connect the Database control&#8217;s URL.</span></p>
<pre class="brush: plain;">$ emca -config dbcontrol db -ORACLE_HOSTNAME ORCLSERVER -SID orcl1 -PORT 1521 -SYS_PWD **** -SYSMAN_PWD **** -DBSNMP_PWD ****
STARTED EMCA at Jun 17, 2010 8:04:27 PM

EM Configuration Assistant, Version 11.2.0.0.2   Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.
Enter the following information:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------
You have specified the following settings

Database ORACLE_HOME ................   /u01/app/oracle/product/11.2.0/db_1

Local hostname ................ &lt;HOSTNAME&gt;

Listener ORACLE_HOME ................   /u01/app/oracle/product/11.2.0/db_1

Listener port number ................ 1521

Database SID ................ orcl1

Email address for notifications ...............

Outgoing Mail (SMTP) server for notifications   ...............

-----------------------------------------------------------------

Do you wish to continue? [yes(Y)/no(N)]: y

Jun 17, 2010 8:04:44 PM oracle.sysman.emcp.EMConfig   perform
INFO: This operation is being logged at   /u01/app/oracle/cfgtoollogs/emca/orcl2/emca_2010_06_17_20_04_27.log          .

Jun 17, 2010 8:04:45 PM   oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository   (this may take a while) ...

Jun 17, 2010 8:05:43 PM   oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully

Jun 17, 2010 8:05:44 PM   oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO: Software library is already configured.

Jun 17, 2010 8:05:44 PM   oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO:    EM_SWLIB_STAGE_LOC (value) will be ignored.

Jun 17, 2010 8:05:44 PM   oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Deploying   Provisioning archives ...

Jun 17, 2010 8:06:09 PM   oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Provisioning archives deployed successfully.

Jun 17, 2010 8:06:09 PM   oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a   while) ...

Jun 17, 2010 8:06:34 PM   oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.

Jun 17, 2010 8:06:34 PM   oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a   while) ...

Jun 17, 2010 8:07:28 PM oracle.sysman.emcp.EMDBPostConfig   performConfiguration
INFO: Database Control started successfully

Jun 17, 2010 8:07:28 PM   oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;   The Database Control URL is https://HOSTNAME:1158/em   &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;

Jun 17, 2010 8:07:36 PM   oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************  WARNING    ************************
Management Repository has been placed in secure mode   wherein Enterprise Manager data will be encrypted.  The encryption key has been placed in the   file: /u01/app/oracle/product/11.2.0/db_1/HOSTNAME_orcl2/sysman/config/emkey.ora.   Please ensure this file is backed up as   the encrypted data will become unusable if this file is lost.
***********************************************************

Enterprise Manager configuration completed   successfully

FINISHED EMCA at Jun 17, 2010 8:07:36 PM
</pre>
<p><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;line-height: 22px;font-size: 13.3333px"><strong>Known Issues:</strong> </span></p>
<p><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;line-height: 22px;font-size: 13.3333px">In case no new hostname is provided in the attribute </span><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;line-height: 26px;font-size: 13.3333px">&#8216;–ORACLE_HOSTNAME&#8217; of the emca command, the utility will use the <strong>old</strong> hostname and the drop/create operation will fail. </span></p>
<p><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;line-height: 26px;font-size: 13.3333px"> </span><br />
<span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;line-height: 26px;font-size: 13.3333px"><strong>For more information in regards to Drop, Create And Recreate DB Control, please refer to Metalink note</strong><strong>:</strong><strong> <span style="text-decoration: underline">278100.1</span></strong></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/replicating-virtual-machines-with-oracle-databases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Multiple AWR reports</title>
		<link>http://www.dbsnaps.com/oracle/automatic-awr-reports/</link>
		<comments>http://www.dbsnaps.com/oracle/automatic-awr-reports/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 08:29:27 +0000</pubDate>
		<dc:creator>Roni Vered</dc:creator>
				<category><![CDATA[Administration]]></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>

		<guid isPermaLink="false">http://www.dbsnaps.com/?p=265</guid>
		<description><![CDATA[Analyzing AWR (Automated Workload Repository) is a common operation while doing a performance and tuning sessions on a database instance.]]></description>
			<content:encoded><![CDATA[<p>Analyzing AWR (Automated Workload Repository) is a common operation while doing a performance and tuning sessions on a database instance.</p>
<p>If your database contains the Oracle Database Diagnostic Pack, then by default, the database generates an AWR snapshot in an hourly interval (it of course can be changed by using the DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS procedure).</p>
<p>Once taken, each two snapshots can be compared in an AWR report and greatly assist in the performance and tuning job.</p>
<p>There’re several methods of generating these AWR report, however, most of the methods are manual methods &#8211; creating one report at the time.</p>
<p>The following procedure will create <strong>several</strong> AWR reports in HTML format in a given directory, based on a begin/end snapshot id parameters.</p>
<p><strong>Procedure’s Parameters:</strong></p>
<ul>
<li><strong>Begin_snap</strong> – the first AWR snapshot to be compared.</li>
<li><strong>End_snap</strong> – the last AWR snapshot to be compared.</li>
<li><strong>Directory</strong> – the directory in which it will generate the reports</li>
</ul>
<p>The required begin/end snapshot values can be retrieved from the following query on DBA_HIST_SNAPSHOT:</p>
<div>
<pre>
<div>
<pre class="brush: sql;">

SELECT     	SNAP_ID,
                TO_CHAR(BEGIN_INTERVAL_TIME,'DD/MM/YYYY HH24:MI') ,
                TO_CHAR(END_INTERVAL_TIME,'DD/MM/YYYY HH24:MI')&lt;/pre&gt;
FROM DBA_HIST_SNAPSHOT 
--The following WHERE clause can be used in order to limit the snapshot details.
--WHERE TO_CHAR(BEGIN_INTERVAL_TIME,'DD/MM/YYYY') &gt; TO_CHAR(SYSDATE -2,'DD/MM/YYYY'); 
</pre>
</div>
</pre>
</div>
<p>Once Created, the procedure can be executed as the following example:</p>
<p><em>EXEC CreateAwrReports (465, 475, &#8216;C:\TEMP&#8217;);</em></p>
<p>Below is the procedure&#8217;s script:</p>
<pre class="brush: sql;">
CREATE OR REPLACE PROCEDURE CreateAwrReports (begin_snap number,end_snap number, directory varchar2 )
as
/*---------------------------------------------------------------------------
 Name: CreateAwrReports Procedure
 Purpose : 	Create several AWR reported based on begin_snap and end_snap input parameters.
			The AWR reports will be created in the directory input parameter.
 Date    : 06.21.2010.
 Author  : Roni Vered
 Website : WWW.DBSNAPS.COM
 Execution :	exec CreateAwrReports (462, 472, 'c:\temp');

 Remarks : Run as privileged user
 --------------------------------------------------------------------------- */
	v_Instance_number v$instance.instance_number%TYPE;
	v_Instance_name v$instance.instance_name%TYPE;
	v_dbid V$database.dbid%TYPE;
	v_file UTL_FILE.file_type;

BEGIN

/* Collecting instance information: Instance_number, Instance_name and Dbid */
	SELECT instance_number, instance_name
	into v_Instance_number,v_Instance_name
	FROM   gv$instance
	ORDER BY 1;

	SELECT dbid
	INTO v_dbid
	FROM v$database;

/* Creating a database directory which will point to the acual wanted report directory in the OS */
	EXECUTE IMMEDIATE('CREATE OR REPLACE DIRECTORY TEMP_DIR AS '''||directory||'''');

/*
	Looping on all the snapshots from the begin_snap input parameter to the end_snap input parameter
	On each snapshot pair we will create a file in the given directory which will contain the AWR report.
	We use DBMS_WORKLOAD_REPOSITORY.AWR_REPORT_HTML build in procedure to create the HTML report.
*/
  FOR i IN begin_snap..end_snap-1 LOOP
		BEGIN
			--Creating and Naming the file:
			v_file := UTL_FILE.fopen('TEMP_DIR', 'awr_' || v_Instance_name ||'_'|| v_Instance_number || '_' || i || '_' || (i+1) || '.html', 'w', 32767);
			FOR c_AWRReport IN (
				SELECT output FROM TABLE (DBMS_WORKLOAD_REPOSITORY.AWR_REPORT_HTML( v_dbid, v_Instance_number,  i, i+1))
					   ) LOOP
						--Writing the AWR HTML report content to the file:
						UTL_FILE.PUT_LINE(v_file, c_AWRReport.output);
					   END LOOP;
			--Closing the file:
			UTL_FILE.fclose(v_file);
		END;
	END LOOP;

/* Dropping the database directory which we've created earlier. */
	EXECUTE IMMEDIATE('DROP DIRECTORY TEMP_DIR');

END;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/automatic-awr-reports/feed/</wfw:commentRss>
		<slash:comments>3</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>Connect as an Oracle User Without Knowing the Password</title>
		<link>http://www.dbsnaps.com/oracle/connect-as-an-oracle-user-without-knowing-the-password/</link>
		<comments>http://www.dbsnaps.com/oracle/connect-as-an-oracle-user-without-knowing-the-password/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 12:30:35 +0000</pubDate>
		<dc:creator>Oded Raz</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Connect through]]></category>
		<category><![CDATA[Connect Without Password]]></category>

		<guid isPermaLink="false">http://dbsnaps.oracletutorialvideos.com/?p=145</guid>
		<description><![CDATA[In some cases we have to connect to the database as a specific user, but don't know the password.

There are two ways to handle this problem:]]></description>
			<content:encoded><![CDATA[<p>In some cases we have to connect to the database as a specific user, but don&#8217;t know the password.</p>
<p>There are two ways to handle this problem:</p>
<p>1. There is a system privilege called &#8220;connect through&#8221;. Let&#8217;s say we have the user called &#8220;master&#8221; and we wish to connect as &#8220;app&#8221;. We will grant the privilege using the following syntax:</p>
<div id="_mcePaste">
<pre class="brush: sql;">
Alter user app grant connect through master;
</pre>
</div>
<pre><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: small;"><span style="line-height: 19px; white-space: normal;">
</span></span></pre>
<p>After granting this privilege, the user &#8220;master&#8221; can connect as the user &#8220;app&#8221; without the password of &#8220;app&#8221; user.</p>
<p>To connect as &#8220;app&#8221; user, use the following syntax:</p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;"> </span></p>
<pre class="brush: sql;">
sqlplus master[app]/pwd@db
</pre>
<p>Note that the password given is the password of &#8220;master&#8221; user. But in this sqlplus session we are connected as &#8220;app&#8221; user.</p>
<p>2. If we can allow ourselves to change the password, but don&#8217;t want to change it permanently, there is a way to change the password back.</p>
<p>The DBA_USERS table contains the PASSWORD column. This column contains the encrypted password of the user.<br />
Follow these steps to change the user&#8217;s password:</p>
<ol>
<li>Get the encrypted password of the user from DBA_USERS table and save it.</li>
<li>Change the password by using the &#8220;alter user &lt;user&gt; identified by &lt;pwd&gt;&#8221; command.</li>
</ol>
<p>Perform the following step to change the password back:</p>
<ol>
<li>Use the &#8220;alter user &lt;user&gt; identified by values &lt;encrypted_password&gt;&#8221; command.</li>
</ol>
<p>Use the encrypted password you have and pay attention to the &#8220;values&#8221; keyword in the command, it specifies that the password given in the command is already encrypted.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dbsnaps.com/oracle/connect-as-an-oracle-user-without-knowing-the-password/feed/</wfw:commentRss>
		<slash:comments>1</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>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>

