<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Oracle DBA - Tips and Techniques</title>
	<atom:link href="http://gavinsoorma.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://gavinsoorma.com</link>
	<description>Knowledge Is Power - Share IT ....</description>
	<lastBuildDate>Tue, 15 May 2012 01:43:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>12c Management Agent Installation and Deployment</title>
		<link>http://gavinsoorma.com/2012/05/12c-management-agent-installation-and-deployment/</link>
		<comments>http://gavinsoorma.com/2012/05/12c-management-agent-installation-and-deployment/#comments</comments>
		<pubDate>Tue, 15 May 2012 01:43:23 +0000</pubDate>
		<dc:creator>Gavin Soorma</dc:creator>
				<category><![CDATA[12c Cloud Control]]></category>
		<category><![CDATA[EM Grid Control]]></category>
		<category><![CDATA[12c]]></category>
		<category><![CDATA[cloud control]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[Management Agent]]></category>

		<guid isPermaLink="false">http://gavinsoorma.com/?p=3525</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>In an earlier post, I had mentioned the procedure for doing a silent install on the 12c management agent from the command line.</p>
<p><a href="http://gavinsoorma.com/2012/05/12c-management-agent-silent-installation/">http://gavinsoorma.com/2012/05/12c-management-agent-silent-installation/</a></p>
<p>We will see here how we can install as well as deployment the management agent on single or multiple target hosts from within 12c Cloud Control itself.</p>
<p> From the Cloud Control <strong>Setup</strong> menu, click <strong>Add Target</strong> and then<strong> Add Targets Manually</strong></p>
<p>&nbsp;</p>
<p><a href="http://gavinsoorma.com/wp-content/uploads/2012/05/12agent_1.png"><img class="aligncenter size-full wp-image-3516" title="12agent_1" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12agent_1.png" alt="" width="592" height="446" /></a></p>
<p>&nbsp;</p>
<p>Select <strong>Add Host Targets</strong> and click <strong>Add Host</strong></p>
<p><img class="aligncenter size-full wp-image-3516" title="12agent_1" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12agent_2.png" alt="" width="592" height="446" /></p>
<p>&nbsp;</p>
<p>We can provide a name for the agent deployment session activity or leave it at the default value.</p>
<p> Click <strong>Add</strong> and enter the host name as well as select the appropriate platform from the dropdown list. It is recommended to use a fully qualified host name which includes the domain name as well.</p>
<p> Note – to deploy on multiple host targets, do not enter multiple hosts on the same line separated by commas. Instead each host must be entered on a separate row</p>
<p>&nbsp;</p>
<p> <a href="http://gavinsoorma.com/wp-content/uploads/2012/05/12agent_3.png"><img class="aligncenter size-full wp-image-3518" title="12agent_3" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12agent_3.png" alt="" width="1701" height="456" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3518" title="12agent_3" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12agent_4.png" alt="" width="1701" height="456" /></p>
<p>&nbsp;</p>
<p>On the <strong>Installation Details</strong> page,  we have entered the following:</p>
<p> For <strong>Installation Base Directory</strong> we have entered the absolute path to the agent base directory under which the 12c management agent software will be installed. Ensure that this directory is empty.</p>
<p> The <strong>Instance Directory</strong> is where all the management agent configuration files will be stored.</p>
<p> For<strong> Named Credential</strong>, either use an existing profile or create a new one. These credentials are used for setting up SSH connectivity between the OMS and the managed hosts as well as installing the Management Agent on the target hosts.</p>
<p> If we leave the <strong>Privileged Delegation Setting</strong> blank, then the root scripts will not be run and we have to manually run the same after the agent installation</p>
<p>&nbsp;</p>
<p> <img class="aligncenter  wp-image-3518" title="12agent_3" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12agent_5.png" alt="" width="1701" height="457" /></p>
<p> We can review the agent deployment details and then click on the <strong>Deploy Agent</strong> button</p>
<p><img class="aligncenter size-full wp-image-3518" title="12agent_3" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12agent_6.png" alt="" width="1701" height="456" /></p>
<p>&nbsp;</p>
<p>We can review the progress made on each of the phases of the agent deployment operation — Initialization, Remote Prerequisite Check, and Agent Deployment.</p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3518" title="12agent_3" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12agent_7.png" alt="" width="1701" height="456" /></p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3518" title="12agent_3" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12agent_8.png" alt="" width="1701" height="456" /></p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3518" title="12agent_3" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12agent_9.png" alt="" width="1701" height="456" /></p>
<p>&nbsp;</p>
<p>After the agent deployment has been completed we need to do the following</p>
<ol>
<li>Run the agent root.sh script as root which is located in the Management Agent home.</li>
<li>Discover and Add Targets for monitoring via Cloud Control</li>
</ol>
<p>&nbsp;</p>
<p>From the <strong>Setup</strong> menu, select <strong>Configure Auto Discovery</strong></p>
<p><a href="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc1.png"><img class="aligncenter size-full wp-image-3529" title="autodisc1" src="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc1.png" alt="" width="464" height="420" /></a></p>
<p>&nbsp;</p>
<p>Select <strong>Multiple Target-Type Discovery on Single Host</strong> and then click on <strong>Configure </strong></p>
<p><a href="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc2.png"><img class="aligncenter size-full wp-image-3530" title="autodisc2" src="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc2.png" alt="" width="1165" height="615" /></a></p>
<p>&nbsp;</p>
<p>Select the relevant <strong>Agent Host Name</strong> and click on <strong>Configure</strong></p>
<p> <a href="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc3.png"><img class="aligncenter size-full wp-image-3531" title="autodisc3" src="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc3.png" alt="" width="1152" height="343" /></a></p>
<p>&nbsp;</p>
<p>Under the <strong>Discovery Module</strong>, we are checking the <strong>Enabled</strong> box for Oracle Database,Listener &#8230;. and Oracle Home Discovery</p>
<p>&nbsp;</p>
<p><a href="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc4.png"><img class="aligncenter size-full wp-image-3532" title="autodisc4" src="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc4.png" alt="" width="804" height="363" /></a></p>
<p>&nbsp;</p>
<p>Click on the <strong>Run Discovery Now</strong> button</p>
<p>&nbsp;</p>
<p><a href="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc5.png"><img class="aligncenter size-full wp-image-3533" title="autodisc5" src="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc5.png" alt="" width="1337" height="333" /></a></p>
<p>&nbsp;</p>
<p><a href="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc6.png"><img class="aligncenter size-full wp-image-3534" title="autodisc6" src="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc6.png" alt="" width="981" height="450" /></a></p>
<p>&nbsp;</p>
<p><a href="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc7.png"><img class="aligncenter size-full wp-image-3535" title="autodisc7" src="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc7.png" alt="" width="958" height="568" /></a></p>
<p>&nbsp;</p>
<p><a href="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc8.png"><img class="aligncenter size-full wp-image-3536" title="autodisc8" src="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc8.png" alt="" width="817" height="518" /></a></p>
<p>&nbsp;</p>
<p><a href="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc9.png"><img class="aligncenter size-full wp-image-3537" title="autodisc9" src="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc9.png" alt="" width="1195" height="358" /></a></p>
<p>&nbsp;</p>
<p>We see that for the host where we have just run the target discovery, out of the 5 Discovered Targets, so far 3 are Managed Targets. We still need to discover the Database Instance and the Listener.</p>
<p><a href="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc10.png"><img class="aligncenter size-full wp-image-3538" title="autodisc10" src="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc10.png" alt="" width="690" height="205" /></a></p>
<p>&nbsp;</p>
<p><a href="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc11.png"><img class="aligncenter size-full wp-image-3539" title="autodisc11" src="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc11.png" alt="" width="1022" height="202" /></a></p>
<p>&nbsp;</p>
<p><a href="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc12.png"><img class="aligncenter size-full wp-image-3540" title="autodisc12" src="http://gavinsoorma.com/wp-content/uploads/2012/05/autodisc12.png" alt="" width="1652" height="547" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.com/2012/05/12c-management-agent-installation-and-deployment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>12c Management Agent Silent Installation</title>
		<link>http://gavinsoorma.com/2012/05/12c-management-agent-silent-installation/</link>
		<comments>http://gavinsoorma.com/2012/05/12c-management-agent-silent-installation/#comments</comments>
		<pubDate>Thu, 10 May 2012 02:41:18 +0000</pubDate>
		<dc:creator>Gavin Soorma</dc:creator>
				<category><![CDATA[12c Cloud Control]]></category>
		<category><![CDATA[EM Grid Control]]></category>
		<category><![CDATA[12c]]></category>
		<category><![CDATA[agent.rsp]]></category>
		<category><![CDATA[cloud control]]></category>
		<category><![CDATA[emcli]]></category>
		<category><![CDATA[Management Agent]]></category>
		<category><![CDATA[Silent Installation]]></category>

		<guid isPermaLink="false">http://gavinsoorma.com/?p=3510</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>Outlined here is the process used to deploy the 12c management agent on a target Linux x86_64 server using the silent installation method with an agent response file.</p>
<p>In this case the 12c  OMS host server is called linux-oem-prod and the target host where we are deploying the agent is .linux-orasql-001-dev.</p>
<p>In the next post we will see how we can deploy or push the 12c management agents to target hosts from 12c Cloud Control itself.</p>
<p>&nbsp;</p>
<p><strong>On the OMS host launch the EMCLI client</strong></p>
<p>[oracle@linux-oem-prod Middleware]$ cd oms</p>
<p> [oracle@linux-oem-prod oms]$ cd bin</p>
<p> [oracle@linux-oem-prod bin]$ <strong>./emcli login -username=sysman -password=xxx</strong></p>
<p>Login successful</p>
<p><strong></strong> </p>
<p><strong>Synchronize EMCLI</strong></p>
<p>[oracle@linux-oem-prod bin]$ <strong>./emcli sync</strong></p>
<p>Synchronized successfully</p>
<p>&nbsp;</p>
<p><strong>Check the platforms for which the Management Agent software is available on the OMS host</strong></p>
<p>[oracle@linux-oem-prod bin]$ <strong>./emcli get_supported_platforms</strong></p>
<p>Getting list of platforms &#8230;</p>
<p>Check the logs at /u01/app/oracle/Middleware/oms/bin/agent.log</p>
<p>About to access self-update code path to retrieve the platforms list..</p>
<p>Getting Platforms list  &#8230;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Version = 12.1.0.1.0</p>
<p> Platform = Linux x86-64</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Platforms list displayed successfully.</p>
<p>&nbsp;</p>
<p><strong>Download the Management Agent software from Oracle Software Library to a temporary directory on the OMS host</strong></p>
<p>[oracle@linux-oem-prod bin]$ <strong>./emcli get_agentimage -destination=/u01/app/oracle/agent_software -platform=&#8221;Linux x86-64&#8243; -version=&#8221;12.1.0.1.0&#8243;</strong></p>
<p>Platform:Linux x86-64</p>
<p>Destination:/u01/app/oracle/agent_software</p>
<p> === Partition Detail ===</p>
<p>Space free : 14 GB</p>
<p>Space required : 1 GB</p>
<p>Check the logs at /u01/app/oracle/agent_software/get_agentimage_2012-04-15_22-50-00-PM.log</p>
<p>Setting property ORACLE_HOME to:/u01/app/oracle/Middleware/oms</p>
<p>calling pulloneoffs with arguments:/u01/app/oracle/Middleware/oms/u01/app/oracle/Middleware/oms/sysman/agent/12.1.0.1.0_AgentCore_226.zip12.1.0.1.0linux_x64</p>
<p>Check this logs for more information: /u01/app/oracle/Middleware/oms/sysman/prov/agentpush/logs</p>
<p>&nbsp;</p>
<p>[oracle@linux-oem-prod bin]$ <strong>cd /u01/app/oracle/agent_software</strong></p>
<p>[oracle@linux-oem-prod agent_software]$ ls -l</p>
<p>total 230400</p>
<p>-rw-r&#8212;&#8211; 1 oracle oinstall 235679029 Apr 15 22:50 12.1.0.1.0_AgentCore_226.zip</p>
<p>-rw-r&#8211;r&#8211; 1 oracle oinstall      1805 Apr 15 22:50 get_agentimage_2012-04-15_22-50-00-PM.log</p>
<p>&nbsp;</p>
<p><strong>Transfer the downloaded zip file to the host where we would like to install the 12c management agent</strong></p>
<p>[oracle@linux-oem-prod agent_software]$ scp -rp 12.1.0.1.0_AgentCore_226.zip <a href="mailto:oracle@linux-orasql-001-dev.dev.domain:/u01/app/oracle/agent_software">oracle@linux-orasql-001-dev.dev.domain:/u01/app/oracle/agent_software</a></p>
<p>&nbsp;</p>
<p><strong>Unzip the file on the target host</strong></p>
<p>Check the directory contents</p>
<p>[oracle@linux-orasql-001-dev agent_software]$ <strong>ls -l</strong></p>
<p>total 460420</p>
<p>-rw-r&#8212;&#8211; 1 oracle oinstall 235679029 Apr 16 10:50 12.1.0.1.0_AgentCore_226.zip</p>
<p>-rwxr-xr-x 1 oracle oinstall   4979329 Apr 16 10:50 12.1.0.1.0_PluginsOneoffs_226.zip</p>
<p>-rw-rw-r&#8211; 1 oracle oinstall 230621327 Sep 23  2011 agentcoreimage.zip</p>
<p>-rwxrwxr-x 1 oracle oinstall     17150 Sep 23  2011 agentDeploy.sh</p>
<p>-rw-rw-r&#8211; 1 oracle oinstall        91 Sep 23  2011 agentimage.properties</p>
<p>-rw-rw-r&#8211; 1 oracle oinstall      3856 Sep 23  2011 agent.rsp</p>
<p>drwxr-xr-x 7 oracle oinstall      4096 Apr 16 10:50 plugins</p>
<p>-rwxr-xr-x 1 oracle oinstall       223 Apr 16 10:50 plugins.txt</p>
<p>-rwxr-xr-x 1 oracle oinstall    145976 Sep 23  2011 unzip</p>
<p><strong></strong> </p>
<p><strong>Edit the response file agent.rsp</strong></p>
<p><strong></strong> </p>
<p>OMS_HOST=&#8221;linux-oem-prod.dev.domain&#8221;</p>
<p>EM_UPLOAD_PORT=&#8221;4902&#8243;</p>
<p>AGENT_REGISTRATION_PASSWORD=&#8221;xxx&#8221;</p>
<p>AGENT_INSTANCE_HOME=&#8221;/u01/app/oracle/agent12g/agent_inst&#8221;</p>
<p>AGENT_PORT=&#8221;3872&#8243;</p>
<p>ORACLE_HOSTNAME=&#8221;linux-orasql-001-dev.dev.domain&#8221;</p>
<p>&nbsp;</p>
<p><strong>Run the agent deployment script</strong></p>
<p>[oracle@linux-orasql-001-dev agent_software]$ <strong>./agentDeploy.sh AGENT_BASE_DIR=/u01/app/oracle/agent12g RESPONSE_FILE=/u01/app/oracle/agent_software/agent.rsp </strong></p>
<p> Validating the OMS_HOST &amp; EM_UPLOAD_PORT</p>
<p>Executing command : /u01/app/oracle/agent12g/core/12.1.0.1.0/jdk/bin/java -classpath /u01/app/oracle/agent12g/core/12.1.0.1.0/jlib/agentInstaller.jar:/u01/app/oracle/agent12g/core/12.1.0.1.0/oui/jlib/OraInstaller.jar oracle.sysman.agent.installer.AgentInstaller /u01/app/oracle/agent12g/core/12.1.0.1.0 /u01/app/oracle/agent_software /u01/app/oracle/agent12g -prereq</p>
<p> Validating oms host &amp; port with url: http://linux-oem-prod.dev.domain:4902/empbs/genwallet</p>
<p>Validating oms host &amp; port with url: https://linux-oem-prod.dev.domain:4902/empbs/genwallet</p>
<p>Return status:3</p>
<p>Unzipping the agentcoreimage.zip to /u01/app/oracle/agent12g &#8230;.</p>
<p>12.1.0.1.0_PluginsOneoffs_226.zip</p>
<p>Executing command : /u01/app/oracle/agent_software/unzip -o /u01/app/oracle/agent_software/12.1.0.1.0_PluginsOneoffs_226.zip -d /u01/app/oracle/agent12g</p>
<p> Checking the ownership of agent base directory:/u01/app/oracle/agent12g</p>
<p>Checking for proper ownership on the agent base directory.</p>
<p>Checks whether the agent base directory is owned by the agent user oracle  and that its parent directory is owned by either the agent user or root.</p>
<p>&#8230;.</p>
<p>Login name is : oracle &amp; file owner is : oracle</p>
<p>&#8230;&#8230;&#8230;&#8230;</p>
<p>Agent Base directory verification completed Successfully.</p>
<p> Ownership check completed.</p>
<p>Executing command : /u01/app/oracle/agent12g/core/12.1.0.1.0/jdk/bin/java -classpath /u01/app/oracle/agent12g/core/12.1.0.1.0/oui/jlib/OraInstaller.jar:/u01/app/oracle/agent12g/core/12.1.0.1.0/oui/jlib/xmlparserv2.jar:/u01/app/oracle/agent12g/core/12.1.0.1.0/oui/jlib/srvm.jar:/u01/app/oracle/agent12g/core/12.1.0.1.0/oui/jlib/emCfg.jar:/u01/app/oracle/agent12g/core/12.1.0.1.0/jlib/agentInstaller.jar:/u01/app/oracle/agent12g/core/12.1.0.1.0/oui/jlib/share.jar oracle.sysman.agent.installer.AgentInstaller /u01/app/oracle/agent12g/core/12.1.0.1.0 /u01/app/oracle/agent_software /u01/app/oracle/agent12g AGENT_BASE_DIR=/u01/app/oracle/agent12g AGENT_BASE_DIR=/u01/app/oracle/agent12g RESPONSE_FILE=/u01/app/oracle/agent_software/agent.rsp</p>
<p>&nbsp;</p>
<p> Executing agent install prereqs&#8230;</p>
<p>Executing command: /u01/app/oracle/agent12g/core/12.1.0.1.0/oui/bin/runInstaller -ignoreSysPrereqs -prereqchecker -silent -ignoreSysPrereqs -waitForCompletion  -prereqlogloc /u01/app/oracle/agent12g/core/12.1.0.1.0/cfgtoollogs/agentDeploy -entryPoint oracle.sysman.top.agent_Complete -detailedExitCodes PREREQ_CONFIG_LOCATION=/u01/app/oracle/agent12g/core/12.1.0.1.0/prereqs  -J-DORACLE_HOSTNAME=linux-orasql-001-dev.dev.domain</p>
<p>Prereq Logs Location:/u01/app/oracle/agent12g/core/12.1.0.1.0/cfgtoollogs/agentDeploy/prereq&lt;timestamp&gt;.log</p>
<p>Agent install prereqs completed successfully</p>
<p>&nbsp;</p>
<p>Cloning the agent home&#8230;</p>
<p>Executing command: /u01/app/oracle/agent12g/core/12.1.0.1.0/oui/bin/runInstaller -ignoreSysPrereqs -clone -forceClone -silent -waitForCompletion -nowait ORACLE_HOME=/u01/app/oracle/agent12g/core/12.1.0.1.0 -responseFile /u01/app/oracle/agent_software/agent.rsp  AGENT_BASE_DIR=/u01/app/oracle/agent12g AGENT_BASE_DIR=/u01/app/oracle/agent12g RESPONSE_FILE=/u01/app/oracle/agent_software/agent.rsp -noconfig  ORACLE_HOME_NAME=agent12g1 -force</p>
<p>Clone Action Logs Location:/u01/app/oraInventory/logs/cloneActions&lt;timestamp&gt;.log</p>
<p>Cloning of agent home completed successfully</p>
<p>&nbsp;</p>
<p>Attaching sbin home&#8230;</p>
<p>Executing command: /u01/app/oracle/agent12g/core/12.1.0.1.0/oui/bin/runInstaller -ignoreSysPrereqs -attachHome -waitForCompletion -nowait ORACLE_HOME=/u01/app/oracle/agent12g/sbin ORACLE_HOME_NAME=sbin12g1 -force</p>
<p>Attach Home Logs Location:/u01/app/oracle/agent12g/core/12.1.0.1.0/cfgtoollogs/agentDeploy/AttachHome&lt;timestamp&gt;.log</p>
<p>Attach home for sbin home completed successfully.</p>
<p>&nbsp;</p>
<p>Updating home dependencies&#8230;</p>
<p>Executing command: /u01/app/oracle/agent12g/core/12.1.0.1.0/oui/bin/runInstaller -ignoreSysPrereqs -updateHomeDeps -waitForCompletion HOME_DEPENDENCY_LIST=&#8221;/u01/app/oracle/agent12g/sbin:/u01/app/oracle/agent12g/core/12.1.0.1.0&#8243; -invPtrLoc /u01/app/oracle/agent12g/core/12.1.0.1.0/oraInst.loc -force</p>
<p>Update Home Dependencies Location:/u01/app/oracle/agent12g/core/12.1.0.1.0/cfgtoollogs/agentDeploy/UpdateHomeDeps&lt;timestamp&gt;.log</p>
<p>Update home dependency completed successfully.</p>
<p>&nbsp;</p>
<p>Performing the agent configuration&#8230;</p>
<p>Executing command: /u01/app/oracle/agent12g/core/12.1.0.1.0/oui/bin/runConfig.sh ORACLE_HOME=/u01/app/oracle/agent12g/core/12.1.0.1.0 RESPONSE_FILE=/u01/app/oracle/agent12g/core/12.1.0.1.0/agent.rsp ACTION=configure MODE=perform COMPONENT_XML={oracle.sysman.top.agent.11_1_0_1_0.xml} RERUN=true</p>
<p>Configuration Log Location:/u01/app/oracle/agent12g/core/12.1.0.1.0/cfgtoollogs/cfgfw/CfmLogger&lt;timestamp&gt;.log</p>
<p>Agent Configuration completed successfully</p>
<p>&nbsp;</p>
<p>The following configuration scripts need to be executed as the &#8220;root&#8221; user.</p>
<p>#!/bin/sh</p>
<p>#Root script to run</p>
<p> /u01/app/oracle/agent12g/core/12.1.0.1.0/root.sh</p>
<p>To execute the configuration scripts:</p>
<p>1. Open a terminal window</p>
<p>2. Log in as &#8220;root&#8221;</p>
<p>3. Run the scripts</p>
<p>Agent Deployment Successful.</p>
<p>Agent deployment log location:</p>
<p>/u01/app/oracle/agent12g/core/12.1.0.1.0/cfgtoollogs/agentDeploy/agentDeploy_&lt;timestamp&gt;.log</p>
<p>Agent deployment completed successfully.</p>
<p>&nbsp;</p>
<p><strong>Run the root.sh script</strong></p>
<p>[root@linux-orasql-001-dev ~]# <strong> /u01/app/oracle/agent12g/core/12.1.0.1.0/root.sh</strong></p>
<p>Finished product-specific root actions.</p>
<p>/etc exist</p>
<p>Finished product-specific root actions.</p>
<p>&nbsp;</p>
<p><strong>Check the status of the agent on the target host where it has been deployed</strong></p>
<p><strong></strong> </p>
<p>[oracle@linux-orasql-001-dev oracle]$ <strong>pwd</strong></p>
<p>/u01/app/oracle</p>
<p>[oracle@linux-orasql-001-dev oracle]$ <strong>cd agent12g/</strong></p>
<p>[oracle@linux-orasql-001-dev agent12g]$ <strong>cd core</strong></p>
<p>[oracle@linux-orasql-001-dev core]$<strong> cd 12.1.0.1.0/bin</strong></p>
<p>[oracle@linux-orasql-001-dev bin]$<strong> ./emctl status agent</strong></p>
<p>Oracle Enterprise Manager 12c Cloud Control 12.1.0.1.0</p>
<p>Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Agent Version     : 12.1.0.1.0</p>
<p>OMS Version       : 12.1.0.1.0</p>
<p>Protocol Version  : 12.1.0.1.0</p>
<p>Agent Home        : /u01/app/oracle/agent12g/agent_inst</p>
<p>Agent Binaries    : /u01/app/oracle/agent12g/core/12.1.0.1.0</p>
<p>Agent Process ID  : 2678</p>
<p>Parent Process ID : 2631</p>
<p>Agent URL         : https://linux-orasql-001-dev.dev.domain:3872/emd/main/</p>
<p>Repository URL    : https://linux-oem-prod.dev.domain:4902/empbs/upload</p>
<p>Started at        : 2012-04-16 11:20:59</p>
<p>Started by user   : oracle</p>
<p>Last Reload       : (none)</p>
<p>Last successful upload                       : 2012-04-16 11:31:33</p>
<p>Last attempted upload                        : 2012-04-16 11:31:33</p>
<p>Total Megabytes of XML files uploaded so far : 0.02</p>
<p>Number of XML files pending upload           : 0</p>
<p>Size of XML files pending upload(MB)         : 0</p>
<p>Available disk space on upload filesystem    : 45.31%</p>
<p>Collection Status                            : Collections enabled</p>
<p>Last attempted heartbeat to OMS              : 2012-04-16 11:32:06</p>
<p>Last successful heartbeat to OMS             : 2012-04-16 11:32:06</p>
<p>&nbsp;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Agent is Running and Ready</p>
]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.com/2012/05/12c-management-agent-silent-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Enterprise Manager Cloud Control 12c on Linux</title>
		<link>http://gavinsoorma.com/2012/05/installing-enterprise-manager-cloud-control-12c-on-linux/</link>
		<comments>http://gavinsoorma.com/2012/05/installing-enterprise-manager-cloud-control-12c-on-linux/#comments</comments>
		<pubDate>Fri, 04 May 2012 02:59:09 +0000</pubDate>
		<dc:creator>Gavin Soorma</dc:creator>
				<category><![CDATA[12c Cloud Control]]></category>
		<category><![CDATA[EM Grid Control]]></category>
		<category><![CDATA[12c]]></category>
		<category><![CDATA[cloud control]]></category>
		<category><![CDATA[Grid control]]></category>
		<category><![CDATA[OEM]]></category>

		<guid isPermaLink="false">http://gavinsoorma.com/?p=3494</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p> Here are some of my notes  on Installing 12c Cloud Control on a Linux x86_64 platform.</p>
