<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-13325418</id><updated>2010-04-08T08:12:13.068-07:00</updated><title type='text'>Oracle - Tricks of the Trade</title><subtitle type='html'>The Oracle Database Blog of OCP DBA James Colestock. This is my forum for sharing Oracle-centric information and know-how with the public.</subtitle><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/readme.html'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default?start-index=26&amp;max-results=25'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.colestock.com/blogs/atom.xml'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>91</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-13325418.post-3493099220006596772</id><published>2008-10-15T13:18:00.000-07:00</published><updated>2010-03-05T13:00:25.208-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DBAdminisaurus'/><category scheme='http://www.blogger.com/atom/ns#' term='Monitoring'/><title type='text'>DBAdminisaurus: Open Source Monitoring Application for Oracle</title><content type='html'>I have been working on an open source application for monitoring Oracle; for lack of a better name, I am calling it "DBAdminisaurus." &lt;br /&gt;&lt;br /&gt;DBAdminisaurus is basically a PHP application which allows you to see real-time as well as historical information about your Oracle databases. It leverages open source tools; specifically: Apache, Oracle 11g Instant Client, PHP, MySQL, and &lt;a href="http://www.fusioncharts.com/free/" target="_blank"&gt;FusionCharts Free&lt;/a&gt;. Accordingly, DBAdminisaurus costs nothing! &lt;br /&gt;&lt;br /&gt;I highly recommend FusionCharts Free for developers building these kinds of applications. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.fusioncharts.com/free/" target="_blank"&gt;&lt;img src="http://www.colestock.com/img/fcfree.gif"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;DBAdminisaurus is fully customizable. For example, all chart metadata is contained in an easy to edit XML file. &lt;br /&gt;&lt;br /&gt;DBAdminisaurus uses a local MySQL database for login/authenication information. &lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Apache Instance with OCI/PHP/MySQL Modules&lt;/li&gt;&lt;br /&gt;&lt;li&gt;PHP with GD,OCI, and MySQL&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Oracle Client&lt;/li&gt;&lt;br /&gt;&lt;li&gt;MySQL&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;If you need help configuring your server to meet the prerequisities listed above, reference the following blog posts. In the case of a Linux/Unix-based distribution, many of these services may already be installed and configured. &lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Windows&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/blogs/2008/10/installing-apachephp11g-instant-client.html" target="_blank"&gt;Installing Apache/PHP/11g Instant Client/MySQL on Windows&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Linux&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/blogs/2008/04/how-to-install-apache-tomcat-on-linux.html" target="_blank"&gt;Installing Apache/Tomcat&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/blogs/2007/10/installing-php11g-instant-clientoci8.html" target="_blank"&gt;Installing PHP/11g Instant Client/OCI8&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/blogs/2008/02/installing-multiple-versions-of-mysql.html" target="_blank"&gt;Installing Multiple Versions of MySQL&lt;/a&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Download DBAdminisaurus&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://www.colestock.com/tech/dbsaurus/dbsaurus_1_0.zip" target="_blank"&gt;DBAdminisaurus Version 1.0&lt;/a&gt;&lt;/td&gt;&lt;br /&gt;&lt;td&gt;Initial Release, 10/15/2008&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Installation&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;For the most part, installation should be platform independent. The following shows how to get the application up and running on a Windows platform, however, the same basic steps should apply to other platforms as well.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Unzip DBAdminisaurus to an Apache Directory&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/dbsaurus/dbsaurus1.gif" target="_blank" name="dbsaurus1"&gt;&lt;img src="http://www.colestock.com/img/dbsaurus/dbsaurus1.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/dbsaurus/dbsaurus2.gif" target="_blank" name="dbsaurus2"&gt;&lt;img src="http://www.colestock.com/img/dbsaurus/dbsaurus2.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/dbsaurus/dbsaurus3.gif" target="_blank" name="dbsaurus3"&gt;&lt;img src="http://www.colestock.com/img/dbsaurus/dbsaurus3.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;strong&gt;Install the &lt;span style="font-family: courier new;"&gt;dbsaurus&lt;/span&gt; MySQL Database&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The script to do this is found in the &lt;span style="font-family: courier new;"&gt;setup&lt;/span&gt; directory of DBAdminisaurus. &lt;br /&gt;&lt;br /&gt;Edit the &lt;span style="font-family: courier new;"&gt;setup/setup_dbsaurus.sql&lt;/span&gt; file to reflect the desired password for the &lt;span style="font-family: courier new;"&gt;dbsaurus&lt;/span&gt; user. &lt;br /&gt;  &lt;br /&gt;Connect to your local MySQL database and execute this script as root. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;C:\Program Files\Apache\Apache229\htdocs\setup&gt;mysql -h localhost -u root -P 330&lt;br /&gt;7 -p &lt; setup_dbsaurus.sql&lt;br /&gt;Enter password: ********&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This script creates the &lt;span style="font-family: courier new;"&gt;dbsaurus&lt;/span&gt; user, database, as well as the required tables and indexes.&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Move and Update &lt;span style="font-family: courier new;"&gt;/setup/dbsaurus.ini&lt;/span&gt;&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;DBAdminisaurus has a single application configuration file: &lt;span style="font-family: courier new;"&gt;dbsaurus.ini&lt;/span&gt;. Before using DBAdminisaurus, you will want to move this file out of the Apache directory, to a location local to the server, which cannot be accessed by remote users.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;C:\Program Files\Apache\Apache229\htdocs\setup&gt; move dbsaurus.ini C:\dbsaurus.ini&lt;/pre&gt;&lt;br /&gt;Next, edit &lt;span style="font-family: courier new;"&gt;dbsaurus.ini&lt;/span&gt;, changing the following values: 'mysql.hostname,' 'mysql.password,' and 'aes.salt.' The 'mysql' values are for the local MySQL database you just created. The 'aes.salt' value is used during the encryption of your oracle database passwords. Change this value to something that you can remember.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;&lt;span style="font-family: courier new;"&gt;dbsaurus.ini&lt;/span&gt;&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="largescrollbox"&gt;[mysql]&lt;br /&gt;mysql.username = dbsaurus&lt;br /&gt;mysql.hostname = localhost:3307&lt;br /&gt;mysql.password = dbsaurus&lt;br /&gt;mysql.default_db = dbsaurus&lt;br /&gt;&lt;br /&gt;[security]&lt;br /&gt;aes.salt = babalugats&lt;/div&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Update &lt;span style="font-family: courier new;"&gt;/dbsaurus/dbsaurusconfig.php&lt;/span&gt;&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;The &lt;span style="font-family: courier new;"&gt;/dbsaurus/dbsaurusconfig.php&lt;/span&gt; file needs to be updated to reflect the location of your &lt;span style="font-family: courier new;"&gt;dbsaurus.ini&lt;/span&gt; file. Alter the following line to reflect the path to your configuration file.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;var $ini = 'C:\dbsaurus.ini';&lt;/pre&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Update &lt;span style="font-family: courier new;"&gt;httpd.conf&lt;/span&gt;&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Next, update the Apache configuration for the directory which will serve DBAdminisaurus&lt;br /&gt;&lt;br /&gt;&lt;div class="largescrollbox"&gt;&lt;br /&gt;&lt;br /&gt;    DirectoryIndex index.php&lt;br /&gt;&lt;br /&gt;    #&lt;br /&gt;    # AllowOverride controls what directives may be placed in .htaccess files.&lt;br /&gt;    # It can be "All", "None", or any combination of the keywords:&lt;br /&gt;    #   Options FileInfo AuthConfig Limit&lt;br /&gt;    #&lt;br /&gt;&lt;br /&gt;    AllowOverride None&lt;br /&gt;&lt;br /&gt;    #&lt;br /&gt;    # Controls who can get stuff from this server.&lt;br /&gt;    #&lt;br /&gt;&lt;br /&gt;    Order deny,allow&lt;br /&gt;    Deny from all&lt;br /&gt;    Allow from 192.168.1.104&lt;br /&gt;    Allow from 127.0.0.1&lt;br /&gt;    Allow from localhost&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;In my case, I simply update the 'Directory' directive to restrict access as appropriate and to automatically serve 'index.php' by default. &lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Test Logging In&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;By default, one user already exists, named 'test' with the initial password of 'test'.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/dbsaurus/dbsaurus5.gif" target="_blank" name="dbsaurus5"&gt;&lt;img src="http://www.colestock.com/img/dbsaurus/dbsaurus5.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If everything is working you should see the following screen.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/dbsaurus/dbsaurus6.gif" target="_blank" name="dbsaurus6"&gt;&lt;img src="http://www.colestock.com/img/dbsaurus/dbsaurus6.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Create Oracle Users&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;DBAdminisaurus needs to connect to your Oracle databases in order to run various queries. Therefore, you should create a user against each Oracle database you wish to monitor using the &lt;span style="font-family:courier new;"&gt;/setup/setup_orauser.sql&lt;/span&gt; script.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ export ORACLE_SID=emrep&lt;br /&gt;$ . oraenv&lt;br /&gt;$ sqlplus "/ as sysdba" @setup_orauser.sql&lt;/pre&gt;&lt;br /&gt;&lt;div class="largescrollbox"&gt;SQL*Plus: Release 10.2.0.4.0 - Production on Thu Oct 16 10:58:56 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;&lt;br /&gt;User: dbsaurus&lt;br /&gt;Password:&lt;br /&gt;&lt;br /&gt;User created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Grant succeeded.&lt;/div&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Setup the Oracle User in DBAdminisaurus&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Select 'Databases'&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/dbsaurus/dbsaurus7.gif" target="_blank" name="dbsaurus7"&gt;&lt;img src="http://www.colestock.com/img/dbsaurus/dbsaurus7.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Click 'Add' and Enter the Database Information; Click 'Submit' (Remember that the value of 'Instance' should correspond to the net service name in your &lt;span style="font-family:courier new;"&gt;tnsnames.ora&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/dbsaurus/dbsaurus8.gif" target="_blank" name="dbsaurus8"&gt;&lt;img src="http://www.colestock.com/img/dbsaurus/dbsaurus8.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You should see an entry for the newly entered database&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/dbsaurus/dbsaurus9.gif" target="_blank" name="dbsaurus9"&gt;&lt;img src="http://www.colestock.com/img/dbsaurus/dbsaurus9.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Select 'Dashboard Rex' from the Navigation Bar. Your new database is now available in the drop down.&lt;br /&gt;&lt;br /&gt;Test the Dashboard by choosing your database from the drop-down menu; click 'Submit'&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/dbsaurus/dbsaurus11.gif" target="_blank" name="dbsaurus10"&gt;&lt;img src="http://www.colestock.com/img/dbsaurus/dbsaurus10.gif" /&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-3493099220006596772?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/3493099220006596772/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=3493099220006596772' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/3493099220006596772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/3493099220006596772'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/10/orachart-open-source-monitoring.html' title='DBAdminisaurus: Open Source Monitoring Application for Oracle'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-8442736005408228170</id><published>2008-10-14T10:04:00.000-07:00</published><updated>2008-10-15T23:21:28.692-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Instant Client'/><category scheme='http://www.blogger.com/atom/ns#' term='OCI'/><category scheme='http://www.blogger.com/atom/ns#' term='Installation'/><title type='text'>Installing Apache/PHP/11g Instant Client on Windows</title><content type='html'>This post covers the steps necessary to set-up open source development tools on Windows. Specifically, PHP, Apache, and Oracle's 11g Instant Client. This will allow you to deploy applications locally to a Windows server or laptop should you not have other resources.&lt;br /&gt;&lt;br /&gt;Here is the software I used:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.hightechimpact.com/Apache/httpd/binaries/win32/apache_2.2.9-win32-x86-openssl-0.9.8h-r2.msi" target="_blank"&gt;Apache 2.2.9 with OpenSSL (x86) on Windows&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://us3.php.net/get/php-5.2.6-win32-installer.msi/from/a/mirror" target="_blank"&gt;php-5.2.6-win32-installer.msi&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href ="http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.html" target="_blank"&gt;instantclient-basic-win32-11.1.0.6.0.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href ="http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.67-win32.zip/from/pick" target="_blank"&gt;mysql-5.0.67-win32.zip&lt;/a&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;strong&gt;Install Apache&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Normally I shutdown IIS before installing Apache on Windows as not to disturb the installation routine (port conflicts):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;net stop "IIS Admin"&lt;/pre&gt;&lt;br /&gt;&lt;div class="largescrollbox"&gt;The following services are dependent on the IIS Admin service.&lt;br /&gt;Stopping the IIS Admin service will also stop these services.&lt;br /&gt;&lt;br /&gt;   World Wide Web Publishing&lt;br /&gt;   Simple Mail Transfer Protocol (SMTP)&lt;br /&gt;&lt;br /&gt;Do you want to continue this operation? (Y/N) [N]: Y&lt;br /&gt;The World Wide Web Publishing service is stopping....&lt;br /&gt;The World Wide Web Publishing service was stopped successfully.&lt;br /&gt;&lt;br /&gt;The Simple Mail Transfer Protocol (SMTP) service is stopping.&lt;br /&gt;The Simple Mail Transfer Protocol (SMTP) service was stopped successfully.&lt;br /&gt;&lt;br /&gt;....&lt;br /&gt;The IIS Admin service was stopped successfully.&lt;/div&gt;&lt;br /&gt;Alternatively, you could shut this down via the GUI.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Run the Apache Installer&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Double-click or enter on the command-line:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;apache_2.2.9-win32-x86-openssl-0.9.8h-r2.msi&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/apache1.gif" target="_blank" name="apache1"&gt;&lt;img src="http://www.colestock.com/img/php/apache1.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/apache2.gif" target="_blank" name="apache2"&gt;&lt;img src="http://www.colestock.com/img/php/apache2.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/apache3.gif" target="_blank" name="apache3"&gt;&lt;img src="http://www.colestock.com/img/php/apache3.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Enter the information relevant to your Apache instance&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/apache4.gif" target="_blank" name="apache4"&gt;&lt;img src="http://www.colestock.com/img/php/apache4.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/apache5.gif" target="_blank" name="apache5"&gt;&lt;img src="http://www.colestock.com/img/php/apache5.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Accept the default directory or enter your desired path&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/apache6.gif" target="_blank" name="apache6"&gt;&lt;img src="http://www.colestock.com/img/php/apache6.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/apache7.gif" target="_blank" name="apache7"&gt;&lt;img src="http://www.colestock.com/img/php/apache7.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/apache8.gif" target="_blank" name="apache8"&gt;&lt;img src="http://www.colestock.com/img/php/apache8.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/apache9.gif" target="_blank" name="apache9"&gt;&lt;img src="http://www.colestock.com/img/php/apache9.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Test connectivity to your Apache instance&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/apache10.gif" target="_blank" name="apache10"&gt;&lt;img src="http://www.colestock.com/img/php/apache10.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now we will change the port so that the Apache instance doesn't conflict with IIS. We will do this by editing &lt;span style="font-family: courier new;"&gt;httpd.conf&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;C:\Program Files\Apache\Apache229\conf&amp;gt notepad httpd.conf&lt;/pre&gt;&lt;br /&gt;Change &lt;span style="font-family: courier new;"&gt;Listen 80&lt;/span&gt; to reflect a different port (in my case 81) and save the file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Bounce Apache to test&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;net stop "Apache2.2"&lt;/pre&gt;&lt;br /&gt;&lt;div class="smallscrollbox"&gt;The Apache2.2 service is stopping.&lt;br /&gt;The Apache2.2 service was stopped successfully.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;net start "Apache2.2"&lt;/pre&gt;&lt;br /&gt;&lt;div class="smallscrollbox"&gt;The Apache2.2 service is starting.&lt;br /&gt;The Apache2.2 service was started successfully.&lt;/div&gt;&lt;br /&gt;Afterwards, you should be able to contact Apache on the new port&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/apache11.gif" target="_blank" name="apache11"&gt;&lt;img src="http://www.colestock.com/img/php/apache11.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Restart IIS and its dependent services&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;net start "IIS Admin"&lt;/pre&gt;&lt;br /&gt;&lt;div class="smallscrollbox"&gt;The IIS Admin service is starting.&lt;br /&gt;The IIS Admin service was started successfully.&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;net start "World Wide Web Publishing"&lt;/pre&gt;&lt;br /&gt;&lt;div class="smallscrollbox"&gt;The World Wide Web Publishing service is starting.&lt;br /&gt;The World Wide Web Publishing service was started successfully.&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;net start "FTP Publishing"&lt;/pre&gt;&lt;br /&gt;&lt;div class="smallscrollbox"&gt;The FTP Publishing service is starting.&lt;br /&gt;The FTP Publishing service was started successfully.&lt;/div&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;strong&gt;Install PHP&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Run the PHP Installer&lt;br /&gt;&lt;br /&gt;Double-click or enter on the command-line:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;php-5.2.6-win32-installer.msi&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/php1.gif" target="_blank" name="php1"&gt;&lt;img src="http://www.colestock.com/img/php/php1.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/php2.gif" target="_blank" name="php2"&gt;&lt;img src="http://www.colestock.com/img/php/php2.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Accept the default directory or browse to the desired location&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/php3.gif" target="_blank" name="php3"&gt;&lt;img src="http://www.colestock.com/img/php/php3.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Choose 'Apache 2.2.x' since that is the version of Apache we just installed&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/php4.gif" target="_blank" name="php4"&gt;&lt;img src="http://www.colestock.com/img/php/php4.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Point the installer to the &lt;span style="font-family: courier new;"&gt;conf&lt;/span&gt; directory of the Apache installation you performed previously&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/php5.gif" target="_blank" name="php5"&gt;&lt;img src="http://www.colestock.com/img/php/php5.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Install the PHP options that are needed for the applications you wish to create or run. In my case, I installed: Oracle 8, GD, MySQL, and OpenSSL. I also selected the 'Register php' option.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/php6.gif" target="_blank" name="php6"&gt;&lt;img src="http://www.colestock.com/img/php/php6.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/php7.gif" target="_blank" name="php7"&gt;&lt;img src="http://www.colestock.com/img/php/php7.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/php8.gif" target="_blank" name="php8"&gt;&lt;img src="http://www.colestock.com/img/php/php8.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/php9.gif" target="_blank" name="php9"&gt;&lt;img src="http://www.colestock.com/img/php/php9.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Bounce Apache&lt;/span&gt;. This time I used the Apache Service Monitor from the toolbar.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/php10.gif" target="_blank" name="php10"&gt;&lt;img src="http://www.colestock.com/img/php/php10.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Test your PHP installation by placing the following file in your Apache instance's &lt;span style="font-family: courier new;"&gt;htdocs&lt;/span&gt; directory:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;test.php&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="xsmallscrollbox"&gt;&amp;lt?php phpinfo() ?&amp;gt&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Access the file from your web browser to verify that PHP is integrated with Apache properly. Also, review any options that you had the PHP installer configure.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/php11.gif" target="_blank" name="php11"&gt;&lt;img src="http://www.colestock.com/img/php/php11.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;strong&gt;Install 11g Instant Client&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In order to connect to Oracle databases using the OCI component of PHP, you will need a client local to the machine that contains the necessary networking libraries. In most cases, the easiest, lightest way to do this is with the Oracle Instant Client.&lt;br /&gt;&lt;br /&gt;Simply unzip the Instant Client to the location of your choice&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/ic1.gif" target="_blank" name="ic1"&gt;&lt;img src="http://www.colestock.com/img/php/ic1.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/ic2.gif" target="_blank" name="ic2"&gt;&lt;img src="http://www.colestock.com/img/php/ic2.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/ic3.gif" target="_blank" name="ic3"&gt;&lt;img src="http://www.colestock.com/img/php/ic3.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Afterwards, my Instant Client is located at &lt;span style="font-family:courier new;"&gt;C:\instantclient_11_1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Create a &lt;span style="font-family:courier new;"&gt;tnsnames.ora&lt;/span&gt; file in the Instant Client software directory and add any services you wish to connect to.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;tnsnames.ora (example)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="largescrollbox"&gt;EMREP =&lt;br /&gt;  (DESCRIPTION =&lt;br /&gt;    (ADDRESS = (PROTOCOL = TCP)(HOST = rac1.colestock.test)(PORT = 1521))&lt;br /&gt;    (CONNECT_DATA =&lt;br /&gt;      (SERVER = DEDICATED)&lt;br /&gt;      (SERVICE_NAME = emrep.colestock.test)&lt;br /&gt;      (INSTANCE_NAME = emrep)&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;CUBS =&lt;br /&gt;  (DESCRIPTION =&lt;br /&gt;    (ADDRESS = (PROTOCOL = TCP)(HOST = rac1.colestock.test)(PORT = 1521))&lt;br /&gt;    (CONNECT_DATA =&lt;br /&gt;      (SERVER = DEDICATED)&lt;br /&gt;      (SERVICE_NAME = cubs.colestock.test)&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;JLC =&lt;br /&gt;  (DESCRIPTION =&lt;br /&gt;    (ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1525))&lt;br /&gt;    (ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip)(PORT = 1525))&lt;br /&gt;    (LOAD_BALANCE = yes)&lt;br /&gt;    (CONNECT_DATA =&lt;br /&gt;      (SERVER = DEDICATED)&lt;br /&gt;      (SERVICE_NAME = jlc.colestock.test)&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;JLC2 =&lt;br /&gt;  (DESCRIPTION =&lt;br /&gt;    (ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip)(PORT = 1525))&lt;br /&gt;    (CONNECT_DATA =&lt;br /&gt;      (SERVER = DEDICATED)&lt;br /&gt;      (SERVICE_NAME = jlc.colestock.test)&lt;br /&gt;      (INSTANCE_NAME = jlc2)&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;JLC1 =&lt;br /&gt;  (DESCRIPTION =&lt;br /&gt;    (ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1525))&lt;br /&gt;    (CONNECT_DATA =&lt;br /&gt;      (SERVER = DEDICATED)&lt;br /&gt;      (SERVICE_NAME = jlc.colestock.test)&lt;br /&gt;      (INSTANCE_NAME = jlc1)&lt;br /&gt;    )&lt;br /&gt;  )&lt;/div&gt;&lt;br /&gt;You will need to update your system's environment variables so that Apache can find the necessary libraries. Create or Update &lt;span style="font-family: courier new;"&gt;TNS_ADMIN&lt;/span&gt;, &lt;span style="font-family: courier new;"&gt;PATH&lt;/span&gt;, and &lt;span style="font-family: courier new;"&gt;ORACLE_HOME&lt;/span&gt; variables with the values from your Instant Client via &lt;span style="font-family: courier new;"&gt;Control Panel &amp;gt System &amp;gt Advanced &amp;gt Environment Variables.&lt;/span&gt; You may also have to consider altering any &lt;span style="font-family: courier new;"&gt;NLS_LANG&lt;/span&gt; settings of &lt;span style="font-family: courier new;"&gt;ORACLE_HOMEs&lt;/span&gt; in the registry. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/ic4.gif" target="_blank" name="ic4"&gt;&lt;img src="http://www.colestock.com/img/php/ic4.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/ic5.gif" target="_blank" name="ic5"&gt;&lt;img src="http://www.colestock.com/img/php/ic5.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/ic6.gif" target="_blank" name="ic6"&gt;&lt;img src="http://www.colestock.com/img/php/ic6.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/ic7.gif" target="_blank" name="ic7"&gt;&lt;img src="http://www.colestock.com/img/php/ic7.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Reboot your system&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Create and modify the following script to test Oracle connectivity&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;oratest.php&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="largescrollbox"&gt;&amp;lt?php &lt;br /&gt;$db_conn = ocilogon('username', 'password', 'db'); &lt;br /&gt;$cmdstr = "select 'It Works' as \"Message\" from dual"; &lt;br /&gt;$parsed = ociparse($db_conn, $cmdstr); &lt;br /&gt;ociexecute($parsed); &lt;br /&gt;$nrows = ocifetchstatement($parsed, $results); &lt;br /&gt;for ($i = 0; $i &amp;lt $nrows; $i++ ) { &lt;br /&gt;   echo $results["Message"][$i] ; &lt;br /&gt;}&lt;br /&gt;?&amp;gt&lt;/div&gt;&lt;br /&gt;Test the script from your browser&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/ic8.gif" target="_blank" name="ic8"&gt;&lt;img src="http://www.colestock.com/img/php/ic8.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If the test succeeded, then you have a working configuration.&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;Optionally, update OCI settings in &lt;span style="font-family: courier new;"&gt;php.ini&lt;/span&gt;. The settings I use are below:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;php.ini&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="largescrollbox"&gt;oci8.privileged_connect = Off&lt;br /&gt;oci8.max_persistent = -1&lt;br /&gt;oci8.persistent_timeout = 60&lt;br /&gt;oci8.ping_interval = 60&lt;br /&gt;oci8.statement_cache_size = 50&lt;br /&gt;oci8.default_prefetch = 100&lt;br /&gt;oci8.old_oci_close_semantics = On&lt;br /&gt;oci8.events = On&lt;/div&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;strong&gt;Optionally, Install and Configure MySQL&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Run the Installer and follow the Screens&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/mysql1.gif" target="_blank" name="mysql1"&gt;&lt;img src="http://www.colestock.com/img/php/mysql1.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/mysql2.gif" target="_blank" name="mysql2"&gt;&lt;img src="http://www.colestock.com/img/php/mysql2.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/mysql3.gif" target="_blank" name="mysql3"&gt;&lt;img src="http://www.colestock.com/img/php/mysql3.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/mysql4.gif" target="_blank" name="mysql4"&gt;&lt;img src="http://www.colestock.com/img/php/mysql4.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/mysql5.gif" target="_blank" name="mysql5"&gt;&lt;img src="http://www.colestock.com/img/php/mysql5.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/mysql6.gif" target="_blank" name="mysql6"&gt;&lt;img src="http://www.colestock.com/img/php/mysql6.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/mysql7.gif" target="_blank" name="mysql7"&gt;&lt;img src="http://www.colestock.com/img/php/mysql7.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/mysql8.gif" target="_blank" name="mysql8"&gt;&lt;img src="http://www.colestock.com/img/php/mysql8.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/mysql9.gif" target="_blank" name="mysql9"&gt;&lt;img src="http://www.colestock.com/img/php/mysql9.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/mysql10.gif" target="_blank" name="mysql10"&gt;&lt;img src="http://www.colestock.com/img/php/mysql10.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/mysql11.gif" target="_blank" name="mysql11"&gt;&lt;img src="http://www.colestock.com/img/php/mysql11.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/mysql12.gif" target="_blank" name="mysql12"&gt;&lt;img src="http://www.colestock.com/img/php/mysql12.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/mysql13.gif" target="_blank" name="mysql13"&gt;&lt;img src="http://www.colestock.com/img/php/mysql13.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/mysql14.gif" target="_blank" name="mysql14"&gt;&lt;img src="http://www.colestock.com/img/php/mysql14.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/mysql15.gif" target="_blank" name="mysql15"&gt;&lt;img src="http://www.colestock.com/img/php/mysql15.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/mysql16.gif" target="_blank" name="mysql16"&gt;&lt;img src="http://www.colestock.com/img/php/mysql16.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/mysql17.gif" target="_blank" name="mysql17"&gt;&lt;img src="http://www.colestock.com/img/php/mysql17.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/mysql18.gif" target="_blank" name="mysql18"&gt;&lt;img src="http://www.colestock.com/img/php/mysql18.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/mysql19.gif" target="_blank" name="mysql19"&gt;&lt;img src="http://www.colestock.com/img/php/mysql19.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/mysql20.gif" target="_blank" name="mysql20"&gt;&lt;img src="http://www.colestock.com/img/php/mysql20.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Test Integration with Apache and PHP, by creating the following script&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;testmysql.php&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="largescrollbox"&gt;&amp;LT?php &lt;br /&gt;$conn = mysql_connect("localhost:3307", "root", "password"); &lt;br /&gt;mysql_select_db("mysql",$conn); &lt;br /&gt;$results = mysql_query("select 'It works!'", $conn);&lt;br /&gt;mysql_data_seek($results,0);&lt;br /&gt;$x = mysql_fetch_array($results,MYSQL_NUM);&lt;br /&gt;echo var_dump($x);&lt;br /&gt;?&amp;gt&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Test the script from your browser&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/php/mysql21.gif" target="_blank" name="mysql21"&gt;&lt;img src="http://www.colestock.com/img/php/mysql21.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If the test succeeded, then you have a working configuration.&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-8442736005408228170?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/8442736005408228170/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=8442736005408228170' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/8442736005408228170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/8442736005408228170'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/10/installing-apachephp11g-instant-client.html' title='Installing Apache/PHP/11g Instant Client on Windows'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-777231227145710106</id><published>2008-09-24T16:37:00.001-07:00</published><updated>2008-10-15T22:43:18.346-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Monitoring'/><category scheme='http://www.blogger.com/atom/ns#' term='Grid Control'/><title type='text'>Monitoring a Grid Control Installation</title><content type='html'>This posting covers how to monitor your 10g Grid Control installation.  This is referred to as OOB (Out-of-Bound) Notification. I am using a version 10.2.0.4 OMS (Oracle Management Service), Repository Database, and Agent on Enterprise Linux.&lt;br /&gt;&lt;br /&gt;In essence, the agent local to the OMS must be used in order to monitor your Grid Control installation via the Oracle-provided method (i.e. series of perl scripts, run by the agent).&lt;br /&gt;&lt;br /&gt;This post assumes that you already have a local mail service - in my case sendmail - established and functioning.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Check the Agent and Verify the OMS Target&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ export ORACLE_SID=agent10g&lt;br /&gt;$ . oraenv&lt;br /&gt;$ emctl config agent listtargets | grep oracle_emrep&lt;/pre&gt;&lt;br /&gt;If the OMS target is missing then add it to the &lt;span style="font-family:courier new;"&gt;$AGENT_HOME/sysman/emd/targets.xml&lt;/span&gt; file&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;target type="oracle_emrep" name="Management Services and Repository" version="1.0"&amp;gt;&lt;br /&gt;&amp;lt;property value="(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1.colestock.test)(PORT=1521)))(CONNECT_DATA=(SID=emrep)))" name="ConnectDescriptor"&amp;gt;&amp;lt;/property&amp;gt&lt;br /&gt;&amp;lt;property value="sysman" name="UserName" encrypted="FALSE"&amp;gt;&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property value="password" name="password" encrypted="FALSE"&amp;gt;&amp;lt;/property&amp;gt;&amp;lt;/target&amp;gt;&lt;/pre&gt;&lt;br /&gt;Adjust the aforementioned values to suit your environment&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Reload the Agent&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ emctl reload agent&lt;br /&gt;Oracle Enterprise Manager 10g Release 4 Grid Control 10.2.0.4.0.&lt;br /&gt;Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;EMD reload completed successfully&lt;/pre&gt;&lt;br /&gt;This will encrypt the username and password properties in the &lt;span style="font-family:courier new;"&gt;targets.xml&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The agent should now be monitoring the OMS as a target &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ emctl config agent listtargets | grep oracle_emrep&lt;br /&gt;[Management Services and Repository, oracle_emrep]&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Update the &lt;span style="font-family:courier new;"&gt;$AGENT_HOME/sysman/config/emd.properties&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Configure the email properties for the agent in &lt;span style="font-family:courier new;"&gt;emd.properties&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;emd_email_address=oracle@rac1.colestock.test,james@colestock.com&lt;br /&gt;emd_email_gateway=localhost&lt;br /&gt;emd_from_email_address=&lt;/pre&gt;&lt;br /&gt;Reload the agent again&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ emctl reload agent&lt;br /&gt;Oracle Enterprise Manager 10g Release 4 Grid Control 10.2.0.4.0.&lt;br /&gt;Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;EMD reload completed successfully&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Verify &lt;span style="font-family:courier new;"&gt;$AGENT_HOME/bin/emrepdown.pl&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This file may be missing from your agent installation. If so, copy the file from the OMS' &lt;span style="font-family:courier new;"&gt;$ORACLE_HOME&lt;/span&gt; to &lt;span style="font-family:courier new;"&gt;$AGENT_HOME/bin/emrepdown.pl&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Review this file closely. For example, if you specified a value for &lt;span style="font-family:courier new;"&gt;emd_from_email_address&lt;/span&gt; earlier, then notifications might fail. This is due to the fact that the script uses the &lt;span style="font-family:courier new;"&gt;-r &lt;/span&gt; or "recipient" option of &lt;span style="font-family:courier new;"&gt;mailx&lt;/span&gt;; this option is not available on all Linux/UNIX-based distributions. Make the changes that are necessary for your environment. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Test Notification&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Shut down the OMS and wait to see whether the notification email fires off. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ export ORACLE_SID=oms10g&lt;br /&gt;$ . oraenv&lt;br /&gt;$ $ORACLE_HOME/opmn/bin/opmnctl stopall&lt;br /&gt;opmnctl: stopping opmn and all managed processes...&lt;/pre&gt;&lt;br /&gt;The notification should take at least a few minutes to appear. &lt;br /&gt;&lt;br /&gt;If you were to trace the agent's activity (DEBUG level) you would see the following in &lt;span style="font-family:courier new;"&gt;$AGENT_HOME/sysman/log/emagent_perl.trc&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="largescrollbox"&gt;emrepnotif.pl: Wed Sep 24 18:28:55 2008: DEBUG:  emrepnotif: Connectdescriptor (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1.colestock.test)(PORT=1521)))(CONNECT_DATA=(SID=emrep)))&lt;br /&gt;emrepnotif.pl: Wed Sep 24 18:28:55 2008: DEBUG:  emrepnotif: emConsoleMode=STANDALONE jobLike=EMD_MAINTENANCE%&lt;br /&gt;emrepnotif.pl: Wed Sep 24 18:28:55 2008: DEBUG:  emrepnotif: , /tmp/_emrepnotif&lt;br /&gt;emrepnotif.pl: Wed Sep 24 18:28:55 2008: DEBUG:  emrepnotif: sql is: SELECT&lt;br /&gt;           (SELECT count(broken) FROM user_jobs&lt;br /&gt;              WHERE what LIKE('EMD_MAINTENANCE%')&lt;br /&gt;              AND broken = 'Y'),&lt;br /&gt;           (SELECT MIN(SYSDATE-next_date) FROM user_jobs&lt;br /&gt;              WHERE what LIKE('EMD_MAINTENANCE%')),&lt;br /&gt;           NVL((SELECT AVG(value) FROM mgmt_system_performance_log&lt;br /&gt;              WHERE job_name like('EMD_MAINTENANCE%')&lt;br /&gt;              AND name='Queued Notifications'&lt;br /&gt;              AND time&gt;(SYSDATE-(1/24))),0),&lt;br /&gt;           (SELECT DECODE(COUNT(a.device_name), 0, -1, COUNT(a.device_name)) - COUNT(b.device_name)&lt;br /&gt;              FROM mgmt_notify_devices a, mgmt_notify_devices b&lt;br /&gt;              WHERE b.status = 0) FROM DUAL&lt;br /&gt;emrepnotif.pl: Wed Sep 24 18:28:55 2008: DEBUG:  emrepnotif: query result is:&lt;br /&gt;em_result=0|0|-1&lt;br /&gt;&lt;br /&gt;emrepnotif.pl: Wed Sep 24 18:28:55 2008: DEBUG:  emrepnotif: Time in emrepnotif: 61.2359046936035&lt;br /&gt;emrepresp.pl: Wed Sep 24 18:29:15 2008: DEBUG:  Connectdescriptor (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1.colestock.test)(PORT=1521)))(CONNECT_DATA=(SID=emrep)))&lt;br /&gt;emrepresp.pl: Wed Sep 24 18:29:15 2008: DEBUG:  , /tmp/_emrepresp&lt;br /&gt;emrepresp.pl: Wed Sep 24 18:29:15 2008: DEBUG:  sql is: select count(distinct host_url) from mgmt_failover_table where sysdate-last_time_stamp &lt; 300&lt;br /&gt;emrepresp.pl: Wed Sep 24 18:29:15 2008: DEBUG:  sql1 is: SELECT&lt;br /&gt;           (SELECT count(broken) FROM user_jobs&lt;br /&gt;              WHERE what LIKE('EMD_COLLECTION.%')&lt;br /&gt;              AND broken = 'Y'),&lt;br /&gt;           (SELECT MIN(SYSDATE-next_date) FROM user_jobs&lt;br /&gt;              WHERE what LIKE('EMD_COLLECTION.%')) FROM DUAL&lt;br /&gt;emrepresp.pl: Wed Sep 24 18:29:15 2008: DEBUG:  No active OMSs&lt;br /&gt;emrepresp.pl: Wed Sep 24 18:29:15 2008: DEBUG:  exists=, accesstime=, interval=0.0416666666666667 mailscriptexists=&lt;br /&gt;emrepresp.pl: Wed Sep 24 18:29:15 2008: ERROR:  emrepresp: processfailure /u01/app/oracle/product/agent10g/bin/emrepdown.pl, Message:No active Management Services were found, Subject:Severe Enterprise Manager problem&lt;br /&gt;emrepresp.pl: Wed Sep 24 18:29:15 2008: DEBUG:  opened /tmp/sysman1234_emrepdown&lt;br /&gt;emrepresp.pl: Wed Sep 24 18:29:15 2008: DEBUG:  list command1=cat /u01/app/oracle/product/agent10g/sysman/config/emd.properties | grep -i EMD_EMAIL_ADDRESS= | sed s?EMD_EMAIL_ADDRESS=??i | awk '{print }'&lt;br /&gt;emrepresp.pl: Wed Sep 24 18:29:15 2008: DEBUG:  return command1=cat /u01/app/oracle/product/agent10g/sysman/config/emd.properties | grep -i EMD_FROM_EMAIL_ADDRESS= | sed s?EMD_FROM_EMAIL_ADDRESS=??i | awk '{print }'&lt;br /&gt;emrepresp.pl: Wed Sep 24 18:29:15 2008: DEBUG:  list=oracle@rac1.colestock.test,james@colestock.com&lt;br /&gt;emrepresp.pl: Wed Sep 24 18:29:15 2008: DEBUG:  return=&lt;br /&gt;emrepresp.pl: Wed Sep 24 18:29:15 2008: DEBUG:  command1=`mailx -s "Severe Enterprise Manager problem" oracle@rac1.colestock.test,james@colestock.com &lt; /tmp/sysman1234_emrepdown`&lt;br /&gt;emrepresp.pl: Wed Sep 24 18:29:16 2008: DEBUG:  out=&lt;br /&gt;emrepresp.pl: Wed Sep 24 18:29:16 2008: DEBUG:  emrepresp: Time in emrepresp: 1205.62410354614&lt;/div&gt;&lt;br /&gt;The referenced perl scripts are the ones involved in checking the status of the Grid Control installation and sending the email&lt;br /&gt;&lt;br /&gt;If everything works, you should receive an email similar to the following&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;From oracle@colestock.com  Wed Sep 24 18:29:16 2008&lt;br /&gt;Return-Path: &lt;oracle@colestock.com&gt;&lt;br /&gt;Received: from rac1.colestock.test (localhost.colestock.test [127.0.0.1])&lt;br /&gt;        by rac1.colestock.test (8.13.1/8.13.1) with ESMTP id m8P0TFTp006370;&lt;br /&gt;        Wed, 24 Sep 2008 18:29:16 -0600&lt;br /&gt;Received: (from oracle@localhost)&lt;br /&gt;        by rac1.colestock.test (8.13.1/8.13.1/Submit) id m8P0TFpN006368;&lt;br /&gt;        Wed, 24 Sep 2008 18:29:15 -0600&lt;br /&gt;Date: Wed, 24 Sep 2008 18:29:15 -0600&lt;br /&gt;From: Oracle Software Owner &lt;oracle@colestock.com&gt;&lt;br /&gt;Message-Id: &lt;200809250029.m8P0TFpN006368@rac1.colestock.test&gt;&lt;br /&gt;To: oracle@rac1.colestock.test, james@colestock.com&lt;br /&gt;Subject: Severe Enterprise Manager problem&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Wed Sep 24 18:29:15 MDT 2008&lt;br /&gt;Severe Enterprise Manager problem&lt;br /&gt;Error message: No active Management Services were found&lt;/pre&gt;&lt;br /&gt;For more help, refer to this Metalink article: &lt;a href="https://metalink.oracle.com/CSP/main/article?cmd=show&amp;type=NOT&amp;id=429257.1" target="_blank"&gt;429257.1&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-777231227145710106?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/777231227145710106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=777231227145710106' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/777231227145710106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/777231227145710106'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/09/monitoring-grid_24.html' title='Monitoring a Grid Control Installation'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-6094661433090898971</id><published>2008-09-23T14:15:00.000-07:00</published><updated>2008-09-23T14:44:59.387-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tuning'/><title type='text'>Using the KEEP pool to improve performance</title><content type='html'>In certain circumstances, pinning segments into memory - using the KEEP pool - can improve performance dramatically. I normally resort to using this feature when administering a database that can't be tuned otherwise. For example, it is often hard to change/tune the segments that are part of a COTS product, such as in a vendor-supplied ERP system. &lt;br /&gt;&lt;br /&gt;Of course this option uses, a critical resource, memory; therefore, it's not a viable solution when large tables/indexes are involved. &lt;br /&gt;&lt;br /&gt;The KEEP pool can be used in Data Warehouse applications as well, namely to pin aggregate materialized views, etc. &lt;br /&gt;&lt;br /&gt;In this example, I show how to set-up and use the KEEP pool. In my example I am pinning LOB data and index segments, but I could have just as easily crafted an example that simply pinned non-LOB table/index segments. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Set-up the KEEP pool&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter system set db_keep_cache_size=64m scope=spfile;&lt;br /&gt;SQL&gt; startup;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Create a Sample Table&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; create table lob_pin_example ( lpe_id number(10), &lt;br /&gt;                                         lpe_desc varchar2(40),&lt;br /&gt;                                         lpe_blob BLOB) &lt;br /&gt;          tablespace users &lt;br /&gt;          LOB(lpe_blob) store as lpe_blob_data&lt;br /&gt;          (tablespace users disable storage in row storage &lt;br /&gt;          (buffer_pool KEEP) cache&lt;br /&gt;          index lpe_blob_index);&lt;br /&gt;&lt;br /&gt;Table created.&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Load Sample Data&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; declare&lt;br /&gt;          begin&lt;br /&gt;          for i in 1..6000 loop&lt;br /&gt;          insert into lob_pin_example values (i,'Test','01010101010101');&lt;br /&gt;          end loop;&lt;br /&gt;          commit;&lt;br /&gt;          end;&lt;br /&gt;          /&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; select count(*) from lob_pin_example;&lt;br /&gt;&lt;br /&gt;  COUNT(*)&lt;br /&gt;----------&lt;br /&gt;      6000&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; analyze table lob_pin_example compute statistics;&lt;br /&gt;&lt;br /&gt;Table analyzed.&lt;/pre&gt;&lt;br /&gt;When using the KEEP pool feature, I find it helpful to load the following custom view into the database as SYS. This view allows you to see into the data dictionary to determine how the KEEP pool is being utilized.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Load the &lt;span style="font-family: courier new;"&gt;objects_in_keep_pool&lt;/span&gt; view&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;CREATE OR REPLACE VIEW objects_in_keep_pool (bp_name,blocks,object_name,pool_used_size_kb,seg_size_kb)&lt;br /&gt;AS&lt;br /&gt;SELECT      kcbwbpd.bp_name, &lt;br /&gt;            COUNT (*) blocks, &lt;br /&gt;            ob.name,&lt;br /&gt;            ROUND (bs.block_size * COUNT (*) / 1024) "POOL_USED_SIZE_KB",&lt;br /&gt;            ROUND (ds.BYTES / 1024 ) "SEG_SIZE_KB"&lt;br /&gt;      FROM  x$kcbwds kcbwds,&lt;br /&gt;            x$kcbwbpd kcbwbpd,&lt;br /&gt;            x$bh bh,&lt;br /&gt;            obj$ ob,&lt;br /&gt;            (SELECT block_size&lt;br /&gt;              FROM v$buffer_pool&lt;br /&gt;              WHERE NAME = 'KEEP') bs,&lt;br /&gt;            dba_segments ds&lt;br /&gt;      WHERE kcbwds.set_id &gt;= kcbwbpd.bp_lo_sid&lt;br /&gt;        AND kcbwds.set_id &lt;= kcbwbpd.bp_hi_sid&lt;br /&gt;        AND kcbwbpd.bp_size != 0&lt;br /&gt;        AND kcbwds.addr = bh.set_ds&lt;br /&gt;        AND bh.state != 0&lt;br /&gt;        AND kcbwbpd.bp_name = 'KEEP'&lt;br /&gt;        AND bh.obj = ob.obj#(+)&lt;br /&gt;        AND ob.name = ds.segment_name(+)&lt;br /&gt;  GROUP BY kcbwbpd.bp_name, bh.obj, ob.name, bs.block_size, ds.BYTES;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Query the Sample Table&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; set autotrace on explain statistics ;&lt;br /&gt;&lt;br /&gt;SQL&gt; select dbms_lob.substr(lpe_blob,1) from lob_pin_example;&lt;/pre&gt;&lt;br /&gt;As you can see, there are no physical reads.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Statistics&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;          0  recursive calls&lt;br /&gt;          0  db block gets&lt;br /&gt;      18438  consistent gets&lt;br /&gt;          0  physical reads&lt;br /&gt;          0  redo size&lt;br /&gt;      81128  bytes sent via SQL*Net to client&lt;br /&gt;      4789  bytes received via SQL*Net from client&lt;br /&gt;        401  SQL*Net roundtrips to/from client&lt;br /&gt;          0  sorts (memory)&lt;br /&gt;          0  sorts (disk)&lt;br /&gt;      6000  rows processed&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Query the &lt;span style="font-family: courier new;"&gt;objects_in_keep_pool&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; select * from objects_in_keep_pool;&lt;br /&gt;&lt;br /&gt;BP_NAME        BLOCKS OBJECT_NAME          POOL_USED_SIZE_KB SEG_SIZE_KB&lt;br /&gt;---------- ---------- -------------------- ----------------- -----------&lt;br /&gt;KEEP              48 LPE_BLOB_INDEX                    384        384&lt;br /&gt;KEEP            6112 LPE_BLOB_DATA                    48896      49152&lt;/pre&gt;&lt;br /&gt;As you can see both LOB segments are in the KEEP pool.&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-6094661433090898971?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/6094661433090898971/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=6094661433090898971' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/6094661433090898971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/6094661433090898971'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/09/using-keep-pool-to-improve-performance.html' title='Using the KEEP pool to improve performance'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-561415470712515051</id><published>2008-09-21T13:38:00.000-07:00</published><updated>2008-09-21T16:14:15.527-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Backup and Recovery'/><title type='text'>Cloning a Standalone Database without RMAN</title><content type='html'>This post covers how to clone/duplicate a database the old-fashioned way, without RMAN, using manual scripts, etc.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Backup the Source Database&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In my example, I backup a 10.2.0.4 database called 'cubs' on a host called 'rac1', using a series of &lt;a href="http://www.colestock.com/tech/hotbkp.tar" target="_blank"&gt;customizable scripts&lt;/a&gt;. Feel free to download and customize these 3 scripts to suit your needs. &lt;br /&gt;&lt;br /&gt;Once the scripts have been edited, run the &lt;span style="font-family: courier new;"&gt;run_hotbkp.bsh&lt;/span&gt; script. &lt;br /&gt;&lt;br /&gt;The hot backup copies the datafiles, etc. to the backup location of your choosing. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ls -lart /u01/app/oracle/orabackup/cubs&lt;br /&gt;total 779072&lt;br /&gt;drwxr-xr-x  4 oracle dba      4096 Sep 21 12:15 ../&lt;br /&gt;-rw-r-----  1 oracle dba   5251072 Sep 21 14:27 users01.dbf&lt;br /&gt;-rw-r-----  1 oracle dba  26222592 Sep 21 14:27 undotbs01.dbf&lt;br /&gt;-rw-r-----  1 oracle dba 503324672 Sep 21 14:27 system01.dbf&lt;br /&gt;-rw-r-----  1 oracle dba 262152192 Sep 21 14:28 sysaux01.dbf&lt;br /&gt;-rw-r--r--  1 oracle dba      5602 Sep 21 14:28 CUBS.ctlbkp&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Prepare the Target Host&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In my example, I will be cloning the 'cubs' database to the 'rac2' host, renaming it to 'colts.'&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Create any necessary directories&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ mkdir -p $ORACLE_BASE/admin/colts/adump&lt;br /&gt;$ mkdir -p $ORACLE_BASE/admin/colts/bdump&lt;br /&gt;$ mkdir -p $ORACLE_BASE/admin/colts/cdump&lt;br /&gt;$ mkdir -p $ORACLE_BASE/admin/colts/udump&lt;br /&gt;$ mkdir -p $ORACLE_BASE/oradata/colts&lt;br /&gt;$ mkdir -p $ORACLE_BASE/oradata/colts/arch&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Update &lt;span style="font-family: courier new;"&gt;/etc/oratab&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;echo "colts:/u01/app/oracle/product/10.2:N" &gt;&gt; /etc/oratab&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Create a Passwordfile for the Target Database&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ export ORACLE_SID=colts&lt;br /&gt;$ . oraenv&lt;br /&gt;$ orapwd file=$ORACLE_HOME/dbs/orapwcolts password=password;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Create a PFILE for the Target Database&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;Create a PFILE on the Source host, transfer it to the Target, and modify it as appropriate.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ export ORACLE_SID=cubs&lt;br /&gt;$ . oraenv&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;$ sqlplus "/ as sysdba"&lt;br /&gt;SQL&gt; create pfile='/tmp/initcolts.ora' from spfile;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ scp /tmp/initcolts.ora oracle@rac2:/u01/app/oracle/product/10.2/dbs/.&lt;/pre&gt;&lt;br /&gt;Edit the necessary values; for example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;*.audit_file_dest='/u01/app/oracle/admin/colts/adump'&lt;br /&gt;*.background_dump_dest='/u01/app/oracle/admin/colts/bdump'&lt;br /&gt;*.control_files='/u01/app/oracle/oradata/colts/control01.ctl','/u01/app/oracle/oradata/colts/control02.ctl','/u01/app/oracle/oradata/colts/control03.ctl'&lt;br /&gt;*.core_dump_dest='/u01/app/oracle/admin/colts/cdump'&lt;br /&gt;*.db_file_name_convert='/cubs/','/colts/'&lt;br /&gt;*.db_name='colts'&lt;br /&gt;*.dispatchers='(PROTOCOL=TCP) (SERVICE=coltsXDB)'&lt;br /&gt;*.log_archive_dest_1='LOCATION=/u01/app/oracle/oradata/colts/arch'&lt;br /&gt;*.log_archive_format='colts_%t_%s_%r.dbf'&lt;br /&gt;*.user_dump_dest='/u01/app/oracle/admin/colts/udump'&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Transfer the Hot Backup&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;Move the Hot Backup to the desired location on the Target Host. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ scp /u01/app/oracle/orabackup/cubs/* oracle@rac2:/u01/app/oracle/oradata/colts/.&lt;br /&gt;oracle@rac2's password:&lt;br /&gt;CUBS.ctlbkp                                                               100% 5602     5.5KB/s   00:00&lt;br /&gt;sysaux01.dbf                                                              100%  250MB  27.8MB/s   00:09&lt;br /&gt;system01.dbf                                                              100%  480MB  25.3MB/s   00:19&lt;br /&gt;undotbs01.dbf                                                             100%   25MB  25.0MB/s   00:01&lt;br /&gt;users01.dbf                                                               100% 5128KB   5.0MB/s   00:00&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Transfer Needed Archive Logs to the Target&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ scp -p /u02/oracle/arch/* oracle@rac2:/u01/app/oracle/oradata/colts/arch/.&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Edit the Controlfile Trace&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ vi /u01/app/oracle/oradata/colts/CUBS.ctlbkp&lt;/pre&gt;&lt;br /&gt;Edit the text-based controlfile script until it resembles the following&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;STARTUP NOMOUNT&lt;br /&gt;CREATE CONTROLFILE REUSE SET DATABASE "COLTS" RESETLOGS  ARCHIVELOG&lt;br /&gt;    MAXLOGFILES 16&lt;br /&gt;    MAXLOGMEMBERS 3&lt;br /&gt;    MAXDATAFILES 100&lt;br /&gt;    MAXINSTANCES 8&lt;br /&gt;    MAXLOGHISTORY 292&lt;br /&gt;LOGFILE&lt;br /&gt;  GROUP 1 '/u01/app/oracle/oradata/colts/redo01.log'  SIZE 50M REUSE,&lt;br /&gt;  GROUP 2 '/u01/app/oracle/oradata/colts/redo02.log'  SIZE 50M REUSE,&lt;br /&gt;  GROUP 3 '/u01/app/oracle/oradata/colts/redo03.log'  SIZE 50M REUSE&lt;br /&gt;DATAFILE&lt;br /&gt;  '/u01/app/oracle/oradata/colts/system01.dbf',&lt;br /&gt;  '/u01/app/oracle/oradata/colts/undotbs01.dbf',&lt;br /&gt;  '/u01/app/oracle/oradata/colts/sysaux01.dbf',&lt;br /&gt;  '/u01/app/oracle/oradata/colts/users01.dbf'&lt;br /&gt;CHARACTER SET AL32UTF8&lt;br /&gt;;&lt;br /&gt;RECOVER DATABASE UNTIL CANCEL USING BACKUP CONTROLFILE;&lt;/pre&gt;&lt;br /&gt;I normally recover until cancel because user intervention is often required. This was the case for my recovery, because a datafile was added after the backup.&lt;br /&gt;&lt;br /&gt;Run the modified script&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ sqlplus "/ as sysdba"&lt;br /&gt;SQL&gt; @CUBS.ctlbkp&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area  176160768 bytes&lt;br /&gt;Fixed Size                  1266416 bytes&lt;br /&gt;Variable Size              62917904 bytes&lt;br /&gt;Database Buffers          104857600 bytes&lt;br /&gt;Redo Buffers                7118848 bytes&lt;br /&gt;&lt;br /&gt;Control file created.&lt;br /&gt;&lt;br /&gt;ORA-00279: change 485386 generated at 09/21/2008 15:46:08 needed for thread 1&lt;br /&gt;ORA-00289: suggestion :&lt;br /&gt;/u01/app/oracle/oradata/colts/arch/cubs_1_42_666013624.dbf&lt;br /&gt;ORA-00280: change 485386 for thread 1 is in sequence #42&lt;/pre&gt;&lt;br /&gt;Respond to the recovery:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Specify log: {&lt;RET&gt;=suggested | filename | AUTO | CANCEL}&lt;br /&gt;AUTO&lt;br /&gt;ORA-00283: recovery session canceled due to errors&lt;br /&gt;ORA-01244: unnamed datafile(s) added to control file by media recovery&lt;br /&gt;ORA-01110: data file 5: '/u01/app/oracle/oradata/cubs/tools01.dbf'&lt;br /&gt;&lt;br /&gt;ORA-01112: media recovery not started&lt;/pre&gt;&lt;br /&gt;Remedy the file situtaion via the following commands&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; select name from v$datafile;&lt;br /&gt;&lt;br /&gt;NAME&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;/u01/app/oracle/oradata/colts/system01.dbf&lt;br /&gt;/u01/app/oracle/oradata/colts/undotbs01.dbf&lt;br /&gt;/u01/app/oracle/oradata/colts/sysaux01.dbf&lt;br /&gt;/u01/app/oracle/oradata/colts/users01.dbf&lt;br /&gt;/u01/app/oracle/product/10.2/dbs/UNNAMED00005&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database create datafile '/u01/app/oracle/product/10.2/dbs/UNNAMED00005' as '/u01/app/oracle/oradata/colts/tools01.dbf';&lt;br /&gt;&lt;br /&gt;Database altered.&lt;/pre&gt;&lt;br /&gt;Resume the recovery&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; recover database until cancel using backup controlfile;&lt;br /&gt;ORA-00279: change 485384 generated at 09/21/2008 15:46:06 needed for thread 1&lt;br /&gt;ORA-00289: suggestion :&lt;br /&gt;/u01/app/oracle/oradata/colts/arch/cubs_1_42_666013624.dbf&lt;br /&gt;ORA-00280: change 485384 for thread 1 is in sequence #42&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Specify log: {&lt;RET&gt;=suggested | filename | AUTO | CANCEL}&lt;br /&gt;&lt;br /&gt;ORA-00279: change 485411 generated at 09/21/2008 15:46:20 needed for thread 1&lt;br /&gt;ORA-00289: suggestion :&lt;br /&gt;/u01/app/oracle/oradata/colts/arch/cubs_1_43_666013624.dbf&lt;br /&gt;ORA-00280: change 485411 for thread 1 is in sequence #43&lt;br /&gt;ORA-00278: log file&lt;br /&gt;'/u01/app/oracle/oradata/colts/arch/cubs_1_42_666013624.dbf' no longer needed&lt;br /&gt;for this recovery&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Specify log: {&lt;RET&gt;=suggested | filename | AUTO | CANCEL}&lt;br /&gt;&lt;br /&gt;ORA-00279: change 485415 generated at 09/21/2008 15:46:25 needed for thread 1&lt;br /&gt;ORA-00289: suggestion :&lt;br /&gt;/u01/app/oracle/oradata/colts/arch/cubs_1_44_666013624.dbf&lt;br /&gt;ORA-00280: change 485415 for thread 1 is in sequence #44&lt;br /&gt;ORA-00278: log file&lt;br /&gt;'/u01/app/oracle/oradata/colts/arch/cubs_1_43_666013624.dbf' no longer needed&lt;br /&gt;for this recovery&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Specify log: {&lt;RET&gt;=suggested | filename | AUTO | CANCEL}&lt;br /&gt;CANCEL&lt;br /&gt;Media recovery cancelled.&lt;/pre&gt;&lt;br /&gt;Open the Database RESETLOGS:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter database open resetlogs;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Complete Post-Cloning Steps&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Add back tempfiles&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter tablespace temp add tempfile '/u01/app/oracle/oradata/colts/temp01.dbf' size 250M;&lt;/pre&gt;&lt;br /&gt;Change the DBID (Database ID) of the Database via &lt;span style="font-family: courier new;"&gt;nid&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; shutdown immediate;&lt;br /&gt;SQL&gt; startup mount;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;$ nid target=/&lt;br /&gt;&lt;br /&gt;DBNEWID: Release 10.2.0.4.0 - Production on Sun Sep 21 16:55:20 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Connected to database COLTS (DBID=2153372661)&lt;br /&gt;&lt;br /&gt;Connected to server version 10.2.0&lt;br /&gt;&lt;br /&gt;Control Files in database:&lt;br /&gt;    /u01/app/oracle/oradata/colts/control01.ctl&lt;br /&gt;    /u01/app/oracle/oradata/colts/control02.ctl&lt;br /&gt;    /u01/app/oracle/oradata/colts/control03.ctl&lt;br /&gt;&lt;br /&gt;Change database ID of database COLTS? (Y/[N]) =&gt; Y&lt;br /&gt;&lt;br /&gt;Proceeding with operation&lt;br /&gt;Changing database ID from 2153372661 to 2820171320&lt;br /&gt;    Control File /u01/app/oracle/oradata/colts/control01.ctl - modified&lt;br /&gt;    Control File /u01/app/oracle/oradata/colts/control02.ctl - modified&lt;br /&gt;    Control File /u01/app/oracle/oradata/colts/control03.ctl - modified&lt;br /&gt;    Datafile /u01/app/oracle/oradata/colts/system01.dbf - dbid changed&lt;br /&gt;    Datafile /u01/app/oracle/oradata/colts/undotbs01.dbf - dbid changed&lt;br /&gt;    Datafile /u01/app/oracle/oradata/colts/sysaux01.dbf - dbid changed&lt;br /&gt;    Datafile /u01/app/oracle/oradata/colts/users01.dbf - dbid changed&lt;br /&gt;    Datafile /u01/app/oracle/oradata/colts/tools01.dbf - dbid changed&lt;br /&gt;    Datafile /u01/app/oracle/oradata/colts/temp01.dbf - dbid changed&lt;br /&gt;    Control File /u01/app/oracle/oradata/colts/control01.ctl - dbid changed&lt;br /&gt;    Control File /u01/app/oracle/oradata/colts/control02.ctl - dbid changed&lt;br /&gt;    Control File /u01/app/oracle/oradata/colts/control03.ctl - dbid changed&lt;br /&gt;    Instance shut down&lt;br /&gt;&lt;br /&gt;Database ID for database COLTS changed to 2820171320.&lt;br /&gt;All previous backups and archived redo logs for this database are unusable.&lt;br /&gt;Database has been shutdown, open database with RESETLOGS option.&lt;br /&gt;Succesfully changed database ID.&lt;br /&gt;DBNEWID - Completed succesfully.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; startup mount;&lt;br /&gt;SQL&gt; alter database open resetlogs;&lt;/pre&gt;&lt;br /&gt;Optionally, create a SPFILE&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; create spfile from pfile;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Change the &lt;span style="font-family: courier new;"&gt;log_archive_format&lt;/span&gt; parameter if necessary&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter system set log_archive_format='colts_%t_%s_%r.dbf' scope=spfile;&lt;br /&gt;SQL&gt; shutdown immediate;&lt;br /&gt;SQL&gt; startup&lt;/pre&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-561415470712515051?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/561415470712515051/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=561415470712515051' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/561415470712515051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/561415470712515051'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/09/cloning-standalone-database-without.html' title='Cloning a Standalone Database without RMAN'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-7668401513104445226</id><published>2008-09-18T17:30:00.001-07:00</published><updated>2008-09-19T13:12:26.849-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RMAN'/><category scheme='http://www.blogger.com/atom/ns#' term='ASM'/><title type='text'>How to Duplicate a Standalone Database: ASM to ASM</title><content type='html'>This example covers how to duplicate a 10.2.0.4 database using ASM from one host to another, which is also using ASM. This example uses RMAN without a catalog to disk, but could be quite easily retrofit to support tape channels or the use of a recovery catalog. The RMAN backup is written to a file system available to both hosts.&lt;br /&gt;&lt;br /&gt;In my example, I am duplicating my Grid Control Database from one host to another (EMREP, duplicating to EMTST).&lt;br /&gt;&lt;br /&gt;The term 'TARGET' is used to refer to the Primary Host/Database (The Database you are copying). The term 'AUXILIARY' is used to refer to the Duplicate Host/Database (The New Cloned Database you are creating). &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Backup the TARGET Database (EMREP)&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;backup_emrep.rman&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;run {&lt;br /&gt;configure device type disk parallelism 4 backup type to compressed backupset;&lt;br /&gt;configure default device type to disk;&lt;br /&gt;configure controlfile autobackup on;&lt;br /&gt;configure controlfile autobackup format for device type disk to '/u02/oracle/ora&lt;br /&gt;1/emrep/%F';&lt;br /&gt;configure maxsetsize to 5G;&lt;br /&gt;configure snapshot controlfile name to '/u02/oracle/ora1/emrep/snapf_emrep.ora';&lt;br /&gt;backup full database format '/u02/oracle/ora1/emrep/%d_%U.rman' tag rman_nocat_e&lt;br /&gt;mrep plus archivelog format '/u02/oracle/ora1/emrep/%d_%U.rman' delete input tag&lt;br /&gt; rman_nocat_emrep ;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;run_backup.bsh&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;export $ORACLE_SID=emrep&lt;br /&gt;&lt;br /&gt;. oraenv&lt;br /&gt;&lt;br /&gt;rman target=/ @backup_emrep.rman&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Run the Backup&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ ./run_backup.bsh &gt; rman_emrep.log&lt;/pre&gt;&lt;br /&gt;The output should look something like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ more rman_emrep.log&lt;br /&gt;&lt;br /&gt;Recovery Manager: Release 10.2.0.4.0 - Production on Thu Sep 18 12:13:21 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;connected to target database: EMREP (DBID=3888623110)&lt;br /&gt;&lt;br /&gt;RMAN&gt; run {&lt;br /&gt;2&gt; configure device type disk parallelism 4 backup type to compressed backupset;&lt;br /&gt;3&gt; configure default device type to disk;&lt;br /&gt;4&gt; configure controlfile autobackup on;&lt;br /&gt;5&gt; configure controlfile autobackup format for device type disk to '/u02/oracle/ora1/emrep/%F';&lt;br /&gt;6&gt; configure maxsetsize to 5G;&lt;br /&gt;7&gt; configure snapshot controlfile name to '/u02/oracle/ora1/emrep/snapf_emrep.ora';&lt;br /&gt;8&gt; backup full database format '/u02/oracle/ora1/emrep/%d_%U.rman' tag rman_nocat_emrep plus archivelog format '/u02/orac&lt;br /&gt;le/ora1/emrep/%d_%U.rman' delete input tag rman_nocat_emrep ;&lt;br /&gt;9&gt; }&lt;br /&gt;10&gt;&lt;br /&gt;using target database control file instead of recovery catalog&lt;br /&gt;old RMAN configuration parameters:&lt;br /&gt;CONFIGURE DEVICE TYPE DISK PARALLELISM 4 BACKUP TYPE TO COMPRESSED BACKUPSET;&lt;br /&gt;new RMAN configuration parameters:&lt;br /&gt;CONFIGURE DEVICE TYPE DISK PARALLELISM 4 BACKUP TYPE TO COMPRESSED BACKUPSET;&lt;br /&gt;new RMAN configuration parameters are successfully stored&lt;br /&gt;&lt;br /&gt;old RMAN configuration parameters:&lt;br /&gt;CONFIGURE DEFAULT DEVICE TYPE TO DISK;&lt;br /&gt;new RMAN configuration parameters:&lt;br /&gt;CONFIGURE DEFAULT DEVICE TYPE TO DISK;&lt;br /&gt;new RMAN configuration parameters are successfully stored&lt;br /&gt;&lt;br /&gt;old RMAN configuration parameters:&lt;br /&gt;CONFIGURE CONTROLFILE AUTOBACKUP ON;&lt;br /&gt;new RMAN configuration parameters:&lt;br /&gt;CONFIGURE CONTROLFILE AUTOBACKUP ON;&lt;br /&gt;new RMAN configuration parameters are successfully stored&lt;br /&gt;&lt;br /&gt;old RMAN configuration parameters:&lt;br /&gt;CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u02/oracle/ora1/emrep/%F';&lt;br /&gt;new RMAN configuration parameters:&lt;br /&gt;CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u02/oracle/ora1/emrep/%F';&lt;br /&gt;new RMAN configuration parameters are successfully stored&lt;br /&gt;&lt;br /&gt;old RMAN configuration parameters:&lt;br /&gt;CONFIGURE MAXSETSIZE TO 5 G;&lt;br /&gt;new RMAN configuration parameters:&lt;br /&gt;CONFIGURE MAXSETSIZE TO 5 G;&lt;br /&gt;new RMAN configuration parameters are successfully stored&lt;br /&gt;&lt;br /&gt;snapshot control file name set to: /u02/oracle/ora1/emrep/snapf_emrep.ora&lt;br /&gt;new RMAN configuration parameters are successfully stored&lt;br /&gt;&lt;br /&gt;Starting backup at 18-SEP-08&lt;br /&gt;current log archived&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=145 devtype=DISK&lt;br /&gt;allocated channel: ORA_DISK_2&lt;br /&gt;channel ORA_DISK_2: sid=135 devtype=DISK&lt;br /&gt;allocated channel: ORA_DISK_3&lt;br /&gt;channel ORA_DISK_3: sid=144 devtype=DISK&lt;br /&gt;allocated channel: ORA_DISK_4&lt;br /&gt;channel ORA_DISK_4: sid=125 devtype=DISK&lt;br /&gt;channel ORA_DISK_1: starting compressed archive log backupset&lt;br /&gt;channel ORA_DISK_1: specifying archive log(s) in backup set&lt;br /&gt;input archive log thread=1 sequence=68 recid=53 stamp=665756004&lt;br /&gt;channel ORA_DISK_1: starting piece 1 at 18-SEP-08&lt;br /&gt;channel ORA_DISK_1: finished piece 1 at 18-SEP-08&lt;br /&gt;piece handle=/u02/oracle/ora1/emrep/EMREP_24jqt8b5_1_1.rman tag=RMAN_NOCAT_EMREP comment=NONE&lt;br /&gt;channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02&lt;br /&gt;channel ORA_DISK_1: deleting archive log(s)&lt;br /&gt;archive log filename=+DATA2/emrep/archivelog/2008_09_18/thread_1_seq_68.263.665756005 recid=53 stamp=665756004&lt;br /&gt;Finished backup at 18-SEP-08&lt;br /&gt;&lt;br /&gt;Starting backup at 18-SEP-08&lt;br /&gt;using channel ORA_DISK_1&lt;br /&gt;using channel ORA_DISK_2&lt;br /&gt;using channel ORA_DISK_3&lt;br /&gt;using channel ORA_DISK_4&lt;br /&gt;channel ORA_DISK_1: starting compressed full datafile backupset&lt;br /&gt;channel ORA_DISK_1: specifying datafile(s) in backupset&lt;br /&gt;input datafile fno=00005 name=+DATA2/emrep/datafile/mgmt_tablespace.256.665690321&lt;br /&gt;channel ORA_DISK_1: starting piece 1 at 18-SEP-08&lt;br /&gt;channel ORA_DISK_2: starting compressed full datafile backupset&lt;br /&gt;channel ORA_DISK_2: specifying datafile(s) in backupset&lt;br /&gt;input datafile fno=00001 name=+DATA2/emrep/datafile/system.257.665690973&lt;br /&gt;input datafile fno=00006 name=+DATA2/emrep/datafile/mgmt_ecm_depot_ts.260.665691169&lt;br /&gt;channel ORA_DISK_2: starting piece 1 at 18-SEP-08&lt;br /&gt;channel ORA_DISK_3: starting compressed full datafile backupset&lt;br /&gt;channel ORA_DISK_3: specifying datafile(s) in backupset&lt;br /&gt;input datafile fno=00002 name=+DATA2/emrep/datafile/undotbs1.258.665691079&lt;br /&gt;input datafile fno=00003 name=+DATA2/emrep/datafile/sysaux.259.665691133&lt;br /&gt;channel ORA_DISK_3: starting piece 1 at 18-SEP-08&lt;br /&gt;channel ORA_DISK_4: starting compressed full datafile backupset&lt;br /&gt;channel ORA_DISK_4: specifying datafile(s) in backupset&lt;br /&gt;input datafile fno=00004 name=+DATA2/emrep/datafile/users.261.665691205&lt;br /&gt;channel ORA_DISK_4: starting piece 1 at 18-SEP-08&lt;br /&gt;channel ORA_DISK_4: finished piece 1 at 18-SEP-08&lt;br /&gt;piece handle=/u02/oracle/ora1/emrep/EMREP_28jqt8b9_1_1.rman tag=RMAN_NOCAT_EMREP comment=NONE&lt;br /&gt;channel ORA_DISK_4: backup set complete, elapsed time: 00:00:18&lt;br /&gt;channel ORA_DISK_3: finished piece 1 at 18-SEP-08&lt;br /&gt;piece handle=/u02/oracle/ora1/emrep/EMREP_27jqt8b9_1_1.rman tag=RMAN_NOCAT_EMREP comment=NONE&lt;br /&gt;channel ORA_DISK_3: backup set complete, elapsed time: 00:01:23&lt;br /&gt;channel ORA_DISK_2: finished piece 1 at 18-SEP-08&lt;br /&gt;piece handle=/u02/oracle/ora1/emrep/EMREP_26jqt8b8_1_1.rman tag=RMAN_NOCAT_EMREP comment=NONE&lt;br /&gt;channel ORA_DISK_2: backup set complete, elapsed time: 00:01:31&lt;br /&gt;channel ORA_DISK_1: finished piece 1 at 18-SEP-08&lt;br /&gt;piece handle=/u02/oracle/ora1/emrep/EMREP_25jqt8b8_1_1.rman tag=RMAN_NOCAT_EMREP comment=NONE&lt;br /&gt;channel ORA_DISK_1: backup set complete, elapsed time: 00:02:56&lt;br /&gt;Finished backup at 18-SEP-08&lt;br /&gt;&lt;br /&gt;Starting backup at 18-SEP-08&lt;br /&gt;current log archived&lt;br /&gt;using channel ORA_DISK_1&lt;br /&gt;using channel ORA_DISK_2&lt;br /&gt;using channel ORA_DISK_3&lt;br /&gt;using channel ORA_DISK_4&lt;br /&gt;channel ORA_DISK_1: starting compressed archive log backupset&lt;br /&gt;channel ORA_DISK_1: specifying archive log(s) in backup set&lt;br /&gt;input archive log thread=1 sequence=69 recid=54 stamp=665756192&lt;br /&gt;channel ORA_DISK_1: starting piece 1 at 18-SEP-08&lt;br /&gt;channel ORA_DISK_1: finished piece 1 at 18-SEP-08&lt;br /&gt;piece handle=/u02/oracle/ora1/emrep/EMREP_29jqt8h1_1_1.rman tag=RMAN_NOCAT_EMREP comment=NONE&lt;br /&gt;channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02&lt;br /&gt;channel ORA_DISK_1: deleting archive log(s)&lt;br /&gt;archive log filename=+DATA2/emrep/archivelog/2008_09_18/thread_1_seq_69.263.665756189 recid=54 stamp=665756192&lt;br /&gt;Finished backup at 18-SEP-08&lt;br /&gt;&lt;br /&gt;Starting Control File and SPFILE Autobackup at 18-SEP-08&lt;br /&gt;piece handle=/u02/oracle/ora1/emrep/c-3888623110-20080918-01 comment=NONE&lt;br /&gt;Finished Control File and SPFILE Autobackup at 18-SEP-08&lt;br /&gt;&lt;br /&gt;Recovery Manager complete.&lt;/pre&gt;&lt;br /&gt;The filesystem should now house a series of files, similar to:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ ls -lart&lt;br /&gt;total 160138&lt;br /&gt;drwxr-xr-x  9 oracle dba     4096 Sep 18 11:36 ../&lt;br /&gt;-rw-r-----  1 oracle dba   376320 Sep 18 12:13 EMREP_24jqt8b5_1_1.rman&lt;br /&gt;-rw-r-----  1 oracle dba    98304 Sep 18 12:13 EMREP_28jqt8b9_1_1.rman&lt;br /&gt;-rw-r-----  1 oracle dba 76972032 Sep 18 12:14 EMREP_27jqt8b9_1_1.rman&lt;br /&gt;-rw-r-----  1 oracle dba 54304768 Sep 18 12:14 EMREP_26jqt8b8_1_1.rman&lt;br /&gt;-rw-r-----  1 oracle dba 22044672 Sep 18 12:16 EMREP_25jqt8b8_1_1.rman&lt;br /&gt;-rw-r-----  1 oracle dba   100352 Sep 18 12:16 EMREP_29jqt8h1_1_1.rman&lt;br /&gt;drwxr-xr-x  2 oracle dba     4096 Sep 18 12:16 ./&lt;br /&gt;-rw-r-----  1 oracle dba  5079040 Sep 18 12:16 c-3888623110-20080918-01&lt;br /&gt;-rw-r-----  1 oracle dba  4997120 Sep 18 12:16 snapf_emrep.ora&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Prepare the Auxiliary Host for the Duplicate Database (EMTST)&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Update &lt;span style="font-family: courier new;"&gt;/etc/oratab&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;echo "emtst:/u01/app/oracle/product/10.2:N" &gt;&gt; /etc/oratab&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Create a password file for the Database (EMTST)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ cd $ORACLE_HOME/dbs&lt;br /&gt;$ orapwd file=orapwemtst password=shine123&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Create any Required Directories for the Database (EMTST)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ mkdir -p /u01/app/oracle/admin/emtst/bdump&lt;br /&gt;$ mkdir -p /u01/app/oracle/admin/emtst/udump&lt;br /&gt;$ mkdir -p /u01/app/oracle/admin/emtst/cdump&lt;br /&gt;$ mkdir -p /u01/app/oracle/admin/emtst/adump&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Update the Oracle Networking Files as appropriate (EMTST)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ cd $TNS_ADMIN&lt;br /&gt;$ vi tnsnames.ora&lt;br /&gt;&lt;br /&gt;EMREP =&lt;br /&gt;  (DESCRIPTION =&lt;br /&gt;    (ADDRESS = (PROTOCOL = TCP)(HOST = rac1.colestock.test)(PORT = 1521))&lt;br /&gt;    (CONNECT_DATA =&lt;br /&gt;      (SERVER = DEDICATED)&lt;br /&gt;      (SERVICE_NAME = emrep.colestock.test)&lt;br /&gt;      (INSTANCE_NAME = emrep)&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;EMTST =&lt;br /&gt;  (DESCRIPTION =&lt;br /&gt;    (ADDRESS = (PROTOCOL = TCP)(HOST = rac2.colestock.test)(PORT = 1521))&lt;br /&gt;    (CONNECT_DATA =&lt;br /&gt;      (SERVER = DEDICATED)&lt;br /&gt;      (SERVICE_NAME = emtst.colestock.test)&lt;br /&gt;      (INSTANCE_NAME = emtst)&lt;br /&gt;    )&lt;br /&gt;  )&lt;/pre&gt;&lt;br /&gt;Test connectivity to all services involved in the DUPLICATE operation, for example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ tnsping emrep&lt;br /&gt;&lt;br /&gt;TNS Ping Utility for Linux: Version 10.2.0.4.0 - Production on 18-SEP-2008 13:27:46&lt;br /&gt;&lt;br /&gt;Copyright (c) 1997,  2007, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Used parameter files:&lt;br /&gt;/u01/app/oracle/product/11.1/network/admin/sqlnet.ora&lt;br /&gt;&lt;br /&gt;Used TNSNAMES adapter to resolve the alias&lt;br /&gt;Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = rac1.colestock.test)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = emrep.colestock.test) (INSTANCE_NAME = emrep)))&lt;br /&gt;OK (0 msec)&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Create/Update the Listener with a Static Entry (EMTST)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ vi listener.ora&lt;br /&gt;&lt;br /&gt;LISTENER =&lt;br /&gt;  (DESCRIPTION_LIST =&lt;br /&gt;    (DESCRIPTION =&lt;br /&gt;      (ADDRESS_LIST =&lt;br /&gt;        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;      )&lt;br /&gt;      (ADDRESS_LIST =&lt;br /&gt;        (ADDRESS = (PROTOCOL = TCP)(HOST = rac2.colestock.test)(PORT = 1521))&lt;br /&gt;      )&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;SID_LIST_LISTENER =&lt;br /&gt;  (SID_LIST =&lt;br /&gt;    (SID_DESC =&lt;br /&gt;      (SID_NAME = PLSExtProc)&lt;br /&gt;      (ORACLE_HOME = /u01/app/oracle/product/10.2)&lt;br /&gt;      (PROGRAM = extproc)&lt;br /&gt;    )&lt;br /&gt;    (SID_DESC =&lt;br /&gt;      (GLOBAL_DBNAME = emtst.colestock.test)&lt;br /&gt;      (ORACLE_HOME = /u01/app/oracle/product/10.2)&lt;br /&gt;      (SID_NAME = emtst)&lt;br /&gt;    )&lt;br /&gt;  )&lt;/pre&gt;&lt;br /&gt;If creating a new LISTENER, start it:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ lsnrctl start LISTENER&lt;br /&gt;&lt;br /&gt;LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 18-SEP-2008 13:26:13&lt;br /&gt;&lt;br /&gt;Copyright (c) 1991, 2007, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Starting /u01/app/oracle/product/11.1/bin/tnslsnr: please wait...&lt;br /&gt;&lt;br /&gt;TNSLSNR for Linux: Version 11.1.0.6.0 - Production&lt;br /&gt;System parameter file is /u01/app/oracle/product/11.1/network/admin/listener.ora&lt;br /&gt;Log messages written to /u01/app/oracle/diag/tnslsnr/rac2/listener/alert/log.xml&lt;br /&gt;Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))&lt;br /&gt;Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac2.colestock.test)(PORT=1521)))&lt;br /&gt;&lt;br /&gt;Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))&lt;br /&gt;STATUS of the LISTENER&lt;br /&gt;------------------------&lt;br /&gt;Alias                     LISTENER&lt;br /&gt;Version                   TNSLSNR for Linux: Version 11.1.0.6.0 - Production&lt;br /&gt;Start Date                18-SEP-2008 13:26:15&lt;br /&gt;Uptime                    0 days 0 hr. 0 min. 0 sec&lt;br /&gt;Trace Level               off&lt;br /&gt;Security                  ON: Local OS Authentication&lt;br /&gt;SNMP                      OFF&lt;br /&gt;Listener Parameter File   /u01/app/oracle/product/11.1/network/admin/listener.ora&lt;br /&gt;Listener Log File         /u01/app/oracle/diag/tnslsnr/rac2/listener/alert/log.xml&lt;br /&gt;Listening Endpoints Summary...&lt;br /&gt;  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))&lt;br /&gt;  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac2.colestock.test)(PORT=1521)))&lt;br /&gt;Services Summary...&lt;br /&gt;Service "PLSExtProc" has 1 instance(s).&lt;br /&gt;  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;Service "emtst.colestock.test" has 1 instance(s).&lt;br /&gt;  Instance "emtst", status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;The command completed successfully&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Create Necessary ASM Directories on the Host of the New Database (EMTST)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ export ORACLE_SID=+ASM2&lt;br /&gt;$ . oraenv&lt;br /&gt;The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.1 is /u01/app/oracle&lt;br /&gt;$ asmcmd&lt;br /&gt;ASMCMD&gt; cd DATA&lt;br /&gt;ASMCMD&gt; mkdir EMTST&lt;br /&gt;ASMCMD&gt; cd EMTST&lt;br /&gt;ASMCMD&gt; mkdir CONTROLFILE&lt;br /&gt;ASMCMD&gt; mkdir ONLINELOG&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Copy the Parameter File from the TARGET to the AUXILIARY(EMREP to EMTST)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ export ORACLE_SID=emrep&lt;br /&gt;$ . oraenv&lt;br /&gt;$ sqlplus "/ as sysdba"&lt;br /&gt;SQL&gt; create pfile='/tmp/initemtst.ora' from spfile;&lt;br /&gt;scp /tmp/initemtst.ora oracle@rac2:/u01/app/oracle/product/10.2/dbs/.&lt;br /&gt;oracle@rac2's password:&lt;br /&gt;initemtst.ora                                 100% 1409     1.4KB/s   00:00&lt;br /&gt;cd $ORACLE_HOME/dbs&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Edit the Parameter File, Changing Necessary Values on Auxiliary Host (EMTST)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In this example, the Diskgroup is switched from DATA to DATA2. I will create the online redo logs as part of the &lt;span style="font-family: courier new;"&gt;DUPLICATE&lt;/span&gt; clause.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;vi initemtst.ora&lt;br /&gt;&lt;br /&gt;*.background_dump_dest='/u01/app/oracle/admin/emtst/bdump'&lt;br /&gt;*.core_dump_dest='/u01/app/oracle/admin/emtst/cdump'&lt;br /&gt;*.db_file_name_convert=('+DATA2','+DATA')&lt;br /&gt;*.control_files='+DATA/EMTST/CONTROLFILE/control01.ctl','+DATA/EMTST/CONTROLFILE/control02.ctl','+DATA/EMTST/CONTROLFILE/control03.ctl'&lt;br /&gt;*.db_name='emtst'&lt;br /&gt;*.log_archive_dest_1='LOCATION=+DATA'&lt;br /&gt;*.log_archive_format='emtst_%t_%s_%r.arch'&lt;br /&gt;*.user_dump_dest='/u01/app/oracle/admin/emtst/udump'&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Create an SPFILE and &lt;span style="font-family: courier new;"&gt;startup nomount&lt;/span&gt; the Auxiliary Instance&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; create spfile from pfile;&lt;br /&gt;&lt;br /&gt;File created.&lt;br /&gt;&lt;br /&gt;SQL&gt; startup nomount;&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area  536870912 bytes&lt;br /&gt;Fixed Size                  1268484 bytes&lt;br /&gt;Variable Size             503317756 bytes&lt;br /&gt;Database Buffers           25165824 bytes&lt;br /&gt;Redo Buffers                7118848 bytes&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Create a Connection File that Obfuscates Passwords for RMAN&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;connect.rman&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;connect auxiliary / ;&lt;br /&gt;connect target sys/password@emrep ;&lt;/pre&gt;&lt;br /&gt;Change the file's ownership:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;chmod 711 connect.rman&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Perform the &lt;span style="font-family: courier new;"&gt;DUPLICATE&lt;/span&gt; operation on the Auxiliary Host&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;duplicate_emrep_to_emtst.rman&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;@connect.rman&lt;br /&gt;run {&lt;br /&gt;allocate auxiliary channel aux1 device type disk;&lt;br /&gt;allocate auxiliary channel aux2 device type disk;&lt;br /&gt;allocate auxiliary channel aux3 device type disk;&lt;br /&gt;duplicate target database to emtst logfile&lt;br /&gt;group 1 ('+DATA/EMTST/ONLINELOG/redo_0101.log','+DATA/EMTST/ONLINELOG/redo_0102.log') SIZE 100M REUSE,&lt;br /&gt;group 2 ('+DATA/EMTST/ONLINELOG/redo_0201.log','+DATA/EMTST/ONLINELOG/redo_0202.log') SIZE 100M REUSE,&lt;br /&gt;group 3 ('+DATA/EMTST/ONLINELOG/redo_0301.log','+DATA/EMTST/ONLINELOG/redo_0302.log') SIZE 100M REUSE,&lt;br /&gt;group 4 ('+DATA/EMTST/ONLINELOG/redo_0401.log','+DATA/EMTST/ONLINELOG/redo_0402.log') SIZE 100M REUSE;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;Run the aforementioned script&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;rman @duplicate_emrep_to_emtst.rman &gt; duplicate_emrep_to_emtst.log &amp;&lt;/pre&gt;&lt;br /&gt;A successful &lt;span style="font-family: courier new;"&gt;DUPLICATE&lt;/span&gt; should yield output similar to this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ more duplicate_emrep_to_emtst.log&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;Recovery Manager: Release 10.2.0.4.0 - Production on Thu Sep 18 16:18:02 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;RMAN&gt; @connect.rman&lt;br /&gt;2&gt; connect auxiliary *;&lt;br /&gt;3&gt; connect target *;&lt;br /&gt;4&gt; **end-of-file**&lt;br /&gt;5&gt; run {&lt;br /&gt;6&gt; allocate auxiliary channel aux1 device type disk;&lt;br /&gt;7&gt; allocate auxiliary channel aux2 device type disk;&lt;br /&gt;8&gt; allocate auxiliary channel aux3 device type disk;&lt;br /&gt;9&gt; duplicate target database to emtst logfile&lt;br /&gt;10&gt; group 1 ('+DATA/EMTST/ONLINELOG/redo_0101.log','+DATA/EMTST/ONLINELOG/redo_0102.log') SIZE 100M REUSE,&lt;br /&gt;11&gt; group 2 ('+DATA/EMTST/ONLINELOG/redo_0201.log','+DATA/EMTST/ONLINELOG/redo_0202.log') SIZE 100M REUSE,&lt;br /&gt;12&gt; group 3 ('+DATA/EMTST/ONLINELOG/redo_0301.log','+DATA/EMTST/ONLINELOG/redo_0302.log') SIZE 100M REUSE,&lt;br /&gt;13&gt; group 4 ('+DATA/EMTST/ONLINELOG/redo_0401.log','+DATA/EMTST/ONLINELOG/redo_0402.log') SIZE 100M REUSE;&lt;br /&gt;14&gt; }&lt;br /&gt;15&gt;&lt;br /&gt;connected to auxiliary database: EMTST (not mounted)&lt;br /&gt;&lt;br /&gt;connected to target database: EMREP (DBID=3888623110)&lt;br /&gt;&lt;br /&gt;using target database control file instead of recovery catalog&lt;br /&gt;allocated channel: aux1&lt;br /&gt;channel aux1: sid=156 devtype=DISK&lt;br /&gt;&lt;br /&gt;allocated channel: aux2&lt;br /&gt;channel aux2: sid=155 devtype=DISK&lt;br /&gt;&lt;br /&gt;allocated channel: aux3&lt;br /&gt;channel aux3: sid=154 devtype=DISK&lt;br /&gt;&lt;br /&gt;Starting Duplicate Db at 18-SEP-08&lt;br /&gt;WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to diskgroup only.&lt;br /&gt;&lt;br /&gt;contents of Memory Script:&lt;br /&gt;{&lt;br /&gt;   set until scn  5512981;&lt;br /&gt;   set newname for datafile  1 to&lt;br /&gt; "+data";&lt;br /&gt;   set newname for datafile  2 to&lt;br /&gt; "+data";&lt;br /&gt;   set newname for datafile  3 to&lt;br /&gt; "+data";&lt;br /&gt;   set newname for datafile  4 to&lt;br /&gt; "+data";&lt;br /&gt;   set newname for datafile  5 to&lt;br /&gt; "+data";&lt;br /&gt;   set newname for datafile  6 to&lt;br /&gt; "+data";&lt;br /&gt;   restore&lt;br /&gt;   check readonly&lt;br /&gt;   clone database&lt;br /&gt;   ;&lt;br /&gt;}&lt;br /&gt;executing Memory Script&lt;br /&gt;&lt;br /&gt;executing command: SET until clause&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;Starting restore at 18-SEP-08&lt;br /&gt;&lt;br /&gt;channel aux1: starting datafile backupset restore&lt;br /&gt;channel aux1: specifying datafile(s) to restore from backup set&lt;br /&gt;restoring datafile 00004 to +DATA&lt;br /&gt;channel aux1: reading from backup piece /u02/oracle/ora1/emrep/EMREP_28jqt8b9_1_1.rman&lt;br /&gt;channel aux2: starting datafile backupset restore&lt;br /&gt;channel aux2: specifying datafile(s) to restore from backup set&lt;br /&gt;restoring datafile 00002 to +DATA&lt;br /&gt;restoring datafile 00003 to +DATA&lt;br /&gt;channel aux2: reading from backup piece /u02/oracle/ora1/emrep/EMREP_27jqt8b9_1_1.rman&lt;br /&gt;channel aux3: starting datafile backupset restore&lt;br /&gt;channel aux3: specifying datafile(s) to restore from backup set&lt;br /&gt;restoring datafile 00001 to +DATA&lt;br /&gt;restoring datafile 00006 to +DATA&lt;br /&gt;channel aux3: reading from backup piece /u02/oracle/ora1/emrep/EMREP_26jqt8b8_1_1.rman&lt;br /&gt;channel aux1: restored backup piece 1&lt;br /&gt;piece handle=/u02/oracle/ora1/emrep/EMREP_28jqt8b9_1_1.rman tag=RMAN_NOCAT_EMREP&lt;br /&gt;channel aux1: restore complete, elapsed time: 00:00:15&lt;br /&gt;channel aux1: starting datafile backupset restore&lt;br /&gt;channel aux1: specifying datafile(s) to restore from backup set&lt;br /&gt;restoring datafile 00005 to +DATA&lt;br /&gt;channel aux1: reading from backup piece /u02/oracle/ora1/emrep/EMREP_25jqt8b8_1_1.rman&lt;br /&gt;channel aux2: restored backup piece 1&lt;br /&gt;piece handle=/u02/oracle/ora1/emrep/EMREP_27jqt8b9_1_1.rman tag=RMAN_NOCAT_EMREP&lt;br /&gt;channel aux2: restore complete, elapsed time: 00:01:20&lt;br /&gt;channel aux3: restored backup piece 1&lt;br /&gt;piece handle=/u02/oracle/ora1/emrep/EMREP_26jqt8b8_1_1.rman tag=RMAN_NOCAT_EMREP&lt;br /&gt;channel aux3: restore complete, elapsed time: 00:01:20&lt;br /&gt;channel aux1: restored backup piece 1&lt;br /&gt;piece handle=/u02/oracle/ora1/emrep/EMREP_25jqt8b8_1_1.rman tag=RMAN_NOCAT_EMREP&lt;br /&gt;channel aux1: restore complete, elapsed time: 00:02:30&lt;br /&gt;Finished restore at 18-SEP-08&lt;br /&gt;sql statement: CREATE CONTROLFILE REUSE SET DATABASE "EMTST" RESETLOGS ARCHIVELOG&lt;br /&gt;  MAXLOGFILES     16&lt;br /&gt;  MAXLOGMEMBERS      3&lt;br /&gt;  MAXDATAFILES      100&lt;br /&gt;  MAXINSTANCES     8&lt;br /&gt;  MAXLOGHISTORY      454&lt;br /&gt; LOGFILE&lt;br /&gt;  GROUP  1 ( '+DATA/EMTST/ONLINELOG/redo_0101.log', '+DATA/EMTST/ONLINELOG/redo_0102.log' ) SIZE 100 M  REUSE,&lt;br /&gt;  GROUP  2 ( '+DATA/EMTST/ONLINELOG/redo_0201.log', '+DATA/EMTST/ONLINELOG/redo_0202.log' ) SIZE 100 M  REUSE,&lt;br /&gt;  GROUP  3 ( '+DATA/EMTST/ONLINELOG/redo_0301.log', '+DATA/EMTST/ONLINELOG/redo_0302.log' ) SIZE 100 M  REUSE,&lt;br /&gt;  GROUP  4 ( '+DATA/EMTST/ONLINELOG/redo_0401.log', '+DATA/EMTST/ONLINELOG/redo_0402.log' ) SIZE 100 M  REUSE&lt;br /&gt; DATAFILE&lt;br /&gt;  '+DATA/emtst/datafile/system.282.665770693'&lt;br /&gt; CHARACTER SET AL32UTF8&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;contents of Memory Script:&lt;br /&gt;{&lt;br /&gt;   switch clone datafile all;&lt;br /&gt;}&lt;br /&gt;executing Memory Script&lt;br /&gt;&lt;br /&gt;datafile 2 switched to datafile copy&lt;br /&gt;input datafile copy recid=1 stamp=665770855 filename=+DATA/emtst/datafile/undotbs1.283.665770693&lt;br /&gt;datafile 3 switched to datafile copy&lt;br /&gt;input datafile copy recid=2 stamp=665770855 filename=+DATA/emtst/datafile/sysaux.292.665770695&lt;br /&gt;datafile 4 switched to datafile copy&lt;br /&gt;input datafile copy recid=3 stamp=665770855 filename=+DATA/emtst/datafile/users.284.665770693&lt;br /&gt;datafile 5 switched to datafile copy&lt;br /&gt;input datafile copy recid=4 stamp=665770855 filename=+DATA/emtst/datafile/mgmt_tablespace.291.665770703&lt;br /&gt;datafile 6 switched to datafile copy&lt;br /&gt;input datafile copy recid=5 stamp=665770855 filename=+DATA/emtst/datafile/mgmt_ecm_depot_ts.293.665770695&lt;br /&gt;&lt;br /&gt;contents of Memory Script:&lt;br /&gt;{&lt;br /&gt;   set until scn  5512981;&lt;br /&gt;   recover&lt;br /&gt;   clone database&lt;br /&gt;    delete archivelog&lt;br /&gt;   ;&lt;br /&gt;}&lt;br /&gt;executing Memory Script&lt;br /&gt;&lt;br /&gt;executing command: SET until clause&lt;br /&gt;&lt;br /&gt;Starting recover at 18-SEP-08&lt;br /&gt;&lt;br /&gt;starting media recovery&lt;br /&gt;&lt;br /&gt;archive log thread 1 sequence 70 is already on disk as file +DATA2/emrep/archivelog/2008_09_18/thread_1_seq_70.&lt;br /&gt;280.665766251&lt;br /&gt;channel aux1: starting archive log restore to default destination&lt;br /&gt;channel aux1: restoring archive log&lt;br /&gt;archive log thread=1 sequence=69&lt;br /&gt;channel aux1: reading from backup piece /u02/oracle/ora1/emrep/EMREP_29jqt8h1_1_1.rman&lt;br /&gt;channel aux1: restored backup piece 1&lt;br /&gt;piece handle=/u02/oracle/ora1/emrep/EMREP_29jqt8h1_1_1.rman tag=RMAN_NOCAT_EMREP&lt;br /&gt;channel aux1: restore complete, elapsed time: 00:00:02&lt;br /&gt;archive log filename=+DATA/emtst/archivelog/2008_09_18/thread_1_seq_69.287.665770857 thread=1 sequence=69&lt;br /&gt;channel clone_default: deleting archive log(s)&lt;br /&gt;archive log filename=+DATA/emtst/archivelog/2008_09_18/thread_1_seq_69.287.665770857 recid=1 stamp=665770856&lt;br /&gt;archive log filename=+DATA2/emrep/archivelog/2008_09_18/thread_1_seq_70.280.665766251 thread=1 sequence=70&lt;br /&gt;media recovery complete, elapsed time: 00:00:32&lt;br /&gt;Finished recover at 18-SEP-08&lt;br /&gt;&lt;br /&gt;contents of Memory Script:&lt;br /&gt;{&lt;br /&gt;   shutdown clone;&lt;br /&gt;   startup clone nomount ;&lt;br /&gt;}&lt;br /&gt;executing Memory Script&lt;br /&gt;&lt;br /&gt;database dismounted&lt;br /&gt;Oracle instance shut down&lt;br /&gt;&lt;br /&gt;connected to auxiliary database (not started)&lt;br /&gt;Oracle instance started&lt;br /&gt;&lt;br /&gt;Total System Global Area     536870912 bytes&lt;br /&gt;&lt;br /&gt;Fixed Size                     1268484 bytes&lt;br /&gt;Variable Size                503317756 bytes&lt;br /&gt;Database Buffers              25165824 bytes&lt;br /&gt;Redo Buffers                   7118848 bytes&lt;br /&gt;sql statement: CREATE CONTROLFILE REUSE SET DATABASE "EMTST" RESETLOGS ARCHIVELOG&lt;br /&gt;  MAXLOGFILES     16&lt;br /&gt;  MAXLOGMEMBERS      3&lt;br /&gt;  MAXDATAFILES      100&lt;br /&gt;  MAXINSTANCES     8&lt;br /&gt;  MAXLOGHISTORY      454&lt;br /&gt; LOGFILE&lt;br /&gt;  GROUP  1 ( '+DATA/EMTST/ONLINELOG/redo_0101.log', '+DATA/EMTST/ONLINELOG/redo_0102.log' ) SIZE 100 M  REUSE,&lt;br /&gt;  GROUP  2 ( '+DATA/EMTST/ONLINELOG/redo_0201.log', '+DATA/EMTST/ONLINELOG/redo_0202.log' ) SIZE 100 M  REUSE,&lt;br /&gt;  GROUP  3 ( '+DATA/EMTST/ONLINELOG/redo_0301.log', '+DATA/EMTST/ONLINELOG/redo_0302.log' ) SIZE 100 M  REUSE,&lt;br /&gt;  GROUP  4 ( '+DATA/EMTST/ONLINELOG/redo_0401.log', '+DATA/EMTST/ONLINELOG/redo_0402.log' ) SIZE 100 M  REUSE&lt;br /&gt; DATAFILE&lt;br /&gt;  '+DATA/emtst/datafile/system.282.665770693'&lt;br /&gt; CHARACTER SET AL32UTF8&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;contents of Memory Script:&lt;br /&gt;{&lt;br /&gt;   set newname for tempfile  2 to&lt;br /&gt; "+data";&lt;br /&gt;   switch clone tempfile all;&lt;br /&gt;   catalog clone datafilecopy  "+DATA/emtst/datafile/undotbs1.283.665770693";&lt;br /&gt;   catalog clone datafilecopy  "+DATA/emtst/datafile/sysaux.292.665770695";&lt;br /&gt;   catalog clone datafilecopy  "+DATA/emtst/datafile/users.284.665770693";&lt;br /&gt;   catalog clone datafilecopy  "+DATA/emtst/datafile/mgmt_tablespace.291.665770703";&lt;br /&gt;   catalog clone datafilecopy  "+DATA/emtst/datafile/mgmt_ecm_depot_ts.293.665770695";&lt;br /&gt;   switch clone datafile all;&lt;br /&gt;}&lt;br /&gt;executing Memory Script&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;renamed temporary file 2 to +data in control file&lt;br /&gt;&lt;br /&gt;cataloged datafile copy&lt;br /&gt;datafile copy filename=+DATA/emtst/datafile/undotbs1.283.665770693 recid=1 stamp=665770907&lt;br /&gt;&lt;br /&gt;cataloged datafile copy&lt;br /&gt;datafile copy filename=+DATA/emtst/datafile/sysaux.292.665770695 recid=2 stamp=665770907&lt;br /&gt;&lt;br /&gt;cataloged datafile copy&lt;br /&gt;datafile copy filename=+DATA/emtst/datafile/users.284.665770693 recid=3 stamp=665770907&lt;br /&gt;&lt;br /&gt;cataloged datafile copy&lt;br /&gt;datafile copy filename=+DATA/emtst/datafile/mgmt_tablespace.291.665770703 recid=4 stamp=665770907&lt;br /&gt;&lt;br /&gt;cataloged datafile copy&lt;br /&gt;datafile copy filename=+DATA/emtst/datafile/mgmt_ecm_depot_ts.293.665770695 recid=5 stamp=665770907&lt;br /&gt;&lt;br /&gt;datafile 2 switched to datafile copy&lt;br /&gt;input datafile copy recid=1 stamp=665770907 filename=+DATA/emtst/datafile/undotbs1.283.665770693&lt;br /&gt;datafile 3 switched to datafile copy&lt;br /&gt;input datafile copy recid=2 stamp=665770907 filename=+DATA/emtst/datafile/sysaux.292.665770695&lt;br /&gt;datafile 4 switched to datafile copy&lt;br /&gt;input datafile copy recid=3 stamp=665770907 filename=+DATA/emtst/datafile/users.284.665770693&lt;br /&gt;datafile 5 switched to datafile copy&lt;br /&gt;input datafile copy recid=4 stamp=665770907 filename=+DATA/emtst/datafile/mgmt_tablespace.291.665770703&lt;br /&gt;datafile 6 switched to datafile copy&lt;br /&gt;input datafile copy recid=5 stamp=665770907 filename=+DATA/emtst/datafile/mgmt_ecm_depot_ts.293.665770695&lt;br /&gt;&lt;br /&gt;contents of Memory Script:&lt;br /&gt;{&lt;br /&gt;   Alter clone database open resetlogs;&lt;br /&gt;}&lt;br /&gt;executing Memory Script&lt;br /&gt;&lt;br /&gt;database opened&lt;br /&gt;Finished Duplicate Db at 18-SEP-08&lt;br /&gt;RMAN-00571: ===========================================================&lt;br /&gt;RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============&lt;br /&gt;RMAN-00571: ===========================================================&lt;br /&gt;RMAN-12005: error during channel cleanup&lt;br /&gt;ORA-06502: PL/SQL: numeric or value error: character to number conversion error&lt;br /&gt;&lt;br /&gt;Recovery Manager complete.&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Logon to the the Auxiliary Database (EMTST) and Verify&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; select name from v$datafile;&lt;br /&gt;&lt;br /&gt;NAME&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;+DATA/emtst/datafile/system.282.665770693&lt;br /&gt;+DATA/emtst/datafile/undotbs1.283.665770693&lt;br /&gt;+DATA/emtst/datafile/sysaux.292.665770695&lt;br /&gt;+DATA/emtst/datafile/users.284.665770693&lt;br /&gt;+DATA/emtst/datafile/mgmt_tablespace.291.665770703&lt;br /&gt;+DATA/emtst/datafile/mgmt_ecm_depot_ts.293.665770695&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; select name from v$controlfile;&lt;br /&gt;&lt;br /&gt;NAME&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;+DATA/emtst/controlfile/control01.ctl&lt;br /&gt;+DATA/emtst/controlfile/control02.ctl&lt;br /&gt;+DATA/emtst/controlfile/control03.ctl&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; select member from v$logfile;&lt;br /&gt;&lt;br /&gt;MEMBER&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;+DATA/emtst/onlinelog/redo_0401.log&lt;br /&gt;+DATA/emtst/onlinelog/redo_0402.log&lt;br /&gt;+DATA/emtst/onlinelog/redo_0301.log&lt;br /&gt;+DATA/emtst/onlinelog/redo_0302.log&lt;br /&gt;+DATA/emtst/onlinelog/redo_0201.log&lt;br /&gt;+DATA/emtst/onlinelog/redo_0202.log&lt;br /&gt;+DATA/emtst/onlinelog/redo_0101.log&lt;br /&gt;+DATA/emtst/onlinelog/redo_0102.log&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; select name from v$tempfile;&lt;br /&gt;&lt;br /&gt;NAME&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;+DATA/emtst/tempfile/temp.295.665770955&lt;/pre&gt;&lt;br /&gt;&lt;br&gt;&lt;hr&gt;&lt;br /&gt;Here is how to adjust the aforementioned example to use an RMAN Recovery Catalog&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Create the RMAN Recovery Catalog&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ export ORACLE_SID=jlc2&lt;br /&gt;$ . oraenv&lt;br /&gt;$ sqlplus "/ as sysdba"&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; create user rman identified by rman&lt;br /&gt;  2  temporary tablespace temp&lt;br /&gt;  3  default tablespace users quota unlimited on users;&lt;br /&gt;&lt;br /&gt;User created.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; grant recovery_catalog_owner to rman;&lt;br /&gt;&lt;br /&gt;Grant succeeded.&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Create the Recovery Catalog and Register the TARGET Database (EMREP)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ export ORACLE_SID=emrep&lt;br /&gt;$ . oraenv&lt;br /&gt;$ rman catalog=rman/rman@jlcc target=/&lt;br /&gt;&lt;br /&gt;RMAN&gt; create catalog;&lt;br /&gt;&lt;br /&gt;recovery catalog created&lt;br /&gt;&lt;br /&gt;RMAN&gt; register database;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Create a Connection File on the TARGET to obfuscate the RMAN password&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;rman.connect&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;connect catalog rman/rman@jlc;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Modify the file's permissions&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ chmod 711 rman.connect&lt;/pre&gt;&lt;br /&gt;Add the following line to the previously created backup script, &lt;span style="font-family: courier new;"&gt;backup_emrep.rman&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;@rman.connect&lt;/pre&gt;&lt;br /&gt;Create a New Backup of the TARGET (EMREP)&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;./run_backup.bsh &gt; rman_emrep.log&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Update the Connect File on the AUXILIARY (EMTST)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;rman.connect&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Add the following line:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;connect catalog rman/rman@jlc;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Drop the Previously Created Database (EMTST)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ export ORACLE_SID=emtst&lt;br /&gt;$ . oraenv&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; shutdown immediate;&lt;br /&gt;SQL&gt; startup restrict mount;&lt;br /&gt;SQL&gt; drop database;&lt;br /&gt;SQL&gt; exit;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;$ sqlplus "/ as sysdba"&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; startup nomount;&lt;br /&gt;SQL&gt; exit&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Duplicate the Database using the Recovery Catalog&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;rman @duplicate_emrep_to_emtst.rman &gt; duplicate_emrep_to_emtst.log &amp;&lt;/pre&gt;&lt;br /&gt;&lt;br&gt;&lt;hr&gt;&lt;br /&gt;You may have noticed the following error earlier on in this example:&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;"WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to diskgroup only"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Using OMF (Oracle Managed Files) and ASM with this parameter is a little tricky. I prefer to discontinue the use of OMF by relocating the files and renaming them; for example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;RMAN&gt; COPY DATAFILE '+DATA2/emrep/datafile/undotbs1.258.665691079' TO '+DATA2/emrep/datafile/undotbs01.dbf';&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter database rename file '+DATA2/emrep/datafile/undotbs1.258.665691079' TO '+DATA2/emrep/datafile/undotbs01.dbf';&lt;/pre&gt;&lt;br /&gt;Once all the files have been explicitly named, file name conversion becomes much more straightforward. &lt;br /&gt;&lt;br /&gt;If you are using explicitly named files on ASM, then you can alter &lt;span style="font-family: courier new;"&gt;db_file_name_convert&lt;/span&gt;; for example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;*.db_file_name_convert=('+DATA2/emrep','+DATA/emtst')&lt;/pre&gt;&lt;br /&gt;Provided that the necessary directories are there, this should work. You will, however, see the aforementioned error message. The intended mapping should - in essence - have the intended effects.&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-7668401513104445226?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/7668401513104445226/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=7668401513104445226' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/7668401513104445226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/7668401513104445226'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/09/how-to-duplicate-standalone-database.html' title='How to Duplicate a Standalone Database: ASM to ASM'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-9154263301143230415</id><published>2008-09-18T09:11:00.000-07:00</published><updated>2008-09-18T09:21:27.096-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RAC'/><title type='text'>Cleaning up after a Failed Clusterware Install</title><content type='html'>I normally use the following script when cleaning up after a failed Cluster Ready Services (Clusterware) install. &lt;br /&gt;&lt;br /&gt;In my example, I remove the dependent files and also the entire Oracle Inventory and Binaries directories: this script is Linux-specific.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ ./remove_crs_files.sh&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;remove_crs_files.sh&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;rm -Rf /etc/oracle/*&lt;br /&gt;rm -f /etc/init.d/init.cssd&lt;br /&gt;rm -f /etc/init.d/init.crs&lt;br /&gt;rm -f /etc/init.d/init.crsd&lt;br /&gt;rm -f /etc/init.d/init.evmd&lt;br /&gt;rm -f /etc/rc2.d/K96init.crs&lt;br /&gt;rm -f /etc/rc2.d/S96init.crs&lt;br /&gt;rm -f /etc/rc3.d/K96init.crs&lt;br /&gt;rm -f /etc/rc3.d/S96init.crs&lt;br /&gt;rm -f /etc/rc5.d/K96init.crs&lt;br /&gt;rm -f /etc/rc5.d/S96init.crs&lt;br /&gt;rm -Rf /etc/oracle/scls_scr&lt;br /&gt;rm -f /etc/inittab.crs&lt;br /&gt;cp /etc/inittab.orig /etc/inittab&lt;br /&gt;rm -Rf /u01/app/crs&lt;br /&gt;mkdir /u01/app/crs&lt;br /&gt;chown oracle:dba /u01/app/crs&lt;br /&gt;rm -Rf /u01/app/oracle/oraInventory&lt;br /&gt;mkdir /u01/app/oracle/oraInventory&lt;br /&gt;chown oracle:dba /u01/app/oracle/oraInventory&lt;/pre&gt;&lt;br /&gt;For more information, reference the following Metalink Article: &lt;a href="https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&amp;p_id=239998.1" target="_blank"&gt;239998.1&lt;/a&gt;&lt;br /&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-9154263301143230415?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/9154263301143230415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=9154263301143230415' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/9154263301143230415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/9154263301143230415'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/09/cleaning-up-after-failed-clusterware.html' title='Cleaning up after a Failed Clusterware Install'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-6509542037406130677</id><published>2008-09-18T08:03:00.000-07:00</published><updated>2008-09-18T09:04:46.800-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RMAN'/><category scheme='http://www.blogger.com/atom/ns#' term='ASM'/><title type='text'>How to Migrate a Standalone Database to ASM</title><content type='html'>The following example shows how to migrate a standalone database to ASM. My environment uses an ASM instance which is version 11.1, ASMLib, and a 10.2.0.4 database (my Grid Control database) on Linux. &lt;br /&gt;&lt;br /&gt;I will move the EM database to the DATA2 diskgroup:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ASMCMD&gt; lsdg&lt;br /&gt;State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Name&lt;br /&gt;MOUNTED  EXTERN  N         512   4096  1048576     25023    21597                0           21597              0  DATA/&lt;br /&gt;MOUNTED  EXTERN  N         512   4096  1048576     25023    24930                0           24930              0  DATA2/&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;In order to migrate the database, it must be in ARCHIVELOG mode. If not in ARCHIVELOG mode, place the database in it now&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ sqlplus "/ as sysdba"&lt;br /&gt;SQL&gt; archive log list&lt;br /&gt;Database log mode              No Archive Mode&lt;br /&gt;Automatic archival             Disabled&lt;br /&gt;Archive destination            USE_DB_RECOVERY_FILE_DEST&lt;br /&gt;Oldest online log sequence     10&lt;br /&gt;Current log sequence           13&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter system set log_archive_format='emrep_%t_%s_%r.arch' scope=spfile;&lt;br /&gt;&lt;br /&gt;System altered.&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter system set log_archive_dest_1='LOCATION=/u02/oracle/arch/' scope=spfile;&lt;br /&gt;&lt;br /&gt;System altered.&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; startup mount;&lt;br /&gt;ORACLE instance started.&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter database archivelog;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter database open;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; archive log list&lt;br /&gt;Database log mode              Archive Mode&lt;br /&gt;Automatic archival             Enabled&lt;br /&gt;Archive destination            /u02/oracle/arch/&lt;br /&gt;Oldest online log sequence     13&lt;br /&gt;Next log sequence to archive   16&lt;br /&gt;Current log sequence           16&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter system switch logfile;&lt;br /&gt;&lt;br /&gt;System altered.&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter system archive log current;&lt;br /&gt;&lt;br /&gt;System altered.&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; ! ls -lart /u02/oracle/arch&lt;br /&gt;total 28506&lt;br /&gt;drwxr-xr-x  2 oracle dba     4096 Apr 16 15:31 lost+found&lt;br /&gt;drwxrwxr-x  8 oracle dba     4096 Sep 14 12:39 ..&lt;br /&gt;-rw-r-----  1 oracle dba 29053440 Sep 17 10:43 emrep_1_16_665591431.arch&lt;br /&gt;drwxr-xr-x  3 oracle dba    24576 Sep 17 10:44 .&lt;br /&gt;-rw-r-----  1 oracle dba   103424 Sep 17 10:44 emrep_1_17_665591431.arch&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Backup the Database to the Diskgroup(s)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ rman target=/&lt;br /&gt;RMAN&gt; backup as copy database format '+DATA2';&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Output should be similar to the following:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Starting backup at 17-SEP-08&lt;br /&gt;using target database control file instead of recovery catalog&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=146 devtype=DISK&lt;br /&gt;channel ORA_DISK_1: starting datafile copy&lt;br /&gt;input datafile fno=00005 name=/u01/app/oracle/oradata/emrep/mgmt.dbf&lt;br /&gt;output filename=+DATA2/emrep/datafile/mgmt_tablespace.256.665690321 tag=TAG20080917T175835 recid=1 stamp=665690971&lt;br /&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:10:57&lt;br /&gt;channel ORA_DISK_1: starting datafile copy&lt;br /&gt;input datafile fno=00001 name=/u01/app/oracle/oradata/emrep/system01.dbf&lt;br /&gt;output filename=+DATA2/emrep/datafile/system.257.665690973 tag=TAG20080917T175835 recid=2 stamp=665691068&lt;br /&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:45&lt;br /&gt;channel ORA_DISK_1: starting datafile copy&lt;br /&gt;input datafile fno=00002 name=/u01/app/oracle/oradata/emrep/undotbs01.dbf&lt;br /&gt;output filename=+DATA2/emrep/datafile/undotbs1.258.665691079 tag=TAG20080917T175835 recid=3 stamp=665691129&lt;br /&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:55&lt;br /&gt;channel ORA_DISK_1: starting datafile copy&lt;br /&gt;input datafile fno=00003 name=/u01/app/oracle/oradata/emrep/sysaux01.dbf&lt;br /&gt;output filename=+DATA2/emrep/datafile/sysaux.259.665691133 tag=TAG20080917T175835 recid=4 stamp=665691166&lt;br /&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35&lt;br /&gt;channel ORA_DISK_1: starting datafile copy&lt;br /&gt;input datafile fno=00006 name=/u01/app/oracle/oradata/emrep/mgmt_ecm_depot1.dbf&lt;br /&gt;output filename=+DATA2/emrep/datafile/mgmt_ecm_depot_ts.260.665691169 tag=TAG20080917T175835 recid=5 stamp=665691194&lt;br /&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35&lt;br /&gt;channel ORA_DISK_1: starting datafile copy&lt;br /&gt;input datafile fno=00004 name=/u01/app/oracle/oradata/emrep/users01.dbf&lt;br /&gt;output filename=+DATA2/emrep/datafile/users.261.665691205 tag=TAG20080917T175835 recid=6 stamp=665691204&lt;br /&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01&lt;br /&gt;channel ORA_DISK_1: starting datafile copy&lt;br /&gt;copying current control file&lt;br /&gt;output filename=+DATA2/emrep/controlfile/backup.262.665691205 tag=TAG20080917T175835 recid=7 stamp=665691207&lt;br /&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03&lt;br /&gt;channel ORA_DISK_1: starting full datafile backupset&lt;br /&gt;channel ORA_DISK_1: specifying datafile(s) in backupset&lt;br /&gt;including current SPFILE in backupset&lt;br /&gt;channel ORA_DISK_1: starting piece 1 at 17-SEP-08&lt;br /&gt;channel ORA_DISK_1: finished piece 1 at 17-SEP-08&lt;br /&gt;piece handle=+DATA2/emrep/backupset/2008_09_17/nnsnf0_tag20080917t175835_0.263.665691209 tag=TAG20080917T175835 comment=NONE&lt;br /&gt;channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02&lt;br /&gt;Finished backup at 17-SEP-08&lt;/pre&gt;&lt;br /&gt;You should see entries in the alert log similar to:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Starting background process ASMB&lt;br /&gt;ASMB started with pid=52, OS id=10868&lt;br /&gt;Starting background process RBAL&lt;br /&gt;RBAL started with pid=53, OS id=10885&lt;br /&gt;Wed Sep 17 17:22:20 2008&lt;br /&gt;SUCCESS: diskgroup DATA2 was mounted&lt;/pre&gt;&lt;br /&gt;During the backup you should see files created in the Diskgroup:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ export ORACLE_SID=+ASM1&lt;br /&gt;$ . oraenv&lt;br /&gt;ASMCMD&gt; cd DATA2/EMREP/DATAFILE&lt;br /&gt;ASMCMD&gt; ls&lt;br /&gt;MGMT_TABLESPACE.256.665690321&lt;br /&gt;SYSTEM.257.665690973&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Switch the Database to the Copy on ASM&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;RMAN&gt; shutdown immediate;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;RMAN&gt; startup mount;&lt;br /&gt;&lt;br /&gt;database mounted&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;RMAN&gt; switch database to copy;&lt;br /&gt;&lt;br /&gt;datafile 1 switched to datafile copy "+DATA2/emrep/datafile/system.257.665690973"&lt;br /&gt;datafile 2 switched to datafile copy "+DATA2/emrep/datafile/undotbs1.258.665691079"&lt;br /&gt;datafile 3 switched to datafile copy "+DATA2/emrep/datafile/sysaux.259.665691133"&lt;br /&gt;datafile 4 switched to datafile copy "+DATA2/emrep/datafile/users.261.665691205"&lt;br /&gt;datafile 5 switched to datafile copy "+DATA2/emrep/datafile/mgmt_tablespace.256.665690321"&lt;br /&gt;datafile 6 switched to datafile copy "+DATA2/emrep/datafile/mgmt_ecm_depot_ts.260.665691169"&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;RMAN&gt; recover database;&lt;br /&gt;&lt;br /&gt;Starting recover at 17-SEP-08&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=153 devtype=DISK&lt;br /&gt;&lt;br /&gt;starting media recovery&lt;br /&gt;media recovery complete, elapsed time: 00:00:02&lt;br /&gt;&lt;br /&gt;Finished recover at 17-SEP-08&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;RMAN&gt; alter database open;&lt;/pre&gt;&lt;br /&gt;You should see the datafiles assigned to their new locations:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; col name format a60&lt;br /&gt;SQL&gt; select name from v$datafile;&lt;br /&gt;&lt;br /&gt;NAME&lt;br /&gt;------------------------------------------------------------&lt;br /&gt;+DATA2/emrep/datafile/system.257.665690973&lt;br /&gt;+DATA2/emrep/datafile/undotbs1.258.665691079&lt;br /&gt;+DATA2/emrep/datafile/sysaux.259.665691133&lt;br /&gt;+DATA2/emrep/datafile/users.261.665691205&lt;br /&gt;+DATA2/emrep/datafile/mgmt_tablespace.256.665690321&lt;br /&gt;+DATA2/emrep/datafile/mgmt_ecm_depot_ts.260.665691169&lt;br /&gt;&lt;br /&gt;6 rows selected.&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Switch Tempfiles to the ASM Diskgroups&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter tablespace temp add tempfile '+DATA2' size 250M;&lt;br /&gt;&lt;br /&gt;Tablespace altered.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; select name from v$tempfile;&lt;br /&gt;&lt;br /&gt;NAME&lt;br /&gt;------------------------------------------------------------&lt;br /&gt;/u01/app/oracle/oradata/emrep/temp01.dbf&lt;br /&gt;+DATA2/emrep/tempfile/temp.264.665692035&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter database tempfile '/u01/app/oracle/oradata/emrep/temp01.dbf' drop  including datafiles;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; select name from v$tempfile;&lt;br /&gt;&lt;br /&gt;NAME&lt;br /&gt;------------------------------------------------------------&lt;br /&gt;+DATA2/emrep/tempfile/temp.264.665692035&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Switch the Online Redo Logs to the ASM diskgroup&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter database add logfile group 5 ('+DATA2','+DATA2') size 100M;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database add logfile group 6 ('+DATA2','+DATA2') size 100M;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database add logfile group 7 ('+DATA2','+DATA2') size 100M;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database add logfile group 8 ('+DATA2','+DATA2') size 100M;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;/pre&gt;&lt;br /&gt;You should see the Online Redo Logs created in the ASM instance:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ASMCMD&gt; cd DATA2/EMREP/ONLINELOG&lt;br /&gt;ASMCMD&gt; ls&lt;br /&gt;group_5.265.665693021&lt;br /&gt;group_5.266.665693027&lt;br /&gt;group_6.267.665693117&lt;br /&gt;group_6.268.665693121&lt;br /&gt;group_7.269.665693133&lt;br /&gt;group_7.270.665693141&lt;br /&gt;group_8.271.665693163&lt;br /&gt;group_8.272.665693169&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Switch through Logfile Groups and drop as possible&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter database drop logfile group 1;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database drop logfile group 2;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database drop logfile group 3;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database drop logfile group 4;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;/pre&gt;&lt;br /&gt;Afterwards, only the Online Redo Logs on the ASM diskgroup should remain:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; select bytes/1024/1024, group#, thread#, status from v$log;&lt;br /&gt;&lt;br /&gt;BYTES/1024/1024     GROUP#    THREAD# STATUS&lt;br /&gt;--------------- ---------- ---------- ----------------&lt;br /&gt;            100          5          1 ACTIVE&lt;br /&gt;            100          6          1 ACTIVE&lt;br /&gt;            100          7          1 ACTIVE&lt;br /&gt;            100          8          1 CURRENT&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; select member from v$logfile;&lt;br /&gt;&lt;br /&gt;MEMBER&lt;br /&gt;---------------------------------------------------------------------------&lt;br /&gt;+DATA2/emrep/onlinelog/group_5.265.665693021&lt;br /&gt;+DATA2/emrep/onlinelog/group_5.266.665693027&lt;br /&gt;+DATA2/emrep/onlinelog/group_6.267.665693117&lt;br /&gt;+DATA2/emrep/onlinelog/group_6.268.665693121&lt;br /&gt;+DATA2/emrep/onlinelog/group_7.269.665693133&lt;br /&gt;+DATA2/emrep/onlinelog/group_7.270.665693141&lt;br /&gt;+DATA2/emrep/onlinelog/group_8.271.665693163&lt;br /&gt;+DATA2/emrep/onlinelog/group_8.272.665693169&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Migrate the Controlfiles to ASM&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter system set control_files='+DATA2','+DATA2','+DATA2' scope=spfile;&lt;br /&gt;&lt;br /&gt;System altered.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; shutdown immediate;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;$ rman target=/&lt;br /&gt;&lt;br /&gt;Recovery Manager: Release 10.2.0.4.0 - Production on Wed Sep 17 19:03:37 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;connected to target database (not started)&lt;br /&gt;&lt;br /&gt;RMAN&gt; startup nomount;&lt;br /&gt;&lt;br /&gt;database is already started&lt;br /&gt;&lt;br /&gt;RMAN&gt; restore controlfile from '/u01/app/oracle/oradata/emrep/control01.ctl';&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Starting restore at 17-SEP-08&lt;br /&gt;using target database control file instead of recovery catalog&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=156 devtype=DISK&lt;br /&gt;&lt;br /&gt;channel ORA_DISK_1: copied control file copy&lt;br /&gt;output filename=+DATA2/emrep/controlfile/current.273.665694281&lt;br /&gt;output filename=+DATA2/emrep/controlfile/current.274.665694285&lt;br /&gt;output filename=+DATA2/emrep/controlfile/current.275.665694285&lt;br /&gt;Finished restore at 17-SEP-08&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;RMAN&gt; alter database mount;&lt;br /&gt;&lt;br /&gt;database mounted&lt;br /&gt;released channel: ORA_DISK_1&lt;br /&gt;&lt;br /&gt;RMAN&gt; alter database open;&lt;/pre&gt;&lt;br /&gt;The &lt;span style="font-family: courier new;"&gt;control_files&lt;/span&gt; parameter should be updated via RMAN if you are using an spfile. If using a pfile, you will have to update this value yourself.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Optionally Migrate the Archive Log Files&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter system set log_archive_dest_1='LOCATION=+DATA2' scope=spfile;&lt;br /&gt;&lt;br /&gt;System altered.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; shutdown immediate;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; startup&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter system archive log current;&lt;/pre&gt;&lt;br /&gt;Afterwards, you should see Archivelogs in the ASM instance:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ asmcmd&lt;br /&gt;ASMCMD&gt; ls DATA2/EMREP/ARCHIVELOG&lt;br /&gt;2008_09_17/&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;ASMCMD&gt; cd DATA2/EMREP/ARCHIVELOG/2008_09_17&lt;br /&gt;ASMCMD&gt; ls&lt;br /&gt;thread_1_seq_61.276.665694577&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Drop the Copy of the Database&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ rman target=/&lt;br /&gt;&lt;br /&gt;Recovery Manager: Release 10.2.0.4.0 - Production on Wed Sep 17 19:12:26 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;connected to target database: EMREP (DBID=3888623110)&lt;br /&gt;&lt;br /&gt;RMAN&gt; list copy of database;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;using target database control file instead of recovery catalog&lt;br /&gt;&lt;br /&gt;List of Datafile Copies&lt;br /&gt;Key     File S Completion Time Ckp SCN    Ckp Time        Name&lt;br /&gt;------- ---- - --------------- ---------- --------------- ----&lt;br /&gt;8       1    A 17-SEP-08       2607286    17-SEP-08       /u01/app/oracle/oradata/emrep/system01.dbf&lt;br /&gt;9       2    A 17-SEP-08       2607286    17-SEP-08       /u01/app/oracle/oradata/emrep/undotbs01.dbf&lt;br /&gt;10      3    A 17-SEP-08       2607286    17-SEP-08       /u01/app/oracle/oradata/emrep/sysaux01.dbf&lt;br /&gt;11      4    A 17-SEP-08       2607286    17-SEP-08       /u01/app/oracle/oradata/emrep/users01.dbf&lt;br /&gt;12      5    A 17-SEP-08       2607286    17-SEP-08       /u01/app/oracle/oradata/emrep/mgmt.dbf&lt;br /&gt;13      6    A 17-SEP-08       2607286    17-SEP-08       /u01/app/oracle/oradata/emrep/mgmt_ecm_depot1.dbf&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;RMAN&gt; drop copy of database;&lt;br /&gt;&lt;br /&gt;Do you really want to delete the above objects (enter YES or NO)? YES&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;deleted datafile copy&lt;br /&gt;datafile copy filename=/u01/app/oracle/oradata/emrep/system01.dbf recid=8 stamp=665691542&lt;br /&gt;deleted datafile copy&lt;br /&gt;datafile copy filename=/u01/app/oracle/oradata/emrep/undotbs01.dbf recid=9 stamp=665691542&lt;br /&gt;deleted datafile copy&lt;br /&gt;datafile copy filename=/u01/app/oracle/oradata/emrep/sysaux01.dbf recid=10 stamp=665691542&lt;br /&gt;deleted datafile copy&lt;br /&gt;datafile copy filename=/u01/app/oracle/oradata/emrep/users01.dbf recid=11 stamp=665691542&lt;br /&gt;deleted datafile copy&lt;br /&gt;datafile copy filename=/u01/app/oracle/oradata/emrep/mgmt.dbf recid=12 stamp=665691542&lt;br /&gt;deleted datafile copy&lt;br /&gt;datafile copy filename=/u01/app/oracle/oradata/emrep/mgmt_ecm_depot1.dbf recid=13 stamp=665691542&lt;br /&gt;Deleted 6 objects&lt;/pre&gt;&lt;br /&gt;Obviously, you should distribute your files in a way that maximizes I/O throughput, etc. This example simply demonstrates mechanically how to perform the migration.&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-6509542037406130677?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/6509542037406130677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=6509542037406130677' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/6509542037406130677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/6509542037406130677'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/09/how-to-migrate-standalone-database-to.html' title='How to Migrate a Standalone Database to ASM'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-5538092519683712118</id><published>2008-07-03T10:17:00.000-07:00</published><updated>2008-07-03T10:53:13.631-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maintenance'/><title type='text'>Reorganizing a Table using DBMS_REDEFINITION</title><content type='html'>There are many methods to reorganize/defragment a table in Oracle. If you want to avoid downtime, however, your choices are limited to using the 'SHRINK SPACE' feature and/or employing the &lt;span style="font-family: courier new;"&gt;DBMS_REDEFINITION&lt;/span&gt; PL/SQL package. &lt;br /&gt;&lt;br /&gt;This post demonstrates the latter method. The &lt;span style="font-family: courier new;"&gt;DBMS_REDEFINITION&lt;/span&gt; package is most commonly used for redefining a table, however can be used to reorganize a table amongst other things. Here is a great article which covers the package in a little more detail: &lt;a href="http://www.orafaq.com/node/4" target="_blank"&gt;On-line Table Reorganization and Redefinition&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This example rebuilds the &lt;span style="font-family: courier new;"&gt;OE.ORDER_ITEMS&lt;/span&gt; table using &lt;span style="font-family: courier new;"&gt;DBMS_REDEFINITION&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Collect information about the table's segments prior to the reorg&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ANALYZE TABLE oe.order_items COMPUTE STATISTICS;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SELECT avg_row_len, num_rows, chain_cnt&lt;br /&gt;  FROM dba_tables&lt;br /&gt; WHERE table_name = 'ORDER_ITEMS' AND owner = 'OE';&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SELECT ROUND (BYTES / 1024) kb&lt;br /&gt;  FROM dba_segments&lt;br /&gt; WHERE owner = 'OE' AND segment_name = 'ORDER_ITEMS';&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Check whether the table in question violates any redefinition restrictions&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;EXEC dbms_redefinition.can_redef_table('OE','ORDER_ITEMS', dbms_redefinition.cons_use_pk);&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Create the Intermediary Table - in my case, I use the exact same structure &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;CREATE TABLE OE.ORDER_ITEMS_REDEF&lt;br /&gt;(&lt;br /&gt;  ORDER_ID      NUMBER(12),&lt;br /&gt;  LINE_ITEM_ID  NUMBER(3)                       NOT NULL,&lt;br /&gt;  PRODUCT_ID    NUMBER(6)                       NOT NULL,&lt;br /&gt;  UNIT_PRICE    NUMBER(8,2),&lt;br /&gt;  QUANTITY      NUMBER(8)&lt;br /&gt;) TABLESPACE USERS;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Start the Redefinition Process&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;EXEC dbms_redefinition.start_redef_table('OE', 'ORDER_ITEMS', 'ORDER_ITEMS_REDEF');&lt;/pre&gt;&lt;br /&gt;You will notice that Oracle creates a Materialized View in order to store the table changes, etc. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SELECT COUNT (*)&lt;br /&gt;  FROM oe.mlog$_order_items;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Sync up the Source table with the Intermediary table&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;EXEC dbms_redefinition.sync_interim_table('OE', 'ORDER_ITEMS', 'ORDER_ITEMS_REDEF');&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Duplicate the table's dependent objects on the Intermediary table&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;CREATE INDEX oe.item_order_redef_ix ON oe.order_items_redef&lt;br /&gt;(order_id) LOGGING TABLESPACE users;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;CREATE INDEX oe.item_product_redef_ix ON oe.order_items_redef&lt;br /&gt;(product_id) LOGGING TABLESPACE users;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;CREATE UNIQUE INDEX oe.order_items_redef_pk ON oe.order_items_redef&lt;br /&gt;(order_id, line_item_id) LOGGING TABLESPACE users;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;CREATE UNIQUE INDEX oe.order_items_redef_uk ON oe.order_items_redef&lt;br /&gt;(order_id, product_id) LOGGING TABLESPACE users;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ALTER TABLE oe.order_items_redef ADD (&lt;br /&gt;  CONSTRAINT order_items_redef_pk&lt;br /&gt; PRIMARY KEY (order_id, line_item_id) USING INDEX TABLESPACE USERS);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ALTER TABLE oe.order_items_redef ADD (&lt;br /&gt;  CONSTRAINT order_items_redef_order_id_fk&lt;br /&gt; FOREIGN KEY (order_id)&lt;br /&gt; REFERENCES oe.orders (order_id)&lt;br /&gt; ON DELETE CASCADE DISABLE NOVALIDATE);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ALTER TABLE oe.order_items_redef ADD (&lt;br /&gt;  CONSTRAINT order_items_rdef_product_id_fk&lt;br /&gt; FOREIGN KEY (product_id)&lt;br /&gt; REFERENCES oe.product_information (product_id) DISABLE NOVALIDATE);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;GRANT SELECT ON oe.order_items_redef TO bi;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;GRANT SELECT ON oe.order_items_redef TO pm;&lt;/pre&gt;&lt;br /&gt;Notice how, I create the foreign key constraints initially as disabled.&lt;br /&gt;&lt;br /&gt;To simplify things, I use the following to duplicate any triggers to the Intermediary table&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;DECLARE&lt;br /&gt; retval NUMBER(5);&lt;br /&gt;BEGIN&lt;br /&gt; dbms_redefinition.copy_table_dependents('OE', 'ORDER_ITEMS', 'ORDER_ITEMS_REDEF', copy_indexes=&gt;0, copy_triggers=&gt;TRUE, copy_constraints=&gt;FALSE,copy_privileges=&gt;FALSE, num_errors=&gt;retval);&lt;br /&gt; dbms_output.put_line(retval);&lt;br /&gt;END;&lt;br /&gt;/&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Disable any foreign key constraints on the Source table before finishing the table redefinition process&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ALTER TABLE oe.order_items DISABLE CONSTRAINT order_items_order_id_fk;&lt;br /&gt;&lt;br /&gt;ALTER TABLE oe.order_items DISABLE CONSTRAINT order_items_product_id_fk;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Finish the Redefinition&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;EXEC dbms_redefinition.finish_redef_table('OE', 'ORDER_ITEMS', 'ORDER_ITEMS_REDEF');&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Drop the Intermediary Table&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;DROP TABLE oe.order_items_redef;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Rename any dependent objects&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ALTER TABLE oe.order_items RENAME CONSTRAINT order_items_rdef_product_id_fk TO order_items_product_id_fk;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ALTER TABLE oe.order_items RENAME CONSTRAINT order_items_redef_order_id_fk TO order_items_order_id_fk;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ALTER TABLE oe.order_items RENAME CONSTRAINT order_items_redef_pk TO order_items_pk;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ALTER INDEX oe.item_order_redef_ix RENAME TO item_order_ix;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ALTER INDEX oe.item_product_redef_ix RENAME TO item_product_ix;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ALTER INDEX oe.order_items_redef_pk RENAME TO order_items_pk;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ALTER INDEX oe.order_items_redef_uk RENAME TO order_items_uk;&lt;/pre&gt;&lt;br /&gt;At this point, the table should be reorganized/defragmented. Optionally, compare the storage footprint post-redefintion&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ANALYZE TABLE oe.order_items COMPUTE STATISTICS;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SELECT avg_row_len, num_rows, chain_cnt&lt;br /&gt;  FROM dba_tables&lt;br /&gt; WHERE table_name = 'ORDER_ITEMS' AND owner = 'OE';&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SELECT ROUND (BYTES / 1024) kb&lt;br /&gt;  FROM dba_segments&lt;br /&gt; WHERE owner = 'OE' AND segment_name = 'ORDER_ITEMS';&lt;/pre&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-5538092519683712118?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/5538092519683712118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=5538092519683712118' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/5538092519683712118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/5538092519683712118'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/07/reorganizing-table-using.html' title='Reorganizing a Table using DBMS_REDEFINITION'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-4147498841354411252</id><published>2008-06-30T15:15:00.000-07:00</published><updated>2008-06-30T16:08:24.902-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maintenance'/><title type='text'>Rebuilding Indexes the Easy Way</title><content type='html'>Oracle has made index rebuilding easier through the introduction of the &lt;span style="font-family: courier new;"&gt;DBMS_INDEX_UTL&lt;/span&gt; PL/SQL package back in 10g. &lt;br /&gt;&lt;br /&gt;In lieu of creating hundreds of seperate rebuild DDL statements, you can now create single calls to this package's methods in order to accomplish the same task(s).&lt;br /&gt;&lt;br /&gt;This example demonstrates how to rebuild all indexes - including those with partitions - for the &lt;span style="font-family: courier new;"&gt;SH.SALES&lt;/span&gt; table - by constructing a single call to the aforementioned package. &lt;br /&gt;&lt;br /&gt;Here are the indexes in question for my test system:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SELECT &lt;br /&gt;     TRIM(di.owner) "OWNER", TRIM (di.index_name) "INDEX",&lt;br /&gt;     TRIM(MAX (TO_CHAR (dip.last_analyzed, 'MON-DD-YYYY HH24:MI:SS'))) "LAST ANALYZED",&lt;br /&gt;     COUNT(dip.partition_name) "PART COUNT",&lt;br /&gt;     ROUND(SUM (ds.BYTES) / 1024) "KB"&lt;br /&gt;     FROM  dba_indexes di, &lt;br /&gt;           dba_ind_partitions dip, &lt;br /&gt;           dba_segments ds&lt;br /&gt;     WHERE di.index_name = ds.segment_name&lt;br /&gt;     AND di.owner = ds.owner&lt;br /&gt;     AND dip.partition_name = ds.partition_name&lt;br /&gt;     AND di.table_owner = 'SH'&lt;br /&gt;     AND di.table_name = 'SALES'&lt;br /&gt;     AND di.index_name = dip.index_name&lt;br /&gt;     AND di.owner = dip.index_owner&lt;br /&gt;     AND di.owner = dip.index_owner&lt;br /&gt;GROUP BY di.owner, di.index_name;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-size: 10px;"&gt;OWNER                          INDEX                          LAST ANALYZED              PART COUNT         KB&lt;br /&gt;------------------------------ ------------------------------ -------------------------- ---------- ----------&lt;br /&gt;SH                             SALES_TIME_BIX                 JUN-30-2008 16:14:27               28       9216&lt;br /&gt;SH                             SALES_CHANNEL_BIX              JUN-30-2008 16:14:18               28       4288&lt;br /&gt;SH                             SALES_PROD_BIX                 JUN-30-2008 16:14:24               28       5056&lt;br /&gt;SH                             SALES_CUST_BIX                 JUN-30-2008 16:14:23               28      46848&lt;br /&gt;SH                             SALES_PROMO_BIX                JUN-30-2008 16:14:26               28       2944&lt;br /&gt;&lt;br /&gt;5 rows selected.&lt;/pre&gt;&lt;br /&gt;I will rebuild all these indexes via the following call:  &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;EXEC dbms_index_utl.build_table_indexes (list=&gt;'SH.SALES',just_unusable=&gt;FALSE, locality=&gt;'ALL',concurrent=&gt;TRUE, cont_after_err=&gt;TRUE, max_slaves=&gt;8);&lt;br /&gt;PL/SQL procedure successfully completed.&lt;/pre&gt;&lt;br /&gt;Afterwards, the same query shows that the overall footprint of the indexes in question has been reduced. Additionally, the segments have been analyzed as part of the rebuild.  &lt;br /&gt;&lt;br /&gt;&lt;pre style="font-size: 10px;"&gt;OWNER                          INDEX                          LAST ANALYZED              PART COUNT         KB&lt;br /&gt;------------------------------ ------------------------------ -------------------------- ---------- ----------&lt;br /&gt;SH                             SALES_TIME_BIX                 JUN-30-2008 17:03:47               28       7104&lt;br /&gt;SH                             SALES_CHANNEL_BIX              JUN-30-2008 17:03:42               28       4288&lt;br /&gt;SH                             SALES_PROD_BIX                 JUN-30-2008 17:03:44               28       3968&lt;br /&gt;SH                             SALES_CUST_BIX                 JUN-30-2008 17:03:44               28      37632&lt;br /&gt;SH                             SALES_PROMO_BIX                JUN-30-2008 17:03:46               28       3008&lt;br /&gt;&lt;br /&gt;5 rows selected.&lt;/pre&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-4147498841354411252?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/4147498841354411252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=4147498841354411252' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/4147498841354411252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/4147498841354411252'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/06/rebuilding-indexes-easy-way.html' title='Rebuilding Indexes the Easy Way'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-8296778437228583965</id><published>2008-06-18T14:25:00.001-07:00</published><updated>2008-06-19T09:01:57.299-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tuning'/><title type='text'>Identifying Resource-Intensive SQL</title><content type='html'>Here is a short example on how to identify resource-intensive SQL by querying the &lt;span style="font-family: courier new;"&gt;DBA_HIST_*&lt;/span&gt; views. &lt;br /&gt;&lt;br /&gt;In my example, I query the AWR, ranking the top 20 SQL statements using a rough formula based upon CPU and IO-related statistics for the time period in question. In my case, I am querying the current day, but this can be changed to examine time periods further in the past as well.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/tech/sql/oracle/top_resource_sql.html" target="_blank"&gt;Top 20 Resource-intensive SQL Example&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/tech/sql/oracle/top_resource_sql.sql" target="_blank"&gt;Top 20 Resource-intensive SQL Example Source&lt;/a&gt; (Right-Click - Save Target As...)&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-8296778437228583965?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/8296778437228583965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=8296778437228583965' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/8296778437228583965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/8296778437228583965'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/06/identifying-resource-intensive-sql.html' title='Identifying Resource-Intensive SQL'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-7675995473378925047</id><published>2008-06-18T14:13:00.000-07:00</published><updated>2008-06-18T18:32:12.301-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PLSQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Data Warehousing'/><title type='text'>Pipelined SQL Function Example</title><content type='html'>Here is a short example on how to create and use a pipelined sql function. In my example, I use a pipelined function along with a &lt;span style="font-family: courier new;"&gt;MERGE&lt;/span&gt; statement to keep a star schema's dimension table up to date. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/tech/sql/oracle/pipelined_sql_example.html" target="_blank"&gt;Pipelined SQL Example&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/tech/sql/oracle/pipelined_sql_example.sql" target="_blank"&gt;Pipelined SQL Example Source&lt;/a&gt; (Right-Click - Save Target As...)&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-7675995473378925047?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/7675995473378925047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=7675995473378925047' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/7675995473378925047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/7675995473378925047'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/06/pipelined-sql-function-example.html' title='Pipelined SQL Function Example'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-7970385183161457680</id><published>2008-06-08T10:44:00.000-07:00</published><updated>2008-06-08T12:00:08.497-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OID'/><category scheme='http://www.blogger.com/atom/ns#' term='Application Servers'/><title type='text'>Setting up OID (LDAP) for TNS Service Resolution</title><content type='html'>Here are the steps for configuring OID/LDAP to use for your Net Service (TNS) resolution. &lt;br /&gt;&lt;br /&gt;This example assumes that you already have an LDAP directory available for use, in my case Oracle Internet Directory (OID) installed as part of OracleAS Infrastructure/Identity Management. Additionally, this example does not cover SSL.&lt;br /&gt;&lt;br /&gt;Launch the Net Configuration Assistant&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# export DISPLAY=192.168.1.3:0.0&lt;br /&gt;# netca&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Set-up the Directory Usage Configuration&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ldap/ldap1.gif" target="_blank" name="ldap1"&gt;&lt;img src="http://www.colestock.com/img/ldap/ldap1.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ldap/ldap2.gif" target="_blank" name="ldap2"&gt;&lt;img src="http://www.colestock.com/img/ldap/ldap2.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ldap/ldap3.gif" target="_blank" name="ldap3"&gt;&lt;img src="http://www.colestock.com/img/ldap/ldap3.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ldap/ldap4.gif" target="_blank" name="ldap4"&gt;&lt;img src="http://www.colestock.com/img/ldap/ldap4.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ldap/ldap5.gif" target="_blank" name="ldap5"&gt;&lt;img src="http://www.colestock.com/img/ldap/ldap5.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;At this point, you should have a properly configured directory file similar to the following:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ldap.ora&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;DIRECTORY_SERVERS= (rac2.colestock.test:389:636)&lt;br /&gt;&lt;br /&gt;DEFAULT_ADMIN_CONTEXT = "dc=colestock,dc=test"&lt;br /&gt;&lt;br /&gt;DIRECTORY_SERVER_TYPE = OID&lt;/pre&gt;&lt;br /&gt;Configure your Oracle Naming Configuration. In my case, I will use my OID (LDAP) directory as my primary lookup service; if it fails, the &lt;span style="font-family: courier new;"&gt;tnsnames.ora&lt;/span&gt; will be used. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ldap/ldap6.gif" target="_blank" name="ldap6"&gt;&lt;img src="http://www.colestock.com/img/ldap/ldap6.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ldap/ldap7.gif" target="_blank" name="ldap7"&gt;&lt;img src="http://www.colestock.com/img/ldap/ldap7.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ldap/ldap8.gif" target="_blank" name="ldap8"&gt;&lt;img src="http://www.colestock.com/img/ldap/ldap8.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;At this point, your &lt;span style="font-family: courier new;"&gt;sqlnet.ora&lt;/span&gt; file should be properly configured for OID (LDAP) use:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;sqlnet.ora&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;NAMES.DIRECTORY_PATH= (LDAP, TNSNAMES)&lt;/pre&gt;&lt;br /&gt;Import your Database Services, etc. into your OID (LDAP) Directory via Oracle Network Manager&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# export DISPLAY=192.168.1.3:0.0&lt;br /&gt;# netmgr&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ldap/ldap9.gif" target="_blank" name="ldap9"&gt;&lt;img src="http://www.colestock.com/img/ldap/ldap9.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ldap/ldap10.gif" target="_blank" name="ldap10"&gt;&lt;img src="http://www.colestock.com/img/ldap/ldap10.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ldap/ldap11.gif" target="_blank" name="ldap11"&gt;&lt;img src="http://www.colestock.com/img/ldap/ldap11.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ldap/ldap12.gif" target="_blank" name="ldap12"&gt;&lt;img src="http://www.colestock.com/img/ldap/ldap12.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ldap/ldap13.gif" target="_blank" name="ldap13"&gt;&lt;img src="http://www.colestock.com/img/ldap/ldap13.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Manually confirm that the entries are present via a manual search of LDAP:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# ldapsearch -h rac2 -p 389 -D cn=orcladmin -w password -b "cn=OracleContext,dc=colestock,dc=test" -s one "objectclass=orclNetService" orclnetdescstring&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;cn=LDG,cn=OracleContext,dc=colestock,dc=test&lt;br /&gt;orclnetdescstring=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.101)(PORT=1525)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ldg.colestock.test)))&lt;br /&gt;&lt;br /&gt;cn=EM,cn=OracleContext,dc=colestock,dc=test&lt;br /&gt;orclnetdescstring=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1-vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=rac2-vip)(PORT=1521))(LOAD_BALANCE=yes))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=em.colestock.test)(FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC)(RETRIES=180)(DELAY=5))))&lt;br /&gt;&lt;br /&gt;cn=STDBY,cn=OracleContext,dc=colestock,dc=test&lt;br /&gt;orclnetdescstring=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.102)(PORT=1525)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=stdby.colestock.test)))&lt;br /&gt;&lt;br /&gt;cn=STANDBY,cn=OracleContext,dc=colestock,dc=test&lt;br /&gt;orclnetdescstring=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.102)(PORT=1525)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=stdby.colestock.test)))&lt;br /&gt;&lt;br /&gt;cn=EM2,cn=OracleContext,dc=colestock,dc=test&lt;br /&gt;orclnetdescstring=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac2-vip)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=em.colestock.test)(INSTANCE_NAME=em2)))&lt;br /&gt;&lt;br /&gt;cn=EM1,cn=OracleContext,dc=colestock,dc=test&lt;br /&gt;orclnetdescstring=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1-vip)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=em.colestock.test)(INSTANCE_NAME=em1)))&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Confirm SQLNet's use of the OID (LDAP) via a &lt;span style="font-family: courier new;"&gt;tnsping&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# tnsping EM&lt;br /&gt;&lt;br /&gt;Used parameter files:&lt;br /&gt;/u01/app/oracle/product/10.2/network/admin/sqlnet.ora&lt;br /&gt;&lt;br /&gt;Used LDAP adapter to resolve the alias&lt;br /&gt;Attempting to contact (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1-vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=rac2-vip)(PORT=1521))(LOAD_BALANCE=yes))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=em.colestock.test)(FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC)(RETRIES=180)(DELAY=5))))&lt;br /&gt;OK (0 msec)&lt;/pre&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-7970385183161457680?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/7970385183161457680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=7970385183161457680' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/7970385183161457680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/7970385183161457680'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/06/setting-up-oid-ldap-for-tns-service.html' title='Setting up OID (LDAP) for TNS Service Resolution'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-2133390948717329879</id><published>2008-06-05T18:37:00.000-07:00</published><updated>2008-06-19T09:11:46.354-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Application Servers'/><category scheme='http://www.blogger.com/atom/ns#' term='Installation'/><title type='text'>How to Install OracleAS Infrastructure (10.1.4.0.1)</title><content type='html'>This post assumes that you want to install OracleAS Infrastructure (10.1.4.0.1) using an existing Metadata Repository, created earlier with the Metadata Repository Creation Assistant (MRCA): see the following &lt;a href="http://www.colestock.com/blogs/2008/06/how-to-install-metadata-repository-for.html" target="_blank"&gt;post&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;The above is normally accomplished in steps to allow for a more distributed topology for the OracleAS Infrastructure installation. In my case, I will place the Metadata Repository (database) on one server and then use another server for the remaining components, such as the Application Server. This posting covers the latter step.&lt;br /&gt;&lt;br /&gt;Unpack the appropriate software&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# cpio -idmv &lt; as_linux_x86_oim_oif_101401_disk1.cpio&lt;br /&gt;# cpio -idmv &lt; as_linux_x86_oim_oif_101401_disk2.cpio&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Due to some installation errors, namely inventory corruption issues, I specify an installation-specific inventory location via  &lt;span style="font-family: courier new;"&gt;/etc/oraInst.loc&lt;/span&gt; (depending upon your installation, you may have to do so as root)&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;# su - root&lt;br /&gt;# vi /etc/oraInst.loc&lt;br /&gt;# more /etc/oraInst.loc&lt;br /&gt;inventory_loc=/u01/app/oracle/product/oim/oraInventory&lt;br /&gt;inst_group=dba&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Set the environment&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# echo "oim:/u01/app/oracle/product/oim:N" &gt;&gt; /etc/oratab&lt;br /&gt;# export ORACLE_SID=oim&lt;br /&gt;# . oraenv&lt;br /&gt;# export DISPLAY=192.168.1.3:0.0&lt;br /&gt;# export TMP=/tmp&lt;br /&gt;# export TMPDIR=/tmp&lt;br /&gt;# unset TNS_ADMIN=&lt;br /&gt;# export PATH=.:/usr/local/java/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/bin:/bin:/usr/local/bin:/u02/oracle/logs/em/scripts/common/oracle/bin:/usr/bin/X11&lt;br /&gt;#  CLASSPATH=&lt;br /&gt;# export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib&lt;/pre&gt;&lt;br /&gt;Run the Installer&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# ./runInstaller -ignoreSysPreReqs&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oim/oim1.gif" target="_blank" name="oim1"&gt;&lt;img src="http://www.colestock.com/img/oim/oim1.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oim/oim2.gif" target="_blank" name="oim2"&gt;&lt;img src="http://www.colestock.com/img/oim/oim2.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oim/oim3.gif" target="_blank" name="oim3"&gt;&lt;img src="http://www.colestock.com/img/oim/oim3.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oim/oim4.gif" target="_blank" name="oim4"&gt;&lt;img src="http://www.colestock.com/img/oim/oim4.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oim/oim5.gif" target="_blank" name="oim5"&gt;&lt;img src="http://www.colestock.com/img/oim/oim5.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oim/oim6.gif" target="_blank" name="oim6"&gt;&lt;img src="http://www.colestock.com/img/oim/oim6.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oim/oim7.gif" target="_blank" name="oim7"&gt;&lt;img src="http://www.colestock.com/img/oim/oim7.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oim/oim8.gif" target="_blank" name="oim8"&gt;&lt;img src="http://www.colestock.com/img/oim/oim8.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oim/oim9.gif" target="_blank" name="oim9"&gt;&lt;img src="http://www.colestock.com/img/oim/oim9.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oim/oim10.gif" target="_blank" name="oim10"&gt;&lt;img src="http://www.colestock.com/img/oim/oim10.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oim/oim11.gif" target="_blank" name="oim11"&gt;&lt;img src="http://www.colestock.com/img/oim/oim11.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oim/oim12.gif" target="_blank" name="oim12"&gt;&lt;img src="http://www.colestock.com/img/oim/oim12.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oim/oim13.gif" target="_blank" name="oim13"&gt;&lt;img src="http://www.colestock.com/img/oim/oim13.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oim/oim14.gif" target="_blank" name="oim14"&gt;&lt;img src="http://www.colestock.com/img/oim/oim14.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oim/oim15.gif" target="_blank" name="oim15"&gt;&lt;img src="http://www.colestock.com/img/oim/oim15.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Run the &lt;span style="font-family: courier new;"&gt;root.sh&lt;/span&gt; as root&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oim/oim16.gif" target="_blank" name="oim16"&gt;&lt;img src="http://www.colestock.com/img/oim/oim16.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# su - root&lt;br /&gt;# cd /u01/app/oracle/product/oim&lt;br /&gt;# ./root.sh&lt;br /&gt;Running Oracle10 root.sh script...&lt;br /&gt;\nThe following environment variables are set as:&lt;br /&gt;    ORACLE_OWNER= oracle&lt;br /&gt;    ORACLE_HOME=  /u01/app/oracle/product/oim&lt;br /&gt;&lt;br /&gt;Enter the full pathname of the local bin directory: [/usr/local/bin]:&lt;br /&gt;The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)&lt;br /&gt;[n]:&lt;br /&gt;The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)&lt;br /&gt;[n]:&lt;br /&gt;The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)&lt;br /&gt;[n]:&lt;br /&gt;&lt;br /&gt;Adding entry to /etc/oratab file...&lt;br /&gt;Entries will be added to the /etc/oratab file as needed by&lt;br /&gt;Database Configuration Assistant when a database is created&lt;br /&gt;Finished running generic part of root.sh script.&lt;br /&gt;Now product-specific root actions will be performed.&lt;br /&gt;OCR is configured for Oracle Cluster Ready Services. CSS is already configured and should be running from Oracle Cluster Ready Services home&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Entering Oracle Internet Directory Root Installation Section&lt;br /&gt;&lt;br /&gt;OiD Server Installation&lt;br /&gt;Checking LDAP binary file protections&lt;br /&gt;Setting oidmon file protections&lt;br /&gt;Setting oidldapd file protections&lt;br /&gt;Setting oidrepld file protections&lt;br /&gt;Setting oidemdpasswd file protections&lt;br /&gt;Setting remtool file protections&lt;br /&gt;Setting oiddiag file protections&lt;br /&gt;Leaving Oracle Internet Directory Root Installation Section&lt;/pre&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oim/oim17.gif" target="_blank" name="oim17"&gt;&lt;img src="http://www.colestock.com/img/oim/oim17.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oim/oim18.gif" target="_blank" name="oim18"&gt;&lt;img src="http://www.colestock.com/img/oim/oim18.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Post Installation Steps&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Check key URLs:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oim/oim19.gif" target="_blank" name="oim19"&gt;&lt;img src="http://www.colestock.com/img/oim/oim19.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oim/oim20.gif" target="_blank" name="oim20"&gt;&lt;img src="http://www.colestock.com/img/oim/oim20.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Validate that components are running&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# cd /u01/app/oracle/product/oim/opmn/bin/&lt;br /&gt;# ./opmnctl status&lt;br /&gt;&lt;br /&gt;Processes in Instance: jlc.rac2.colestock.test&lt;br /&gt;-------------------+--------------------+---------+---------&lt;br /&gt;ias-component      | process-type       |     pid | status&lt;br /&gt;-------------------+--------------------+---------+---------&lt;br /&gt;DSA                | DSA                |    9142 | Alive&lt;br /&gt;LogLoader          | logloaderd         |     N/A | Down&lt;br /&gt;dcm-daemon         | dcm-daemon         |   28047 | Alive&lt;br /&gt;OC4J               | oca                |    5202 | Alive&lt;br /&gt;OC4J               | OC4J_SECURITY      |    4824 | Alive&lt;br /&gt;HTTP_Server        | HTTP_Server        |    4630 | Alive&lt;br /&gt;OID                | OID                |   14673 | Alive&lt;/pre&gt;&lt;br /&gt;Check that you can login to the Oracle Internet Directory as &lt;span style="font-family: courier new;"&gt;cn=orcladmin&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# export DISPLAY=192.168.1.3:0.0&lt;br /&gt;# oidadmin&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oid/oid1.gif" target="_blank" name="oid1"&gt;&lt;img src="http://www.colestock.com/img/oid/oid1.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oid/oid2.gif" target="_blank" name="oid2"&gt;&lt;img src="http://www.colestock.com/img/oid/oid2.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oid/oid3.gif" target="_blank" name="oid3"&gt;&lt;img src="http://www.colestock.com/img/oid/oid3.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oid/oid4.gif" target="_blank" name="oid4"&gt;&lt;img src="http://www.colestock.com/img/oid/oid4.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oid/oid5.gif" target="_blank" name="oid5"&gt;&lt;img src="http://www.colestock.com/img/oid/oid5.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Before verifying that single sign-on is operating, you will have to work around a known bug&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SSO Authentication Fails With Internal Server Error After Upgrading To 10.1.4 Or Using MRCA 10.1.4.0.1 (Metalink NOTE:467706.1) &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;After install you will not be able to use SSO, instead the following error will be in the log files:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;java.sql.SQLException: ORA-06550: line 1, column 7:&lt;br /&gt;PLS-00306: wrong number or types of arguments in call to 'ADD_AUDIT_LOG'&lt;br /&gt;ORA-06550: line 1, column 7:&lt;br /&gt;PL/SQL: Statement ignored&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;The workaround according to Oracle:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;The SSO database schema needs to be upgraded to 10.1.4 by running the ssopatch.sql as user orasso.&lt;br /&gt;&lt;br /&gt;1. Get the orasso database password:&lt;br /&gt;ldapsearch -D cn=orcladmin -w &lt;password&gt; -p &lt;oid port&gt;&lt;br /&gt;-b "cn=IAS,cn=Products,cn=OracleContext" -s sub "OrclresourceName=ORASSO" orclpasswordattribute&lt;br /&gt;&lt;br /&gt;2. $ORACLE_HOME/opmn/bin/opmnctl stopall&lt;br /&gt;&lt;br /&gt;3. cd $ORACLE_HOME/sso/admin/plsql/sso&lt;br /&gt;&lt;br /&gt;4. sqlplus orasso/&lt;password from step1&gt;@&lt;sqlnet service name&gt;&lt;br /&gt;&lt;br /&gt;5. restart Identity Management&lt;br /&gt;$ORACLE_HOME/opmn/bin/opmnctl starttall&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;In my case:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;[oracle@rac2 log]$ ldapsearch -D cn=orcladmin -w password -p 389 -b "cn=IAS,cn=Products,cn=OracleContext" -s sub "OrclresourceName=ORASSO" orclpasswordattribute&lt;br /&gt;OrclResourceName=ORASSO,orclReferenceName=EM.COLESTOCK.TEST,cn=IAS Infrastructure Databases,cn=IAS,cn=Products,cn=OracleContext&lt;br /&gt;orclpasswordattribute=WV1z3ihA&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# $ORACLE_HOME/opmn/bin/opmnctl stopall&lt;br /&gt;opmnctl: stopping opmn and all managed processes...&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# cd $ORACLE_HOME/sso/admin/plsql/sso                          &lt;br /&gt;# sqlplus orasso/WV1z3ihA@em @ssopatch.sql&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# $ORACLE_HOME/opmn/bin/opmnctl startall&lt;br /&gt;opmnctl: starting opmn and all managed processes...&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Afterwards, you can validate that SSO is functional by logging in as &lt;span style="font-family: courier new;"&gt;orcladmin&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oid/oid6.gif" target="_blank" name="oid6"&gt;&lt;img src="http://www.colestock.com/img/oid/oid6.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/oid/oid7.gif" target="_blank" name="oid7"&gt;&lt;img src="http://www.colestock.com/img/oid/oid7.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Optionally, set-up your OID installation for Net Service Name Resolution - reference my post on &lt;a href="http://www.colestock.com/blogs/2008/06/setting-up-oid-ldap-for-tns-service.html" target="_blank"&gt;Setting Up OID (LDAP)&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-2133390948717329879?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/2133390948717329879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=2133390948717329879' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/2133390948717329879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/2133390948717329879'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/06/how-to-install-oracleas-infrastructure.html' title='How to Install OracleAS Infrastructure (10.1.4.0.1)'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-1982889073996034238</id><published>2008-06-04T11:40:00.000-07:00</published><updated>2008-06-19T09:11:46.355-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Application Servers'/><category scheme='http://www.blogger.com/atom/ns#' term='Installation'/><title type='text'>How to Install Metadata Repository for Oracle Infrastructure/Identity Management</title><content type='html'>Install the Respository Configuration Assistant Software&lt;br /&gt;&lt;br /&gt;Prepare the kernel for RepCA:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# su - root&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;# vi /etc/sysctl.conf&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;# /sbin/sysctl -p&lt;br /&gt;net.ipv4.ip_forward = 0&lt;br /&gt;net.ipv4.conf.default.rp_filter = 1&lt;br /&gt;net.ipv4.conf.default.accept_source_route = 0&lt;br /&gt;kernel.sysrq = 0&lt;br /&gt;kernel.core_uses_pid = 1&lt;br /&gt;net.core.rmem_default = 262144&lt;br /&gt;net.core.wmem_default = 262144&lt;br /&gt;net.core.rmem_max = 262144&lt;br /&gt;net.core.wmem_max = 262144&lt;br /&gt;kernel.shmmax = 4294967295&lt;br /&gt;kernel.sem = 256 32000 100 142&lt;br /&gt;fs.file-max = 206173&lt;br /&gt;net.ipv4.ip_local_port_range = 1024 65000&lt;br /&gt;kernel.msgmni = 2878&lt;br /&gt;kernel.msgmnb = 65535&lt;/pre&gt;&lt;br /&gt;Unpack the Software and Install:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# cpio -idmv &lt; as_linux_x86_mrca_101203.cpio&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;# export DISPLAY=192.168.1.3:0.0&lt;br /&gt;# cd Disk1&lt;br /&gt;# ./runInstaller&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/mrca/mrca1.gif" target="_blank" name="mrca1"&gt;&lt;img src="http://www.colestock.com/img/mrca/mrca1.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/mrca/mrca2.gif" target="_blank" name="mrca2"&gt;&lt;img src="http://www.colestock.com/img/mrca/mrca2.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/mrca/mrca3.gif" target="_blank" name="mrca3"&gt;&lt;img src="http://www.colestock.com/img/mrca/mrca3.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/mrca/mrca4.gif" target="_blank" name="mrca4"&gt;&lt;img src="http://www.colestock.com/img/mrca/mrca4.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/mrca/mrca5.gif" target="_blank" name="mrca5"&gt;&lt;img src="http://www.colestock.com/img/mrca/mrca5.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/mrca/mrca6.gif" target="_blank" name="mrca6"&gt;&lt;img src="http://www.colestock.com/img/mrca/mrca6.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/mrca/mrca7.gif" target="_blank" name="mrca7"&gt;&lt;img src="http://www.colestock.com/img/mrca/mrca7.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Run the &lt;span style="font-family: courier new;"&gt;root.sh&lt;/span&gt; script as root:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# pwd&lt;br /&gt;/u01/app/oracle/product/mrca&lt;br /&gt;# ./root.sh&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/mrca/mrca8.gif" target="_blank" name="mrca8"&gt;&lt;img src="http://www.colestock.com/img/mrca/mrca8.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Update &lt;span style="font-family: courier new;"&gt;/etc/oratab&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# echo "mrca:/u01/app/oracle/product/mrca:N" &gt;&gt; /etc/oratab&lt;br /&gt;# export ORACLE_SID=mrca&lt;br /&gt;# . oraenv&lt;/pre&gt;&lt;br /&gt;Prepare the destination database for the installation of the OracleAS Repository:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter system set sga_target=600M scope=spfile;&lt;br /&gt;SQL&gt; alter system set pga_aggregate_target=96M scope=spfile;&lt;br /&gt;SQL&gt; alter system set java_pool_size=120M scope=spfile;&lt;br /&gt;SQL&gt; alter system set shared_pool_size=175M scope=spfile;&lt;br /&gt;SQL&gt; alter system set db_cache_size=144M scope=spfile;&lt;br /&gt;SQL&gt; alter system set sessions=400 scope=spfile;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# srvctl stop database -d em&lt;br /&gt;# srvctl start database -d em&lt;/pre&gt;&lt;br /&gt;If not already present, install Ultrasearch Database Option:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# export ORACLE_SID=em1&lt;br /&gt;# . oraenv&lt;br /&gt;# export DISPLAY=192.168.1.3:0.0&lt;br /&gt;# dbca&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ultrasearch/ultrasearch1.gif" target="_blank" name="ultrasearch1"&gt;&lt;img src="http://www.colestock.com/img/ultrasearch/ultrasearch1.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ultrasearch/ultrasearch2.gif" target="_blank" name="ultrasearch2"&gt;&lt;img src="http://www.colestock.com/img/ultrasearch/ultrasearch2.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ultrasearch/ultrasearch3.gif" target="_blank" name="ultrasearch3"&gt;&lt;img src="http://www.colestock.com/img/ultrasearch/ultrasearch3.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ultrasearch/ultrasearch4.gif" target="_blank" name="ultrasearch4"&gt;&lt;img src="http://www.colestock.com/img/ultrasearch/ultrasearch4.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ultrasearch/ultrasearch5.gif" target="_blank" name="ultrasearch5"&gt;&lt;img src="http://www.colestock.com/img/ultrasearch/ultrasearch5.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ultrasearch/ultrasearch6.gif" target="_blank" name="ultrasearch6"&gt;&lt;img src="http://www.colestock.com/img/ultrasearch/ultrasearch6.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ultrasearch/ultrasearch7.gif" target="_blank" name="ultrasearch7"&gt;&lt;img src="http://www.colestock.com/img/ultrasearch/ultrasearch7.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ultrasearch/ultrasearch8.gif" target="_blank" name="ultrasearch8"&gt;&lt;img src="http://www.colestock.com/img/ultrasearch/ultrasearch8.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ultrasearch/ultrasearch9.gif" target="_blank" name="ultrasearch9"&gt;&lt;img src="http://www.colestock.com/img/ultrasearch/ultrasearch9.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Check that all prerequisites for Installing the Metadata Repository Configuration Assistant are met:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# export ORACLE_SID=mrca&lt;br /&gt;# . oraenv&lt;br /&gt;# cd $ORACLE_HOME/repca/prereq&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# DBPrereqChecker -DBHOST rac1.colestock.test -DBPORT 1521 -DBNAME em.colestock.test -SYSPWD password -LOGDIR /tmp/&lt;br /&gt;Starting validation DatabasePrerequisite&lt;br /&gt;Validation Succeeded -&gt; DatabasePrerequisite&lt;br /&gt;Validation check complete&lt;/pre&gt;&lt;br /&gt;Install the Metadata Repository Configuration Assistant:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# cd $ORACLE_HOME&lt;br /&gt;# pwd&lt;br /&gt;/u01/app/oracle/product/mrca&lt;br /&gt;# ./runRepca&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/repca/repca1.gif" target="_blank" name="repca1"&gt;&lt;img src="http://www.colestock.com/img/repca/repca1.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/repca/repca2.gif" target="_blank" name="repca2"&gt;&lt;img src="http://www.colestock.com/img/repca/repca2.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/repca/repca3.gif" target="_blank" name="repca3"&gt;&lt;img src="http://www.colestock.com/img/repca/repca3.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/repca/repca4.gif" target="_blank" name="repca4"&gt;&lt;img src="http://www.colestock.com/img/repca/repca4.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/repca/repca5.gif" target="_blank" name="repca5"&gt;&lt;img src="http://www.colestock.com/img/repca/repca5.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/repca/repca6.gif" target="_blank" name="repca6"&gt;&lt;img src="http://www.colestock.com/img/repca/repca6.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/repca/repca7.gif" target="_blank" name="repca7"&gt;&lt;img src="http://www.colestock.com/img/repca/repca7.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/repca/repca8.gif" target="_blank" name="repca8"&gt;&lt;img src="http://www.colestock.com/img/repca/repca8.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/repca/repca9.gif" target="_blank" name="repca9"&gt;&lt;img src="http://www.colestock.com/img/repca/repca9.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/repca/repca10.gif" target="_blank" name="repca10"&gt;&lt;img src="http://www.colestock.com/img/repca/repca10.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Resize any files as prompted:  &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter database datafile '+DATA/em/datafile/undotbs1.261.655668297' resize 600M;&lt;br /&gt;SQL&gt; alter database datafile '+DATA/em/datafile/system.258.655668171' resize 1G;&lt;br /&gt;SQL&gt; alter database datafile '+DATA/em/datafile/undotbs2.260.655668271' resize 750M;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/repca/repca11.gif" target="_blank" name="repca11"&gt;&lt;img src="http://www.colestock.com/img/repca/repca11.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/repca/repca12.gif" target="_blank" name="repca12"&gt;&lt;img src="http://www.colestock.com/img/repca/repca12.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/repca/repca13.gif" target="_blank" name="repca13"&gt;&lt;img src="http://www.colestock.com/img/repca/repca13.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Before Installing the OracleAS Infrastructure/Identity Management you have to address the following bugs:&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Bug 5612298 (SEE METALINK - Note:550260.1)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Download Patch 5612298 for HP-UX PA-RISC (64-bit) or HP-UX Itanium&lt;br /&gt;&lt;br /&gt;MR schemas and objects will need to be cleaned up within the Database using the MRCA Installation Guide instructions.&lt;br /&gt;&lt;br /&gt;Follow instructions in Patch 5612298 readme file:&lt;br /&gt;&lt;br /&gt;After the MRCA successful installs, copy the patch ldap.tar to $ORACLE_HOME and extract the ldap.tar file from the $ORACLE_HOME by doing the following steps:&lt;br /&gt;&lt;br /&gt;cp ldap.tar $ORACLE_HOME&lt;br /&gt;cd $ORACLE_HOME&lt;br /&gt;tar xvf ldap.tar&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Note that the aforementioned note mentions HP-UX as the platform, but this has effected me on Linux as well! Also, it is the MRCA $ORACLE_HOME in which you should unpack this .tar file.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Warning to Have SSO Schema Version at 10.1.4.0.1 During Installation (SEE METALINK - Note:433208.1)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;1. Connect to the Oracle Database as SYSDBA and perform the following:&lt;br /&gt;&lt;br /&gt;    SQL&gt; update orasso.wwc_version$ set version='10.1.4.0.1';&lt;br /&gt;    SQL&gt; Commit;&lt;br /&gt;&lt;br /&gt;2. Re-start the Oracle Identity Management 10g (10.1.4.0.1) installation&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Accomplishing the above will allow for a successful posthumous install of OracleAS Infrastructure/Identity Management...&lt;br /&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-1982889073996034238?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/1982889073996034238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=1982889073996034238' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/1982889073996034238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/1982889073996034238'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/06/how-to-install-metadata-repository-for.html' title='How to Install Metadata Repository for Oracle Infrastructure/Identity Management'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-4507271159996680142</id><published>2008-06-01T12:04:00.000-07:00</published><updated>2008-06-01T14:40:32.145-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>How to Create and Schedule a SSIS Job in SQL Server 2005</title><content type='html'>This post covers how to create and schedule a SSIS job on SQL Server 2005.&lt;br /&gt;The biggest challenge in doing this has to do more with the convaluted security setup, than with the SSIS package creation and/or scheduling.&lt;br /&gt;&lt;br /&gt;The first step is to create the necessary security objects:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;a href="http://www.colestock.com/tech/sql/ssis_security_setup.sql" target="_blank"&gt;ssis_security_setup.sql&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Create a Login who will own the job&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;USE [master]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE LOGIN [ssis_usr] WITH PASSWORD=N'password', DEFAULT_DATABASE=[msdb], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF;&lt;br /&gt;GO&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Grant the &lt;span style="font-family:courier new;"&gt;sysadmin&lt;/span&gt; role to the previously created login&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;sp_addsrvrolemember @loginame = N'ssis_usr', @rolename = N'sysadmin'&lt;br /&gt;GO&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Create a user in the &lt;span style="font-family:courier new;"&gt;msdb&lt;/span&gt; system database for the login, creating the mapping&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;USE [msdb]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE USER [ssis_usr] FOR LOGIN [ssis_usr]&lt;br /&gt;GO&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Grant the following roles to the user&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;sp_addrolemember N'SQLAgentReaderRole', N'ssis_usr';&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;sp_addrolemember N'SQLAgentOperatorRole', N'ssis_usr'&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;sp_addrolemember N'SQLAgentUserRole', N'ssis_usr'&lt;br /&gt;GO&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Create a credential to be used by the proxy - the proxy will execute the SSIS package within the job&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;USE [master]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE CREDENTIAL [ssis_cred] WITH IDENTITY = N'PRIVATE-E3A52F5\James', SECRET='password';&lt;br /&gt;GO&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Create the proxy, mapping to the credential and provide access to the SSIS subsystem&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;USE [msdb]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;sp_add_proxy @proxy_name=N'ssis_prxy', @credential_name=N'ssis_cred';&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;sp_grant_proxy_to_subsystem @proxy_name=N'ssis_prxy', @subsystem_name=N'SSIS';&lt;br /&gt;GO&lt;/pre&gt;&lt;br /&gt;Now you are ready to create a sample SSIS package.&lt;br /&gt;&lt;br /&gt;I launch the SQL Server Business Intelligence Development Studio via &lt;span style="font-family:courier new;"&gt;All Programs -&gt; Microsoft SQL Server 2005 -&gt; SQL Server Business Intelligence Development Studio&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I create a project named &lt;span style="font-family:courier new;"&gt;sample_ssis&lt;/span&gt;, which consists of a Transfer Database Task, which refreshes a database from one SQL Server instance to another:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;sample_ssis.dstx&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ssis/ssis1.gif" target="_blank" name="ssis1"&gt;&lt;img src="http://www.colestock.com/img/ssis/ssis1.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Task Properties&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ssis/ssis2.gif" target="_blank" name="ssis2"&gt;&lt;img src="http://www.colestock.com/img/ssis/ssis2.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Once the sample SSIS package is created, import into the &lt;span style="font-family:courier new;"&gt;msdb&lt;/span&gt; system database via Integration Services:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Login to Integration Services&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ssis/ssis3.gif" target="_blank" name="ssis3"&gt;&lt;img src="http://www.colestock.com/img/ssis/ssis3.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Import the SSIS Package from the File System&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ssis/ssis4.gif" target="_blank" name="ssis4"&gt;&lt;img src="http://www.colestock.com/img/ssis/ssis4.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Login to the Database Engine using ssis_usr&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ssis/ssis5.gif" target="_blank" name="ssis5"&gt;&lt;img src="http://www.colestock.com/img/ssis/ssis5.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Create a SQL Server Agent Job&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ssis/ssis6.gif" target="_blank" name="ssis6"&gt;&lt;img src="http://www.colestock.com/img/ssis/ssis6.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Create a Step within the Job run by ssis_prxy&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ssis/ssis7.gif" target="_blank" name="ssis7"&gt;&lt;img src="http://www.colestock.com/img/ssis/ssis7.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Create a Schedule for the Job&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ssis/ssis8.gif" target="_blank" name="ssis8"&gt;&lt;img src="http://www.colestock.com/img/ssis/ssis8.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Monitor the Job&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/ssis/ssis9.gif" target="_blank" name="ssis9"&gt;&lt;img src="http://www.colestock.com/img/ssis/ssis9.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You should see something similar to the aforementioned if your job executed successfully.&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-4507271159996680142?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/4507271159996680142/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=4507271159996680142' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/4507271159996680142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/4507271159996680142'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/06/how-to-create-and-schedule-ssis-job-in.html' title='How to Create and Schedule a SSIS Job in SQL Server 2005'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-3400324479881814011</id><published>2008-05-29T14:23:00.000-07:00</published><updated>2008-05-29T15:18:46.366-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Backup and Recovery'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server: Point in Time Recovery Example</title><content type='html'>This example demonstrates how to backup a SQL Server Database and then restore it to a specific point in time. &lt;br /&gt;&lt;br /&gt;The database in question uses the FULL recovery model, which supports such a PITR (Point in Time Recovery). The example uses a simple table to illustrate how all this works.&lt;br /&gt;&lt;br /&gt;The example first creates a sample table and performs a full backup on the database. Then, values are inserted into the table periodically, interlaced with transaction log backups. &lt;br /&gt;&lt;br /&gt;Set-up the example by running &lt;a href="http://www.colestock.com/tech/PITRBackupExample.sql" target="_blank"&gt;PITRBackupExample.sql&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The script yields the following &lt;a href="http://www.colestock.com/tech/PITRBackupExample.out" target="_blank"&gt;output&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In this example, I want to restore the database to the point at which the 'Point-in-time I want to recover to!' value was inserted into the &lt;span style="font-family: courier new;"&gt;sample&lt;/span&gt; table. To do this, a restore point just after this transaction, specifically the '2008-05-28 11:58:09.680' timestamp, will need to be specified. &lt;br /&gt;&lt;br /&gt;The recovery first places the database in single-user mode and performs a tail-log transaction log backup. Then, the full backup and transaction log backups are applied. For the last transaction log backup the &lt;span style="font-family: courier new;"&gt;STOPAT&lt;/span&gt; option is specified, along with the &lt;span style="font-family: courier new;"&gt;WITH RECOVERY&lt;/span&gt; option, which denotes that this operation is to end the recovery. Afterwards, the database is placed into multi-user mode. Last, we check the &lt;span style="font-family: courier new;"&gt;sample&lt;/span&gt; table to make sure that we recovered successfully to the desired timestamp.&lt;br /&gt;&lt;br /&gt;Recover the example by running &lt;a href="http://www.colestock.com/tech/PITRExample.sql" target="_blank"&gt;PITRExample.sql&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The script yields the following &lt;a href="http://www.colestock.com/tech/PITRExample.out" target="_blank"&gt;output&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-3400324479881814011?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/3400324479881814011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=3400324479881814011' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/3400324479881814011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/3400324479881814011'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/05/sql-server-point-in-time-recovery.html' title='SQL Server: Point in Time Recovery Example'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-7512873849138286017</id><published>2008-05-27T12:06:00.000-07:00</published><updated>2008-05-27T12:21:57.857-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Bugs'/><title type='text'>Unable to Open MSDB in Integration Services when using Named Instance(s)</title><content type='html'>Follow the accepted answer from the following post: &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=175893&amp;SiteID=1" target="_blank"&gt;Re: Unable to open MSDB node&lt;/a&gt; if you are using a named SQL Server instance and you can't access the SSIS packages within the MSDB database. &lt;br /&gt;&lt;br /&gt;You will experience a 'Login Timeout' exception until you edit the XML file mentioned in the post. By default, Microsoft is configured to connect to the DEFAULT instance only; short of modifying this file, there is no way of specifying a different Database Service for Integration Services to use. &lt;BR&gt;&lt;BR&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-7512873849138286017?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/7512873849138286017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=7512873849138286017' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/7512873849138286017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/7512873849138286017'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/05/unable-to-open-msdb-in-integration.html' title='Unable to Open MSDB in Integration Services when using Named Instance(s)'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-3770978250082805223</id><published>2008-05-25T14:43:00.000-07:00</published><updated>2008-10-15T22:15:33.765-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RMAN'/><category scheme='http://www.blogger.com/atom/ns#' term='RAC'/><category scheme='http://www.blogger.com/atom/ns#' term='ASM'/><title type='text'>How to Migrate an Existing RAC database to ASM</title><content type='html'>This post covers how to migrate an existing RAC database to use ASM storage. In my case, I use a 2-node, 10gR2 database on Linux that is currently using OCFS2 filesystems for the database's files. I will migrate the database to ASM using ASMLib on top of iSCSI volumes. This example assumes that you have already prepared the relevant storage devices for recognition by the O/S.  &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Prepare the Storage&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;As root on one of the hosts, first identify the device names to format:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# ./iscsi-map.sh&lt;br /&gt;Host / SCSI ID    SCSI Device Name         iSCSI Target Name&lt;br /&gt;----------------  -----------------------  -----------------&lt;br /&gt;2                 /dev/sdb                 asm2&lt;br /&gt;3                 /dev/sde                 asm1&lt;br /&gt;4                 /dev/sdc                 arch&lt;br /&gt;5                 /dev/sdf                 software&lt;br /&gt;6                 /dev/sdd                 logs&lt;br /&gt;7                 /dev/sdg                 ora2&lt;br /&gt;8                 /dev/sdi                 ora1&lt;br /&gt;9                 /dev/sdh                 crs&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Format the devices you plan to use for the ASM migration:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# fdisk /dev/sdb&lt;br /&gt;Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel&lt;br /&gt;Building a new DOS disklabel. Changes will remain in memory only,&lt;br /&gt;until you decide to write them. After that, of course, the previous&lt;br /&gt;content won't be recoverable.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The number of cylinders for this disk is set to 25024.&lt;br /&gt;There is nothing wrong with that, but this is larger than 1024,&lt;br /&gt;and could in certain setups cause problems with:&lt;br /&gt;1) software that runs at boot time (e.g., old versions of LILO)&lt;br /&gt;2) booting and partitioning software from other OSs&lt;br /&gt;   (e.g., DOS FDISK, OS/2 FDISK)&lt;br /&gt;Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)&lt;br /&gt;&lt;br /&gt;Command (m for help): n&lt;br /&gt;Command action&lt;br /&gt;   e   extended&lt;br /&gt;   p   primary partition (1-4)&lt;br /&gt;p&lt;br /&gt;Partition number (1-4): 1&lt;br /&gt;First cylinder (1-25024, default 1):&lt;br /&gt;Using default value 1&lt;br /&gt;Last cylinder or +size or +sizeM or +sizeK (1-25024, default 25024):&lt;br /&gt;Using default value 25024&lt;br /&gt;&lt;br /&gt;Command (m for help): p&lt;br /&gt;&lt;br /&gt;Disk /dev/sdb: 26.2 GB, 26239565824 bytes&lt;br /&gt;64 heads, 32 sectors/track, 25024 cylinders&lt;br /&gt;Units = cylinders of 2048 * 512 = 1048576 bytes&lt;br /&gt;&lt;br /&gt;   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;/dev/sdb1               1       25024    25624560   83  Linux&lt;br /&gt;&lt;br /&gt;Command (m for help): w&lt;br /&gt;The partition table has been altered!&lt;br /&gt;&lt;br /&gt;Calling ioctl() to re-read partition table.&lt;br /&gt;Syncing disks.&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# fdisk /dev/sde&lt;br /&gt;Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel&lt;br /&gt;Building a new DOS disklabel. Changes will remain in memory only,&lt;br /&gt;until you decide to write them. After that, of course, the previous&lt;br /&gt;content won't be recoverable.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The number of cylinders for this disk is set to 25024.&lt;br /&gt;There is nothing wrong with that, but this is larger than 1024,&lt;br /&gt;and could in certain setups cause problems with:&lt;br /&gt;1) software that runs at boot time (e.g., old versions of LILO)&lt;br /&gt;2) booting and partitioning software from other OSs&lt;br /&gt;   (e.g., DOS FDISK, OS/2 FDISK)&lt;br /&gt;Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)&lt;br /&gt;&lt;br /&gt;Command (m for help): n&lt;br /&gt;Command action&lt;br /&gt;   e   extended&lt;br /&gt;   p   primary partition (1-4)&lt;br /&gt;p&lt;br /&gt;Partition number (1-4): 1&lt;br /&gt;First cylinder (1-25024, default 1):&lt;br /&gt;Using default value 1&lt;br /&gt;Last cylinder or +size or +sizeM or +sizeK (1-25024, default 25024):&lt;br /&gt;Using default value 25024&lt;br /&gt;&lt;br /&gt;Command (m for help): p&lt;br /&gt;&lt;br /&gt;Disk /dev/sde: 26.2 GB, 26239565824 bytes&lt;br /&gt;64 heads, 32 sectors/track, 25024 cylinders&lt;br /&gt;Units = cylinders of 2048 * 512 = 1048576 bytes&lt;br /&gt;&lt;br /&gt;   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;/dev/sde1               1       25024    25624560   83  Linux&lt;br /&gt;&lt;br /&gt;Command (m for help): w&lt;br /&gt;The partition table has been altered!&lt;br /&gt;&lt;br /&gt;Calling ioctl() to re-read partition table.&lt;br /&gt;Syncing disks.&lt;/pre&gt;&lt;br /&gt;Probe each host to pickup the changes via:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# partprobe&lt;br /&gt;# fdisk -l&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Configure ASMLib on each host via:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# /etc/init.d/oracleasm configure&lt;br /&gt;Configuring the Oracle ASM library driver.&lt;br /&gt;&lt;br /&gt;This will configure the on-boot properties of the Oracle ASM library&lt;br /&gt;driver.  The following questions will determine whether the driver is&lt;br /&gt;loaded on boot and what permissions it will have.  The current values&lt;br /&gt;will be shown in brackets ('[]').  Hitting &lt;ENTER&gt; without typing an&lt;br /&gt;answer will keep that current value.  Ctrl-C will abort.&lt;br /&gt;&lt;br /&gt;Default user to own the driver interface []: oracle&lt;br /&gt;Default group to own the driver interface []: dba&lt;br /&gt;Start Oracle ASM library driver on boot (y/n) [n]: y&lt;br /&gt;Fix permissions of Oracle ASM disks on boot (y/n) [y]: y&lt;br /&gt;Writing Oracle ASM library driver configuration:           [  OK  ]&lt;br /&gt;Loading module "oracleasm":                                [  OK  ]&lt;br /&gt;Mounting ASMlib driver filesystem:                         [  OK  ]&lt;br /&gt;Scanning system for ASM disks:                             [  OK  ]&lt;/pre&gt;&lt;br /&gt;On one node as root, create the ASM Volumes via:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb1&lt;br /&gt;Marking disk "/dev/sdb1" as an ASM disk:                   [  OK  ]&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# /etc/init.d/oracleasm createdisk VOL2 /dev/sde1&lt;br /&gt;Marking disk "/dev/sde1" as an ASM disk:                   [  OK  ]&lt;/pre&gt;&lt;br /&gt;On all other nodes, scan to recognize the changes via:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# /etc/init.d/oracleasm scandisks&lt;br /&gt;Scanning system for ASM disks:                             [  OK  ]&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# /etc/init.d/oracleasm listdisks&lt;br /&gt;VOL1&lt;br /&gt;VOL2&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Create the ASM Instances&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Create directories for the clustered ASM instance on shared storage. In my case, I will put it on the same OCFS2 volumes hosting the voting and cluster registry files for CRS. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# mkdir -p /u02/oracle/crs/asm&lt;br /&gt;# mkdir -p /u02/oracle/crs/asm/bdump&lt;br /&gt;# mkdir -p /u02/oracle/crs/asm/cdump&lt;br /&gt;# mkdir -p /u02/oracle/crs/asm/udump&lt;br /&gt;# chown -R oracle:dba /u02/oracle/crs/asm&lt;/pre&gt;&lt;br /&gt;Create the initial ASM instance parameter file on the shared storage: &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# touch /u02/oracle/crs/asm/init+ASM.ora&lt;br /&gt;# vi /u02/oracle/crs/asm/init+ASM.ora&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;init+ASM.ora&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;*.asm_diskgroups='DATA','BACKUPS'&lt;br /&gt;*.asm_diskstring='/dev/oracleasm/disks/*'&lt;br /&gt;*.background_dump_dest='/u02/oracle/crs/asm/bdump'&lt;br /&gt;*.cluster_database=true&lt;br /&gt;*.core_dump_dest='/u02/oracle/crs/asm/cdump'&lt;br /&gt;+ASM2.instance_number=2&lt;br /&gt;+ASM1.instance_number=1&lt;br /&gt;*.instance_type='asm'&lt;br /&gt;*.large_pool_size=20M&lt;br /&gt;*.remote_login_passwordfile='exclusive'&lt;br /&gt;*.user_dump_dest='/u02/oracle/crs/asm/udump'&lt;/pre&gt;&lt;br /&gt;Link to the parameter file from each host:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# su - oracle&lt;br /&gt;# cd $ORACLE_HOME/dbs&lt;br /&gt;# ln -s /u02/oracle/crs/asm/init+ASM.ora init+ASM1.ora&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# su - oracle&lt;br /&gt;# cd $ORACLE_HOME/dbs&lt;br /&gt;# ln -s /u02/oracle/crs/asm/init+ASM.ora init+ASM2.ora&lt;/pre&gt;&lt;br /&gt;Create the passwordfile on shared storage and link to it from each ASM instance:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# orapwd file=/u02/oracle/crs/asm/orapw+ASM password={password}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Link to the passwordfile on each node:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# cd $ORACLE_HOME/dbs&lt;br /&gt;# ln -s /u02/oracle/crs/asm/orapw+ASM orapw+ASM1&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# cd $ORACLE_HOME/dbs&lt;br /&gt;# ln -s /u02/oracle/crs/asm/orapw+ASM orapw+ASM2&lt;/pre&gt;&lt;br /&gt;Update &lt;span style="font-family: courier new;"&gt;/etc/oratab&lt;/span&gt; on each node:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# echo "+ASM1:/u01/app/oracle/product/10.2:N" &gt;&gt; /etc/oratab&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# echo "+ASM2:/u01/app/oracle/product/10.2:N" &gt;&gt; /etc/oratab&lt;/pre&gt;&lt;br /&gt;Create the ASM Diskgroups:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# export ORACLE_SID=+ASM1&lt;br /&gt;# . oraenv&lt;br /&gt;# sqlplus "/ as sysdba"&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.2.0.3.0 - Production on Sun May 25 16:52:56 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.&lt;br /&gt;&lt;br /&gt;Connected to an idle instance.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; startup mount;&lt;br /&gt;ASM instance started&lt;br /&gt;&lt;br /&gt;Total System Global Area  100663296 bytes&lt;br /&gt;Fixed Size                  1260312 bytes&lt;br /&gt;Variable Size              74237160 bytes&lt;br /&gt;ASM Cache                  25165824 bytes&lt;br /&gt;ORA-15032: not all alterations performed&lt;br /&gt;ORA-15063: ASM discovered an insufficient number of disks for diskgroup "DATA"&lt;br /&gt;ORA-15063: ASM discovered an insufficient number of disks for diskgroup&lt;br /&gt;"BACKUPS"&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; create diskgroup DATA external redundancy disk '/dev/oracleasm/disks/VOL1';&lt;br /&gt;&lt;br /&gt;Diskgroup created.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; create diskgroup BACKUPS external redundancy disk '/dev/oracleasm/disks/VOL2';&lt;br /&gt;&lt;br /&gt;Diskgroup created.&lt;/pre&gt;&lt;br /&gt;Now that you have confirmed that the ASM instance is functional, create the spfile from pfile:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; create spfile='/u02/oracle/crs/asm/spfile+ASM.ora' from pfile;&lt;br /&gt;&lt;br /&gt;File created.&lt;/pre&gt;&lt;br /&gt;Update each node to reflect use of the spfile:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# cd $ORACLE_HOME/dbs&lt;br /&gt;# vi init+ASM1.ora&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;init+ASM1.ora&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;spfile='/u02/oracle/crs/asm/spfile+ASM.ora'&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;# cd $ORACLE_HOME/dbs&lt;br /&gt;# vi init+ASM2.ora&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;init+ASM2.ora&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;spfile='/u02/oracle/crs/asm/spfile+ASM.ora'&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Register the clustered ASM instance with &lt;span style="font-family:courier new;"&gt;srvctl&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# srvctl add asm -n rac1 -i +ASM1 -o $ORACLE_HOME&lt;br /&gt;# srvctl add asm -n rac2 -i +ASM2 -o $ORACLE_HOME&lt;br /&gt;# srvctl enable asm -n rac1 -i +ASM1&lt;br /&gt;# srvctl enable asm -n rac2 -i +ASM2&lt;/pre&gt;&lt;br /&gt;Start and verify ASM instances:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# srvctl start asm -n rac1&lt;br /&gt;# srvctl start asm -n rac2&lt;br /&gt;# srvctl status asm -n rac2&lt;br /&gt;ASM instance +ASM2 is running on node rac2.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;# srvctl status asm -n rac1&lt;br /&gt;ASM instance +ASM1 is running on node rac1.&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Prepare to migrate the database in question to use ASM as storage&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Query the names of the database files:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; select name from v$datafile;&lt;br /&gt;&lt;br /&gt;NAME&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;/u02/oracle/ora1/em/system01.dbf&lt;br /&gt;/u02/oracle/ora1/em/undotbs01.dbf&lt;br /&gt;/u02/oracle/ora1/em/sysaux01.dbf&lt;br /&gt;/u02/oracle/ora1/em/users01.dbf&lt;br /&gt;/u02/oracle/ora1/em/example01.dbf&lt;br /&gt;/u02/oracle/ora1/em/undotbs02.dbf&lt;br /&gt;/u02/oracle/ora2/em/mgmt.dbf&lt;br /&gt;/u02/oracle/ora1/em/mgmt_ecm_depot1.dbf&lt;br /&gt;&lt;br /&gt;8 rows selected.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; select name from v$controlfile;&lt;br /&gt;&lt;br /&gt;NAME&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;/u02/oracle/ora1/em/control01.ctl&lt;br /&gt;/u02/oracle/ora2/em/control02.ctl&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; select * from gv$logfile;&lt;br /&gt;&lt;br /&gt;   INST_ID     GROUP# STATUS  TYPE    MEMBER                              IS_&lt;br /&gt;---------- ---------- ------- ------- ----------------------------------- ---&lt;br /&gt;         1          2         ONLINE  /u02/oracle/ora1/em/redo_1_2a.log   NO&lt;br /&gt;         1          2         ONLINE  /u02/oracle/ora2/em/redo_1_2b.log   NO&lt;br /&gt;         1          1         ONLINE  /u02/oracle/ora1/em/redo_1_1a.log   NO&lt;br /&gt;         1          1         ONLINE  /u02/oracle/ora2/em/redo_1_1b.log   NO&lt;br /&gt;         1          3         ONLINE  /u02/oracle/ora1/em/redo_2_3a.log   NO&lt;br /&gt;         1          3         ONLINE  /u02/oracle/ora2/em/redo_2_3b.log   NO&lt;br /&gt;         1          4         ONLINE  /u02/oracle/ora1/em/redo_2_4a.log   NO&lt;br /&gt;         1          4         ONLINE  /u02/oracle/ora2/em/redo_2_4b.log   NO&lt;br /&gt;         2          2         ONLINE  /u02/oracle/ora1/em/redo_1_2a.log   NO&lt;br /&gt;         2          2         ONLINE  /u02/oracle/ora2/em/redo_1_2b.log   NO&lt;br /&gt;         2          1         ONLINE  /u02/oracle/ora1/em/redo_1_1a.log   NO&lt;br /&gt;&lt;br /&gt;   INST_ID     GROUP# STATUS  TYPE    MEMBER                              IS_&lt;br /&gt;---------- ---------- ------- ------- ----------------------------------- ---&lt;br /&gt;         2          1         ONLINE  /u02/oracle/ora2/em/redo_1_1b.log   NO&lt;br /&gt;         2          3         ONLINE  /u02/oracle/ora1/em/redo_2_3a.log   NO&lt;br /&gt;         2          3         ONLINE  /u02/oracle/ora2/em/redo_2_3b.log   NO&lt;br /&gt;         2          4         ONLINE  /u02/oracle/ora1/em/redo_2_4a.log   NO&lt;br /&gt;         2          4         ONLINE  /u02/oracle/ora2/em/redo_2_4b.log   NO&lt;br /&gt;&lt;br /&gt;16 rows selected.&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Migrate the Database to ASM&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Update the &lt;span style="font-family:courier new;"&gt;control_files&lt;/span&gt; parameter in preparation for migration:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ srvctl stop database -d em&lt;br /&gt;[oracle@rac1 dbs]$ export ORACLE_SID=em1&lt;br /&gt;[oracle@rac1 dbs]$ . oraenv&lt;br /&gt;[oracle@rac1 dbs]$ sqlplus "/ as sysdba"&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.2.0.3.0 - Production on Sun May 25 17:38:38 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.&lt;br /&gt;&lt;br /&gt;Connected to an idle instance.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; startup nomount;&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area  268435456 bytes&lt;br /&gt;Fixed Size                  1261300 bytes&lt;br /&gt;Variable Size             243269900 bytes&lt;br /&gt;Database Buffers           16777216 bytes&lt;br /&gt;Redo Buffers                7127040 bytes&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter system set control_files='+DATA/control.ctl' scope=spfile sid='*';&lt;br /&gt;&lt;br /&gt;System altered.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; shutdown immediate;&lt;br /&gt;ORA-01507: database not mounted&lt;br /&gt;ORACLE instance shut down.&lt;/pre&gt;&lt;br /&gt;Migrate the controlfile:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# rman target=/&lt;br /&gt;&lt;br /&gt;Recovery Manager: Release 10.2.0.3.0 - Production on Sun May 25 17:40:41 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;connected to target database (not started)&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;RMAN&gt; startup nomount;&lt;br /&gt;&lt;br /&gt;Oracle instance started&lt;br /&gt;&lt;br /&gt;Total System Global Area     268435456 bytes&lt;br /&gt;&lt;br /&gt;Fixed Size                     1261300 bytes&lt;br /&gt;Variable Size                247464204 bytes&lt;br /&gt;Database Buffers              12582912 bytes&lt;br /&gt;Redo Buffers                   7127040 bytes&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;RMAN&gt; restore controlfile from '/u02/oracle/ora1/em/control01.ctl';&lt;br /&gt;&lt;br /&gt;Starting restore at 25-MAY-08&lt;br /&gt;using target database control file instead of recovery catalog&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=145 instance=em1 devtype=DISK&lt;br /&gt;&lt;br /&gt;channel ORA_DISK_1: copied control file copy&lt;br /&gt;output filename=+DATA/control.ctl&lt;br /&gt;Finished restore at 25-MAY-08&lt;/pre&gt;&lt;br /&gt;Migrate the Datafiles:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;RMAN&gt; alter database mount;&lt;br /&gt;&lt;br /&gt;database mounted&lt;br /&gt;released channel: ORA_DISK_1&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;RMAN&gt; backup as copy database format '+DATA';&lt;br /&gt;&lt;br /&gt;Starting backup at 25-MAY-08&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=145 instance=em1 devtype=DISK&lt;br /&gt;channel ORA_DISK_1: starting datafile copy&lt;br /&gt;input datafile fno=00007 name=/u02/oracle/ora2/em/mgmt.dbf&lt;br /&gt;output filename=+DATA/em/datafile/mgmt_tablespace.257.655667175 tag=TAG20080525T174614 recid=10 stamp=655668164&lt;br /&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:16:35&lt;br /&gt;channel ORA_DISK_1: starting datafile copy&lt;br /&gt;input datafile fno=00001 name=/u02/oracle/ora1/em/system01.dbf&lt;br /&gt;output filename=+DATA/em/datafile/system.258.655668171 tag=TAG20080525T174614 recid=11 stamp=655668229&lt;br /&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:05&lt;br /&gt;channel ORA_DISK_1: starting datafile copy&lt;br /&gt;input datafile fno=00003 name=/u02/oracle/ora1/em/sysaux01.dbf&lt;br /&gt;output filename=+DATA/em/datafile/sysaux.259.655668235 tag=TAG20080525T174614 recid=12 stamp=655668262&lt;br /&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35&lt;br /&gt;channel ORA_DISK_1: starting datafile copy&lt;br /&gt;input datafile fno=00006 name=/u02/oracle/ora1/em/undotbs02.dbf&lt;br /&gt;output filename=+DATA/em/datafile/undotbs2.260.655668271 tag=TAG20080525T174614 recid=13 stamp=655668293&lt;br /&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25&lt;br /&gt;channel ORA_DISK_1: starting datafile copy&lt;br /&gt;input datafile fno=00002 name=/u02/oracle/ora1/em/undotbs01.dbf&lt;br /&gt;output filename=+DATA/em/datafile/undotbs1.261.655668297 tag=TAG20080525T174614 recid=14 stamp=655668309&lt;br /&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15&lt;br /&gt;channel ORA_DISK_1: starting datafile copy&lt;br /&gt;input datafile fno=00005 name=/u02/oracle/ora1/em/example01.dbf&lt;br /&gt;output filename=+DATA/em/datafile/example.262.655668311 tag=TAG20080525T174614 recid=15 stamp=655668322&lt;br /&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15&lt;br /&gt;channel ORA_DISK_1: starting datafile copy&lt;br /&gt;input datafile fno=00008 name=/u02/oracle/ora1/em/mgmt_ecm_depot1.dbf&lt;br /&gt;output filename=+DATA/em/datafile/mgmt_ecm_depot_ts.263.655668327 tag=TAG20080525T174614 recid=16 stamp=655668337&lt;br /&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15&lt;br /&gt;channel ORA_DISK_1: starting datafile copy&lt;br /&gt;input datafile fno=00004 name=/u02/oracle/ora1/em/users01.dbf&lt;br /&gt;output filename=+DATA/em/datafile/users.264.655668341 tag=TAG20080525T174614 recid=17 stamp=655668352&lt;br /&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15&lt;br /&gt;channel ORA_DISK_1: starting datafile copy&lt;br /&gt;copying current control file&lt;br /&gt;output filename=+DATA/em/controlfile/backup.265.655668357 tag=TAG20080525T174614 recid=18 stamp=655668358&lt;br /&gt;channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03&lt;br /&gt;channel ORA_DISK_1: starting full datafile backupset&lt;br /&gt;channel ORA_DISK_1: specifying datafile(s) in backupset&lt;br /&gt;including current SPFILE in backupset&lt;br /&gt;channel ORA_DISK_1: starting piece 1 at 25-MAY-08&lt;br /&gt;channel ORA_DISK_1: finished piece 1 at 25-MAY-08&lt;br /&gt;piece handle=+DATA/em/backupset/2008_05_25/nnsnf0_tag20080525t174614_0.266.655668361 tag=TAG20080525T174614 comment=NONE&lt;br /&gt;channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02&lt;br /&gt;Finished backup at 25-MAY-08&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;RMAN&gt; switch database to copy;&lt;br /&gt;&lt;br /&gt;datafile 1 switched to datafile copy "+DATA/em/datafile/system.258.655668171"&lt;br /&gt;datafile 2 switched to datafile copy "+DATA/em/datafile/undotbs1.261.655668297"&lt;br /&gt;datafile 3 switched to datafile copy "+DATA/em/datafile/sysaux.259.655668235"&lt;br /&gt;datafile 4 switched to datafile copy "+DATA/em/datafile/users.264.655668341"&lt;br /&gt;datafile 5 switched to datafile copy "+DATA/em/datafile/example.262.655668311"&lt;br /&gt;datafile 6 switched to datafile copy "+DATA/em/datafile/undotbs2.260.655668271"&lt;br /&gt;datafile 7 switched to datafile copy "+DATA/em/datafile/mgmt_tablespace.257.655667175"&lt;br /&gt;datafile 8 switched to datafile copy "+DATA/em/datafile/mgmt_ecm_depot_ts.263.655668327"&lt;/pre&gt;&lt;br /&gt;Open the Database by exiting RMAN and then issuing the following via SQL*Plus:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# SQL&gt; alter database open;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;/pre&gt;&lt;br /&gt;Startup the other instances:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# srvctl start instance -d em -i em2&lt;/pre&gt;&lt;br /&gt;Create a new Temporary Tablespace on the ASM Diskgroup:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; CREATE TEMPORARY TABLESPACE TEMPTBS TEMPFILE '+DATA' SIZE 200M;&lt;br /&gt;&lt;br /&gt;Tablespace created.&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMPTBS;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; DROP TABLESPACE TEMP INCLUDING CONTENTS AND DATAFILES;&lt;br /&gt;&lt;br /&gt;Tablespace dropped.&lt;/pre&gt;&lt;br /&gt;Create new Online Redo Log Groups:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter system archive log all;&lt;br /&gt;alter system archive log all&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-00271: there are no logs that need archiving&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter system archive log stop;&lt;br /&gt;&lt;br /&gt;System altered.&lt;/pre&gt;&lt;br /&gt;Create ASM Directories&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# export ORACLE_SID=+ASM1&lt;br /&gt;# . oraenv&lt;br /&gt;# sqlplus "/ as sysdba"&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.2.0.3.0 - Production on Sun May 25 18:32:31 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production&lt;br /&gt;With the Partitioning, Real Application Clusters, OLAP and Data Mining options&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter diskgroup DATA add directory '+DATA/em/log1';&lt;br /&gt;&lt;br /&gt;Diskgroup altered.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter diskgroup DATA add directory '+DATA/em/log2';&lt;br /&gt;&lt;br /&gt;Diskgroup altered.&lt;/pre&gt;&lt;br /&gt;Create New Online Redo Log Groups for each public thread before dropping the old ones&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter database add logfile thread 1 group 5&lt;br /&gt;  2  ('+DATA/em/log1/log_1_5a.log','+DATA/em/log1/log_1_5b.log') size 10M;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter database add logfile thread 1 group 6&lt;br /&gt;  2  ('+DATA/em/log1/log_1_6a.log','+DATA/em/log1/log_1_6b.log') size 10M;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter database add logfile thread 1 group 7&lt;br /&gt;  2  ('+DATA/em/log1/log_1_7a.log','+DATA/em/log1/log_1_7b.log') size 10M;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter database add logfile thread 2 group 8&lt;br /&gt;  2   ('+DATA/em/log2/log_2_8a.log','+DATA/em/log2/log_2_8b.log') size 10M;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter database add logfile thread 2 group 9&lt;br /&gt;  2  ('+DATA/em/log2/log_2_9a.log','+DATA/em/log2/log_2_9b.log') size 10M;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter database add logfile thread 2 group 10&lt;br /&gt;  2  ('+DATA/em/log2/log_2_10a.log','+DATA/em/log2/log_2_10b.log') size 10M;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;/pre&gt;&lt;br /&gt;Drop the Old Online Redo Log Groups using the traditional process, for example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt;  alter system switch logfile;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;System altered.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; select group#, thread#, status from v$log;&lt;br /&gt;&lt;br /&gt;    GROUP#    THREAD# STATUS&lt;br /&gt;---------- ---------- ----------------&lt;br /&gt;         1          1 INACTIVE&lt;br /&gt;         5          1 ACTIVE&lt;br /&gt;         6          1 ACTIVE&lt;br /&gt;         7          1 CURRENT&lt;br /&gt;         8          2 CURRENT&lt;br /&gt;         9          2 ACTIVE&lt;br /&gt;        10          2 ACTIVE&lt;br /&gt;&lt;br /&gt;7 rows selected.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter database drop logfile group 1;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;/pre&gt;&lt;br /&gt;Optionally, drop the old datafile images:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# rman target=/&lt;br /&gt;&lt;br /&gt;Recovery Manager: Release 10.2.0.3.0 - Production on Sun May 25 19:00:45 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;connected to target database: EM (DBID=1167076574)&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;RMAN&gt; delete copy of database;&lt;br /&gt;&lt;br /&gt;using target database control file instead of recovery catalog&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=124 instance=em1 devtype=DISK&lt;br /&gt;&lt;br /&gt;List of Datafile Copies&lt;br /&gt;Key     File S Completion Time Ckp SCN    Ckp Time        Name&lt;br /&gt;------- ---- - --------------- ---------- --------------- ----&lt;br /&gt;19      1    A 25-MAY-08       2754400    25-MAY-08       /u02/oracle/ora1/em/system01.dbf&lt;br /&gt;20      2    A 25-MAY-08       2754400    25-MAY-08       /u02/oracle/ora1/em/undotbs01.dbf&lt;br /&gt;21      3    A 25-MAY-08       2754400    25-MAY-08       /u02/oracle/ora1/em/sysaux01.dbf&lt;br /&gt;22      4    A 25-MAY-08       2754400    25-MAY-08       /u02/oracle/ora1/em/users01.dbf&lt;br /&gt;23      5    A 25-MAY-08       2754400    25-MAY-08       /u02/oracle/ora1/em/example01.dbf&lt;br /&gt;24      6    A 25-MAY-08       2754400    25-MAY-08       /u02/oracle/ora1/em/undotbs02.dbf&lt;br /&gt;25      7    A 25-MAY-08       2754400    25-MAY-08       /u02/oracle/ora2/em/mgmt.dbf&lt;br /&gt;26      8    A 25-MAY-08       2754400    25-MAY-08       /u02/oracle/ora1/em/mgmt_ecm_depot1.dbf&lt;br /&gt;&lt;br /&gt;Do you really want to delete the above objects (enter YES or NO)? YES&lt;br /&gt;deleted datafile copy&lt;br /&gt;datafile copy filename=/u02/oracle/ora1/em/system01.dbf recid=19 stamp=655668498&lt;br /&gt;deleted datafile copy&lt;br /&gt;datafile copy filename=/u02/oracle/ora1/em/undotbs01.dbf recid=20 stamp=655668498&lt;br /&gt;deleted datafile copy&lt;br /&gt;datafile copy filename=/u02/oracle/ora1/em/sysaux01.dbf recid=21 stamp=655668498&lt;br /&gt;deleted datafile copy&lt;br /&gt;datafile copy filename=/u02/oracle/ora1/em/users01.dbf recid=22 stamp=655668498&lt;br /&gt;deleted datafile copy&lt;br /&gt;datafile copy filename=/u02/oracle/ora1/em/example01.dbf recid=23 stamp=655668498&lt;br /&gt;deleted datafile copy&lt;br /&gt;datafile copy filename=/u02/oracle/ora1/em/undotbs02.dbf recid=24 stamp=655668498&lt;br /&gt;deleted datafile copy&lt;br /&gt;datafile copy filename=/u02/oracle/ora2/em/mgmt.dbf recid=25 stamp=655668498&lt;br /&gt;deleted datafile copy&lt;br /&gt;datafile copy filename=/u02/oracle/ora1/em/mgmt_ecm_depot1.dbf recid=26 stamp=655668498&lt;br /&gt;Deleted 8 objects&lt;/pre&gt;&lt;br /&gt;Migrate the Archive Log Destinations to ASM:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter system set log_archive_dest_1='LOCATION=+BACKUPS' scope=BOTH sid='*';&lt;br /&gt;&lt;br /&gt;System altered.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter system archive log start;&lt;br /&gt;&lt;br /&gt;System altered.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter system archive log current;&lt;br /&gt;&lt;br /&gt;System altered.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; archive log list&lt;br /&gt;Database log mode              Archive Mode&lt;br /&gt;Automatic archival             Enabled&lt;br /&gt;Archive destination            +BACKUPS&lt;br /&gt;Oldest online log sequence     342&lt;br /&gt;Next log sequence to archive   344&lt;br /&gt;Current log sequence           344&lt;/pre&gt;&lt;br /&gt;At this point, you should be able to query an ASM instance and find archivelogs in the BACKUPS diskgroup:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; select count(*) from v$asm_file where type='ARCHIVELOG' and group_number = (select group_number from v$asm_diskgroup where name='BACKUPS');&lt;br /&gt;&lt;br /&gt;  COUNT(*)&lt;br /&gt;----------&lt;br /&gt;         4&lt;/pre&gt;&lt;br /&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-3770978250082805223?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/3770978250082805223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=3770978250082805223' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/3770978250082805223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/3770978250082805223'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/05/how-to-migrate-existing-rac-database-to.html' title='How to Migrate an Existing RAC database to ASM'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-7085099412217013708</id><published>2008-05-24T15:33:00.001-07:00</published><updated>2008-10-15T21:52:25.649-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Backup and Recovery'/><category scheme='http://www.blogger.com/atom/ns#' term='RAC'/><title type='text'>How to Backup and Restore a RAC Database</title><content type='html'>This example illustrates how to backup and recover a 2-node, 10gR2 RAC cluster on Linux. Backup and recovery operations for RAC databases are similar to that of single instance databases, however there are some key differences - the goal of this post is to highlight the steps required for recoverying RAC databases.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Backup the Database&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Use the method you prefer. I used a NOCATALOG, disk-based backup for this example, using the scripts found &lt;a href="http://www.colestock.com/blogs/2008/05/basic-oracle-maintenance-jobs.html" target="_blank"&gt;here&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Simulate the Failure&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Shutdown the database and simulate a failure by dropping and/or corrupting a datafile.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# export ORACLE_SID=em1&lt;br /&gt;# . oraenv&lt;br /&gt;# srvctl stop database -d em&lt;br /&gt;# srvctl status database -d em&lt;br /&gt;Instance em1 is not running on node rac1&lt;br /&gt;Instance em2 is not running on node rac2&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# cd /u02/oracle/ora1/em&lt;br /&gt;# rm sysaux01.dbf&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Verify the Failure&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# srvctl start instance -d em -i em1&lt;br /&gt;PRKP-1001 : Error starting instance em1 on node rac1&lt;br /&gt;CRS-0215: Could not start resource 'ora.em.em1.inst'.&lt;/pre&gt;&lt;br /&gt;You will find something similar to the following in the instance's alert log:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Sat May 24 16:53:47 2008&lt;br /&gt;Errors in file /u02/oracle/logs/em/bdump/em1_dbw0_16947.trc:&lt;br /&gt;ORA-01157: cannot identify/lock data file 3 - see DBWR trace file&lt;br /&gt;ORA-01110: data file 3: '/u02/oracle/ora1/em/sysaux01.dbf'&lt;br /&gt;ORA-27037: unable to obtain file status&lt;br /&gt;Linux Error: 2: No such file or directory&lt;br /&gt;Additional information: 3&lt;br /&gt;ORA-1157 signalled during: ALTER DATABASE OPEN...&lt;br /&gt;Sat May 24 16:53:49 2008&lt;br /&gt;Shutting down instance (abort)&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Restore the Database&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;First, take the database out of cluster mode via:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# sqlplus "/ as sysdba"&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.2.0.3.0 - Production on Sat May 24 17:02:17 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.&lt;br /&gt;&lt;br /&gt;Connected to an idle instance.&lt;br /&gt;&lt;br /&gt;SQL&gt; startup nomount;&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area  268435456 bytes&lt;br /&gt;Fixed Size                  1261300 bytes&lt;br /&gt;Variable Size             251658508 bytes&lt;br /&gt;Database Buffers            8388608 bytes&lt;br /&gt;Redo Buffers                7127040 bytes&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter system set cluster_database=false scope=spfile sid='*';&lt;br /&gt;&lt;br /&gt;System altered.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; shutdown immediate;&lt;br /&gt;ORA-01507: database not mounted&lt;br /&gt;ORACLE instance shut down.&lt;/pre&gt;&lt;br /&gt;Then restore the database via RMAN:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# rman target=/&lt;br /&gt;&lt;br /&gt;Recovery Manager: Release 10.2.0.3.0 - Production on Sat May 24 17:04:10 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;connected to target database (not started)&lt;br /&gt;&lt;br /&gt;RMAN&gt; startup mount;&lt;br /&gt;&lt;br /&gt;Oracle instance started&lt;br /&gt;database mounted&lt;br /&gt;&lt;br /&gt;Total System Global Area     268435456 bytes&lt;br /&gt;&lt;br /&gt;Fixed Size                     1261300 bytes&lt;br /&gt;Variable Size                251658508 bytes&lt;br /&gt;Database Buffers               8388608 bytes&lt;br /&gt;Redo Buffers                   7127040 bytes&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;RMAN&gt; restore database;&lt;br /&gt;&lt;br /&gt;Starting restore at 24-MAY-08&lt;br /&gt;using target database control file instead of recovery catalog&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=154 devtype=DISK&lt;br /&gt;&lt;br /&gt;channel ORA_DISK_1: starting datafile backupset restore&lt;br /&gt;channel ORA_DISK_1: specifying datafile(s) to restore from backup set&lt;br /&gt;restoring datafile 00001 to /u02/oracle/ora1/em/system01.dbf&lt;br /&gt;restoring datafile 00002 to /u02/oracle/ora1/em/undotbs01.dbf&lt;br /&gt;restoring datafile 00003 to /u02/oracle/ora1/em/sysaux01.dbf&lt;br /&gt;restoring datafile 00004 to /u02/oracle/ora1/em/users01.dbf&lt;br /&gt;restoring datafile 00005 to /u02/oracle/ora1/em/example01.dbf&lt;br /&gt;restoring datafile 00006 to /u02/oracle/ora1/em/undotbs02.dbf&lt;br /&gt;restoring datafile 00007 to /u02/oracle/ora2/em/mgmt.dbf&lt;br /&gt;restoring datafile 00008 to /u02/oracle/ora1/em/mgmt_ecm_depot1.dbf&lt;br /&gt;channel ORA_DISK_1: reading from backup piece /u02/oracle/ora3/em/backups/0ijh6j4t_1_1&lt;br /&gt;channel ORA_DISK_1: restored backup piece 1&lt;br /&gt;piece handle=/u02/oracle/ora3/em/backups/0ijh6j4t_1_1 tag=FHB_EM1200805241630&lt;br /&gt;channel ORA_DISK_1: restore complete, elapsed time: 00:06:36&lt;br /&gt;Finished restore at 24-MAY-08&lt;/pre&gt;&lt;br /&gt;Since my database is so small, I will simply restore the entire thing, however, since you know which datafile is missing, you could simply restore it and then recover the database as necessary.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Recover the Database&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;RMAN&gt; recover database;&lt;br /&gt;&lt;br /&gt;Starting recover at 24-MAY-08&lt;br /&gt;using channel ORA_DISK_1&lt;br /&gt;&lt;br /&gt;starting media recovery&lt;br /&gt;media recovery complete, elapsed time: 00:00:03&lt;br /&gt;&lt;br /&gt;Finished recover at 24-MAY-08&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;RMAN&gt; alter database open;&lt;br /&gt;&lt;br /&gt;database opened&lt;br /&gt;RMAN-06900: WARNING: unable to generate V$RMAN_STATUS or V$RMAN_OUTPUT row&lt;br /&gt;RMAN-06901: WARNING: disabling update of the V$RMAN_STATUS and V$RMAN_OUTPUT rows&lt;br /&gt;ORACLE error from target database:&lt;br /&gt;ORA-06502: PL/SQL: numeric or value error: character to number conversion error&lt;/pre&gt;&lt;br /&gt;Afterwards, place the database back into cluster mode and startup both instances:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# sqlplus "/ as sysdba"&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.2.0.3.0 - Production on Sat May 24 17:16:36 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production&lt;br /&gt;With the Partitioning, Real Application Clusters, OLAP and Data Mining options&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; alter system set cluster_database=true scope=spfile sid='*';&lt;br /&gt;&lt;br /&gt;System altered.&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;SQL&gt; shutdown immediate;&lt;br /&gt;Database closed.&lt;br /&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# srvctl start database -d em&lt;br /&gt;[oracle@rac1 bdump]$ srvctl status database -d em&lt;br /&gt;Instance em1 is running on node rac1&lt;br /&gt;Instance em2 is running on node rac2&lt;/pre&gt;&lt;br /&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-7085099412217013708?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/7085099412217013708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=7085099412217013708' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/7085099412217013708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/7085099412217013708'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/05/how-to-backup-and-restore-rac-database.html' title='How to Backup and Restore a RAC Database'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-3469050592997918077</id><published>2008-05-22T15:22:00.000-07:00</published><updated>2008-05-23T16:22:53.590-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DB2'/><category scheme='http://www.blogger.com/atom/ns#' term='Installation'/><title type='text'>Installing DB2 V9.5 on Linux</title><content type='html'>Get the Software Here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ibm.com/developerworks/downloads/im/udb/?S_TACT=105AGX28&amp;amp;S_CMP=TRIALS" target="_blank"&gt;DB2 9 Trial Download&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Reference the Following Documentation:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp" target="_blank"&gt;Information Center DB2 9.5 Documentation&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Unpack the Software and Satisfy any Prerequisites&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;export DISPLAY=192.168.1.3:0.0&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;# gunzip db2_v95_linuxia32_server.tar.gz&lt;br /&gt;# tar -xvf db2_v95_linuxia32_server.tar&lt;/pre&gt;&lt;br /&gt;Note that these are the recommended kernel values&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;kernel.shmmax=268435456 for 32-bit; 1073741824 for 64-bit&lt;br /&gt;kernel.msgmni=1024&lt;br /&gt;fs.file-max=8192&lt;br /&gt;kernel.sem=”250 32000 32 1024”&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Install Database Engine&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# ./server/db2_install -f NOTSAMP&lt;br /&gt;&lt;br /&gt;Default directory for installation of products - /opt/ibm/db2/V9.5&lt;br /&gt;&lt;br /&gt;***********************************************************&lt;br /&gt;Do you want to choose a different directory to install [yes/no] ?&lt;br /&gt;no&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Specify one of the following keywords to install DB2 products.&lt;br /&gt;&lt;br /&gt;  ESE&lt;br /&gt;  CONSV&lt;br /&gt;  WSE&lt;br /&gt;  EXP&lt;br /&gt;  PE&lt;br /&gt;  CLIENT&lt;br /&gt;  RTCL&lt;br /&gt;&lt;br /&gt;Enter "help" to redisplay product names.&lt;br /&gt;&lt;br /&gt;Enter "quit" to exit.&lt;br /&gt;&lt;br /&gt;***********************************************************&lt;br /&gt;ESE&lt;br /&gt;DB2 installation is being initialized.&lt;br /&gt;&lt;br /&gt;Total number of tasks to be performed: 41&lt;br /&gt;Total estimated time for all tasks to be performed: 1461&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;The execution completed successfully.&lt;br /&gt;&lt;br /&gt;For more information see the DB2 installation log at&lt;br /&gt;"/tmp/db2_install.log.6602".&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Perform Post-Installation Tasks&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Add O/S User and Groups&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# groupadd -g 999 db2iadm1&lt;br /&gt;# groupadd -g 998 db2fadm1&lt;br /&gt;# groupadd -g 997 dasadm1&lt;br /&gt;# useradd -u 1004 -g db2iadm1 -m -d /home/db2inst1 db2inst1&lt;br /&gt;# useradd -u 1003 -g db2fadm1 -m -d /home/db2fenc1 db2fenc1&lt;br /&gt;# useradd -u 1002 -g dasadm1 -m -d /home/dasusr1 dasusr1&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Set the Passwords&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# passwd db2inst1&lt;br /&gt;# passwd db2fenc1&lt;br /&gt;# passwd dasusr1&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Create the DAS Instance&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;# cd /opt/ibm/db2/V9.5/instance/&lt;br /&gt;# ./dascrt -u dasusr1&lt;br /&gt;SQL4406W  The DB2 Administration Server was started successfully.&lt;br /&gt;DBI1070I  Program dascrt completed successfully.&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Create a DB2 Instance&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# cd /opt/ibm/db2/V9.5/instance&lt;br /&gt;# ./db2icrt -a server -u db2fenc1 db2inst1&lt;br /&gt;DBI1070I  Program db2icrt completed successfully.&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Create Symbolic Links to DB2 Binaries&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# cd /opt/ibm/db2/V9.5/cfg&lt;br /&gt;# ./db2ln&lt;br /&gt;# ls -lart /usr/lib/*db2* | wc -l&lt;br /&gt;6&lt;br /&gt;# ls -lart /usr/include/*db2* | wc -l&lt;br /&gt;8&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Setup Communications&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Verify Service File Entry&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# grep db2c_db2inst1 /etc/services&lt;br /&gt;db2c_db2inst1   50000/tcp&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Update the Service Name&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# su - db2inst1&lt;br /&gt;# . $HOME/sqllib/db2profile&lt;br /&gt;# db2&lt;br /&gt;db2 =&gt; update dbm cfg using svcename db2c_db2inst1;&lt;br /&gt;DB20000I  The UPDATE DATABASE MANAGER CONFIGURATION command completed&lt;br /&gt;successfully.&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# db2stop&lt;br /&gt;05/23/2008 14:03:33     0   0   SQL1032N  No start database manager command was issued.&lt;br /&gt;SQL1032N  No start database manager command was issued.  SQLSTATE=57019&lt;br /&gt;&lt;br /&gt;# db2start&lt;br /&gt;05/23/2008 14:03:46     0   0   SQL1063N  DB2START processing was successful.&lt;br /&gt;SQL1063N  DB2START processing was successful.&lt;br /&gt;# db2 get database manager configuration | grep "TCP/IP Service name"&lt;br /&gt; TCP/IP Service name                          (SVCENAME) = db2c_db2inst1;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# db2set DB2COMM=tcpip&lt;br /&gt;# db2stop&lt;br /&gt;05/23/2008 14:50:03     0   0   SQL1064N  DB2STOP processing was successful.&lt;br /&gt;SQL1064N  DB2STOP processing was successful.&lt;br /&gt;# db2start&lt;br /&gt;05/23/2008 14:50:14     0   0   SQL1063N  DB2START processing was successful.&lt;br /&gt;SQL1063N  DB2START processing was successful.&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Enable SSL Support&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# export DISPLAY=192.168.1.3:0.0&lt;br /&gt;# export JAVA_HOME=$HOME/sqllib/java/jdk32&lt;br /&gt;# export PATH=$PATH:/usr/local/ibm/gsk7/bin&lt;br /&gt;# gsk7ikm&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Create the Key Store Database as well as a Self-signed Certificate&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/db2/db2-1.gif" target="_blank" name="DB2-1"&gt;&lt;img src="http://www.colestock.com/img/db2/db2-1.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/db2/db2-2.gif" target="_blank" name="DB2-2"&gt;&lt;img src="http://www.colestock.com/img/db2/db2-2.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/db2/db2-3.gif" target="_blank" name="DB2-3"&gt;&lt;img src="http://www.colestock.com/img/db2/db2-3.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/db2/db2-4.gif" target="_blank" name="DB2-4"&gt;&lt;img src="http://www.colestock.com/img/db2/db2-4.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/db2/db2-5.gif" target="_blank" name="DB2-5"&gt;&lt;img src="http://www.colestock.com/img/db2/db2-5.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/db2/db2-6.gif" target="_blank" name="DB2-6"&gt;&lt;img src="http://www.colestock.com/img/db2/db2-6.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/img/db2/db2-7.gif" target="_blank" name="DB2-7"&gt;&lt;img src="http://www.colestock.com/img/db2/db2-7.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Create the SSLconfig.ini File and Populate with Correct Values&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# touch $HOME/sqllib/cfg/SSLconfig.ini&lt;br /&gt;# vi $HOME/sqllib/cfg/SSLconfig.ini&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SSLconfig.ini&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;DB2_SSL_KEYSTORE_FILE=/home/db2inst1/GSKit/Keystore/key.kdb&lt;br /&gt;DB2_SSL_KEYSTORE_PW=password&lt;br /&gt;DB2_SSL_LISTENER=40000&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# db2set DB2COMM=SSL,TCPIP&lt;br /&gt;# db2stop&lt;br /&gt;05/23/2008 15:50:13     0   0   SQL1064N  DB2STOP processing was successful.&lt;br /&gt;SQL1064N  DB2STOP processing was successful.&lt;br /&gt;# db2start&lt;br /&gt;05/23/2008 15:50:20     0   0   SQL1063N  DB2START processing was successful.&lt;br /&gt;SQL1063N  DB2START processing was successful.&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Create the Tools Catalog for Task Center/Control Center &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# db2 create database TOOLSDB AUTOMATIC STORAGE YES ON /u01/app/ibm/data&lt;br /&gt;DB20000I  The CREATE DATABASE command completed successfully.&lt;br /&gt;# db2 create tools catalog toolscat use existing database toolsdb force&lt;br /&gt;DB20000I  The CREATE TOOLS CATALOG command completed successfully.&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Update the DAS Configuration, Verifying Values&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# db2 update admin configuration using smtp_server localhost&lt;br /&gt;DB20000I  The UPDATE ADMIN CONFIGURATION command completed successfully.&lt;br /&gt;# db2 update admin configuration using dasadm_group dasadm1&lt;br /&gt;DB20000I  The UPDATE ADMIN CONFIGURATION command completed successfully.&lt;br /&gt;# db2 get admin configuration&lt;br /&gt;&lt;br /&gt;            Admin Server Configuration&lt;br /&gt;&lt;br /&gt; Authentication Type DAS                (AUTHENTICATION) = SERVER_ENCRYPT&lt;br /&gt;&lt;br /&gt; DAS Administration Authority Group Name  (DASADM_GROUP) = dasadm1&lt;br /&gt;&lt;br /&gt; DAS Discovery Mode                           (DISCOVER) = SEARCH&lt;br /&gt; Name of the DB2 Server System               (DB2SYSTEM) = RAC1&lt;br /&gt;&lt;br /&gt; Java Development Kit Installation Path DAS   (JDK_PATH) = AUTOMATIC (/home/db2inst1/sqllib/java/jdk32)&lt;br /&gt; Java Development Kit Installation Path DAS   (JDK_64_PATH) = AUTOMATIC (/home/db2inst1/sqllib/java/jdk32)&lt;br /&gt;&lt;br /&gt; DAS Code Page                            (DAS_CODEPAGE) = 0&lt;br /&gt; DAS Territory                           (DAS_TERRITORY) = 0&lt;br /&gt;&lt;br /&gt; Location of Contact List                 (CONTACT_HOST) =&lt;br /&gt; Execute Expired Tasks                   (EXEC_EXP_TASK) = NO&lt;br /&gt; Scheduler Mode                           (SCHED_ENABLE) = ON&lt;br /&gt; SMTP Server                               (SMTP_SERVER) = localhost&lt;br /&gt; Tools Catalog Database                    (TOOLSCAT_DB) = TOOLSDB&lt;br /&gt; Tools Catalog Database Instance         (TOOLSCAT_INST) = db2inst1&lt;br /&gt; Tools Catalog Database Schema         (TOOLSCAT_SCHEMA) = TOOLSCAT&lt;br /&gt; Scheduler User ID                                       =&lt;br /&gt;&lt;br /&gt; Diagnostic error capture level              (DIAGLEVEL) = 2&lt;/pre&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-3469050592997918077?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/3469050592997918077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=3469050592997918077' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/3469050592997918077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/3469050592997918077'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/05/installing-db2-v95-on-linux.html' title='Installing DB2 V9.5 on Linux'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-171968659774887763</id><published>2008-05-20T13:36:00.001-07:00</published><updated>2008-05-20T14:00:38.156-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Statistics'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server Statistics Maintenance Job</title><content type='html'>I use the following job to augment SQL Server's auto statistics create/update functionality: &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;a href="http://www.colestock.com/tech/sql/create_update_statistics.sql" target="_blank"&gt;create_update_statistics.sql&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;sp_MSforeachdb @command1='&lt;br /&gt;USE ?;&lt;br /&gt;IF NOT ("?" IN ("model","msdb","master","tempdb")) &lt;br /&gt;BEGIN&lt;br /&gt;   EXEC sp_createstats;&lt;br /&gt;   DECLARE @tbls TABLE (rowId INT IDENTITY(1,1), tblschema NVARCHAR(128), tblname NVARCHAR(128));&lt;br /&gt;   DECLARE @stmt NVARCHAR(2000), @rowId INT, @maxRowId INT, @tblschema NVARCHAR(128), @tblname NVARCHAR(128);&lt;br /&gt;   INSERT INTO @tbls (tblschema, tblname) &lt;br /&gt;   SELECT table_schema, table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_type="BASE TABLE";&lt;br /&gt;   SELECT @rowId = MIN(rowId), @maxRowId = MAX(rowId) FROM @tbls;&lt;br /&gt;   WHILE  @rowId &lt;= @maxRowId &lt;br /&gt;      BEGIN&lt;br /&gt;         SELECT @tblschema = tblschema, @tblname = tblname FROM @tbls WHERE rowId = @rowId;&lt;br /&gt;         SET @stmt = "UPDATE STATISTICS " + "[" + @tblschema + "].[" + @tblname + "];"; &lt;br /&gt;         PRINT "?: " + @stmt;&lt;br /&gt;         EXECUTE (@stmt);&lt;br /&gt;         SET @rowId = @rowId + 1;&lt;br /&gt;      END&lt;br /&gt;END&lt;br /&gt;';&lt;/pre&gt;&lt;br /&gt;You can adjust this to fit your needs and implement as part of your Maintenance Plans and/or run from a batch file, such as:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;a href="http://www.colestock.com/tech/sql/create_update_statistics.bat" target="_blank"&gt;create_update_statistics.bat&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;sqlcmd -S PRIVATE-E3A52F5\SS1 -E -i create_update_statistics.sql -o create_update_statistics.out&lt;br /&gt;notepad.exe create_update_statistics.out&lt;/pre&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-171968659774887763?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/171968659774887763/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=171968659774887763' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/171968659774887763'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/171968659774887763'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/05/sql-server-statistics-maintenance-job.html' title='SQL Server Statistics Maintenance Job'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-5740597585499505613</id><published>2008-05-19T13:12:00.000-07:00</published><updated>2008-05-19T13:59:56.867-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Backup and Recovery'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Backup and Recovery of SQL Server System Databases</title><content type='html'>This posting covers how to backup and restore SQL Servers' system databases - &lt;span style="font-family: courier new;"&gt;master, msdb, model&lt;/span&gt;, etc. &lt;br /&gt;&lt;br /&gt;In this example, I backup SQL Server's databases and then replicate a loss/corruption - and subsequent restoration - of the &lt;span style="font-family: courier new;"&gt;master&lt;/span&gt; database's underlying datafiles. &lt;br /&gt;&lt;br /&gt;In SQL Server 2000, the &lt;span style="font-family: courier new;"&gt;rebuildm.exe&lt;/span&gt; executable was available to help you rebuild the &lt;span style="font-family: courier new;"&gt;master&lt;/span&gt; database so that you could start the SQL Server and then, in turn, restore the &lt;span style="font-family: courier new;"&gt;master&lt;/span&gt; (and related system databases) database from an available backup. &lt;br /&gt;&lt;br /&gt;In SQL Server 2005, the &lt;span style="font-family: courier new;"&gt;rebuildm.exe&lt;/span&gt; executable is not available, rather the approved procedure is to call the &lt;span style="font-family: courier new;"&gt;setup.exe&lt;/span&gt; of the installation binaries, passing the appropriate parameters/switches, etc. in order to rebuild the &lt;span style="font-family: courier new;"&gt;master&lt;/span&gt; database. Afterwards, you could startup the database engine and then restore the system databases from backups. Unfortunately, this process is riddled with bugs, particularly post application of SP2. &lt;br /&gt;&lt;br /&gt;Given the aforementioned, my preferred approach is to retain offline copies of the system databases' underlying datafiles. In the event of a loss/corruption of the master database, I simply restore these old datafile copies to the default location. This allows me to startup the database engine and restore the system databases from backups, avoiding the above flawed mechanisms. Such datafile backups should be taken at key times, such as post-upgrade, etc.&lt;br /&gt;&lt;br /&gt;All the scripts used in this example are available in the following .zip file:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/tech/bckp_restore_sys_dbs_sql2005.zip" target="_blank"&gt;bckp_restore_sys_dbs_sql2005.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;My example uses SQL Server 2005 - my instance is named &lt;span style="font-family: courier new;"&gt;PRIVATE-E3A52F5\SS1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 1 - backup_master_files.bat&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I first take an offline file backup of the master database's datafiles:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;net stop "SQL Server Agent (SS1)"&lt;br /&gt;net stop "SQL Server (SS1)"&lt;br /&gt;copy /Y "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\master.mdf" "C:\backups\master.mdf"&lt;br /&gt;copy /Y "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\mastlog.ldf" "C:\backups\mastlog.ldf"&lt;br /&gt;net start "SQL Server (SS1)"&lt;br /&gt;net start "SQL Server Agent (SS1)"&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Step 2 - backup_databases.bat&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Next, I backup all the SQL Server's databases via a batch file:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;sqlcmd -S PRIVATE-E3A52F5\SS1 -E -i "C:\Documents and Settings\James\Desktop\backup_all_databases.sql" -o "C:\Documents and Settings\James\Desktop\backup_all_databases.out"&lt;/pre&gt;&lt;br /&gt;This batch file calls the following SQL script:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;backup_all_databases.sql&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;--Use the foreach stored procedure  &lt;br /&gt;--To backup each database to disk - except - tempdb&lt;br /&gt;--Create necessary sub-directories and validate each backup&lt;br /&gt;EXEC master.sys.sp_MSforeachdb @command1='&lt;br /&gt;BEGIN&lt;br /&gt;DECLARE @bkpfile NVARCHAR(1000), @bkploc NVARCHAR(500), @bkpname NVARCHAR(500);&lt;br /&gt;DECLARE @backupsetid INT;&lt;br /&gt;SET @bkploc  = ''C:\backups\?\'';&lt;br /&gt;PRINT @bkploc;&lt;br /&gt;SET @bkpname = @bkploc +  ''?_backup_''+ cast(datepart(yyyy, getdate()) as nvarchar) + cast(datepart(mm,getdate()) as nvarchar) +  cast(datepart(dd, getdate()) as nvarchar) +  cast(datepart(hh, getdate()) as nvarchar) + cast(datepart(mi, getdate()) as nvarchar);&lt;br /&gt;PRINT @bkpname;&lt;br /&gt;SET @bkpfile = @bkpname + ''.BAK'';&lt;br /&gt;  IF NOT (''?'' = ''tempdb'')&lt;br /&gt;  BEGIN&lt;br /&gt;     BEGIN &lt;br /&gt;        EXECUTE master.dbo.xp_create_subdir @bkploc;&lt;br /&gt;     END;&lt;br /&gt;     &lt;br /&gt;     BEGIN&lt;br /&gt;        BACKUP DATABASE ? TO DISK = @bkpfile WITH NOFORMAT, NOINIT,  NAME = @bkpname, SKIP, REWIND, NOUNLOAD;&lt;br /&gt;     END;&lt;br /&gt;   &lt;br /&gt;     BEGIN&lt;br /&gt;       SELECT @backupsetid = position FROM msdb.dbo.backupset WHERE database_name=''?'' AND backup_set_id=(SELECT MAX(backup_set_id) FROM msdb.dbo.backupset WHERE database_name=''?'' );&lt;br /&gt;       RESTORE VERIFYONLY FROM  DISK = @bkpfile WITH  FILE = @backupsetid,  NOUNLOAD,  NOREWIND&lt;br /&gt;     END;&lt;br /&gt;&lt;br /&gt;  END;&lt;br /&gt;END';&lt;br /&gt;GO&lt;/pre&gt;&lt;br /&gt;Yielding the following output:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;C:\backups\master\&lt;br /&gt;C:\backups\master\master_backup_20085181746&lt;br /&gt;Processed 352 pages for database 'master', file 'master' on file 1.&lt;br /&gt;Processed 2 pages for database 'master', file 'mastlog' on file 1.&lt;br /&gt;BACKUP DATABASE successfully processed 354 pages in 0.517 seconds (5.599 MB/sec).&lt;br /&gt;The backup set on file 1 is valid.&lt;br /&gt;C:\backups\tempdb\&lt;br /&gt;C:\backups\tempdb\tempdb_backup_20085181746&lt;br /&gt;C:\backups\model\&lt;br /&gt;C:\backups\model\model_backup_20085181746&lt;br /&gt;Processed 152 pages for database 'model', file 'modeldev' on file 1.&lt;br /&gt;Processed 2 pages for database 'model', file 'modellog' on file 1.&lt;br /&gt;BACKUP DATABASE successfully processed 154 pages in 0.285 seconds (4.426 MB/sec).&lt;br /&gt;The backup set on file 1 is valid.&lt;br /&gt;C:\backups\msdb\&lt;br /&gt;C:\backups\msdb\msdb_backup_20085181746&lt;br /&gt;Processed 600 pages for database 'msdb', file 'MSDBData' on file 1.&lt;br /&gt;Processed 6 pages for database 'msdb', file 'MSDBLog' on file 1.&lt;br /&gt;BACKUP DATABASE successfully processed 606 pages in 0.763 seconds (6.500 MB/sec).&lt;br /&gt;The backup set on file 1 is valid.&lt;br /&gt;C:\backups\ReportServer$SS1\&lt;br /&gt;C:\backups\ReportServer$SS1\ReportServer$SS1_backup_20085181746&lt;br /&gt;Processed 288 pages for database 'ReportServer$SS1', file 'ReportServer$SS1' on file 1.&lt;br /&gt;Processed 1 pages for database 'ReportServer$SS1', file 'ReportServer$SS1_log' on file 1.&lt;br /&gt;BACKUP DATABASE successfully processed 289 pages in 0.496 seconds (4.773 MB/sec).&lt;br /&gt;The backup set on file 1 is valid.&lt;br /&gt;C:\backups\ReportServer$SS1TempDB\&lt;br /&gt;C:\backups\ReportServer$SS1TempDB\ReportServer$SS1TempDB_backup_20085181746&lt;br /&gt;Processed 176 pages for database 'ReportServer$SS1TempDB', file 'ReportServer$SS1TempDB' on file 1.&lt;br /&gt;Processed 1 pages for database 'ReportServer$SS1TempDB', file 'ReportServer$SS1TempDB_log' on file 1.&lt;br /&gt;BACKUP DATABASE successfully processed 177 pages in 0.357 seconds (4.061 MB/sec).&lt;br /&gt;The backup set on file 1 is valid.&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Step 3 - destroy_master.bat&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;When ready to perform the test, I call this batch file to simulate a destruction/corruption of the &lt;span style="font-family: courier new;"&gt;master&lt;/span&gt; database. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;net stop "SQL Server Agent (SS1)"&lt;br /&gt;net stop "SQL Server (SS1)"&lt;br /&gt;del "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\master.mdf"&lt;br /&gt;del "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\mastlog.ldf"&lt;/pre&gt;&lt;br /&gt;At this point, attempts to start the database engine, would yield something similar to the following with the ERRORLOG:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;2008-05-18 13:09:26.73 Server      Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) &lt;br /&gt; Oct 14 2005 00:33:37 &lt;br /&gt; Copyright (c) 1988-2005 Microsoft Corporation&lt;br /&gt; Standard Edition on Windows NT 5.1 (Build 2600: Service Pack 2)&lt;br /&gt;&lt;br /&gt;2008-05-18 13:09:26.73 Server      (c) 2005 Microsoft Corporation.&lt;br /&gt;2008-05-18 13:09:26.73 Server      All rights reserved.&lt;br /&gt;2008-05-18 13:09:26.73 Server      Server process ID is 3360.&lt;br /&gt;2008-05-18 13:09:26.73 Server      Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'.&lt;br /&gt;2008-05-18 13:09:26.74 Server      This instance of SQL Server last reported using a process ID of 456 at 5/18/2008 1:08:35 PM (local) 5/18/2008 7:08:35 PM (UTC). This is an informational message only; no user action is required.&lt;br /&gt;2008-05-18 13:09:26.74 Server      Registry startup parameters:&lt;br /&gt;2008-05-18 13:09:26.74 Server        -d C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf&lt;br /&gt;2008-05-18 13:09:26.74 Server        -e C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG&lt;br /&gt;2008-05-18 13:09:26.74 Server        -l C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf&lt;br /&gt;2008-05-18 13:09:26.74 Server      Error: 17113, Severity: 16, State: 1.&lt;br /&gt;2008-05-18 13:09:26.74 Server      Error 2(The system cannot find the file specified.) occurred while opening file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf' to obtain configuration information at startup. An invalid startup option might have caused the error. Verify your startup options, and correct or remove them if necessary.&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;Step 4 - recover_master.bat&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Next, a batch file is called to perform the recovery:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;net stop  "SQL Server Agent (SS1)"&lt;br /&gt;net stop  "SQL Server (SS1)"&lt;br /&gt;net stop  "SQL Server Analysis Services (SS1)"&lt;br /&gt;net stop  "SQL Server FullText Search (SS1)"&lt;br /&gt;net stop  "SQL Server Integration Services"&lt;br /&gt;net stop  "SQL Server Reporting Services (SS1)"&lt;br /&gt;copy /Y "C:\backups\master.mdf"  "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\master.mdf" &lt;br /&gt;copy /Y "C:\backups\mastlog.ldf" "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\mastlog.ldf"&lt;br /&gt;net start "SQL Server (SS1)" /m&lt;br /&gt;sqlcmd -S PRIVATE-E3A52F5\SS1 -E -i "restore_master.sql" -o "restore_master.out"&lt;br /&gt;net start "SQL Server (SS1)"&lt;br /&gt;sqlcmd -S PRIVATE-E3A52F5\SS1 -E -i "restore_databases.sql" -o "restore_databases.out"&lt;br /&gt;net start "SQL Server Agent (SS1)"&lt;br /&gt;net start  "SQL Server Analysis Services (SS1)"&lt;br /&gt;net start  "SQL Server FullText Search (SS1)"&lt;br /&gt;net start "SQL Server Integration Services"&lt;br /&gt;net start  "SQL Server Reporting Services (SS1)"&lt;/pre&gt;&lt;br /&gt;The batch file first restores the offline backups of the &lt;span style="font-family: courier new;"&gt;master&lt;/span&gt; database's datafiles and then performs a recovery of that database via:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;restore_master.sql&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;RESTORE DATABASE [master] from DISK = 'C:\backups\master\master_backup_20085181746.BAK' WITH REPLACE ;&lt;br /&gt;GO&lt;/pre&gt;&lt;br /&gt;Yielding the following output:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Processed 352 pages for database 'master', file 'master' on file 1.&lt;br /&gt;Processed 2 pages for database 'master', file 'mastlog' on file 1.&lt;br /&gt;The master database has been successfully restored. Shutting down SQL Server.&lt;br /&gt;SQL Server is terminating this process.&lt;/pre&gt;&lt;br /&gt;Next, the batch file restores the other system databases via:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;restore_databases.sql&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;RESTORE DATABASE [msdb] from DISK = 'C:\backups\msdb\msdb_backup_20085181746.BAK' WITH REPLACE  ;&lt;br /&gt;GO&lt;br /&gt;RESTORE DATABASE [model] from DISK = 'C:\backups\model\model_backup_20085181746.BAK' WITH REPLACE ;&lt;br /&gt;GO&lt;/pre&gt;&lt;br /&gt;Yielding the following output:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Processed 600 pages for database 'msdb', file 'MSDBData' on file 1.&lt;br /&gt;Processed 6 pages for database 'msdb', file 'MSDBLog' on file 1.&lt;br /&gt;RESTORE DATABASE successfully processed 606 pages in 0.531 seconds (9.341 MB/sec).&lt;br /&gt;Processed 152 pages for database 'model', file 'modeldev' on file 1.&lt;br /&gt;Processed 2 pages for database 'model', file 'modellog' on file 1.&lt;br /&gt;RESTORE DATABASE successfully processed 154 pages in 0.127 seconds (9.933 MB/sec).&lt;/pre&gt;&lt;br /&gt;At this point, your SQL Server Instance should be ready for use.  &lt;br /&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-5740597585499505613?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/5740597585499505613/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=5740597585499505613' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/5740597585499505613'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/5740597585499505613'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/05/backup-and-recovery-of-sql-server.html' title='Backup and Recovery of SQL Server System Databases'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-7981856869244044741</id><published>2008-05-17T13:08:00.000-07:00</published><updated>2008-05-17T14:36:16.927-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maintenance'/><title type='text'>Basic Oracle Maintenance Jobs</title><content type='html'>There are many processes that need to be in place in order to maintain Oracle databases' environments. &lt;br /&gt;&lt;br /&gt;There are, also, many 3rd-party tools that are available to assist the DBA as well as many differing methods in which to approach performing these tasks; however, traditionally, shell scripts called from an O/S scheduler - such as cron - have been used to perform - at a bare minimum - the following tasks:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Rotate Listener Log&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Rotate Alert Log&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Romove Old Files - Trace, etc.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Backup Database and Archive Logs, including Deleting Old Logs and Crosschecking Recovery Catalogs/Controlfiles, etc.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Gather Object - Table, Index, etc. - Statistics&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;This example includes a tar file which contains all of the scripts necessary to perform the above 5 tasks on the Linux platform for any Oracle 9i/10g database - these scripts can also be modified to support 11g:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.colestock.com/tech/oracron.tar" target="_blank"&gt;oracron.tar&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Simply untar the files to the desired location, edit as appropriate and schedule via your preferred mechanism; below are the entries from my oracle user's crontab file: &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;49 18 * * * sh -c '. ~/.bash_profile ; ~/scripts/rotate_alert.bsh ldg' &gt;&gt; ~/logs/rotate_alert.log 2&gt;&amp;1&lt;br /&gt;50 18 * * * sh -c '. ~/.bash_profile ; ~/scripts/remove_old_files.bsh ldg 2' &gt;&gt; ~/logs/remove_old_files.log 2&gt;&amp;1&lt;br /&gt;13 20 * * * sh -c '. ~/.bash_profile ; ~/scripts/rman_full_nc.bsh ldg' &gt;&gt; ~/logs/rman_full_nc.log 2&gt;&amp;1&lt;br /&gt;12 21 * * * sh -c '. ~/.bash_profile ; ~/scripts/analyze_db.bsh ldg' &gt;&gt; ~/logs/analyze_db.log 2&gt;&amp;1&lt;br /&gt;23 22 * * * sh -c '. ~/.bash_profile ; ~/scripts/rotate_listener.bsh ldg ldg' &gt;&gt; ~/logs/rotate_listener.log 2&gt;&amp;1&lt;/pre&gt;&lt;br /&gt;Make sure that &lt;span style="font-family: courier new;"&gt;oraenv&lt;/span&gt; is in the oracle user's path and that each database has a &lt;span style="font-family: courier new;"&gt;/etc/oratab&lt;/span&gt; entry. You will want to adjust the crontab entries above to use the &lt;span style="font-family: courier new;"&gt;$ORACLE_SID&lt;/span&gt; of your choosing. Additionally, my database statistics gathering job requires that you first compile the &lt;span style="font-family: courier new;"&gt;DBA_STATS_MAINT_PKG&lt;/span&gt; in the SYS schema. You will find the ddl for this package within the tar file. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;analyze_db.bsh&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;   #!/bin/bash&lt;br /&gt;  &lt;br /&gt;   # Wrapper Script that calls PL/SQL function to analyze your&lt;br /&gt;   # database to suite your particular needs &lt;br /&gt;&lt;br /&gt;   function quit {&lt;br /&gt;     echo "${0} ORACLE_SID";&lt;br /&gt;     exit;&lt;br /&gt;   } &lt;br /&gt;&lt;br /&gt;   # Make Sure Oracle instance name is passed&lt;br /&gt;   if [ "" == "${1}" ]; then &lt;br /&gt;    quit;&lt;br /&gt;   fi; &lt;br /&gt;&lt;br /&gt;   # Set the Environment&lt;br /&gt;   export ORACLE_SID=${1};&lt;br /&gt;   export ORAENV_ASK=NO;&lt;br /&gt;   . oraenv;&lt;br /&gt;  &lt;br /&gt;   date ;&lt;br /&gt;   sqlplus -s /nolog &amp;lt&amp;ltINP&lt;br /&gt;   connect / as sysdba ;&lt;br /&gt;   exec dba_stats_maint_pkg.disable_auto_job('GATHER_STATS_JOB'); &lt;br /&gt;   exec dba_stats_maint_pkg.gather_stats;&lt;br /&gt;   exec dba_stats_maint_pkg.gather_data_dict_stats;&lt;br /&gt;INP&lt;br /&gt;   date ;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;remove_old_files.bsh&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;   #!/bin/bash&lt;br /&gt;   &lt;br /&gt;   # Works for Oracle databases pre-11g &lt;br /&gt;   # 11g introduces universal diagnostic dest&lt;br /&gt;  &lt;br /&gt;   function quit {&lt;br /&gt;     echo "${0} ORACLE_SID DAYS_OLD";&lt;br /&gt;     exit;&lt;br /&gt;   } &lt;br /&gt;&lt;br /&gt;   # Make Sure Oracle instance name is passed&lt;br /&gt;   if [ "" == "${1}" ]; then &lt;br /&gt;    quit;&lt;br /&gt;   fi; &lt;br /&gt;&lt;br /&gt;   # Make Sure the Days Old argument is passed&lt;br /&gt;   if [ "" == "${2}" ]; then &lt;br /&gt;    quit;&lt;br /&gt;   fi; &lt;br /&gt;   &lt;br /&gt;   # Set the Environment&lt;br /&gt;   export ORACLE_SID=${1};&lt;br /&gt;   export DAYS_OLD=${2};&lt;br /&gt;   export ORAENV_ASK=NO;&lt;br /&gt;   . oraenv;&lt;br /&gt;   &lt;br /&gt;   # Get the location for the bdump&lt;br /&gt;   bdump=`${ORACLE_HOME}/bin/sqlplus -s /nolog &amp;lt&amp;ltEOF&lt;br /&gt;    connect / as sysdba ;&lt;br /&gt;    set head off;&lt;br /&gt;    set feedback off;&lt;br /&gt;    set verify off;&lt;br /&gt;    select value from v\\$parameter where name='background_dump_dest'; &lt;br /&gt;    exit;&lt;br /&gt;    EOF `&lt;br /&gt;&lt;br /&gt;   # Get the location for the udump&lt;br /&gt;   udump=`${ORACLE_HOME}/bin/sqlplus -s /nolog &amp;lt&amp;ltEOF&lt;br /&gt;    connect / as sysdba ;&lt;br /&gt;    set head off;&lt;br /&gt;    set feedback off;&lt;br /&gt;    set verify off;&lt;br /&gt;    select value from v\\$parameter where name='user_dump_dest'; &lt;br /&gt;    exit;&lt;br /&gt;    EOF `&lt;br /&gt;&lt;br /&gt;    # Make sure the directories are valid and cleanup the files&lt;br /&gt;   if [ -d ${bdump} ] &amp;&amp; [ -d ${udump} ] ;  then&lt;br /&gt;     echo "Removing old files at `date +%Y%m%d%H%M` for ${ORACLE_SID}" ;&lt;br /&gt;     echo "Background Dump Before Cleanup `ls -l ${bdump} | wc -l`";&lt;br /&gt;     echo "User Dump Before Cleanup `ls -l ${udump} | wc -l`";&lt;br /&gt;     echo "Listener Log Dump Before Cleanup `ls -l ${ORACLE_HOME}/network/log | wc -l` ";&lt;br /&gt;     find ${bdump} -mtime +${DAYS_OLD} -name "*" -type f -exec rm {} \;&lt;br /&gt;     find ${udump} -mtime +${DAYS_OLD} -name "*" -type f -exec rm {} \;&lt;br /&gt;     find ${ORACLE_HOME}/network/log -mtime +${DAYS_OLD} -name "*" -type f -exec rm {} \;&lt;br /&gt;     echo "Background Dump After Cleanup `ls -l ${bdump} | wc -l`";&lt;br /&gt;     echo "User Dump After Cleanup `ls -l ${udump} | wc -l`";&lt;br /&gt;     echo "Listener Log Dump After Cleanup `ls -l ${ORACLE_HOME}/network/log | wc -l` ";&lt;br /&gt;   fi;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;rman_full_nc.bsh&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;   #!/bin/bash&lt;br /&gt;  &lt;br /&gt;   # Backup/Catalog Crosscheck Delete using RMAN&lt;br /&gt;   # This is for Controlfile backups w/o RMAN Catalog &lt;br /&gt; &lt;br /&gt;   function quit {&lt;br /&gt;     echo "${0} ORACLE_SID";&lt;br /&gt;     exit;&lt;br /&gt;   } &lt;br /&gt;&lt;br /&gt;   # Make Sure Oracle instance name is passed&lt;br /&gt;   if [ "" == "${1}" ]; then &lt;br /&gt;    quit;&lt;br /&gt;   fi; &lt;br /&gt;&lt;br /&gt;   # Set the Environment&lt;br /&gt;   export ORACLE_SID=${1};&lt;br /&gt;   export BACKUP_TAG=FHB_${ORACLE_SID}`date +%Y%m%d%H%M`&lt;br /&gt;   export ARCH_TAG=ARCH_${ORACLE_SID}`date +%Y%m%d%H%M`&lt;br /&gt;&lt;br /&gt;   export ORAENV_ASK=NO;&lt;br /&gt;   . oraenv;&lt;br /&gt;  &lt;br /&gt;   date ;&lt;br /&gt;   rman&amp;lt&amp;ltEOF&lt;br /&gt;   connect target / ;&lt;br /&gt;   show all ;&lt;br /&gt;   crosscheck backup ;&lt;br /&gt;   crosscheck archivelog all ;&lt;br /&gt;   delete noprompt obsolete ;&lt;br /&gt;   backup full database tag ${BACKUP_TAG} plus archivelog tag ${ARCH_TAG} ; &lt;br /&gt;   exit ;&lt;br /&gt;EOF&lt;br /&gt;   date ;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;rotate_alert.bsh&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;   #!/bin/bash&lt;br /&gt;   &lt;br /&gt;   # Works for Oracle databases pre-11g &lt;br /&gt;   # 11g introduces universal diagnostic dest&lt;br /&gt;  &lt;br /&gt;   function quit {&lt;br /&gt;     echo "${0} ORACLE_SID";&lt;br /&gt;     exit;&lt;br /&gt;   } &lt;br /&gt;&lt;br /&gt;   # Make Sure Oracle instance name is passed&lt;br /&gt;   if [ "" == "${1}" ]; then &lt;br /&gt;    quit;&lt;br /&gt;   fi; &lt;br /&gt;   &lt;br /&gt;   # Set the Environment&lt;br /&gt;   export ORACLE_SID=${1};&lt;br /&gt;   export ORAENV_ASK=NO;&lt;br /&gt;   . oraenv;&lt;br /&gt;  &lt;br /&gt;   date ; &lt;br /&gt;   # Get the location for the alert log &lt;br /&gt;   bdump=`${ORACLE_HOME}/bin/sqlplus -s /nolog &amp;lt&amp;ltEOF&lt;br /&gt;    connect / as sysdba ;&lt;br /&gt;    set head off;&lt;br /&gt;    set feedback off;&lt;br /&gt;    set verify off;&lt;br /&gt;    select value from v\\$parameter where name='background_dump_dest'; &lt;br /&gt;    exit;&lt;br /&gt;    EOF&lt;br /&gt;    `  &lt;br /&gt;    logfile=${bdump}/alert_${ORACLE_SID}.log ;&lt;br /&gt;&lt;br /&gt;    # Ensure that the background dump dest exists  &lt;br /&gt;    # If so, rotate the log &lt;br /&gt;    if [ -d ${bdump} ]; then &lt;br /&gt;      if [ -f ${logfile} ]; then&lt;br /&gt;        echo "${logfile} rotated at `date +%Y%m%d%H%M`" ;&lt;br /&gt;        mv ${logfile} ${bdump}/alert_${ORACLE_SID}.`date +%Y%m%d%H%M`.log&lt;br /&gt;          if [ $? == 0 ]; then&lt;br /&gt;            touch ${logfile};&lt;br /&gt;          fi;&lt;br /&gt;      else &lt;br /&gt;        echo "Alert Log ${logfile} does not exist...";&lt;br /&gt;        quit; &lt;br /&gt;      fi;&lt;br /&gt;    else &lt;br /&gt;     echo "Directory does not exist...";&lt;br /&gt;     quit;&lt;br /&gt;    fi;  &lt;br /&gt;    date ;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;rotate_listener.bsh&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;   #!/bin/bash&lt;br /&gt;   &lt;br /&gt;   # Works for Oracle databases pre-11g &lt;br /&gt;   # 11g introduces universal diagnostic dest&lt;br /&gt;  &lt;br /&gt;   function quit {&lt;br /&gt;     echo "${0} ORACLE_SID LSNR";&lt;br /&gt;     exit;&lt;br /&gt;   } &lt;br /&gt;&lt;br /&gt;   # Make Sure Oracle instance name is passed&lt;br /&gt;   if [ "" == "${1}" ]; then &lt;br /&gt;    quit;&lt;br /&gt;   fi; &lt;br /&gt;&lt;br /&gt;   # Make Sure Listener name is passed&lt;br /&gt;   if [ "" == "${2}" ]; then &lt;br /&gt;    quit;&lt;br /&gt;   fi; &lt;br /&gt;   &lt;br /&gt;   # Set the Environment&lt;br /&gt;   export NOW=`/bin/date +%m%d%y%H%M%S`;&lt;br /&gt;   export ORACLE_SID=${1};&lt;br /&gt;   export LSNR=${2};&lt;br /&gt;   export ORAENV_ASK=NO;&lt;br /&gt;   . oraenv;&lt;br /&gt;  &lt;br /&gt;   date ; &lt;br /&gt;   &lt;br /&gt;   if [ -d ${ORACLE_HOME}/network/log ]; then&lt;br /&gt;     if [ -f ${ORACLE_HOME}/network/log/listener_${LSNR}.log ]; then&lt;br /&gt;      cat ${ORACLE_HOME}/network/log/listener_${LSNR}.log &gt;&gt; ${ORACLE_HOME}/network/log/listener_${LSNR}.log.$NOW ;    &lt;br /&gt;      ${ORACLE_HOME}/bin/lsnrctl &lt;&lt; EOF&lt;br /&gt;      set current_listener LISTENER_${LSNR}&lt;br /&gt;      set log_file temp.log&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;      rm ${ORACLE_HOME}/network/log/listener_${LSNR}.log ;&lt;br /&gt;&lt;br /&gt;      ${ORACLE_HOME}/bin/lsnrctl &amp;lt&amp;lt EOF&lt;br /&gt;      set current_listener LISTENER_${LSNR}&lt;br /&gt;      set log_file listener_${LSNR}.log&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;      cat ${ORACLE_HOME}/network/log/temp.log &gt;&gt; $ORACLE_HOME/network/log/listener_${LSNR}.log.${NOW} ;&lt;br /&gt;      rm ${ORACLE_HOME}/network/log/temp.log ;&lt;br /&gt;    fi ;&lt;br /&gt;   else&lt;br /&gt;      echo "Directory not found...";&lt;br /&gt;      quit ;&lt;br /&gt;   fi ; &lt;br /&gt;   date ;&lt;/pre&gt;&lt;br /&gt;Edit the above mentioned in any way you see fit. Although these are written using bash, you could easily adapt these scripts to your preferred shell. &lt;br /&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-7981856869244044741?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/7981856869244044741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=7981856869244044741' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/7981856869244044741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/7981856869244044741'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/05/basic-oracle-maintenance-jobs.html' title='Basic Oracle Maintenance Jobs'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13325418.post-412557035615708380</id><published>2008-05-14T16:50:00.000-07:00</published><updated>2008-05-14T20:05:36.710-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Data Warehousing'/><category scheme='http://www.blogger.com/atom/ns#' term='Bugs'/><title type='text'>Bugs when installing OWB 10g Release 2</title><content type='html'>When installing Oracle Warehouse Builder - specifically 10g Release 2 - there are a couple of Oracle bugs that need to be addressed:&lt;br /&gt;&lt;br /&gt;Depending upon your platform, you may encounter:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Error in invoking target 'isqlldr' of makefile &lt;br /&gt;'$ORACLE_HOME/rdbms/lib/ins_rdbms.mk'.&lt;/pre&gt;&lt;br /&gt;The following Oracle Forum posting identifies the workaround:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://forums.oracle.com/forums/thread.jspa?messageID=2075619" target="_blank"&gt;Thread: OWB paris install on 10g rel1 RAC cluster&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Depending upon your platform, you may also encounter the following bug while installing the optional Oracle Workflow - version 2.6.4 - component. &lt;br /&gt;&lt;br /&gt;After issuing this command:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ORACLE_HOME/wf/install/wfinstall.csh&lt;/pre&gt;&lt;br /&gt;You will encounter an error which mentions &lt;span style="font-family: courier new;"&gt;WorkflowCA: WFTLoad Exception: could not upload&lt;/span&gt; the &lt;span style="font-family: courier new;"&gt;wfstd.wft&lt;/span&gt; file.&lt;br /&gt;&lt;br /&gt;The above issues is resolved with patch:&lt;br /&gt;&lt;br /&gt;4778368 - WFTLOAD EXCEPTION:COULD NOT UPLOAD FILE /RDBMS/10201/WF/RES/US/WFSTD.WFT&lt;br /&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13325418-412557035615708380?l=www.colestock.com%2Fblogs%2Freadme.html' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/412557035615708380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13325418&amp;postID=412557035615708380' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/412557035615708380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13325418/posts/default/412557035615708380'/><link rel='alternate' type='text/html' href='http://www.colestock.com/blogs/2008/05/bugs-to-remember-when-installing-owb.html' title='Bugs when installing OWB 10g Release 2'/><author><name>James</name><uri>http://www.blogger.com/profile/02083074160929552557</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03777104910613884451'/></author><thr:total>0</thr:total></entry></feed>