<p>In a previous note I described the process of  <a href="http://gavinsoorma.com/2012/04/upgrading-10g-grid-control-to-oracle-enterprise-manager-12c">upgrading 10.2.0.5 Grid Control to 12c Cloud Control</a>.</p>
<p>If you have installed 11g Grid Contro;l, then the process is quite similar. The real difference is the screen related to selecting Plug-ins which is something new in 12c. Plug-ins and Connectors are extensions to Grid Control to enable management of non-Oracle products and the complete &#8216;cloud&#8217; stack which includes databases, middleware and even virtual servers.</p>
<p>We have plug-ins for Oracle like Oracle Database, Oracle Exadata, My Oracle Support, Oracle Fusion Middleware, Oracle Virtualisation and also a number of no-Oracle plug-ins like IBM DB2, Sybase etc</p>
<p><strong>Packages required</strong>:</p>
<ul>
<li>make-3.81</li>
<li>binutils-2.17.50.0.6</li>
<li>gcc -4.1.1</li>
<li>libaio-0.3.106</li>
<li>glibc-common-2.3.4</li>
<li>libstdc++ -4.1.1</li>
<li>setarch-1.6</li>
<li>sysstat-5.0.5</li>
<li>rng-utils-2.0</li>
<li>libXtst-1.0.1-3.1(x86_64)</li>
<li>glibc-2.5.12</li>
</ul>
<p>In addition, install the 32-bit version as well as the 64-bit version of glibc-devel-2.5-49</p>
<p><strong>Port Requirements</strong></p>
<p>•Admin Server HTTP SSL Port = 7101 &#8211; 7200</p>
<p>•Enterprise Manager Upload HTTP Port = 4889 &#8211; 4898</p>
<p>•Enterprise Manager Upload HTTP SSL Port = 1159, 4899 &#8211; 4908</p>
<p>•Enterprise Manager Central Console HTTP Port = 7788 &#8211; 7798</p>
<p>•Enterprise Manager Central Console HTTP SSL Port = 7799 &#8211; 7809</p>
<p>•Oracle Management Agent Port = 3872, 1830 &#8211; 1849</p>
<p>&nbsp;</p>
<p><strong>Repository Database requirements </strong></p>
<p>10.2.0.5 database can be used as repository for cloud control</p>
<p>If you use Oracle Database 11g Release 2 (11.2.0.1), then ensure that you apply the patches for bugs 10014178 and 8799099</p>
<p>For fresh installs, database should not have SYSMAN schema. If Database Control exists in the dtaabase chosen for the OMS repository, then we need to use the emca -deconfig dbcontrol db -repos drop command to deconfigure Database Control first.</p>
<p>open_cursors  needs  to be 300 to 400</p>
<p>processes  should be greater than  300</p>
<p>session_cached_cursors between 200 and 500</p>
<p>job_queue_interval needs to be at least 20</p>
<p>shared pool size minimum 600 MB</p>
<p>Redo log file sizes minimum 300 MB</p>
<p>UNDO tablespace has a minimum space of 200 MB</p>
<p> stop the Gather Statistics job</p>
<p>For 10g use :</p>
<p>execute dbms_scheduler.disable(&#8216;GATHER_STATS_JOB&#8217;,TRUE);</p>
<p>execute dbms_scheduler.stop_job(&#8216;GATHER_STATS_JOB&#8217;,TRUE);</p>
<p>For 11g use :</p>
<p>execute dbms_auto_task_admin.disable(&#8216;auto optimizer stats collection&#8217;,null,null);</p>
<p>&nbsp;</p>
<p><strong>Use the Enterprise Manager Prerequisite Kit utility (emprereqkit)</strong></p>
<p>The emprereqkit utlity is available  in the 12c software under the directory location install/requisites/bin/emprereqkit. After installation also, it can be run if say we want to upgrade to the next higher version and now need to check if the repository meets the minimum requirements.</p>
<p>It will be located under the OMS_HOME at /install/requisites/bin</p>
<p>It is a command line utility which we can run to test if our repoitory database for the 12c OMS meets all the requirements before we start the installation.</p>
<p>An example of running this is shown here:</p>
<p>$ <strong>./emprereqkit -executionType install -prerequisiteXMLLoc $ORACLE_HOME/install/requisites/list -dbHost oem-prod -dbPort 1521 -dbSid oem12c -dbUser SYS -dbPassword syspwd -dbRole sysdba -showPrereqs</strong></p>
<p>&nbsp;</p>
<p><a href="http://gavinsoorma.com/wp-content/uploads/2012/05/emprereqkit.png"><img class="aligncenter size-full wp-image-3499" title="emprereqkit" src="http://gavinsoorma.com/wp-content/uploads/2012/05/emprereqkit.png" alt="" width="1055" height="721" /></a></p>
<p><strong></strong> </p>
<p><strong>Also &#8230;</strong></p>
<p>Ensure the directory selected for the Middleware Home Location <strong>does not contain any files or subdirectories</strong></p>
<p>If not already present, Oracle WebLogic Server 11g Release 1 (<strong>10.3.5</strong>) and <strong>JDK 1.6 v24</strong> are installed in the Middleware home</p>
<p>A WebLogic domain called <strong>GCDomain</strong> is created</p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3478" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12c1.png" alt="" width="805" height="603" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://gavinsoorma.com/wp-content/uploads/2012/05/12c2.png"><img class="aligncenter size-full wp-image-3478" title="12c2" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12c2.png" alt="" width="805" height="603" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://gavinsoorma.com/wp-content/uploads/2012/05/12c3.png"><img class="aligncenter size-full wp-image-3478" title="12c3" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12c3.png" alt="" width="805" height="603" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3478" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12c4.png" alt="" width="805" height="603" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3478" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12ca.png" alt="" width="805" height="603" /><br />
 </p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3478" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12cb.png" alt="" width="805" height="603" /><br />
 </p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3478" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12cc.png" alt="" width="805" height="603" /><br />
 </p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3478" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12c6.png" alt="" width="805" height="603" /><br />
 </p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3478" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12c10.png" alt="" width="805" height="603" /><br />
 </p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3478" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12c11.png" alt="" width="805" height="603" /><br />
 </p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3478" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12c12.png" alt="" width="805" height="603" /><br />
 </p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3478" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12c13.png" alt="" width="805" height="603" /><br />
 </p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3478" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12c14.png" alt="" width="805" height="603" /><br />
 </p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3478" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12c15.png" alt="" width="805" height="603" /><br />
 </p>
<p>&nbsp;</p>
<p><img class="aligncenter size-full wp-image-3478" src="http://gavinsoorma.com/wp-content/uploads/2012/05/12c16.png" alt="" width="805" height="603" /></p>
]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.com/2012/05/installing-enterprise-manager-cloud-control-12c-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the adodfcmp and FndXdfCmp utilities to manually create and verify 11i database objects</title>
		<link>http://gavinsoorma.com/2012/04/using-the-adodfcmp-and-fndxdfcmp-utilities-to-manually-create-and-verify-11i-database-objects/</link>
		<comments>http://gavinsoorma.com/2012/04/using-the-adodfcmp-and-fndxdfcmp-utilities-to-manually-create-and-verify-11i-database-objects/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 01:19:18 +0000</pubDate>
		<dc:creator>Gavin Soorma</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[11i Apps]]></category>
		<category><![CDATA[adodfcmp]]></category>
		<category><![CDATA[FndXdfCmp]]></category>
		<category><![CDATA[odf]]></category>
		<category><![CDATA[xdf]]></category>

		<guid isPermaLink="false">http://gavinsoorma.com/?p=3468</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>Recently while applying the Financials Family Pack G, we encountered some issues where certain forms and libraries were not compiling and we had to manually create some new tables and packages and also modify some existing tables and view.</p>
<p>We can not only create new database objects, but also verify if the objects currently stored in the database have the right definition which is being expected by the particular patch which we were running.</p>
<p>The object defintions are stored in the odf and xdf files which are located under the patch sub-directory $PRODUCT_TOP/patch/115/odf and $PRODUCT_TOP/patch/115/xdf.</p>
<p>The Java Utility FndXdfCmp is located under the $JAVA_TOP/oracle/apps/fnd/odf2 to verify and create Database Objects, defined in a xdf-File.</p>
<p>To verify and create Database Objects, defined in a odf-File adodfcmp utility is used and it is located under the $AD_TOP/bin.</p>
<h6>Using adodfcmp</h6>
<p>This is an example of the adodfcmp command:</p>
<p><strong>adodfcmp odffile=arcceh.odf mode=tables changedb=YES userid=AR/ar touser=APPS/appspwd priv_schema=SYSTEM/systempwd</strong></p>
<p>odffile: name of the Object definition odf file</p>
<p>Mode: type of the objects to be compared or created. Valid values include tables, views, sequences</p>
<p>Changedb: toggle between YES and NO</p>
<p>userid: this is the ORACLE database user account who owns the base object</p>
<p>touser: this will typically be the APPS user account</p>
<p>priv_schema: database user account with DBA privileges &#8211; we are using SYSTEM in this case</p>
<p>Initially we run it with changedb=NO which will not make any changes in the database but willl just write the actions to the odf log file which we can review.</p>
<p>If we are satisfied with the object creation commands which will be executed, we can use changedb=YES which will cause the objects to be created or modified as the case may be in the database.</p>
<p>Copyright (c) 2002 Oracle Corporation<br />
Redwood Shores, California, USA<br />
ODF (Object Description File) Comparison Utility<br />
Version 11.5.0<br />
NOTE: You may not use this utility for custom development<br />
unless you have written permission from Oracle Corporation.<br />
************* Start of ODF Comparison Utility session *************<br />
ODF Comparison Utility version: 11.5.0<br />
ODF Comparison Utility started at: Mon Apr 23 2012 17:44:59<br />
Reading objects from ODF file<br />
Reading table AR_CC_ERROR_MAPPINGS &#8230;<br />
Reading table AR_CC_ERROR_HISTORY &#8230;<br />
*** Reading objects from AR schema</p>
<p>*******************************************************<br />
The database is missing the table AR_CC_ERROR_MAPPINGS.<br />
Create it with the statement(s):<br />
CREATE TABLE AR.AR_CC_ERROR_MAPPINGS (CC_ERROR_CODE VARCHAR2(80) NOT NULL,<br />
CC_ERROR_TEXT VARCHAR2(255), RECEIPT_METHOD_ID NUMBER(15) NOT NULL,<br />
CC_TRX_CATEGORY VARCHAR2(15) NOT NULL, CC_ACTION_CODE VARCHAR2(30) NOT<br />
NULL, NO_DAYS NUMBER, SUBSEQUENT_ACTION_CODE VARCHAR2(30), ERROR_NOTES<br />
VARCHAR2(255), LAST_UPDATE_DATE DATE NOT NULL, LAST_UPDATED_BY NUMBER(15)<br />
NOT NULL, LAST_UPDATE_LOGIN NUMBER(15), CREATION_DATE DATE NOT NULL,<br />
CREATED_BY NUMBER(15) NOT NULL, OBJECT_VERSION_NUMBER NUMBER(15))<br />
STORAGE(INITIAL 4K NEXT 128K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE<br />
0 FREELIST GROUPS 4 FREELISTS 4 ) PCTFREE 10 PCTUSED 60 INITRANS 10<br />
MAXTRANS 255<br />
CREATE UNIQUE INDEX AR.AR_CC_ERROR_MAPPINGS_U1 ON AR.AR_CC_ERROR_MAPPINGS<br />
(CC_ERROR_CODE, CC_TRX_CATEGORY, RECEIPT_METHOD_ID) LOGGING STORAGE<br />
(INITIAL 4K NEXT 32K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0<br />
FREELIST GROUPS 4 FREELISTS 4 ) PCTFREE 10 INITRANS 11 MAXTRANS 255<br />
COMPUTE STATISTICS<br />
*******************************************************<br />
Schema is &#8220;AR&#8221;, SQL statement is:<br />
GRANT ALL ON AR.AR_CC_ERROR_MAPPINGS TO APPS_APPLFND WITH GRANT OPTION<br />
[did not execute above statement -- Mode changedb = NO]</p>
<p>CREATE OR REPLACE SYNONYM APPS_APPLFND.AR_CC_ERROR_MAPPINGS FOR<br />
AR.AR_CC_ERROR_MAPPINGS<br />
Schema is &#8220;AR&#8221;, SQL statement is:<br />
GRANT ALL ON AR.AR_CC_ERROR_HISTORY TO APPS_APPLFND WITH GRANT OPTION<br />
[did not execute above statement -- Mode changedb = NO]</p>
<p>CREATE OR REPLACE SYNONYM APPS_APPLFND.AR_CC_ERROR_HISTORY FOR<br />
AR.AR_CC_ERROR_HISTORY</p>
<p>ODF Comparison Utility is complete.<br />
You should check the file<br />
/u01/home/applprod/patch/3653484/ar/patch/115/odf/adodfcmp.log<br />
for errors.</p>
<h5>If we now set changedb=YES, we can see that the statements are executed in the database.</h5>
<p>The database is missing the table AR_CC_ERROR_MAPPINGS.<br />
Create it with the statement(s):<br />
CREATE TABLE AR.AR_CC_ERROR_MAPPINGS (CC_ERROR_CODE VARCHAR2(80) NOT NULL,<br />
CC_ERROR_TEXT VARCHAR2(255), RECEIPT_METHOD_ID NUMBER(15) NOT NULL,<br />
CC_TRX_CATEGORY VARCHAR2(15) NOT NULL, CC_ACTION_CODE VARCHAR2(30) NOT<br />
NULL, NO_DAYS NUMBER, SUBSEQUENT_ACTION_CODE VARCHAR2(30), ERROR_NOTES<br />
VARCHAR2(255), LAST_UPDATE_DATE DATE NOT NULL, LAST_UPDATED_BY NUMBER(15)<br />
NOT NULL, LAST_UPDATE_LOGIN NUMBER(15), CREATION_DATE DATE NOT NULL,<br />
CREATED_BY NUMBER(15) NOT NULL, OBJECT_VERSION_NUMBER NUMBER(15))<br />
STORAGE(INITIAL 4K NEXT 128K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE<br />
0 FREELIST GROUPS 4 FREELISTS 4 ) PCTFREE 10 PCTUSED 60 INITRANS 10<br />
MAXTRANS 255<br />
Statement executed.<br />
CREATE UNIQUE INDEX AR.AR_CC_ERROR_MAPPINGS_U1 ON AR.AR_CC_ERROR_MAPPINGS<br />
(CC_ERROR_CODE, CC_TRX_CATEGORY, RECEIPT_METHOD_ID) LOGGING STORAGE<br />
(INITIAL 4K NEXT 32K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0<br />
FREELIST GROUPS 4 FREELISTS 4 ) PCTFREE 10 INITRANS 11 MAXTRANS 255<br />
COMPUTE STATISTICS<br />
Statement executed.</p>
<h6>Using FndXdfCmp</h6>
<p>This is the usage:</p>
<p>adjava -mx512m -nojit oracle.apps.fnd.odf2.FndXdfCmp [Oracle_Schema] [Oracle_Password] \<br />
[apps_schema] [apps_password] [jdbc protocol] [JDBC_Connect_String] [Object Type] \<br />
[full path to xdf file] [full path of $FND_TOP/patch/115/xdf/xsl</p>
<p>Note: ChangeDb can also be specified as ChangeDb=y/n. The default is y so objects will be created in the database.</p>
<p>For example:</p>
<p>applprod@/u01/home/applprod $ <strong>adjava -mx512m -nojit oracle.apps.fnd.odf2.FndXdfCmp fa fa apps appspwd thin \<br />
test-4:1523:CLMTS10G all fa_inquiry_trx_gt.xdf $FND_TOP/patch/115/xdf/xsl</strong></p>
<p>Copyright (c) 2002 Oracle Corporation<br />
Redwood Shores, California, USA<br />
AD Java<br />
Version 11.5.0<br />
NOTE: You may not use this utility for custom development<br />
unless you have written permission from Oracle Corporation.<br />
Reading product information from file&#8230;<br />
Reading language and territory information from file&#8230;<br />
Reading language information from applUS.txt &#8230;<br />
Temporarily resetting CLASSPATH to:<br />
&#8220;/u02/prod/clmfinpr/clmfinprappl/ad/11.5.0/java/adjri.zip:/u01/home/applprod/patch/jdk16/jdk1.6.0_20/jre/lib/rt.jar:/u01/home/applprod/patch/jdk16/jdk1.6.0_20/lib/dt.jar:/u01/home/applprod/patch/jdk16/jdk1.6.0_20/lib/tools.jar:/u01/home/applprod/patch/jdk16/jdk1.6.0_20/jre/lib/charsets.jar:/u02/prod/clmfinpr/clmfinprcomn/java/appsborg2.zip:/u02/prod/clmfinpr/clmfinprora/8.0.6/forms60/java:/u02/prod/clmfinpr/clmfinprcomn/java&#8221;<br />
Calling /u01/home/applprod/patch/jdk16/jdk1.6.0_20/bin/java &#8230;<br />
================================================================================<br />
Applying XDF file : fa_inquiry_trx_gt.xdf<br />
================================================================================<br />
Copyright (c) 2003 Oracle Corporation<br />
Redwood Shores, California, USA<br />
XDF(XML Object Description File) Comparison Utility<br />
Version 1<br />
NOTE: You may not use this utility for custom development<br />
unless you have written permission from Oracle Corporation.</p>
<p>Creating Table in the XDF file<br />
Table Name is FA_INQUIRY_TRX_GT<br />
Table does not exist in the target database<br />
Executing create Statement<br />
Create Statement is</p>
<p>CREATE GLOBAL TEMPORARY TABLE &#8220;FA&#8221;.&#8221;FA_INQUIRY_TRX_GT&#8221;<br />
( &#8220;TRANSACTION_HEADER_ID&#8221; NUMBER(15,0),<br />
&#8220;ASSET_ID&#8221; NUMBER(15,0),<br />
&#8220;BOOK_TYPE_CODE&#8221; VARCHAR2(15)<br />
) ON COMMIT PRESERVE ROWS<br />
Start time for statement above is Tue Apr 24 10:49:10 WST 2012<br />
End time for statement above is Tue Apr 24 10:49:10 WST 2012<br />
Executing grants on FA_INQUIRY_TRX_GT to APPS_APPLFND<br />
GRANT ALL ON FA.FA_INQUIRY_TRX_GT TO APPS_APPLFND WITH GRANT OPTION<br />
Creating synonym FA_INQUIRY_TRX_GT for FA.FA_INQUIRY_TRX_GT<br />
Synonym created<br />
Index hashcode(s) extracted from the XDF.<br />
Hashcodes generated for DB indexes.<br />
Index FA_INQUIRY_TRX_GT_N2 does not exist in FA.<br />
CREATE INDEX &#8220;FA&#8221;.&#8221;FA_INQUIRY_TRX_GT_N2&#8243; ON &#8220;FA&#8221;.&#8221;FA_INQUIRY_TRX_GT&#8221; (&#8220;ASSET_ID&#8221;, &#8220;BOOK_TYPE_CODE&#8221;)<br />
Start time for statement above is Tue Apr 24 10:49:11 WST 2012<br />
End time for statement above is Tue Apr 24 10:49:11 WST 2012<br />
Index FA_INQUIRY_TRX_GT_N2 Created<br />
Index FA_INQUIRY_TRX_GT_N1 does not exist in FA.<br />
CREATE INDEX &#8220;FA&#8221;.&#8221;FA_INQUIRY_TRX_GT_N1&#8243; ON &#8220;FA&#8221;.&#8221;FA_INQUIRY_TRX_GT&#8221; (&#8220;TRANSACTION_HEADER_ID&#8221;)<br />
Start time for statement above is Tue Apr 24 10:49:11 WST 2012<br />
End time for statement above is Tue Apr 24 10:49:11 WST 2012<br />
Index FA_INQUIRY_TRX_GT_N1 Created</p>
]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.com/2012/04/using-the-adodfcmp-and-fndxdfcmp-utilities-to-manually-create-and-verify-11i-database-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performing a database clone using a Data Guard physical standby database</title>
		<link>http://gavinsoorma.com/2012/04/performing-a-database-clone-using-a-data-guard-physical-standby-database/</link>
		<comments>http://gavinsoorma.com/2012/04/performing-a-database-clone-using-a-data-guard-physical-standby-database/#comments</comments>
		<pubDate>Thu, 19 Apr 2012 05:27:23 +0000</pubDate>
		<dc:creator>Gavin Soorma</dc:creator>
				<category><![CDATA[Backup and Recovery]]></category>
		<category><![CDATA[High Availability]]></category>
		<category><![CDATA[clone]]></category>
		<category><![CDATA[data guard]]></category>
		<category><![CDATA[duplicate]]></category>
		<category><![CDATA[rman]]></category>
		<category><![CDATA[standby database]]></category>

		<guid isPermaLink="false">http://gavinsoorma.com/?p=3445</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>A common DBA task is to perform regular clones and database refreshes of the production database for the purpose of setting up training or test or development environments.</p>
<p>If we are having a physical standby Data Guard environment, then we can easily offload the potentially I/O and CPU intensive  backup process required for creating these clone or duplicate databases to the standby site.</p>
<p>Here are a few examples of using the physical Standby database in a Data Guard environment to create a clone of the primary production database.</p>
<p>In the first example we use RMAN to perform the backup and restore and in the second example we are using OS commands to just copy files ONLINE from Standby host to the target host.</p>
<p>Note that in 11g, we can take the backup of the control file from the Standby database. In 10g, we have to take the backup of the controlfile from the primary database.</p>
<p>Metalink states that:</p>
<p>From 11G onwards controlfile backups are interchangible. This is applicable for Physical standby only.</p>
<p>For example the controlfile backup taken on standby(the control file type is STANDBY) can be restored directly on primary and the controlfile type automatically converted as CURRENT.</p>
<p><H6>Method 1)  Using RMAN to take a backup from Standby Database (same DB_NAME)</H6></p>
<p><b>On Standby</b></p>
<p>SQL> recover managed standby database cancel;<br />
Media recovery complete.</p>
<p>[oracle@kens-orasql-001-dev oracle]$ rman target /</p>
<p>Recovery Manager: Release 11.2.0.1.0 &#8211; Production on Wed Apr 18 11:15:00 2012</p>
<p>Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.</p>
<p>connected to target database: HDESK11G (DBID=1866661199, not open)</p>
<p>RMAN> backup as compressed backupset database plus archivelog format &#8216;/u01/app/oracle/bkp_db.%U&#8217;;</p>
<p>Starting backup at 18-APR-12<br />
using channel ORA_DISK_1<br />
channel ORA_DISK_1: starting compressed archived log backup set<br />
channel ORA_DISK_1: specifying archived log(s) in backup set<br />
input archived log thread=1 sequence=1300 RECID=376 STAMP=780913484<br />
input archived log thread=1 sequence=1301 RECID=377 STAMP=780913486<br />
input archived log thread=1 sequence=1302 RECID=379 STAMP=780913792<br />
input archived log thread=1 sequence=1303 RECID=378 STAMP=780913792<br />
input archived log thread=1 sequence=1304 RECID=380 STAMP=780913805<br />
input archived log thread=1 sequence=1305 RECID=381 STAMP=780913812<br />
input archived log thread=1 sequence=1306 RECID=382 STAMP=780913822<br />
input archived log thread=1 sequence=1307 RECID=383 STAMP=780914242<br />
input archived log thread=1 sequence=1308 RECID=384 STAMP=780914245<br />
input archived log thread=1 sequence=1309 RECID=386 STAMP=780914858<br />
input archived log thread=1 sequence=1310 RECID=385 STAMP=780914858<br />
input archived log thread=1 sequence=1311 RECID=387 STAMP=780914870<br />
input archived log thread=1 sequence=1312 RECID=388 STAMP=780914872<br />
channel ORA_DISK_1: starting piece 1 at 18-APR-12<br />
channel ORA_DISK_1: finished piece 1 at 18-APR-12<br />
piece handle=/u01/app/oracle/bkp_db.0pn8nrhf_1_1 tag=TAG20120418T105335 comment=NONE<br />
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07<br />
Finished backup at 18-APR-12</p>
<p>Starting backup at 18-APR-12<br />
using channel ORA_DISK_1<br />
channel ORA_DISK_1: starting compressed full datafile backup set<br />
channel ORA_DISK_1: specifying datafile(s) in backup set<br />
input datafile file number=00006 name=/u01/oradata/HDESK11G/hdesk_data01.dbf<br />
input datafile file number=00001 name=/u01/oradata/HDESK11G/system01.dbf<br />
input datafile file number=00002 name=/u01/oradata/HDESK11G/sysaux01.dbf<br />
input datafile file number=00003 name=/u01/oradata/HDESK11G/undotbs101.dbf<br />
input datafile file number=00007 name=/u01/oradata/HDESK11G/common_data01.dbf<br />
input datafile file number=00004 name=/u01/oradata/HDESK11G/users01.dbf<br />
input datafile file number=00008 name=/u01/oradata/HDESK11G/testme01.dbf<br />
input datafile file number=00005 name=/u01/oradata/HDESK11G/example01.dbf<br />
channel ORA_DISK_1: starting piece 1 at 18-APR-12<br />
channel ORA_DISK_1: finished piece 1 at 18-APR-12<br />
piece handle=/u01/oradata/HDESK11G/FRA/HDESK11G2/backupset/2012_04_18/o1_mf_nnndf_TAG20120418T105342_7rwc5pf4_.bkp tag=TAG20120418T105342 comment=NONE<br />
channel ORA_DISK_1: backup set complete, elapsed time: 00:05:15<br />
Finished backup at 18-APR-12</p>
<p>Starting backup at 18-APR-12<br />
using channel ORA_DISK_1<br />
specification does not match any archived log in the repository<br />
backup cancelled because there are no files to backup<br />
Finished backup at 18-APR-12</p>
<p>Starting Control File and SPFILE Autobackup at 18-APR-12<br />
piece handle=/u01/oradata/HDESK11G/FRA/HDESK11G2/autobackup/2012_04_18/o1_mf_s_780922291_7rwchkow_.bkp comment=NONE<br />
Finished Control File and SPFILE Autobackup at 18-APR-12</p>
<p>Now copy the RMAN backup pieces from the Standby site to the Target site. Note that if the directory structure where we have taken the backup on standby differs on the target server where we are performing the restore, then we have to use the CATALOG command to register those backups in the controlfile.</p>
<p><b>On Target </b></p>
<p>RMAN> restore controlfile from &#8216;/u01/app/oracle/ o1_mf_s_780922291_7rwchkow_.bkp’;</p>
<p>Starting restore at 18-APR-12<br />
using target database control file instead of recovery catalog<br />
allocated channel: ORA_DISK_1<br />
channel ORA_DISK_1: SID=134 device type=DISK</p>
<p>channel ORA_DISK_1: restoring control file<br />
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01<br />
output file name=/u01/app/oracle/oradata/HDESK11G/control01.ctl<br />
output file name=/u01/app/oracle/oradata/HDESK11G/control02.ctl<br />
Finished restore at 18-APR-12</p>
<p>RMAN> alter database mount;</p>
<p>RMAN> catalog backuppiece &#8216;/u01/app/oracle/o1_mf_nnndf_TAG20120418T105342_7rwc5pf4_.bkp&#8217;;</p>
<p>using target database control file instead of recovery catalog<br />
cataloged backup piece<br />
backup piece handle=/u01/app/oracle/o1_mf_nnndf_TAG20120418T105342_7rwc5pf4_.bkp RECID=9 STAMP=780923733</p>
<p>RMAN> restore database;</p>
<p>Starting restore at 18-APR-12<br />
allocated channel: ORA_DISK_1<br />
channel ORA_DISK_1: SID=125 device type=DISK</p>
<p>channel ORA_DISK_1: starting datafile backup set restore<br />
channel ORA_DISK_1: specifying datafile(s) to restore from backup set<br />
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/HDESK11G/system01.dbf<br />
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/HDESK11G/sysaux01.dbf<br />
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/HDESK11G/undotbs101.dbf<br />
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/HDESK11G/users01.dbf<br />
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/HDESK11G/example01.dbf<br />
channel ORA_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/HDESK11G/hdesk_data01.dbf<br />
channel ORA_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/HDESK11G/common_data01.dbf<br />
channel ORA_DISK_1: restoring datafile 00008 to /u01/app/oracle/oradata/HDESK11G/testme01.dbf<br />
channel ORA_DISK_1: reading from backup piece /u01/oradata/HDESK11G/FRA/HDESK11G2/backupset/2012_04_18/o1_mf_nnndf_TAG20120418T105342_7rwc5pf4_.bkp<br />
channel ORA_DISK_1: errors found reading piece handle=/u01/oradata/HDESK11G/FRA/HDESK11G2/backupset/2012_04_18/o1_mf_nnndf_TAG20120418T105342_7rwc5pf4_.bkp<br />
channel ORA_DISK_1: failover to piece handle=/u01/app/oracle/o1_mf_nnndf_TAG20120418T105342_7rwc5pf4_.bkp tag=TAG20120418T105342<br />
channel ORA_DISK_1: restored backup piece 1<br />
channel ORA_DISK_1: restore complete, elapsed time: 00:04:35<br />
Finished restore at 18-APR-12</p>
<p>RMAN> recover database noredo;</p>
<p>Starting recover at 18-APR-12<br />
using channel ORA_DISK_1</p>
<p>Finished recover at 18-APR-12</p>
<p>RMAN> alter database open resetlogs;</p>
<p><b>FAILED HERE !!</b></p>
<p>Alert log showed:</p>
<p>LGWR: Primary database is in MAXIMUM AVAILABILITY mode<br />
LGWR: Destination LOG_ARCHIVE_DEST_1 is not serviced by LGWR<br />
LGWR: Minimum of 1 LGWR standby database required<br />
Errors in file /u01/app/oracle/diag/rdbms/hdesk11g/HDESK11G/trace/HDESK11G_lgwr_7926.trc:<br />
ORA-16072: a minimum of one standby database destination is required<br />
Errors in file /u01/app/oracle/diag/rdbms/hdesk11g/HDESK11G/trace/HDESK11G_lgwr_7926.trc:<br />
ORA-16072: a minimum of one standby database destination is required<br />
LGWR (ospid: 7926): terminating the instance due to error 16072<br />
Wed Apr 18 11:40:30 2012<br />
ARC1 started with pid=19, OS id=8008<br />
Instance terminated by LGWR, pid = 7926</p>
<p>This error was because in the original environment Standby Database was running in MAXIMUM AVAILABILITY mode and it needs a valid destination for LOG_ARCHIVE_DEST_2. Changed it to maximum performance even though there is no Data Guard involved in the restored database. But control file which was restored belonged to a Data Guard Primary database (even though we took it from Standby) – this is the difference in 11g.</p>
<p>SQL> startup mount;<br />
ORACLE instance started.</p>
<p>Total System Global Area 2137886720 bytes<br />
Fixed Size                  2215064 bytes<br />
Variable Size             553649000 bytes<br />
Database Buffers         1577058304 bytes<br />
Redo Buffers                4964352 bytes<br />
Database mounted.</p>
<p>SQL> alter database set standby database to maximize performance;</p>
<p>Database altered.</p>
<p>SQL> alter database open;</p>
<p>Database altered.</p>
<p>SQL> select name from v$database;</p>
<p>NAME<br />
&#8212;&#8212;&#8212;<br />
HDESK11G</p>
<p><H6>Method 2)  Using Online ‘Hot’ Operating System level copy of database files of the standby database (Changing DB_NAME)</H6></p>
<p><b>On Primary </b></p>
<p>SQL> alter database backup controlfile to trace;</p>
<p>Copy trace file to target site and edit as required </p>
<p>SQL> alter database begin backup;</p>
<p>Database altered.</p>
<p>Create a test table as SYSTEM (just to test the process)</p>
<p>SQL> conn system/<br />
Connected.</p>
<p>SQL> create table test_me<br />
  2  as select * from all_objects;</p>
<p>Table created.</p>
<p>SQL> alter system switch logfile;  >>> doing this because we are using MAXIMUM PERFORMANCE mode </p>
<p>System altered.</p>
<p><b>ON STANDBY</b></p>
<p> scp all the data files to the target server </p>
<p>[oracle@kens-orasql-002 HDESK11G]$ scp -rp *.dbf oracle@kens-orasql-001-dev:/u01/app/oracle/oradata/CLONEDB</p>
<p> <b>ON PRIMARY</b></p>
<p>SQL> alter database end backup;</p>
<p>Database altered.</p>
<p>SQL> alter system switch logfile;</p>
<p>System altered.</p>
<p><b>ON STANDBY </b></p>
<p>scp all the archivelog files generated while copy in progress. Ensure last archive log file is present after the alter database end backup command is issues on primary </p>
<p>[oracle@kens-orasql-002 2012_04_19]$ scp -rp *.arch  oracle@kens-orasql-001-dev:/u01/app/oracle/oradata/CLONEDB/arch<br />
oracle@kens-orasql-001-dev&#8217;s password:<br />
o1_mf_1_1313_7rywxhl0_.arc                                        100%  108MB  27.0MB/s   00:04<br />
o1_mf_1_1314_7ryx9660_.arc                                        100%  387KB 387.0KB/s   00:00<br />
o1_mf_1_1315_7ryy5322_.arc                                        100% 9807KB   9.6MB/s   00:00<br />
o1_mf_1_1316_7ryyjztx_.arc                                        100%  359KB 358.5KB/s   00:00</p>
<p><b>ON TARGET </b></p>
<p>Create the controlfile </p>
<p>Startup nomount – note init.ora file is having new database name </p>
<p>[oracle@kens-orasql-001-dev dbs]$ export ORACLE_SID=CLONEDB<br />
[oracle@kens-orasql-001-dev dbs]$ sqlplus sys as sysdba</p>
<p>SQL*Plus: Release 11.2.0.1.0 Production on Thu Apr 19 10:48:47 2012</p>
<p>Copyright (c) 1982, 2009, Oracle.  All rights reserved.</p>
<p>Enter password:<br />
Connected to an idle instance.</p>
<p>SQL> startup nomount<br />
ORACLE instance started.</p>
<p>Total System Global Area 2137886720 bytes<br />
Fixed Size                  2215064 bytes<br />
Variable Size             553649000 bytes<br />
Database Buffers         1577058304 bytes<br />
Redo Buffers                4964352 bytes</p>
<p>SQL> @crectl</p>
<p>Control file created.</p>
<p>Apply the archive log files and recover the database </p>
<p>SQL> !ls -lrt /u01/app/oracle/oradata/CLONEDB/arch/<br />
total 843700<br />
-rw-r&#8212;&#8211; 1 oracle oinstall 113127424 Apr 19 10:08 o1_mf_1_1313_7rywxhl0_.arc<br />
-rw-r&#8212;&#8211; 1 oracle oinstall    396288 Apr 19 10:15 o1_mf_1_1314_7ryx9660_.arc<br />
-rw-r&#8212;&#8211; 1 oracle oinstall  10042368 Apr 19 10:29 o1_mf_1_1315_7ryy5322_.arc<br />
-rw-r&#8212;&#8211; 1 oracle oinstall    367104 Apr 19 10:36 o1_mf_1_1316_7ryyjztx_.arc</p>
<p>SQL> recover database until cancel using backup controlfile;</p>
<p>ORA-00279: change 23286334 generated at 04/18/2012 10:51:31 needed for thread 1<br />
ORA-00289: suggestion :<br />
/u01/app/oracle/oradata/CLONEDB/arch/1_1313_764155537.arch<br />
ORA-00280: change 23286334 for thread 1 is in sequence #1313</p>
<p>Specify log: {<RET>=suggested | filename | AUTO | CANCEL}<br />
/u01/app/oracle/oradata/CLONEDB/arch/o1_mf_1_1313_7rywxhl0_.arc<br />
ORA-00279: change 23395781 generated at 04/19/2012 10:08:47 needed for thread 1<br />
ORA-00289: suggestion :<br />
/u01/app/oracle/oradata/CLONEDB/arch/1_1314_764155537.arch<br />
ORA-00280: change 23395781 for thread 1 is in sequence #1314<br />
ORA-00278: log file<br />
&#8216;/u01/app/oracle/oradata/CLONEDB/arch/o1_mf_1_1313_7rywxhl0_.arc&#8217; no longer<br />
needed for this recovery</p>
<p>Specify log: {<RET>=suggested | filename | AUTO | CANCEL}<br />
/u01/app/oracle/oradata/CLONEDB/arch/o1_mf_1_1314_7ryx9660_.arc<br />
ORA-00279: change 23396254 generated at 04/19/2012 10:15:02 needed for thread 1<br />
ORA-00289: suggestion :<br />
/u01/app/oracle/oradata/CLONEDB/arch/1_1315_764155537.arch<br />
ORA-00280: change 23396254 for thread 1 is in sequence #1315<br />
ORA-00278: log file<br />
&#8216;/u01/app/oracle/oradata/CLONEDB/arch/o1_mf_1_1314_7ryx9660_.arc&#8217; no longer<br />
needed for this recovery</p>
<p>Specify log: {<RET>=suggested | filename | AUTO | CANCEL}<br />
/u01/app/oracle/oradata/CLONEDB/arch/o1_mf_1_1315_7ryy5322_.arc<br />
ORA-00279: change 23397491 generated at 04/19/2012 10:29:55 needed for thread 1<br />
ORA-00289: suggestion :<br />
/u01/app/oracle/oradata/CLONEDB/arch/1_1316_764155537.arch<br />
ORA-00280: change 23397491 for thread 1 is in sequence #1316<br />
ORA-00278: log file<br />
&#8216;/u01/app/oracle/oradata/CLONEDB/arch/o1_mf_1_1315_7ryy5322_.arc&#8217; no longer<br />
needed for this recovery</p>
<p>Specify log: {<RET>=suggested | filename | AUTO | CANCEL}<br />
/u01/app/oracle/oradata/CLONEDB/arch/o1_mf_1_1316_7ryyjztx_.arc<br />
ORA-00279: change 23397950 generated at 04/19/2012 10:36:15 needed for thread 1<br />
ORA-00289: suggestion :<br />
/u01/app/oracle/oradata/CLONEDB/arch/1_1317_764155537.arch<br />
ORA-00280: change 23397950 for thread 1 is in sequence #1317<br />
ORA-00278: log file<br />
&#8216;/u01/app/oracle/oradata/CLONEDB/arch/o1_mf_1_1316_7ryyjztx_.arc&#8217; no longer<br />
needed for this recovery</p>
<p>Specify log: {<RET>=suggested | filename | AUTO | CANCEL}<br />
cancel<br />
Media recovery cancelled.</p>
<p>SQL> alter database open resetlogs;</p>
<p>Database altered.</p>
<p>SQL> select name from v$database;</p>
<p>NAME<br />
&#8212;&#8212;&#8212;<br />
CLONEDB</p>
<p>SQL> select name from v$datafile;</p>
<p>NAME<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
/u01/app/oracle/oradata/CLONEDB/system01.dbf<br />
/u01/app/oracle/oradata/CLONEDB/sysaux01.dbf<br />
/u01/app/oracle/oradata/CLONEDB/undotbs101.dbf<br />
/u01/app/oracle/oradata/CLONEDB/users01.dbf<br />
/u01/app/oracle/oradata/CLONEDB/example01.dbf<br />
/u01/app/oracle/oradata/CLONEDB/hdesk_data01.dbf<br />
/u01/app/oracle/oradata/CLONEDB/common_data01.dbf<br />
/u01/app/oracle/oradata/CLONEDB/testme01.dbf</p>
<p>8 rows selected.</p>
<p>SQL> select member from v$logfile;</p>
<p>MEMBER<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
/u01/app/oracle/oradata/CLONEDB/redo03.log<br />
/u01/app/oracle/oradata/CLONEDB/redo02.log<br />
/u01/app/oracle/oradata/CLONEDB/redo01.log</p>
<p><b>Check the table we created on primary is also present on clone database </b></p>
<p>SQL> conn system<br />
Enter password:<br />
Connected.</p>
<p>SQL> select count(*) from test_me;</p>
<p>  COUNT(*)<br />
&#8212;&#8212;&#8212;-<br />
     74864</p>
]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.com/2012/04/performing-a-database-clone-using-a-data-guard-physical-standby-database/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Upgrading 10g Grid Control to Oracle Enterprise Manager 12c</title>
		<link>http://gavinsoorma.com/2012/04/upgrading-10g-grid-control-to-oracle-enterprise-manager-12c/</link>
		<comments>http://gavinsoorma.com/2012/04/upgrading-10g-grid-control-to-oracle-enterprise-manager-12c/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 06:41:06 +0000</pubDate>
		<dc:creator>Gavin Soorma</dc:creator>
				<category><![CDATA[12c Cloud Control]]></category>
		<category><![CDATA[EM Grid Control]]></category>
		<category><![CDATA[10.2.0.5]]></category>
		<category><![CDATA[12c]]></category>
		<category><![CDATA[Enterprise Manager]]></category>
		<category><![CDATA[grid contro]]></category>
		<category><![CDATA[l 2-system]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://gavinsoorma.com/?p=3440</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>This note details the procedure used to upgrade an OEM Grid Control 10.2.0.5 environment on Linux to Oracle 12c Enterprise Manager Cloud Control.</p>
<p>Broadly speaking at a high level, these are the main steps involved in the 12c upgrade.</p>
<ul>
<li>Decide on what upgrade you are going to follow. I have used the 2-System Upgrade approach which although requires an additional server for the 12g OMS, is non-intrusive and does not affect the existing 10g OEM environment.</li>
<li>Apply the pre-upgrade console patch on existing 10g OEM – this will provide us the interface in the existing 10g OEM Grid Control for performing many of the upgrade tasks. Note the 10g OMS needs to down for this.</li>
<li>Provide information about the host where the 12c upgrade is going to take place.</li>
<li>Download the 12c Grid Control software and plug-ins and stage them on the server which is going to host the 12c OMS</li>
<li>Register the software and plug-ins with Grid Control</li>
<li>Analyze the existing management agents and determine which agents are having an upgradeable status – note that currently there are no Windows 12c Management Agents available. On Metalink it is mentioned that Windows 12c agents will be available by June 2012.</li>
<li>Backup the existing 10g Repository Database and restore it on the same host or another host. In our case, I have restored the 10.2.0.5 OEM repository database on the server which will host the 12c OMS. So both repository database and OMS are on the same host. We can perform an upgrade of the database here if we so desire, but 10.2.0.5 repository database is supported with the 12c Grid Control.</li>
<li>Install 12c Enterprise Manager Cloud Control and upgrade the Management Repository in the database you backed up and restored.</li>
<li>Link the earlier release of the Management Repository with the upgraded Management Repository.</li>
<li>Upgrade the management agents by deploying the 12c agent software on the hosts where we are upgrading the existing 10g agent. All these tasks are done from the Upgrade Console in the 10g OEM Grid Control. We can do this in a piecemeal manner and do not have to upgrade all the agents to 12c in one go. So we will have both the 10g and 12c Grid Control environments running side by side until we have migrated all the 10g agents to 12c. Note that the 12c OMS can only communicate with the 12c agent and not any other agent version.</li>
<li>Generate a health report and check the readiness of the redeployed Management Agents. Verify and sign off the health report.</li>
<li>Switch over the old Management Agent to the newly deployed 12c agent</li>
<li>Note &#8211; Ensure that you have the Enterprise Manager Cloud Control software released in February 2012 &#8211; Enterprise Manager Cloud Control 12c Release 1 (12.1.0.1) (With Bundle Patch 1).</li>
</ul>
<p>&nbsp;</p>
<p>Read the note: <a href="http://gavinsoorma.com/wp-content/uploads/2012/04/OEM-Grid-Control-12C-upgrade.doc">Upgrading Grid Control 10.2.0.5 to OEM 12c Cloud Control</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.com/2012/04/upgrading-10g-grid-control-to-oracle-enterprise-manager-12c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RMAN Duplicate Database RAC to RAC</title>
		<link>http://gavinsoorma.com/2012/04/rman-duplicate-database-rac-to-rac/</link>
		<comments>http://gavinsoorma.com/2012/04/rman-duplicate-database-rac-to-rac/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 07:16:34 +0000</pubDate>
		<dc:creator>Gavin Soorma</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Backup and Recovery]]></category>
		<category><![CDATA[Real Application Clusters]]></category>
		<category><![CDATA[RAC RMAN Duplicate]]></category>

		<guid isPermaLink="false">http://gavinsoorma.com/?p=3432</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>This note outlines the procedure to clone or refresh an Oracle Real Application Clusters database using the RMAN Duplicate Database feature.</p>
<p>In case of a RAC to RAC clone, with RMAN Duplicate we first create a target or duplicate single instance database and then convert the single instance database to a RAC database.</p>
<p>While the note deals with an Oracle 10.2.0.4 database, the same procedure can be used for an 11g database. However, note that in 11g we now have the Duplicate From Active enhanced feature as well.</p>
<p><a href="http://gavinsoorma.com/wp-content/uploads/2012/04/RAC_NONRAC_clone.doc">Read the document &#8230;..</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.com/2012/04/rman-duplicate-database-rac-to-rac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building a test 11gR2 RAC environment in minutes using Oracle Virtual Machine templates</title>
		<link>http://gavinsoorma.com/2011/11/3366/</link>
		<comments>http://gavinsoorma.com/2011/11/3366/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 02:55:32 +0000</pubDate>
		<dc:creator>Gavin Soorma</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle 11g release 2]]></category>
		<category><![CDATA[Real Application Clusters]]></category>
		<category><![CDATA[11gR2 RAC OVm template]]></category>

		<guid isPermaLink="false">http://gavinsoorma.com/?p=3366</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>This note illustrates how we can set up an Orace 11g Release 2 Real Application Clusters environment for test purposes using the Oracle VM templates which are currently available in <b>under 30 minutes</b>!</p>
<p>The templates are available from the Oracle E-Delivery web site and are available in both OEL 32bit Linux as well as 64bit Linux.</p>
<p>While we are demonstrating a test or development RAC setup where a single Oracle VM server is hosting both the guest nodes, a &#8216;Production&#8217; type envrionment is also supported using the Oracle VM Templates where we have multiple OVM Servers and the shared disks are configured as &#8216;phy&#8217; devices which are then passed on to the guest Oracle VM&#8217;s. So there are a number of Oracle VM Servers in this case.</p>
<p>In this test environment, however, the shared disk is configured as &#8216;file&#8217; devices and both guests can run on the same Oracle VM Server.</p>
<p>In other words we have one single DOM-0 and we use files located in the DOM-0 to emulate the shared disks for the Oracle RAC &#8216;cluster&#8217; nodes running in DOM-U.</p>
<p>The template requires about 40 Gb of disk space and assumes that we have at least 4 Gb of RAM available. In our test case, we have allocated 4 Gb of RAM to each Virtual Machine.</p>
<p>The template assumes the following are already in place.</p>
<p>a) We have already installed Oracle VM Server (we have used OVM 2.2)<br />
b) We have already installed and configured Oracle VM Manager (OVM 2.2)<br />
c) allocated 7 unused IP addresses and registered in our DNS</p>
<p>Assuming a two node RAC cluster, that is </p>
<p>2 IP&#8217;s for the public host names<br />
2 IP&#8217;s for the VIP<br />
3 IP&#8217;s for the SCAN </p>
<p>The high level steps involved would be:<br />
<UL><br />
<LI>Download the zip files from Oracle E-Delivery site<br />
<LI>Import the Virtual Machine template into OVM<br />
<LI>Create the ASM shared storage</p>
<li>Create the VM&#8217;s from the 11gR2 RAC template
<li>Add the shared disks to the VM&#8217;s
<li>Complete the first boot interview
<li>run the script buildcluster.sh which will install the 11g R2 Grid Infrastructure and database software and also create the ORCL RAC database
<li>Customize as required<br />
</UL></p>
<h5>Some resources</h5>
<p><UL><br />
<LI> <a href="http://gavinsoorma.com/wp-content/uploads/2011/12/Installation-of-VM-Manager-2.doc"> Installing OVM Manager 2.2 </a></p>
<p><LI><a href="http://gavinsoorma.com/wp-content/uploads/2011/12/OVM-2.2-Server-Installation.doc"> Installing OVM Server 2.2 </a></p>
<p><LI><a href="http://gavinsoorma.com/wp-content/uploads/2011/12/RAC_OVM_Templates_Overview1.pdf"> RAC OVM Templates Overview </a></p>
<p><LI><a href="http://gavinsoorma.com/wp-content/uploads/2011/12/rac11202-ovm-tmplt-test-config-170450.pdf">RAC 11g Release 2 (11.2.0.2.0) Oracle VM templates Test and Development Configuration&#8221;</a><br />
</UL></p>
<p>We need to unzip the 3 files we have downloaded fron the E-Delivery web site and then also extract the 11gR2 RAC template.</p>
<p>This is all done in the /OVS/seed_pool/ directory on the OVM Server </p>
<pre>
[root@kens-ovm-002 OVS]# mv p10113572*.zip ./tmp

[root@kens-ovm-002 OVS]# cd tmp

[root@kens-ovm-002 tmp]# ls
p10113572_10_Linux-x86-64_1of3.zip  p10113572_10_Linux-x86-64_2of3.zip  p10113572_10_Linux-x86-64_3of3.zip

[root@kens-ovm-002 tmp]# unzip -q p10113572_10_Linux-x86-64_1of3.zip
[root@kens-ovm-002 tmp]# unzip -q p10113572_10_Linux-x86-64_2of3.zip
[root@kens-ovm-002 tmp]# unzip -q p10113572_10_Linux-x86-64_3of3.zip

[root@kens-ovm-002 tmp]# cd /OVS/seed_pool/

[root@kens-ovm-002 seed_pool]# tar xzf /OVS/tmp/OVM_EL5U4_X86_64_11202RAC_PVM-1of2.tgz

[root@kens-ovm-002 seed_pool]# cat /OVS/tmp/OVM_EL5U4_X86_64_11202RAC_PVM-2of2-parta.tgz /OVS/tmp/OVM_EL5U4_X86_64_11202RAC_PVM-2of2-partb.tgz | tar xzf -
</pre>
<h4>Importing the Virtual Machine Template</h4>
<p>We will now import this template using OVM Manager.</p>
<p><b>Resources</b> >> <b>Virtual Machine Templates</b> and click on <b>Import</b> button</p>
<p><img src="http://gavinsoorma.com/wp-content/uploads/2011/11/rac6.png"></img></p>
<p>Our template is stored in the /OVS/seed_pool on our OVM Server machine. So we select the option &#8220;Select from Server Pool (Discover and Register)&#8221;</p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/rac7.png"></img></p>
<p>From the <b>Virtual Machine Template Name</b> drop down list select the 11gR2 RAC PVM.</p>
<p>In the <b>Virtual Machine System Password</b> field, we need to enter the root password. <i>The template assumes the root password to be &#8216;ovsroot&#8217; and if we set it to anything else as in our case, we got an error</i>.</p>
<p>But there is a configuration file we can edit to change the default root password to whatever we desire and I will show you how that&#8217;s done in a bit.</p>
<p><img src="http://gavinsoorma.com/wp-content/uploads/2011/11/rac8.png"></img></p>
<p>Click on the <b>Confirm</b> button</p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/rac9.png"></img></p>
<p>We will see that the status of the Virtual Machine Template is now changed to &#8220;Importing&#8221;</p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/rac10.png"></img></p>
<p>
We will see that the status of the Virtual Machine Template is now changed to &#8220;Pending&#8221;</p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/rac11.png"></img></p>
<p>We need to click on the <b>Approve</b> button</p>
<p><img src="http://gavinsoorma.com/wp-content/uploads/2011/11/rac12.png"></img></p>
<p>
We see that the template status has now changed to &#8220;Active&#8221; and we can now use this template to set up our 11g R2 RAC environment.</p>
<p><img src="http://gavinsoorma.com/wp-content/uploads/2011/11/rac13.png"></img></p>
<h4>Create the shared ASM disks </h4>
<p><b>Resources</b> >> <b>Shared Virtual Disks</b> >> <b>Create</b></p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/rac14.png"></img></p>
<p>Select the appropriate Server Pool Name and Group Name. </p>
<p>We will be creating 5 shared virtual disks &#8211; ASM1,ASM2,ASM3, ASM4 and ASM5 each of size 2048 Mb or 2 Gb</p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/rac22.png"></img></p>
<p>Click on <b> Confirm</b></p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/rac32.png"></img></p>
<p>After the first disk ASM1 has been created, click on the <b>Create</b> button and similarly create the other ASM disks in the same manner</p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/rac41.png"></img></p>
<p>We should now see all the five Shared Virtual Disks with status Active</p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/rac51.png"></img></p>
<p><h4>Create the Virtual Machines from the imported 11gR2 RAC template </h4>
<p>Click on the <b>Create Virtual Machine</b> button</p>
<p><img src="http://gavinsoorma.com/wp-content/uploads/2011/11/racvm1.png"></img></p>
<p>Select the option <b> Create virtual machine based on virtual machine template</b></p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/racvm2.png"></img></p>
<p><p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/racvm3.png"></img></p>
<p>Select the template <b>OVM_EL5U4_X86_64_11202RAC_PVM</b></p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/racvm4.png"></img></p>
<p><b>Important</b></p>
<p>Do not forget to add a SECOND Virtual Network Interface &#8211; in this case the name is VIF1 and Bridge name is xenbr1</p>
<p>Keep a note of the console password as we will need to enter this at a later stage </p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/racvm5.png"></img></p>
<p><p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/racvm6.png"></img></p>
<p>Note the status of the Virtual Machine is now &#8216;Creating&#8217;</p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/racvm7.png"></img></p>
<p>After the Virtual Machine is created, it is in a Powered Off state</p>
<p>Click on the <b>Configure</b> tab as we would like to change the Memory Size of this VM from 2 Gb to 4 Gb</p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/racvm8.png"></img></p>
<p>Change the <b>Maximum Memory Size</b> and <b> Memory Size </b> to 4096</p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/racvm9.png"></img></p>
<p>Change the Memory Size of the second VM as well to 4096 MB and now we will see that both the VM&#8217;s have been created and are in the Powered Off state</p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/racvm10.png"></img></p>
<p><h4>Attach the Shared Disks to both the VM&#8217;s </h4>
<p>Select one of the Virtual Machines and click on the <b>Configure</b> tab</p>
<p>Select the <b>Storage</b> tab and then the <b>Attach/Detach Shared Virtual Disk</b></p>
<p><img src="http://gavinsoorma.com/wp-content/uploads/2011/11/racvm11.png"></img></p>
<p>We see the 5 Shared Virtual Disks which we had earlier created &#8211; Click on <b>Move All</b></p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/racvm12.png"></img></p>
<p><p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/racvm13.png"></img></p>
<p>We can now see that the 5 ASM Shared Disks have been attached to the VM and the disk status is Active</p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/12/racvm141.png"></img></p>
<p><b>Repeat the same process for the second VM and attach the same 5 ASM disks to that Virtual Machine as well</b></p>
<h4> Complete the First Boot Interview </h4>
<p>Power On both the VM&#8217;s </p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/12/11grac1.png"></img></p>
<p>Once the machines are powered on, click on the <b>Console</b> tab and launch both the consoles</p>
<p>This is called the First Boot Interview stage.</p>
<p>On the first screen we enter <b> YES</b> and on the second screen we enter <b>NO</b>. </p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/12/11grac2.png"></img></p>
<p>Only after we have entered NO on the second console does the install continue.</p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/12/11grac3.png"></img></p>
<p>We need to now provide the IP&#8217;s for the Public, Private and Virtual hostnames</p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/12/11grac4.png"></img></p>
<p><p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/12/11grac5.png"></img></p>
<p>We need to enter the SCAN name for this cluster. <b>Note &#8211; we should have registered the SCAN in our DNS already and have assigned 3 unused IP addresses to the SCAN</b></p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/12/11grac6.png"></img></p>
<p><p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/12/11grac7.png"></img></p>
<p><h4> Install Grid Infrastructure and Oracle 11g R2 RAC </h4>
<p>We now need to run the <b>buildcluster.sh </b> script. This needs to be on only ONE of the VM&#8217;s &#8211; the one we have designated to be the first node of the cluster.</p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/12/11grac8.png"></img></p>
<p>Note &#8211; because we had not used the standad root password <b>ovsroot</b>, we find that the script has failed becuase it tries to establish a passwordless ssh session which fails.</p>
<p>We needed to edit the /u01/racovm/<b>params.ini</b> file and change the entry for ROOTUSERPASSWORD to the one we want.</p>
<p>Have a read through of the params.ini file as it is through this file that we can add a lot of customisation to the RAC cluster build.</p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/12/11grac9.png"></img></p>
<p>While the RAC installation is in progress, we can monitor the same by doing a tail -f of the <b>progress-racovm.out </b> file located on /tmp</p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/12/11grac10.png"></img></p>
<p>
]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.com/2011/11/3366/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle 11g Fusion Middleware Installation on Linux</title>
		<link>http://gavinsoorma.com/2011/11/oracle-11g-fusion-middleware-installation-on-linux/</link>
		<comments>http://gavinsoorma.com/2011/11/oracle-11g-fusion-middleware-installation-on-linux/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 00:31:59 +0000</pubDate>
		<dc:creator>Gavin Soorma</dc:creator>
				<category><![CDATA[10g Application Server]]></category>
		<category><![CDATA[11g Fusion Middleware]]></category>
		<category><![CDATA[Identity Management]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Oracle 11g Fusion Middleware]]></category>
		<category><![CDATA[SSO]]></category>
		<category><![CDATA[Weblogic]]></category>

		<guid isPermaLink="false">http://gavinsoorma.com/?p=3310</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>This note describes the (long) process of installing an <strong>11g Fusion Middleware</strong> environment with <strong>Forms, Reports, Discoverer and Portal </strong>on an <strong>Oracle Enterprise Linux </strong>5.6 64 Bit platform.</p>
<p><em>If you are not using Oracle Portal , then you do not need to configure Identity Management and Single Sign On</em> which is a real big pain as there is no 11g SSO as yet and we have to install, upgrade and configure 10g SSO/DAS as well with a number of patches.</p>
<p>These are the top level steps:</p>
<li>Install Java SE Development Kit 6u25</li>
<p><BR></p>
<li>Install Oracle Weblogic Server 11g Release 1 ( 10.3.2)</li>
<p><BR></p>
<li>Install Oracle 11g R2 Database software (can be on same machine as Middleware  or different server)</li>
<p><BR></p>
<li>Create the 11g R2 repository database</li>
<p><BR></p>
<li>Download the Repository creation for Windows available in 32 bit for Linux and Windows ( ofm_rcu_win32_11.1.1.3.3_disk1_1of1.zip) – change compatibility for Windows 7 to run it</li>
<p><BR></p>
<li>Make changes to the database required for running  the RCU</li>
<p><BR></p>
<li>Run the RCU and create all the required schemas in the repository database like DEV_PORTAL, DEV_DISCOVERER etc</li>
<p><BR></p>
<li>Install 11g Identity management </li>
<p><BR></p>
<li><strong>Install 10g SSO </strong></li>
<ul>
<li>
<li>Run inspre11.pls (with -op1)
<li>Install SSO MRCA 10.1.4.3.1 on Windows  &#8211; not available for 64 bit Linux  &#8211; change compatibility to Windows XP since we have installed on Windows 7 client PC  (ofm_sso_rcu_win_10.1.4.3.1_disk1_1of1.zip)
<li>Reset the ODS Password
<li> Run inspre11.pls (with -op2)
<li>Install SSO/DAS 10.1.4.0.1 (into a NEW Oracle Home &#8211; this must be a different Oracle Home from OID/DIP 11gR1)
<li>Apply patch 688088 (p6880880_101000_Linux-x86-64.zip)
<li> Apply Patch 5649850 for release 10.1.0.5 (p5649850_10105_GENERIC.zip)
<li>Apply patch  6265268 (p6265268_101430_GENERIC.zip)
<li> Upgrade SSO/DAS to 10.1.4.3 (p7215628_101430_LINUX.zip)
<li> Run inspre11.pls (with -op3)
<p></LI>
</ul>
<p><BR></p>
<li>Install Oracle 11g Portal, Forms, Reports and Discoverer</li>
<p><strong>Read the note:</strong></p>
<p><a href="http://gavinsoorma.com/wp-content/uploads/2011/11/11g-Fusion-Middleware-Installation-Part-1.doc">11g-Fusion-Middleware-Installation-Part-1.doc</a></p>
<p><a href="http://gavinsoorma.com/wp-content/uploads/2011/11/11g-Fusion-Middleware-Installation-Part-2.doc">11g-Fusion-Middleware-Installation-Part-2.doc</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.com/2011/11/oracle-11g-fusion-middleware-installation-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OEM Tablespace Space Used % Alerts and the AUTOEXTEND effect</title>
		<link>http://gavinsoorma.com/2011/11/oem-tablespace-space-used-alerts-and-the-autoextend-effect/</link>
		<comments>http://gavinsoorma.com/2011/11/oem-tablespace-space-used-alerts-and-the-autoextend-effect/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 02:59:50 +0000</pubDate>
		<dc:creator>Gavin Soorma</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[EM Grid Control]]></category>
		<category><![CDATA[autoextend]]></category>
		<category><![CDATA[DBA_TABLESPACE_USAGE_METRICS]]></category>
		<category><![CDATA[Grid control]]></category>
		<category><![CDATA[metrics]]></category>
		<category><![CDATA[OEM]]></category>
		<category><![CDATA[tablespace space used]]></category>

		<guid isPermaLink="false">http://gavinsoorma.com/?p=3294</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>I performed a simple test to try and help clarify a rather confusing topic about when OEM will send out alerts for tablespace usage and what happens when autoextend is turned on and what about the MAXSIZE and UNLIMITED parameters of the AUTOEXTEND ON clause.</p>
<p>A number of Metalink support notes discuss this topic like:</p>
<p>Database Tablespace Full Metric Alerts not Generated In Grid Control [ID 357049.1]<br />
Troubleshooting a Database Tablespace Used(%) Alert problem [ID 403264.1]<br />
Oracle Recommended Patches For Tablespace Monitoring using the Tablespace Space Used % metric [ID 849498.1]</p>
<p>What happens if autoextend is turned on but in some cases we have specified an upper limit for the MAXSIZE parameter or have just left it to UNLIMITED? How will OEM handle those cases?</p>
<p>To clarify things, OEM alert notification mechanism will query the <strong>DBA_TABLESPACE_USAGE_METRICS</strong> view to determine the Used % in a tablespace in relation to the Warning and Critical thresholds which have been set.  This is true for Oracle 10g and above and if we are using Locally Managed tablespaces.</p>
<p>It does not look at DBA_FREE_SPACE or DBA_TABLESPACES for that matter to determine how much of free space is there in a tablespace. In fact many of us had these custom scripts which query these two views and in case of databases which had many tablespaces like an Oracle Applications environment, this query could take a long time to return the results and was quite a &#8216;costly&#8217; query.</p>
<p>It is important to note that <strong>this metric takes into consideration the available disk space into which the tablespace&#8217;s datafile can extend if autoextend is turned on</strong>.</p>
<p>With a 8k block size, on most Unix systems the maximum a datafile can extend upto with autoextend turned on is 32 Gb.  In that case the DBA_TABLESPACE_USAGE_METRICS view will use 32 Gb as the basis for calculating the available free space in the tablespace because if a tablespace consists of one datafile, that is the maximum size the tablespace can grow to.</p>
<p>In the figure below of the OEM Tablespaces screen (Database Instance Home Page &#8211;> Administration &#8211;> Tablespaces), we see some tablespaces which have used space greater 95%, but we have not received any alert from OEM even though the Critical threshold has been crossed.</p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/autoext1.png"></img></p>
<p>Why is that the case?</p>
<p>This is because of the AUTOEXTEND setting.  In the figure above, some tablespaces have datafiles which have autoextend turned on and some do not have autoextend enabled.</p>
<p>In this case, the datafile of the SYSTEM tablespace does have autoextend turned on, and even though the SYSTEM tablespace is 99% full, OEM does not consider it a candidate for an alert notification because the DBA_TABLESPACE_USAGE_METRICS view shows it only as 15.71% used.</p>
<p><PRE>
SQL>  SELECT TABLESPACE_NAME TBSP_NAME
  2  , USED_SPACE
  3  , TABLESPACE_SIZE TBSP_SIZE
  4  , USED_PERCENT
  5  FROM SYS.DBA_TABLESPACE_USAGE_METRICS
  6  order by 4;

TBSP_NAME                      USED_SPACE  TBSP_SIZE USED_PERCENT
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;
&#8230;
&#8230;

SYSTEM                              91512     582427   15.7121837
</pre>
<p>So how did Oracle compute this 15.71% used figure? (91512/582427*100)</p>
<p>Note the USED_SPACE and TBSP_SIZE columns are in blocks - in this case the DB_BLOCK_SIZE of the database is 8k or 8192 bytes.</p>
<p>The maximum size which the file can extend upto via autoextend is 582427 blocks or 4450 Mb</p>
<p>582427 (blocks) *8192 (each block size)  / 1048576 (to convert to MB) = 4450 MB </p>
<p>The SYSTEM tablespace is made up of one datafile and that datafile is about 714 MB used.  (91512* 8192/1048576)</p>
<p>Let us create a tablespace TESTME of size 50 Mb.</p>
<pre>
SQL>  create tablespace testme
  2  datafile '/u01/oradata/HDESK11G/testme01.dbf' size 50m;
</pre>
<p>We now create a table and use the TESTME tablespace to store the table data</p>
<pre>
SQL> create table sh.test
  2   tablespace testme
  3   as select * from sh.sales;

Table created.
</pre>
<p>Since we have not specified any AUTOEXTEND for the datafile of the TESTME tablespace, the TBSP_SIZE column for this tablespace shows 6400 blocks which is equal to 50 MB and the tablespace is about 74% full after we have created and populated the TEST table.</p>
<pre>
TBSP_NAME                      USED_SPACE  TBSP_SIZE USED_PERCENT
------------------------------ ---------- ---------- ------------
...
...
SYSTEM                              91512     552558   16.5615193
TESTME                               4736       6400           74
</pre>
<p>Let us now force a space used alert to be fired from OEM </p>
<pre>
SQL> insert into  sh.test
  2  select * from sh.sales;
insert into  sh.test
                *
ERROR at line 1:
ORA-01653: unable to extend table SH.TEST by 128 in tablespace TESTME
</pre>
<p>We can see that the tablespace TESTME is now 100% full  and an alert has been raised as well.</p>
<pre>
TBSP_NAME                      USED_SPACE  TBSP_SIZE USED_PERCENT
------------------------------ ---------- ---------- ------------
...
...
TESTME                               6400       6400          100
</pre>
<pre>
SELECT REASON
, METRIC_VALUE
, MESSAGE_TYPE
, TO_CHAR(CREATION_TIME,'DD-MON-YYYY HH24:MI:SS')
, HOST_ID
FROM SYS.DBA_OUTSTANDING_ALERTS;

SQL> /

REASON
----------------------------------------------
METRIC_VALUE MESSAGE_TYPE TO_CHAR(CREATION_TIM
------------ ------------ --------------------
HOST_ID
----------------------------------------------
Tablespace [TESTME] is [100 percent] full
         100 Warning      15-NOV-2011 08:38:39
kens-orasql-001.corporateict.domain
</pre>
<p>Now we turn on AUTOEXTEND for the datafile of the TESTME tablespace - note in this case we specify the MAXIZE as UNLIMITED</p>
<pre>

SQL> alter database datafile '/u01/oradata/HDESK11G/testme01.dbf' autoextend on next 100M maxsize unlimited;

Database altered.
</pre>
<p>Now we see that the DBA_TABLESPACE_USAGE_METRICS view shows the tablespace as only 1.37% used. </p>
<p>Currently 50 MB is being used (the file size initially was 50 Mb and all the space in the datafile was used when we inserted rows into the table), but the TBSP_SIZE is showing 466770 (blocks) which is about 3646 Mb ( 466770*8192/1048576).</p>
<p>So why has Oracle chosen this figure?</p>
<p>If we run a df -k command, we see that the /u01 file system where this datafile of the TESTME tablespace is located has about 3.7 GB of free space and with AUTOEXTEND turned on, Oracle estimates that this is the maximum that the datafile can extend upto.</p>
<pre>

TBSP_NAME                      USED_SPACE  TBSP_SIZE USED_PERCENT
------------------------------ ---------- ---------- ------------
...
....
TESTME                               6400     466770   1.37112497

SQL> !df -k |grep u01

Filesystem           1K-blocks      Used Available Use% Mounted on

/dev/xvdb1            20635700  16007140   3780324  82% /u01
</pre>
<p>Now what happens if we instead specify an upper file size limit to which the datafile can extend upto with autoextend turned on.</p>
<pre>

SQL> alter database datafile '/u01/oradata/HDESK11G/testme01.dbf' autoextend on next 100M maxsize 500M;

Database altered.
</pre>
<p>We now see that the TESTME tablespace is 10% full because the maximum size that this tablespace can now grow to is 64000 blocks or 500 Mb and currently it has 50 Mb of used space.</p>
<p>The tablespaces screen from OEM however shows the tablepace as 33% full because it has grown the datafile to 150 MB from 50 Mb as we had specified the NEXT increment as 100 MB when we had enabled autoextend for the datafile of the TESTME tablesapace.</p>
<pre>
TBSP_NAME                      USED_SPACE  TBSP_SIZE USED_PERCENT
------------------------------ ---------- ---------- ------------
...
...
TESTME                               6400      64000           10
</pre>
<p>But what we see from OEM Tablespaces screen (Database Instance Home Page --> Administration --> Tablespaces), the tablespace is 33% full and not 10%.</p>
<p>Remember, this is not what OEM will use to determine the tablespace free space available and when it needs to raise an alert if the space usage threshold is crossed.</p>
<p>
<img src="http://gavinsoorma.com/wp-content/uploads/2011/11/autoext2.png"></img></p>
]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.com/2011/11/oem-tablespace-space-used-alerts-and-the-autoextend-effect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle 11g Cross Platform Active Standby &#8211; Windows Primary database and Linux Active Standby</title>
		<link>http://gavinsoorma.com/2011/11/oracle-11g-cross-platform-active-standby-windows-primary-database-and-linux-active-standby/</link>
		<comments>http://gavinsoorma.com/2011/11/oracle-11g-cross-platform-active-standby-windows-primary-database-and-linux-active-standby/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 14:29:32 +0000</pubDate>
		<dc:creator>Gavin Soorma</dc:creator>
				<category><![CDATA[Backup and Recovery]]></category>
		<category><![CDATA[High Availability]]></category>
		<category><![CDATA[Oracle 11g release 2]]></category>

		<guid isPermaLink="false">http://gavinsoorma.com/?p=3279</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>This note describes the procedure of configuring a cross platform  using the 11g RMAN Active Duplicate as well as an Active Standby Database setup over a Windows and Linux platform.</p>
<p>The Metalink note Data Guard Support for Heterogeneous Primary and Physical Standbys in Same Data Guard Configuration [ID 413484.1] describes the supported cross platform combinations between a primary and standby database.</p>
<p>In Oracle 10g, we could have a 32 bit and 64 bit Primary/Standby combination on some supported platforms and in 11g this has been extended to cover heterogenous platforms for the Primary and Standby database.</p>
<p>The environment used is as follows:</p>
<p><strong>Primary</strong> </p>
<p>Windows 7 64 bit<br />
11g Release 2<br />
DB_UNIQUE_NAME=orcl</p>
<p><strong>Active Standby </strong></p>
<p>Oracle Enterprise Linux 5.7 64 bit<br />
11g Release 2<br />
DB_UNIUE_NAME=orcl_dr</p>
<p>Read the rest of the note <a href="http://gavinsoorma.com/wp-content/uploads/2011/11/11g-cross-platform-active-standby.doc">Oracle 11g Cross platform Active Standby &#8211; Windows Primary database and Linux Active Standby </a></p>
]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.com/2011/11/oracle-11g-cross-platform-active-standby-windows-primary-database-and-linux-active-standby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recovery through RESETLOGS and reset of the incarnation of the database</title>
		<link>http://gavinsoorma.com/2011/10/recovery-through-resetlogs-and-reset-of-the-incarnation-of-the-database/</link>
		<comments>http://gavinsoorma.com/2011/10/recovery-through-resetlogs-and-reset-of-the-incarnation-of-the-database/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 00:28:15 +0000</pubDate>
		<dc:creator>Gavin Soorma</dc:creator>
				<category><![CDATA[Backup and Recovery]]></category>
		<category><![CDATA[INCARNATION]]></category>
		<category><![CDATA[RESET INCARNATION]]></category>
		<category><![CDATA[resetlogs]]></category>
		<category><![CDATA[rman]]></category>

		<guid isPermaLink="false">http://gavinsoorma.com/?p=3262</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<pre>

<strong>Prior to Oracle 10g</strong>, the redo log files generated after opening the database with RESETLOGS could not be used with the backups taken before the RESETLOGS was performed.

Therefore, whenever a resetlogs was done, it was important to take an immediate full database backup, <strong>since all previous backups became invalid</strong>.

Just to recap, a RESETLOGS needs to be performed when we 

1)	Do a point in time recovery
2)	Recover a database using a backup of the control file

<strong>What does a RESETLOGS do?</strong>

•	Archives the current online redo logs (if they are accessible) and then erases the contents of the online redo logs and resets the log sequence number to 1.
•	Creates the online redo log files if they do not currently exist.
•	Updates all current datafiles and online redo logs and all subsequent archived redo logs with a new RESETLOGS SCN and time stamp

The <strong>Recovery through Resetlogs </strong>feature provides the following benefits:

* There is no need to perform a full backup after an incomplete recovery.
* There is no need to recreate a new standby database after a failover operation.
* You can take incremental backups based on full backups of a previous incarnation when you use RMAN.
* Block media recovery can restore backups from parent incarnation backups and recover the corrupted blocks through a RESETLOGS operation.
* You can use the newly generated logs with an earlier incarnation of the database.

Important:

<strong>To perform recovery through RESETLOGS you must have all archived logs generated after the most recent backup</strong>.

<strong>The new log_archive_format introduced in 10g</strong> 

Oracle 10g introduces a new format specification for archived log files. This new format avoids overwriting archived redo log files with the same sequence number across incarnations.

SQL> show parameter log_archive_format
NAME TYPE VALUE
----------------------- ----------- ----------------
log_archive_format string %t_%s_%r.dbf

The format specification of the log_archive_format string "%"r represents the resetlogs id. It will ensure that a unique name is constructed for the archived redo log file during RMAN restore and as well as restoring via SQL*plus auto recovery mode.

Note: The database would not start if you remove the %r from the log archive format specification.

<strong>What is an incarnation?</strong>

A database incarnation is created whenever you open the database with the RESETLOGS option.

The Current incarnation is the one in which the database is running at present

The incarnation from which the current incarnation branched after a ALTER DATABASE OPEN RESETLOGS  was performed is called the Parent incarnation.

If you want to go back to some SCN which is not part of the Current database incarnation, we need to use the RESET DATABASE TO INCARNATION
command as shown in the example below

<strong>The purpose of incarnations</strong>

An incarnation helps to identify redo streams which have the same SCN, but occurred at different points in time. This prevents the possibility of applying the wrong archive log file from a previous incarnation which could corrupt the database.

Suppose we are at incarnation 1 and are at SCN 100 in the database. I do a resetlogs and now the incarnation of the database becomes 2. Suppose we do another resetlogs and it so happens that the SCN at the time we did the resetlogs was also 100. Somewhere down the line later  we want to do a point in time recovery and want to recover the database until SCN 100. How does Oracle know which is the correct SCN and how far back in time should the database be rolled back to and which archive logs need to be applied?

This is where incarnations come in and we will see how we can set the database to a particular incarnation to enable RMAN to do a point in time recovery.

<strong>Example</strong>

Let us now run the LIST INCARNATION OF DATABASE command from RMAN and this is the output.

List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       1       TEST11G  916751459        PARENT  1          15-AUG-09
2       2       TEST11G  916751459        CURRENT 945184     18-OCT-11

What is the current SCN of the database?

SQL> select current_scn from v$database;

CURRENT_SCN
-----------
     991395

Now, let us make a change in the database which we will then try to undo by restoring  and recovering the database to a point in time before the media failure or as in this case, a wrong transaction has happened.

SQL> conn sh/sh
Connected.

SQL> select count(*) from sales;

  COUNT(*)
----------
    918843

SQL> delete from sales where rownum < 1001;

1000 rows deleted.

SQL> commit;

Commit complete.

SQL> select count(*) from sales;

  COUNT(*)
----------
    917843

We now will roll the database back to an SCN before the delete operation was performed.

SQL> conn / as sysdba
Connected.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;

[oracle@orasql-001 u01]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Tue Oct 18 09:41:08 2011

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: TEST11G (DBID=916751459, not open)

RMAN> run {
2> set until scn 991395;
3> restore database;
4> recover database;
5> }

executing command: SET until clause

Starting restore at 18-OCT-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=63 device type=DISK
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/oradata/TEST11G/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /u01/oradata/TEST11G/sysaux01.dbf

….
….

channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
Finished restore at 18-OCT-11

Starting recover at 18-OCT-11
using channel ORA_DISK_1

starting media recovery
media recovery complete, elapsed time: 00:00:00

Finished recover at 18-OCT-11

RMAN> alter database open resetlogs;

database opened

We can now see that the deleted rows have been recovered and the number of rows in the table is now the same as before the delete operation was performed.

SQL> select count(*) from sh.sales;

  COUNT(*)
----------
    918843

Let us check what the incarnation of the database is.

RMAN> list incarnation of database;

using target database control file instead of recovery catalog

List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       1       TEST11G  916751459        PARENT  1          15-AUG-09
2       2       TEST11G  916751459        PARENT  945184     18-OCT-11
3       3       TEST11G  916751459        CURRENT 991396     18-OCT-11

The current incarnation of the database is 3 and since we have recovered the database until SCN 991395, the RESET SCN has been set to the SCN 991396.

The alert log of the database will also log this resetlogs operation and we will see lines the ones shown below:

Incomplete Recovery applied until change 991395 time 10/18/2011 09:39:19
Media Recovery Complete (TEST11G)
Completed: alter database recover if needed
 start until change 991395
Tue Oct 18 09:42:14 2011
alter database open resetlogs
Archived Log entry 3 added for thread 1 sequence 5 ID 0x36a3e663 dest 1:
RESETLOGS after incomplete recovery UNTIL CHANGE 991395

Setting recovery target incarnation to 3
Tue Oct 18 09:42:15 2011
Assigning activation ID 916768223 (0x36a4c5df)

Now let us make another delete from the sales table. 

SQL> delete from sh.sales where rownum < 10001;

10000 rows deleted.

SQL> commit;

Commit complete.

SQL> select count(*) from sh.sales;

  COUNT(*)
----------
    908843

Now, let us shutdown the database, startup and mount it and try the same incomplete recovery which we tried earlier until the SCN 991395

oracle@orasql-001 u01]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Tue Oct 18 09:46:29 2011

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: TEST11G (DBID=916751459, not open)

RMAN> run {
2>  set until scn 991395;
3> restore database;
4> recover database;
5> }

executing command: SET until clause

Starting restore at 18-OCT-11
using target database control file instead of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 10/18/2011 09:46:55
RMAN-20208: UNTIL CHANGE is before RESETLOGS change

We get the error RMAN-20208 because since the current incarnation of the database is 3 and we trying to go to an SCN before this incarnation.

So how do we go back to SCN 993195?

For this to happen, we need to change the current incarnation (3) of the database to an older incarnation (2). The SCN 993195 was present during the incarnation 2.

After resetting the incarnation to 2, we now see that the restore is proceeding fine.

RMAN> reset database to incarnation 2;

database reset to incarnation 2

RMAN>  run {
2>  set until scn 991395;
3>  restore database;
4> recover database;
5> }

executing command: SET until clause

Starting restore at 18-OCT-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=63 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/oradata/TEST11G/system01.dbf
…
…

channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
Finished restore at 18-OCT-11

Starting recover at 18-OCT-11
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 4 is already on disk as file /u01/oradata/TEST11G/arch/1_4_764845989.arch
archived log for thread 1 with sequence 5 is already on disk as file /u01/oradata/TEST11G/arch/1_5_764845989.arch
archived log file name=/u01/oradata/TEST11G/arch/1_4_764845989.arch thread=1 sequence=4
archived log file name=/u01/oradata/TEST11G/arch/1_5_764845989.arch thread=1 sequence=5
media recovery complete, elapsed time: 00:00:00
Finished recover at 18-OCT-11

Now we open the database with the ALTER DATABASE OPEN RESETOGS command and see that a new incarnation key (4) has been allocated to the database as the CURRENT incarnation and the previous incarnation (3) has become an ORPHAN incarnation.

RMAN> list incarnation of database;

List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       1       TEST11G  916751459        PARENT  1          15-AUG-09
2       2       TEST11G  916751459        PARENT  945184     18-OCT-11
3       3       TEST11G  916751459        ORPHAN  991396     18-OCT-11
4       4       TEST11G  916751459        CURRENT 991396     18-OCT-11

Now let us do the same procedure once again:

Delete some rows
Set the database to incarnation 2
Recover the database until the same SCN as previous case – 991395
Open the database with resetlogs 

Now list the incarnation of the database

RMAN> list incarnation of database;

List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       1       TEST11G  916751459        PARENT  1          15-AUG-09
2       2       TEST11G  916751459        PARENT  945184     18-OCT-11
4       4       TEST11G  916751459        ORPHAN  991396     18-OCT-11
5       5       TEST11G  916751459        CURRENT 991396     18-OCT-11
3       3       TEST11G  916751459        ORPHAN  991396     18-OCT-11

The incarnation key 5 now is the CURRENT incarnation of the database, and incarnations 3 and 4 both have become ORPHAN.
The current SCN now is 991734

SQL> select current_scn from v$database;

CURRENT_SCN
-----------
     991734

What happens if we change the structure of the database?  And we do not take any new backup after this change was made, but try and recover using a backup before we had changed the structure of the database. We add another datafile to the USERS tablespace. So the current control file has knowledge of the fact that the  USERS tablespace now has not one, but two datafiles.

We now try and do the same delete of rows and try and go back to our old SCN 991395. At this point in time, the control file had only knowledge of the fact that the USERS tablespace has one data file and not two and the restore and recovery process will not try to do anything with regards to the newly added datafile..

This is what we see in the alert log of the database. Note that datafile 6 which is the new datafile added is being taken offline and dropped because at SCN 991735, this datafile did not exist in the database.

Wed Oct 19 10:03:42 2011
alter database datafile 6 offline drop
Completed: alter database datafile 6 offline drop
alter database recover datafile list clear
Completed: alter database recover datafile list clear
alter database recover datafile list
 1 , 2 , 3 , 4 , 5
Completed: alter database recover datafile list
 1 , 2 , 3 , 4 , 5
alter database recover if needed
 start until change 991735

Dictionary check beginning
File #6 in the controlfile not found in data dictionary.
Removing file from controlfile.
data file 6: '/u01/oradata/TEST11G/users02.dbf'
Dictionary check complete
</pre>
]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.com/2011/10/recovery-through-resetlogs-and-reset-of-the-incarnation-of-the-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the oracle-validated RPM to install Oracle 11g on Linux</title>
		<link>http://gavinsoorma.com/2011/10/using-the-oracle-validated-rpm-to-install-oracle-11g-on-linux/</link>
		<comments>http://gavinsoorma.com/2011/10/using-the-oracle-validated-rpm-to-install-oracle-11g-on-linux/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 01:42:53 +0000</pubDate>
		<dc:creator>Gavin Soorma</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[oracle 11g]]></category>
		<category><![CDATA[oracle-validated RPM]]></category>

		<guid isPermaLink="false">http://gavinsoorma.com/?p=3254</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>I recently came across this OTN article  <a href="http://www.oracle.com/technetwork/articles/servers-storage-admin/ginnydbinstallonlinux-488779.html">How I Simplified Oracle Database Installation on Oracle Linux</a>.</p>
<p>I tried out the procedure listed by the author and thought I’d share this with those who may not be aware of this note and must say thanks to the author <b>Ginny Henningsen</b>.</p>
<p>When I have tried to install Oracle 11g on Linux, in most cases I have found that  the OUI either reports that some packages are missing (typically unixODBC or libaio) or some kernel parameters are not appropriately set. In this case however, we download and install an RPM package called <b>oracle-validated</b> and the oracle-validated RPM does a number of things for us.</p>
<li>It creates the user oracle</li>
<li>It creates the groups oinstall and dba</li>
<li>It modifies the kernel parameters in /etc/sysctl.conf </li>
<li>It sets the hard and soft shell resource limits in /etc/security/limits.conf</li>
<li>And most importantly, downloads and installs  number of packages which are required for the Oracle 11g database software installation while resolving the dependencies between the packages as well</li>
<p>Note that the oracle-validated RPM package is accessible through the Oracle Unbreakable Linux Network (ULN) which requires a support contract or from the Oracle public yum repository.</p>
<p>First we needed to configure the Linux machine to be able to connect to the internet using the corporate proxy and we did this by editing the <b>/etc/profile.d/proxy.sh</b> file with some environment variables like FTP_PROXY and HTTP_PROXY</p>
<p>export http_proxy=http://test-apache-001-dev.corporateict.domain:8123/<br />
export ftp_proxy=http://test-apache-001-dev.corporateict.domain:8123/<br />
export no_proxy=.corporateict.domain<br />
export HTTP_PROXY=http://test-apache-001-dev.corporateict.domain:8123/<br />
export FTP_PROXY=http://test-apache-001-dev.corporateict.domain:8123/</p>
<p>Login once again as root to invoke the changes made  to the environment.</p>
<p>We then use <b>wget</b> to download the file which has the repository locations</p>
<p>[root@kens-orasql-001 yum.repos.d]# <b>wget http://public-yum.oracle.com/public-yum-el5.repo</b></p>
<p>We have to update this file and change the line enabled=0 to enabled=1 for the tag which is appropriate to our Linux version – in our case we were using OEL 5.7 so we have to update these lines:</p>
<p>Change </p>
<p>[ol5_u7_base]<br />
name=Oracle Linux $releasever &#8211; U7 &#8211; $basearch &#8211; base<br />
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL5/7/base/$basearch/<br />
gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5<br />
gpgcheck=1<br />
<b>enabled=0</b></p>
<p>to</p>
<p>[ol5_u7_base]<br />
name=Oracle Linux $releasever &#8211; U7 &#8211; $basearch &#8211; base<br />
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL5/7/base/$basearch/<br />
gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5<br />
gpgcheck=1<br />
<b>enabled=1</b></p>
<p>We then ran a yum update followed by the yum install oracle-validated</p>
<pre>
[root@kens-orasql-002 yum.repos.d]# <b>yum update</b>
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
ol5_u7_base                                                                                                                                    | 1.1 kB     00:00
ol5_u7_base/primary                                                                                                                            | 1.5 MB     00:07
ol5_u7_base                                                                                                                                                 4605/4605
Skipping security plugin, no data
Setting up Update Process
No Packages marked for Update
</pre>
<pre>
[root@kens-orasql-002 yum.repos.d]# <b>yum install oracle-validated</b>
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package oracle-validated.x86_64 0:1.1.0-14.el5 set to be updated
--> Processing Dependency: kernel-uek >= 2.6.32 for package: oracle-validated
--> Processing Dependency: libXp.so.6 for package: oracle-validated
--> Processing Dependency: /usr/lib/libodbccr.so for package: oracle-validated
--> Processing Dependency: /usr/lib64/libodbccr.so for package: oracle-validated
--> Processing Dependency: unixODBC-devel for package: oracle-validated
--> Processing Dependency: libaio-devel for package: oracle-validated
--> Processing Dependency: sysstat for package: oracle-validated
--> Processing Dependency: /usr/lib64/libaio.so for package: oracle-validated
--> Processing Dependency: /usr/lib/libodbc.so.1 for package: oracle-validated
--> Processing Dependency: /usr/lib/libaio.so for package: oracle-validated
--> Processing Dependency: compat-gcc-34-c++ for package: oracle-validated
--> Processing Dependency: compat-gcc-34 for package: oracle-validated
--> Processing Dependency: libdb-4.2.so()(64bit) for package: oracle-validated
--> Processing Dependency: libodbc.so.1()(64bit) for package: oracle-validated
--> Running transaction check
---> Package compat-db.x86_64 0:4.2.52-5.1 set to be updated
---> Package compat-gcc-34.x86_64 0:3.4.6-4.1 set to be updated
---> Package compat-gcc-34-c++.x86_64 0:3.4.6-4.1 set to be updated
---> Package kernel-uek.x86_64 0:2.6.32-200.13.1.el5uek set to be installed
--> Processing Dependency: kernel-firmware >= 2.6.32-200.13.1.el5uek for package: kernel-uek
---> Package libXp.i386 0:1.0.0-8.1.el5 set to be updated
---> Package libaio-devel.i386 0:0.3.106-5 set to be updated
---> Package libaio-devel.x86_64 0:0.3.106-5 set to be updated
---> Package sysstat.x86_64 0:7.0.2-11.el5 set to be updated
---> Package unixODBC.i386 0:2.2.11-7.1 set to be updated
---> Package unixODBC.x86_64 0:2.2.11-7.1 set to be updated
---> Package unixODBC-devel.i386 0:2.2.11-7.1 set to be updated
---> Package unixODBC-devel.x86_64 0:2.2.11-7.1 set to be updated
--> Running transaction check
---> Package kernel-uek-firmware.noarch 0:2.6.32-200.13.1.el5uek set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================================
Package                                     Arch                           Version                                         Repository                           Size
======================================================================================================================================================================
Installing:
oracle-validated                            x86_64                         1.1.0-14.el5                                    ol5_u7_base                          24 k
Installing for dependencies:
compat-db                                   x86_64                         4.2.52-5.1                                      ol5_u7_base                         1.6 M
compat-gcc-34                               x86_64                         3.4.6-4.1                                       ol5_u7_base                         4.3 M
compat-gcc-34-c++                           x86_64                         3.4.6-4.1                                       ol5_u7_base                          13 M
kernel-uek                                  x86_64                         2.6.32-200.13.1.el5uek                          ol5_u7_base                          25 M
kernel-uek-firmware                         noarch                         2.6.32-200.13.1.el5uek                          ol5_u7_base                         2.5 M
libXp                                       i386                           1.0.0-8.1.el5                                   ol5_u7_base                          22 k
libaio-devel                                i386                           0.3.106-5                                       ol5_u7_base                          12 k
libaio-devel                                x86_64                         0.3.106-5                                       ol5_u7_base                          11 k
sysstat                                     x86_64                         7.0.2-11.el5                                    ol5_u7_base                         187 k
unixODBC                                    i386                           2.2.11-7.1                                      ol5_u7_base                         830 k
unixODBC                                    x86_64                         2.2.11-7.1                                      ol5_u7_base                         835 k
unixODBC-devel                              i386                           2.2.11-7.1                                      ol5_u7_base                         743 k
unixODBC-devel                              x86_64                         2.2.11-7.1                                      ol5_u7_base                         799 k

Transaction Summary
======================================================================================================================================================================
Install      14 Package(s)
Upgrade       0 Package(s)

Total size: 50 M
Is this ok [y/N]: y
Downloading Packages:
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 1e5e0159
ol5_u7_base/gpgkey                                                                                                                             | 1.4 kB     00:00
Importing GPG key 0x1E5E0159 "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>" from http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : unixODBC                                                                                                                                      1/14
  Installing     : compat-gcc-34                                                                                                                                 2/14
  Installing     : sysstat                                                                                                                                       3/14
  Installing     : compat-db                                                                                                                                     4/14
  Installing     : unixODBC                                                                                                                                      5/14
  Installing     : unixODBC-devel                                                                                                                                6/14
  Installing     : unixODBC-devel                                                                                                                                7/14
  Installing     : libaio-devel                                                                                                                                  8/14
  Installing     : libaio-devel                                                                                                                                  9/14
  Installing     : kernel-uek-firmware                                                                                                                          10/14
  Installing     : libXp                                                                                                                                        11/14
  Installing     : compat-gcc-34-c++                                                                                                                            12/14
Change references of /dev/hd in /etc/fstab to disk label
  Installing     : kernel-uek                                                                                                                                   13/14
WARNING: No module ehci-hcd found for kernel 2.6.32-200.13.1.el5uek, continuing anyway
WARNING: No module ohci-hcd found for kernel 2.6.32-200.13.1.el5uek, continuing anyway
WARNING: No module uhci-hcd found for kernel 2.6.32-200.13.1.el5uek, continuing anyway
  Installing     : oracle-validated                                                                                                                             14/14

Installed:
  oracle-validated.x86_64 0:1.1.0-14.el5

Dependency Installed:
  compat-db.x86_64 0:4.2.52-5.1                         compat-gcc-34.x86_64 0:3.4.6-4.1                               compat-gcc-34-c++.x86_64 0:3.4.6-4.1
  kernel-uek.x86_64 0:2.6.32-200.13.1.el5uek            kernel-uek-firmware.noarch 0:2.6.32-200.13.1.el5uek            libXp.i386 0:1.0.0-8.1.el5
  libaio-devel.i386 0:0.3.106-5                         libaio-devel.x86_64 0:0.3.106-5                                sysstat.x86_64 0:7.0.2-11.el5
  unixODBC.i386 0:2.2.11-7.1                            unixODBC.x86_64 0:2.2.11-7.1                                   unixODBC-devel.i386 0:2.2.11-7.1
  unixODBC-devel.x86_64 0:2.2.11-7.1

Complete!
[root@kens-orasql-002 yum.repos.d]#
</pre>
<p>We can see that the oracle-validated  RPM has been installed.</p>
<pre>
[root@kens-orasql-001 yum.repos.d]# <b>rpm -qa |grep oracle-valid</b>
oracle-validated-1.1.0-14.el5
</pre>
<p>We can also check and see that the user and groups have been created as well.</p>
<pre>
[root@kens-orasql-001 yum.repos.d]# <b>cat /etc/passwd |grep oracle</b>

oracle:x:54321:54321::/home/oracle:/bin/bash

[root@kens-orasql-001 yum.repos.d]# <b>cat /etc/group |grep dba </b>
dba:x:54322:oracle
</pre>
<p>It has also updated the /etc/security/limits.conf file</p>
<pre>
[root@kens-orasql-001 yum.repos.d]# cat /etc/security/limits.conf

# Oracle-Validated setting for nofile soft limit is 131072
oracle   soft   nofile    131072

# Oracle-Validated setting for nofile hard limit is 131072
oracle   hard   nofile    131072

# Oracle-Validated setting for nproc soft limit is 131072
oracle   soft   nproc    131072

# Oracle-Validated setting for nproc hard limit is 131072
oracle   hard   nproc    131072

# Oracle-Validated setting for core soft limit is unlimited
oracle   soft   core    unlimited

# Oracle-Validated setting for core hard limit is unlimited
oracle   hard   core    unlimited

# Oracle-Validated setting for memlock soft limit is 50000000
oracle   soft   memlock    50000000

# Oracle-Validated setting for memlock hard limit is 50000000
oracle   hard   memlock    50000000
</pre>
<p>Finally, we can see that the /etc/sysctl.conf has been updated as well with some &#8220;Oracle-Validated&#8221; settings.</p>
<pre>
# For 11g, Oracle-Validated setting for fs.file-max is 6815744
# For 10g, uncomment 'fs.file-max = 327679', and comment 'fs.file-max = 6553600' entry and re-run sysctl -p
# fs.file-max = 327679
fs.file-max = 6815744

# Oracle-Validated setting for kernel.msgmni is 2878
kernel.msgmni = 2878

# Oracle-Validated setting for kernel.msgmax is 8192
kernel.msgmax = 8192

# Oracle-Validated setting for kernel.msgmnb is 65536
kernel.msgmnb = 65536

# Oracle-Validated setting for kernel.sem is '250 32000 100 142'
kernel.sem = 250 32000 100 142

# Oracle-Validated setting for kernel.shmmni is 4096
kernel.shmmni = 4096

# Oracle-Validated setting for kernel.shmall is 1073741824
kernel.shmall = 1073741824

# Oracle-Validated setting for kernel.shmmax is 4398046511104 on x86_64 and 4294967295 on i386 architecture. Refer Note id 567506.1
kernel.shmmax = 4398046511104

# Oracle-Validated setting for kernel.sysrq is 1
kernel.sysrq = 1

# Oracle-Validated setting for net.core.rmem_default is 262144
net.core.rmem_default = 262144

# For 11g, Oracle-Validated setting for net.core.rmem_max is 4194304
# For 10g, uncomment 'net.core.rmem_max = 2097152', comment 'net.core.rmem_max = 4194304' entry and re-run sysctl -p
# net.core.rmem_max = 2097152
net.core.rmem_max = 4194304

# Oracle-Validated setting for net.core.wmem_default is 262144
net.core.wmem_default = 262144

# For 11g, Oracle-Validated setting for net.core.wmem_max is 1048576
# For 10g, uncomment 'net.core.wmem_max = 262144', comment 'net.core.wmem_max = 1048576' entry for this parameter and re-run sysctl -p
# net.core.wmem_max = 262144
net.core.wmem_max = 1048576

# Oracle-Validated setting for fs.aio-max-nr is 3145728
fs.aio-max-nr = 3145728

# For 11g, Oracle-Validated setting for net.ipv4.ip_local_port_range is 9000 65500
# For 10g, uncomment 'net.ipv4.ip_local_port_range = 1024 65000', comment 'net.ipv4.ip_local_port_range = 9000 65500' entry and re-run sysctl -p
# net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.ip_local_port_range = 9000 65500

# Oracle-Validated setting for vm.min_free_kbytes is 51200 to avoid OOM killer
vm.min_free_kbytes = 51200
</pre>
]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.com/2011/10/using-the-oracle-validated-rpm-to-install-oracle-11g-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the GoldgenGate column conversion functions &#8211; STRCAT and STREXT</title>
		<link>http://gavinsoorma.com/2011/08/using-the-goldgengate-column-conversion-functions-strcat-and-strext/</link>
		<comments>http://gavinsoorma.com/2011/08/using-the-goldgengate-column-conversion-functions-strcat-and-strext/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 00:47:44 +0000</pubDate>
		<dc:creator>Gavin Soorma</dc:creator>
				<category><![CDATA[GoldenGate]]></category>

		<guid isPermaLink="false">http://gavinsoorma.com/?p=3249</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>In one of my <a href="http://gavinsoorma.com/2011/08/using-the-goldengate-column-conversion-functions-case-and-eval/">earlier</a> posts, I had showed some examples of using the CASE and EVAL column conversion functions available in GoldenGate.</p>
<p>Let us today take a look at two other functions <strong>STRCAT</strong> and <strong>STREXT</strong>.</p>
<p>STRCAT basically enables us to concatenate two strings or two character columns.</p>
<p>The STREXT function on the other hand is used to extract a portion of a string.</p>
<p>For example in our source database we have a table MYPHONE with the following structure:</p>
<pre>
SQL> desc myphone
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 AREA_CODE                                          NUMBER
 PHONE_NO                                           NUMBER
</pre>
<p>In the target we have the same table MYPHONE with a different structure:</p>
<pre>
SQL> desc myphone
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 PHONE_NO                                           VARCHAR2(30)
</pre>
<p>So in the target database, the PHONE_NO column includes both the area code as well as the phone number with a ‘-‘ character as well between both the values, while in the source database the table has two columns – one for the area code and one for the phone number.</p>
<p>We will use SRTCAT function in this case.</p>
<p>Remember that since the source and target tables differ in structure, we need to run the DEFGEN utility in the source GoldenGate environment to generate the definitions file and then copy this across to the target GoldenGate environment..</p>
<p>These are the contents of the extract parameter file:</p>
<pre>

extract ext
userid ggs_owner, password ggs_owner
rmthost venom , mgrport 7809
rmttrail ./dirdat/gg
table ggs_owner.myphone;
</pre>
<p>These are the contents of the replicat parameter file – note how the STRCAT function is being used here.</p>
<pre>
REPLICAT rep
sourcedefs /export/home/oracle/gg/dirsql/myphone.sql
USERID ggs_owner, PASSWORD ggs_owner
MAP ggs_owner.myphone, TARGET ggs_owner.myphone,
COLMAP (phone_no=@STRCAT("0",area_code,"-",phone_no));
</pre>
<p>We now start the extract and replicat processes and insert some records in the source table.</p>
<p>The source table now has the following rows:</p>
<pre>
SQL> select * from myphone;

 AREA_CODE   PHONE_NO
---------- ----------
         8   92471136
         4   17213124
         2     818188
</pre>
<p>Let us see how these rows have been transformed on the target database.</p>
<pre>
SQL> select * from myphone;

PHONE_NO
------------------------------
08-92471136
04-17213124
02-818188
</pre>
<p>We can extend this example and use both STRCAT and STREXT together to achieve the data transformation that we desire.</p>
<p>For example in our source MYSSID table, we have data like this:</p>
<pre>
SQL> select * from myssid;

      SSID
----------
 123456787
 123456788
 123456789
</pre>
<p>But on the target database, in the same table the data has been displayed like this:</p>
<pre>

SQL> select * from myssid;

SSID
--------------------
123-456-787
123-456-788
123-456-789
</pre>
<p>So how did we achieve this?</p>
<p>Have a look at the replicat parameter file and note how we have used first the STREXT function to extract 3 characters at a time – the first 3, then the next 3 and finally  the last 3 and then used STRCAT to concatenate the result of the STREXT functions together with a ‘-‘ character acting as the string separator.</p>
<pre>
REPLICAT rep
sourcedefs /export/home/oracle/gg/dirsql/myssid.sql
USERID ggs_owner, PASSWORD ggs_owner
MAP ggs_owner.myssid, TARGET ggs_owner.myssid,
COLMAP (ssid=@STRCAT(@STREXT(ssid,1,3),"-",@STREXT(ssid,4,6),"-",@STREXT(ssid,7,9) ));
</pre>
]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.com/2011/08/using-the-goldgengate-column-conversion-functions-strcat-and-strext/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the GoldenGate column conversion functions &#8211; CASE and EVAL</title>
		<link>http://gavinsoorma.com/2011/08/using-the-goldengate-column-conversion-functions-case-and-eval/</link>
		<comments>http://gavinsoorma.com/2011/08/using-the-goldengate-column-conversion-functions-case-and-eval/#comments</comments>
		<pubDate>Wed, 24 Aug 2011 01:22:59 +0000</pubDate>
		<dc:creator>Gavin Soorma</dc:creator>
				<category><![CDATA[GoldenGate]]></category>

		<guid isPermaLink="false">http://gavinsoorma.com/?p=3243</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>Let us have a look at some GoldenGate column conversion functions – <b>CASE</b> and <b>EVAL </b></p>
<p>To illustrate this example, we have a source and target table called EMPSAL and the structure of the tables in both databases is slightly different. </p>
<p>In the source table we have the JOB column and in the target database we have a TAX_BRACKET column.</p>
<p>In the first example, we will use CASE function to populate the target database TAX_BRACKET column based on the value for the JOB column in the source database.</p>
<p>In the second example,  we will use the EVAL function to populate the target database TAX_BRACKET column based on a particular range of values for the SAL column in the source table.</p>
<p>Remember that since the table structure in source and target are different, we need to run the DEFGEN utility to generate a definitions file which we will then copy to the target GoldenGate environment and instead of using the ASSUMEDEFS parameter in the replicate parameter file, we use the SOURCEDEFS parameter instead to indicate the location of the definitions file which we have generated and copied over from the source GoldenGate environment.</p>
<p><strong>Source</strong></p>
<pre>

SQL> desc empsal
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 ENAME                                              VARCHAR2(20)
 SAL                                                NUMBER
 JOB                                                VARCHAR2(12)
</pre>
<p><strong>Target </strong></p>
<pre>
SQL> desc empsal
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 ENAME                                              VARCHAR2(20)
 SAL                                                NUMBER
 TAX_BRACKET                                        VARCHAR2(10)
</pre>
<p>We now create the definitions file for the EMPSAL table and copy the generated definitions file to the target GoldenGate environment.</p>
<pre>

GGSCI (sunos1) 4> edit params defgen

"/export/home/oracle/gg/dirprm/defgen.prm" 3 lines, 97 characters
defsfile ./dirsql/empsal.sql
userid ggs_owner password ggs_owner
table ggs_owner.empsal;

sunos1:/export/home/oracle/gg $ ./defgen paramfile /export/home/oracle/gg/dirprm/defgen.prm

sunos1:/export/home/oracle/gg/dirsql $ scp -rp empsal.sql oracle@sunos2:/export/home/oracle/gg/dirsql
</pre>
<p>Let us have a look at the Extract parameter file &#8211; quite normal and straight forward here.</p>
<pre>
extract ext
userid ggs_owner, password ggs_owner
rmthost sunos2 , mgrport 7809
rmttrail ./dirdat/gg
table ggs_owner.empsal;
</pre>
<p>On the target, these are the contents of the replicat parameter file. Note the COLPMAP clause. Since both the tables have common  columns ENAME and SAL, we do not have to explicitly map them and we can just specify USEDEFAULTS.</p>
<p>The TAX_BRACKET column on the target table is being populated using the CASE function which evaluates the values for the JOB column in the source table.</p>
<p>If the value for JOB is &#8216;OPERATOR&#8217;, then the TAX_BRACKET column is assigned the value &#8216;LOW&#8217;. If it is &#8216;DBA&#8217; then the TAX_BRACKET column is assigned the value &#8216;MID&#8217; and if the value is &#8216;MANAGER&#8217;, then the TAX_BRACKET column is assigned the value &#8216;HIGH&#8217;.  If the value for JOB is none of the values, then a default value of &#8216;UNKNOWN&#8217; is assigned.</p>
<pre>
REPLICAT rep
sourcedefs /export/home/oracle/gg/dirsql/empsal.sql
USERID ggs_owner, PASSWORD ggs_owner
MAP ggs_owner.empsal, TARGET ggs_owner.empsal,
COLMAP (
usedefaults, tax_bracket=@case(JOB, "OPERATOR","LOW","DBA", "MID","MANAGER","HIGH", "UNKNOWN"));
<pre>

Let us now insert some values into the source table.
<pre>

SQL> insert into empsal values
  2  ('JOHN',10000, 'DBA');

1 row created.

SQL> insert into empsal values
  2  ('JACK',5000, 'OPERATOR');

1 row created.

SQL> insert into empsal values
  2  ('TOM',20000, 'MANAGER');

1 row created.

SQL>  insert into empsal values
  2  ('MARY', 6000, 'ANALYST');

1 row created.

SQL> commit;

Commit complete.

SQL> select * from empsal;

ENAME                       SAL JOB
-------------------- ---------- ------------
JOHN                      10000 DBA
JACK                       5000 OPERATOR
TOM                       20000 MANAGER
MARY                       6000 ANALYST
</pre>
<p>Let us now see how the data has been replicated and how the transformation has taken place on the target.</p>
<pre>

SQL> select * from empsal;

ENAME                       SAL TAX_BRACKE
-------------------- ---------- ----------
JOHN                      10000 MID
JACK                       5000 LOW
TOM                       20000 HIGH
MARY                       6000 UNKNOWN
</pre>
<p>Let us now truncate both the tables and see the next example using EVAL instead of CASE.</p>
<p>We stop both the extract and replicat processes and will now change the replicat parameter file on the target to include the EVAL function.</p>
<p>So this is how our replicat parameter file will look like.</p>
<pre>
REPLICAT rep
sourcedefs /export/home/oracle/gg/dirsql/empsal.sql
USERID ggs_owner, PASSWORD ggs_owner
MAP ggs_owner.empsal, TARGET ggs_owner.empsal,
COLMAP (
usedefaults, &#038;
tax_bracket=@eval(sal < 10000,"LOW", sal >= 20000 , "HIGH",sal >= 10000, "MID"));
</pre>
<p>Start the extract and replicat processes again and let us now insert the same set of values in the source table as we did before and see how they are now replicated and transformed on the target.</p>
<pre>
SQL> select * from empsal;

ENAME                       SAL TAX_BRACKE
-------------------- ---------- ----------
JOHN                      10000 MID
JACK                       5000 LOW
TOM                       20000 HIGH
MARY                       6000 LOW
</pre>
<p>For those rows where the SAL value was less than 10000, a value of 'LOW' was assigned to the TAX_BRACKET column and if the value was equal to or greater than 10000 (but less than 20000), a value of 'MID' is assigned and all SAL values above 20000 are assigned 'HIGH'.</p>
<p>Have a read of the all the diferent column conversion functions mentioned in the GoldenGate reference guide and there are quite a few. Let me know if you found any others which are useful and kindly share your experience with the community!</p>
]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.com/2011/08/using-the-goldengate-column-conversion-functions-case-and-eval/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Passed the 1Z0-539 Exam &#8211; am now an Oracle Certified GoldenGate Implementation Specialist</title>
		<link>http://gavinsoorma.com/2011/08/passed-the-1z0-539-exam-am-now-an-oracle-certified-goldengate-implementation-specialist/</link>
		<comments>http://gavinsoorma.com/2011/08/passed-the-1z0-539-exam-am-now-an-oracle-certified-goldengate-implementation-specialist/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 02:44:21 +0000</pubDate>
		<dc:creator>Gavin Soorma</dc:creator>
				<category><![CDATA[GoldenGate]]></category>

		<guid isPermaLink="false">http://gavinsoorma.com/?p=3239</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p> I have recently passed the Oracle GoldenGate 10 Essentials exam which recognizes you as a Oracle GoldenGate 10 Certified Implementation Specialist.</p>
<p>Note that the exam is currently based on GoldenGate 10.4 and not the 11g version of GoldenGate which has been out now for quite some time.</p>
<p>I must point out that while there are a number of &#8216;brain dumps&#8217; like Pass4Sure and Test King to &#8216;help&#8217; you pass the exam, I have seen the questions and answers that are provided by them and in most cases I found the answers to be provided to be grossly incorrect and wrong. So beware!</p>
<p>The best preparation for the exam is to go through the following sets of documentation:</p>
<p>Oracle Installation and Setup Guide<br />
Reference Guide<br />
Administration Guide</p>
<p>These and other 10.4 GoldenGate documentation can be obtained online <a href="http://download.oracle.com/docs/cd/E15881_01/index.htm"> here &#8230;</a></p>
<p>I am now available to provide my services in any GoldenGate implementation project around the world as well as for consultancy on any GoldenGate related subjects.</p>
<p>You can contact me at +61417713124 or via email to gavin.soorma@oncalldba.com.au to discuss anything further.</p>
<p>Happy GoldenGating!</p>
]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.com/2011/08/passed-the-1z0-539-exam-am-now-an-oracle-certified-goldengate-implementation-specialist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Does GoldenGate support Oracle Flashback?</title>
		<link>http://gavinsoorma.com/2011/08/does-goldengate-support-oracle-flashback/</link>
		<comments>http://gavinsoorma.com/2011/08/does-goldengate-support-oracle-flashback/#comments</comments>
		<pubDate>Wed, 17 Aug 2011 03:16:21 +0000</pubDate>
		<dc:creator>Gavin Soorma</dc:creator>
				<category><![CDATA[GoldenGate]]></category>

		<guid isPermaLink="false">http://gavinsoorma.com/?p=3235</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>There is an Oracle Metalink Note (Does Goldengate Support The New Oracle 10g Flashback Feature? [ID 966212.1]) which discusses this aspect, but I thought that I would like to see for myself how does the Extract and Replicat processes behave if we issue any FLASHBACK command on the source database.</p>
<p>The Metalink note states that GoldenGate supports the following Flashback operations:</p>
<p>Flashback Table to SCN<br />
Flashback Table to timestamp<br />
Flashback Table to restore point</p>
<p>and does not support operations like:</p>
<p>Flashback Table to before drop<br />
Flashback database</p>
<p>I have tested both the Flashback Table To Timestamp as well as the Flashback Table To Before Drop operations and find that both seem to be supported by GoldenGate and replication continues inspite of these commands being issued on the source database.</p>
<p>Let us see the examples of the same.</p>
<p>I have an Oracle 11g Goldengate (11.1.1) environment configured with the source and target databases of version 11.2.0.2.</p>
<p>Extract and Replicat processes are running and I am not using Data Pump in this case. The table configured for replication is called MYOBJECTS.</p>
<p>To test the Flashback, I am deleting all the rows from the table and then check on the target database if this delete operation has been propagated. </p>
<p>We will then flashback to a point in time when all the rows were present in the table and then check both the source and target database to verify if the delete operation has been flashed back on both databases.</p>
<p><strong>Source</strong></p>
<p>SQL> select count(*) from myobjects;</p>
<p>  COUNT(*)<br />
&#8212;&#8212;&#8212;-<br />
     56687</p>
<p>SQL> select to_char(sysdate,&#8217;dd-mon-yyyy hh24:mi:ss&#8217;) from dual;</p>
<p>TO_CHAR(SYSDATE,&#8217;DD-<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
17-aug-2011 10:23:07</p>
<p>SQL> delete myobjects;</p>
<p>56687 rows deleted.</p>
<p>SQL> commit;</p>
<p>Commit complete.</p>
<p><strong>Target</strong> </p>
<p>SQL> select count(*) from myobjects;</p>
<p>  COUNT(*)<br />
&#8212;&#8212;&#8212;-<br />
         0</p>
<p><strong>Source</strong></p>
<p>SQL> conn / as sysdba<br />
Connected.<br />
SQL> alter table ggs_owner.myobjects enable row movement;</p>
<p>Table altered.</p>
<p>SQL>   flashback table ggs_owner.myobjects to timestamp to_timestamp (&#8217;17-aug-2011 10:23:07&#8242;,&#8217;dd-mon-yyyy hh24:mi:ss&#8217;);</p>
<p>Flashback complete.</p>
<p>SQL> select count(*) from ggs_owner.myobjects;</p>
<p>  COUNT(*)<br />
&#8212;&#8212;&#8212;-<br />
     56687</p>
<p><strong>Target </strong></p>
<p>SQL> select count(*) from myobjects;</p>
<p>  COUNT(*)<br />
&#8212;&#8212;&#8212;-<br />
     56687</p>
<p>If we check the Extract and Replicat process reports, we can see that around the time we have performed the database flashback operation, there has been both extract and replicat activity </p>
<p><strong>Source</strong></p>
<p>2011-08-17 10:23:58  INFO    OGG-01026  Rolling over remote file ./dirdat/yy000004.<br />
2011-08-17 10:25:53  INFO    OGG-01026  Rolling over remote file ./dirdat/yy000005.<br />
2011-08-17 10:25:58  INFO    OGG-01026  Rolling over remote file ./dirdat/yy000006.</p>
<p><strong>Target</strong></p>
<p>Switching to next trail file ./dirdat/yy000004 at 2011-08-17 10:23:59 due to EOF, with current RBA 9999940<br />
Opened trail file ./dirdat/yy000004 at 2011-08-17 10:23:59</p>
<p>Switching to next trail file ./dirdat/yy000005 at 2011-08-17 10:25:54 due to EOF, with current RBA 9999930<br />
Opened trail file ./dirdat/yy000005 at 2011-08-17 10:25:54</p>
<p>Switching to next trail file ./dirdat/yy000006 at 2011-08-17 10:25:58 due to EOF, with current RBA 9999882<br />
Opened trail file ./dirdat/yy000006 at 2011-08-17 10:25:58</p>
<p>Let us now look at the <strong>Flashback Table To Before Drop</strong> operation. </p>
<p>The Metalink note states that  this operation is NOT supported, but I found that in my case, GoldenGate was still peforming the online change synchronization even after we dropped the table and flashed it back.</p>
<p>Would like others in the community to try this out themselves and provide some feedback to me on how it went for them.</p>
<p>Here is the example.</p>
<p>We will use the same MYOBJECTS table and drop it and then flash it back from the recycle bin. Note &#8211; if you are using DDL replication as well, then recycle bin has to be turned off and in that case you will not be able to flashback the table from the recycle bin using the Flashback Table To Before Drop command.</p>
<p><strong>Source</strong></p>
<p>SQL> drop table myobjects;</p>
<p>Table dropped.</p>
<p>SQL> flashback table myobjects to before drop;</p>
<p>Flashback complete.</p>
<p>SQL> update myobjects set owner=&#8217;GAVIN&#8217;;</p>
<p>56687 rows updated.</p>
<p>SQL> commit;</p>
<p>Commit complete.</p>
<p>SQL> select distinct owner from myobjects;</p>
<p>OWNER<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
GAVIN</p>
<p><strong>Target</strong></p>
<p>SQL> select distinct owner from myobjects;</p>
<p>OWNER<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
GAVIN</p>
<p>Changes have been replicated!</p>
]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.com/2011/08/does-goldengate-support-oracle-flashback/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GoldenGate replication with source and target on the same physical host</title>
		<link>http://gavinsoorma.com/2011/08/goldengate-replication-with-source-and-target-on-the-same-physical-host/</link>
		<comments>http://gavinsoorma.com/2011/08/goldengate-replication-with-source-and-target-on-the-same-physical-host/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 06:47:39 +0000</pubDate>
		<dc:creator>Gavin Soorma</dc:creator>
				<category><![CDATA[GoldenGate]]></category>

		<guid isPermaLink="false">http://gavinsoorma.com/?p=3229</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>I have been asked this question several times about using GoldenGate to replicate between source and target Oracle databases located on the same physical server. Do we need two manager processes, or do we need two separate Goldengate environments or what happens if one database is a version 11g database and the other is 10g – do we need to install two versions of GoldenGate and so on and so forth.</p>
<p>To answer these common questions:</p>
<p>1)	You do not need two manager processes configured. In fact, I am not sure if we can have multiple manager processes on the same GoldenGate environment.<br />
2)	You do not need to install two GoldenGate environments in this particular case– one for source and one for target<br />
3)	You can replicate data from 11g to 10g and vice versa as well.<br />
4)	Both extract and replicat processes can run on the same host with one manager process for both </p>
<p>Let us test this with a simple example. </p>
<p>We have a table called MYOBJECTS existing in both source database (11.2.0.2) and target database (10.2.0.4). At present, both the tables have no rows. We will insert rows into the 11g database and see them propagated to the 10g target database on the same host.</p>
<pre>
SQL> desc  myobjects;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 OWNER                                              VARCHAR2(30)
 OBJECT_NAME                                        VARCHAR2(128)
 OBJECT_ID                                 NOT NULL NUMBER

SQL> select count(*) from myobjects;

  COUNT(*)
----------
         0
</pre>
<p>We create an extract called extlocal and a remote trail file (even though there is actually no ‘remote’ machine) – note the directory path pertains to a location on the source database machine. We are dealing with just one server here which acts as both a local as well as remote server as far as GoldenGate is concerned.</p>
<pre>
GGSCI (sunos01) 25> <b>add extract extlocal tranlog begin now</b>

2011-08-12 09:03:50  INFO    OGG-01749  Successfully registered EXTRACT EXTLOCAL to start managing log retention at SCN 10185228.
EXTRACT added.

GGSCI (sunos01) 26> <b>add rmttrail ./dirdat/aa extract extlocal</b>

RMTTRAIL added.
</pre>
<p>These are the contents of the extract parameter file – note rmthost points to the ‘local’ machine.</p>
<p>However, since we have both the source and target database on the same host, we need to define the source database which GoldenGate will connect to using the setenv keyword.</p>
<pre>

extract extlocal
userid ggs_owner, password ggs_owner
setenv (ORACLE_HOME="/u01/app/oracle/product/11.2.0/dbhome_2")
setenv (ORACLE_SID="eleven")
rmthost sunos01 , mgrport 7809
rmttrail ./dirdat/aa
table ggs_owner.myobjects;
</pre>
<p>We then add a replicat group replocal, which will read from the trail file located on the same server where the extract process is running. So in essence, we are running the extract and replicat processes on the same host!</p>
<pre>
GGSCI (sunos01) 1> <b>add replicat replocal exttrail ./dirdat/aa</b>
REPLICAT added.
</pre>
<p>These are the contents of the replicat parameter file – we now are setting the environment for the Oracle 10g database which will be the target.</p>
<pre>
REPLICAT replocal
SETENV (ORACLE_HOME="/u01/app/oracle/product/10.2.0/dbhome_1")
SETENV (ORACLE_SID="tentwo")
ASSUMETARGETDEFS
USERID ggs_owner, PASSWORD ggs_owner
MAP ggs_owner.myobjects, TARGET ggs_owner.myobjects;
</pre>
<p>We now start the extract process.</p>
<pre>
GGSCI (sunos01) 27> <b>start extract extlocal</b>

Sending START request to MANAGER ...
EXTRACT EXTLOCAL starting
</pre>
<p>Also, start the replicat process.</p>
<pre>
GGSCI (sunos01) 2> <b>start replicat replocal</b>

Sending START request to MANAGER ...
REPLICAT REPLOCAL starting
</pre>
<p>Check the status and we see both are running now (on the same server)</p>
<pre>
GGSCI (sunos01) 6> <b>info all</b>

Program     Status      Group       Lag           Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     EXTLOCAL    00:00:00      00:00:13
REPLICAT    RUNNING     REPLOCAL    00:00:31      00:00:03
</pre>
<p>Now make some changes in the 11g source database ….</p>
<pre>
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> insert into myobjects
  2  select owner,object_name,object_id from dba_objects where object_id is not null;

56656 rows created.

SQL> commit;

Commit complete.
</pre>
<p>Connect to the target 10g database and we see that the rows have been inserted into the table </p>
<pre>
devastator:/export/home/oracle/gg $ sqlplus ggs_owner/ggs_owner

SQL*Plus: Release 10.2.0.4.0 - Production on Mon Aug 15 14:28:47 2011

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select count(*) from myobjects;

  COUNT(*)
----------
     56656
</pre>
<p>Let us use the STATS command to verify that the replicat process has actually done the inserts.</p>
<pre>
GGSCI (devastator) 4> <b>stats replicat replocal latest</b>

Sending STATS request to REPLICAT REPLOCAL ...

Start of Statistics at 2011-08-15 14:30:11.

Replicating from GGS_OWNER.MYOBJECTS to GGS_OWNER.MYOBJECTS:

*** Latest statistics since 2011-08-15 14:28:20 ***
        Total inserts                            56656.00
        Total updates                                0.00
        Total deletes                                0.00
        Total discards                               0.00
        Total operations                         56656.00
</pre>
]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.com/2011/08/goldengate-replication-with-source-and-target-on-the-same-physical-host/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GoldenGate replication using a data definition file and DEFGEN utility</title>
		<link>http://gavinsoorma.com/2011/08/goldengate-replication-using-a-data-definition-file-and-defgen-utility/</link>
		<comments>http://gavinsoorma.com/2011/08/goldengate-replication-using-a-data-definition-file-and-defgen-utility/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 02:17:04 +0000</pubDate>
		<dc:creator>Gavin Soorma</dc:creator>
				<category><![CDATA[GoldenGate]]></category>

		<guid isPermaLink="false">http://gavinsoorma.com/?p=3224</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>Some time back I had written a post on GoldenGate column <a href="http://gavinsoorma.com/2010/02/oracle-goldengate-tutorial-8-filtering-and-mapping-data/">mapping and transformations.</a></p>
<p>I have been asked the question several times regarding how can we replicate data between tables which are not similar in structure or where the target table has columns which are just a subset of the columns present in the source table.</p>
<p>Let us look at a simple example to see how this can be done using the DEFGEN utility of GoldenGate.</p>
<p>In this example we have a source table MYOBJECTS2 (based on DBA_TABLES) and the target table structure is different as it has only three columns – OWNER, OBJECT_NAME and OBJECT_TYPE as shown below.</p>
<p>The table has 113238 rows which we need to replicate to the target database.</p>
<p>Source table </p>
<pre>
SQL> desc myobjects2
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 OWNER                                              VARCHAR2(30)
 OBJECT_NAME                                        VARCHAR2(128)
 SUBOBJECT_NAME                                     VARCHAR2(30)
 OBJECT_ID                                          NUMBER
 DATA_OBJECT_ID                                     NUMBER
 OBJECT_TYPE                                        VARCHAR2(19)
 CREATED                                            DATE
 LAST_DDL_TIME                                      DATE
 TIMESTAMP                                          VARCHAR2(19)
 STATUS                                             VARCHAR2(7)
 TEMPORARY                                          VARCHAR2(1)
 GENERATED                                          VARCHAR2(1)
 SECONDARY                                          VARCHAR2(1)
 NAMESPACE                                          NUMBER
 EDITION_NAME                                       VARCHAR2(30)
</pre>
<p>Target table </p>
<pre>
SQL> desc  myobjects2
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 OWNER                                              VARCHAR2(30)
 OBJECT_NAME                                        VARCHAR2(128)
 OBJECT_TYPE                                        VARCHAR2(19)
</pre>
<p>Since the source and target table definitions are different, we first need to create what is called a data definition file which contains the definition of the source table. </p>
<p>This is done using the DEFGEN utility and after the file is created, we transfer the same to the target server.</p>
<p>We first create a DEFGEN parameter file as shown below:</p>
<pre>
GGSCI (dev1) 1> edit params defgen

defsfile ./dirsql/myobjects2.sql
userid ggs_owner password ggs_owner
table ggs_owner.myobjects2;
</pre>
<p>We then run DEFGEN and specify the parameter file to be used which is the one we have just created.</p>
<p>$ ./defgen paramfile /export/home/oracle/gg/dirprm/defgen.prm</p>
<p>This will create a file called myobjects2.sql in the /dirsql subdirectory with the following contents:</p>
<pre>

* Definitions created/modified  2011-08-01 08:16
*
*  Field descriptions for each column entry:
*
*     1    Name
*     2    Data Type
*     3    External Length
*     4    Fetch Offset
*     5    Scale
*     6    Level
*     7    Null
*     8    Bump if Odd
*     9    Internal Length
*    10    Binary Length
*    11    Table Length
*    12    Most Significant DT
*    13    Least Significant DT
*    14    High Precision
*    15    Low Precision
*    16    Elementary Item
*    17    Occurs
*    18    Key Column
*    19    Sub Data Type
*
*
Definition for table GGS_OWNER.MYOBJECTS2
Record length: 532
Syskey: 0
Columns: 15
OWNER            64     30        0  0  0 1 0     30     30      0 0 0 0 0 1    0 1 0
OBJECT_NAME      64    128       36  0  0 1 0    128    128      0 0 0 0 0 1    0 1 0
SUBOBJECT_NAME   64     30      170  0  0 1 0     30     30      0 0 0 0 0 1    0 1 0
OBJECT_ID        64     50      206  0  0 1 0     50     50     50 0 0 0 0 1    0 1 2
DATA_OBJECT_ID   64     50      262  0  0 1 0     50     50     50 0 0 0 0 1    0 1 2
OBJECT_TYPE      64     19      318  0  0 1 0     19     19      0 0 0 0 0 1    0 1 0
CREATED         192     19      342  0  0 1 0     19     19     19 0 5 0 0 1    0 1 0
LAST_DDL_TIME   192     19      364  0  0 1 0     19     19     19 0 5 0 0 1    0 1 0
TIMESTAMP        64     19      386  0  0 1 0     19     19      0 0 0 0 0 1    0 1 0
STATUS           64      7      410  0  0 1 0      7      7      0 0 0 0 0 1    0 1 0
TEMPORARY        64      1      422  0  0 1 0      1      1      0 0 0 0 0 1    0 1 0
GENERATED        64      1      428  0  0 1 0      1      1      0 0 0 0 0 1    0 1 0
SECONDARY        64      1      434  0  0 1 0      1      1      0 0 0 0 0 1    0 1 0
NAMESPACE        64     50      440  0  0 1 0     50     50     50 0 0 0 0 1    0 1 2
EDITION_NAME     64     30      496  0  0 1 0     30     30      0 0 0 0 0 1    0 1 0
End of definition
</pre>
<p>We then will ftp or copy this data definitions file which we have just generated to the target machine. In this case we are copying the file to the same ./dirsql subdirectory under the GoldenGate root directory on the target machine.</p>
<p>In our example, we are running an initial data load and not online change synchronization. But the same example can be extended to cover online change replication as well.</p>
<p>Since this is an initial data load remember for the Extract process, we need to use the SOURCEISTABLE keyword and for the Replicat process we need to use the SPECIALRUN keyword.</p>
<p>GGSCI (dev1) 1>  add extract ext1, sourceistable </p>
<p>These are the contents of the parameter file for extract process ext1</p>
<pre>
extract ext1
userid ggs_owner, password ggs_owner
rmthost dev2 , mgrport 7809
rmttask replicat, group rep1
table ggs_owner.myobjects2;
</pre>
<p>On the target we create a replicat process and replicat parameter file.</p>
<pre>
GGSCI (dev2) 1> add replicat rep1 specialrun
</pre>
<p>The replicat rep1 parameter file has the following contents:</p>
<pre>
REPLICAT rep1
USERID ggs_owner, PASSWORD ggs_owner
SOURCEDEFS ./dirsql/myobjects2.sql
MAP ggs_owner.myobjects2, TARGET ggs_owner.myobjects2,
colmap (
owner=owner, object_name=object_name,object_type=object_type)
;
</pre>
<p>Note the column mapping using the COLMAP clause and how we have only mapped the three columns which we require. The SOURCEDEFS keyword will specify the location of the data definitions file which we have copied from the source machine and which was generated via the DEFGEN utility.</p>
<p>On the source GoldenGate environment, we start the extract ext1 using the START EXTRACT EXT1 command. Note that we do not have to start the replicat process REP1 on the target as this is done automatically by the initial load extract process.</p>
<p>We can see that after a while the extract process has stopped because it has extracted and loaded all the 113238 rows into the source table and if we see the report via the VIEW REPORT EXT1 command, we can see the insert operations which have taken place.</p>
<pre>
Processing table GGS_OWNER.MYOBJECTS2
***********************************************************************
*                   ** Run Time Statistics **                         *
***********************************************************************

Report at 2011-08-01 08:42:40 (activity since 2011-08-01 08:42:13)
Output to rep1:
From Table GGS_OWNER.MYOBJECTS2:
       #                   inserts:    113238
       #                   updates:         0
       #                   deletes:         0
       #                  discards:         0
</pre>
<p>On the target, we can see via the VIEW REPORT REP1 command, the column mapping which has taken place.</p>
<pre>
MAP resolved (entry GGS_OWNER.MYOBJECTS2):
  MAP GGS_OWNER.MYOBJECTS2, TARGET ggs_owner.myobjects2, colmap ( owner=owner, object_name=object_name,object_type=object_type) ;
2011-08-01 08:42:23  WARNING OGG-00869  No unique key is defined for table MYOBJECTS2. All viable columns will be used to represent the key, but may not guar
antee uniqueness.  KEYCOLS may be used to define the key.
Using the following key columns for target table GGS_OWNER.MYOBJECTS2: OWNER, OBJECT_NAME, OBJECT_TYPE.

***********************************************************************
*                   ** Run Time Statistics **                         *
***********************************************************************

Report at 2011-08-01 08:42:45 (activity since 2011-08-01 08:42:23)
From Table GGS_OWNER.MYOBJECTS2 to GGS_OWNER.MYOBJECTS2:
       #                   inserts:    113238
       #                   updates:         0
       #                   deletes:         0
       #                  discards:         0
</pre>
]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.com/2011/08/goldengate-replication-using-a-data-definition-file-and-defgen-utility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Oracle 10.2.0.5 Enterprise Manager Grid Control on Linux and upgrading the repository database to 10.2.0.5</title>
		<link>http://gavinsoorma.com/2011/07/installing-oracle-10-2-0-5-enterprise-manager-grid-control-on-linux-and-upgrading-the-repository-database-to-10-2-0-5/</link>
		<comments>http://gavinsoorma.com/2011/07/installing-oracle-10-2-0-5-enterprise-manager-grid-control-on-linux-and-upgrading-the-repository-database-to-10-2-0-5/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 02:51:06 +0000</pubDate>
		<dc:creator>Gavin Soorma</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[EM Grid Control]]></category>

		<guid isPermaLink="false">http://gavinsoorma.com/?p=3218</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>This note explains the procedure used to install 10.2.0.5 Grid Control on a Linux operating system (64 bit Red Hat Enterprise Linux Server release 5.6) as well as the steps taken to upgrade the repository database from the default 10.1.0.4 version to 10.2.0.5.</p>
<p>We will be using the <strong>silent installation method </strong>and not doing the installation using the OUI in interactive mode.</p>
<p>The steps can be broadly outlined as follows:</p>
<p>•	Install any missing RPM’s especially the 32 bit RPM’s needed for OEM<br />
•	Create the users and groups<br />
•	Configure kernel parameters and hosts file<br />
•	Edit the response files needed for the silent installation<br />
•	Install Grid Control 10.2.0.3 (OMS and Agent) using response files<br />
•	Upgrade Grid Control to 10.2.0.5 using response files<br />
•	Configure database repository (10.1.0.4) and OMS using response files<br />
•	Upgrade repository database to 10g Release 2 (10.2.0.1) using DBUA<br />
•	Apply 10.2.0.5 patch to database software and upgrade repository database to 10.2.0.5</p>
<p><strong>Download the software </strong></p>
<p>Download the Grid Control software from the following link:</p>
<p>http://www.oracle.com/technetwork/oem/grid-control/downloads/linuxx8664soft-085949.html</p>
<p>We need the 10.2.0.3 OEM Grid Control base release and the 10.2.0.5 patch release.</p>
<p>•	Linux_x86_64_Grid_Control_full_102030_disk1.zip<br />
•	Linux_x86_64_Grid_Control_full_102030_disk2.zip<br />
•	gc_x86_64_10205_part1of2.zip<br />
•	gc_x86_64_10205_part2of2.zip </p>
<p>Create a staging directory and unzip all the downloaded software there.</p>
<p><a href="http://gavinsoorma.com/wp-content/uploads/2011/07/gc10205_linux.doc">Download </a> and read the rest of this note.</p>
]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.com/2011/07/installing-oracle-10-2-0-5-enterprise-manager-grid-control-on-linux-and-upgrading-the-repository-database-to-10-2-0-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

