<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>azad&#039;s Blog</title>
	<atom:link href="http://syedazad.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://syedazad.wordpress.com</link>
	<description>Syed Badiuzzaman Azad &#124; Oracle DBA And ArcSDE &#38; Network Engineer administrator(Delhi,India)</description>
	<lastBuildDate>Wed, 08 Jul 2009 11:49:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='syedazad.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>azad&#039;s Blog</title>
		<link>http://syedazad.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://syedazad.wordpress.com/osd.xml" title="azad&#039;s Blog" />
	<atom:link rel='hub' href='http://syedazad.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Oracle 11g New Features</title>
		<link>http://syedazad.wordpress.com/2009/07/08/oracle-11g-new-features/</link>
		<comments>http://syedazad.wordpress.com/2009/07/08/oracle-11g-new-features/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 11:49:44 +0000</pubDate>
		<dc:creator>syedazad</dc:creator>
				<category><![CDATA[DBA]]></category>
		<category><![CDATA[Oracle 11g New Features]]></category>

		<guid isPermaLink="false">http://syedazad.wordpress.com/?p=26</guid>
		<description><![CDATA[Oracle 11g top features are as follows : 1. Database Replay 2. Flashback Data Archive 3. Automatic Diagnostic Repository &#8211; ADR 4. Automatic Memory Tuning 5. Case sensitive password 6. Virtual columns and indexes 7. Interval Partition and System Partition 8. The Query Result Cache 9. ADDM RAC Enhancements 10. SQL Plan Management and SQL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=syedazad.wordpress.com&amp;blog=8227940&amp;post=26&amp;subd=syedazad&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Oracle 11g top features are as follows : </p>
<p>1. Database Replay</p>
<p>2. Flashback Data Archive </p>
<p>3. Automatic Diagnostic Repository &#8211; ADR</p>
<p>4. Automatic Memory Tuning<br />
5. Case sensitive password<br />
6. Virtual columns and indexes<br />
7. Interval Partition and System Partition<br />
8. The Query Result Cache<br />
9. ADDM RAC Enhancements<br />
10. SQL Plan Management and SQL Plan Baselines<br />
11. SQL Access Advisor &amp; Partition Advisor<br />
12. SQL Query Repair Advisor<br />
13. SQL Performance Analyzer (SPA)<br />
14. DBMS_STATS Enhancements<br />
15. The  PL/SQL Result Cache</p>
<p>1. Database Reply: </p>
<p>This allows the total database workload to be captured, transferred to a test database  create from a backup or standby database, then replayed to test the affects of an upgrade or  system change. Currently, these are working to a capture performance overhead of 5%,   so this will capture real production workloads</p>
<p>The new Database Replay tool works like a DVR inside the database. Using a unique approach, it faithfully captures all database activity beneath the level of SQL in a binary format and then replays it either in the same database or in a different one (which is exactly what you would want to do prior to making a database change). You can also customize the capture process to include certain types of activity, or perhaps exclude some. </p>
<p>Database Replay delivers half of what Oracle calls Oracle Database 11g\&#8217;s \&#8221;Real Application Testing\&#8221; option; the other half is provided by another tool, SQL Performance Analyzer. The main difference between these two tools is the scope involved: whereas Database Replay applies to the capture and replay of all (subject to some filtering) activities in a database, SQL Performance Analyzer allows you to capture specific SQL statements and replay them. (You can\&#8217;t see or access specific SQLs captured in Database Replay, while in SQL Performance Analyzer you can.) The latter offers a significant advantage for SQL tuning because you can tweak the SQL statement issued by an application and assess its impact. (SQL Performance Analyzer is covered in a forthcoming installment in this series.)</p>
<p>2. Flashback Data Archive /Total Recall<br />
A new database object, a flashback data archive is a logical container for storing historical information. It is stored in one or more tablespaces and tracks the history for one or more tables.</p>
<p>You specify retention duration for each flashback data archive (could be # of years). </p>
<p>SQL&gt; create flashback archive fla1 tablespace tbs1 retention 2 year;</p>
<p>With the \&#8221;Oracle Total Recall\&#8221; option, Oracle database 11g has been specifically enhanced to track history with minimal performance impact and to store historical data in compressed form to minimize storage requirements, completely transparent to applications, easy to setup . This efficiency cannot be duplicated by your own triggers, which also cost time and effort to set up and maintain.</p>
<p>To satisfy long-retention requirements that exceed the undo retention, create a flashback data archive</p>
<p>3. ADR – Automatic Diagnostics Repository </p>
<p>All trace files, core files, and the alert files are now organized into a directory structure comprising the Automatic Diagnostic Repository (ADR). </p>
<p>The ADR is a file-based repository for database diagnostic data. It has a unified directory structure across multiple instances and multiple products.<br />
Beginning with Release 11g, the database, Automatic Storage Management (ASM), Cluster Ready Services (CRS), and other Oracle products or components store all diagnostic data in the ADR. Each instance of each product stores diagnostic data underneath its own ADR home directory. </p>
<p>For example, in an Oracle Real Application Clusters environment with shared storage and ASM, each database instance and each ASM instance has a home directory within the ADR. ADR\&#8217;s unified directory structure, consistent diagnostic data formats across products and instances, and a unified set of tools enable customers and Oracle Support to correlate and analyze diagnostic data across multiple instances.</p>
<p>The location of the ADR is controlled by the Oracle \&#8221;diagnostic_dest\&#8221; parameter.<br />
Path specified in the \&#8217;diagnostic_dest\&#8217; parameter defines the ADR root directory,ADR BASE. </p>
<p>The first subdirectory inside an ADR (under the  directory) is always named \&#8221;diag\&#8221;</p>
<p>For example, if the \&#8217;diagnostic_dest\&#8217; and thus the  is specified as \&#8221;$ORACLE_HOME/log\&#8221;, then expect to find the subdirectory \&#8221;$ORACLE_HOME/log/diag\&#8221;. Below this will be  .<br />
Any number of instances/components can share same ADR BASE. Under ADR BASE there will be individual ADR HOMES.<br />
Under ADR BASE ,the address of an  will be similar to :<br />
diag///. </p>
<p>Inside each ADR home, you can find several subdirectories, each for storing a specific type of diagnostic data. Among the subdirectories, you should be able to find TRACE, ALERT, INCIDENT, CDUMP etc</p>
<p>4. Automatic Memory Tuning </p>
<p>Automatic PGA tuning was introduced in Oracle 9i. Automatic SGA tuning was already<br />
introduced in  Oracle 10g.  But In 11g, all memory can be tuned automatically by setting one  parameter.  We can literally tell Oracle how much memory it has and it determines how  much  to use for PGA, SGA and OS Processes. Maximum and minimum thresholds can be set.</p>
<p>Automatic Memory Management is being introduced in 11g. This enables automatic tuning of PGA and SGA with use of two new parameters named MEMORY_MAX_TARGET and MEMORY_TARGET. </p>
<p>You have to use RESULT_CACHE_MODE initialization parameter which determines the SQL query result cache behavior. The possible initialization parameter values are MANUAL and FORCE</p>
<p>RESULT_CACHE_MAX_SIZE is new component which has been introduced as part of 11g Memory architecture. The result cache is composed of the SQL query result cache and PL/SQL function result cache, which share the same infrastructure. Results of queries and query fragments can be cached in memory in the SQL query result cache. The database can then use cached results to answer future executions of these queries and query fragments.  Similarly PL/SQL Function Result can also be cached.</p>
<p>5.Case sensitive password :</p>
<p>Passwords are expected to also become case sensitive This and other changes should result  in better protection against  password guessing scenarios. For  example, in addition to limiting the number of failed login attempts to 10 (default  configuration in 10gR2), Oracle 11g beta’s planned default settings should expire  passwords every 180 days, and limit to seven the number of times a user can login with an expired password before disabling access.</p>
<p>6.Virtual columns/indexes :</p>
<p>User can create Virtual index on table. This Virtual index is not visible to optimizer, so it will not affect performance, Developer can user HINT and see is Index is useful or not.Invisible Indexes prevent premature use of newly created indexes</p>
<p>When queried, virtual columns appear to be normal table columns, but their values are derived rather than being stored on disc. The syntax for defining a virtual column is listed below. </p>
<p>column_name [datatype] [GENERATED ALWAYS] AS (expression) [VIRTUAL]<br />
If the datatype is omitted, it is determined based on the result of the expression. The GENERATED ALWAYS and VIRTUAL keywords are provided for clarity only.</p>
<p>A virtual index is created in a slightly different manner than the normal indexes. A virtual index has no segment pegged to it, i.e., the DBA_SEGMENTS view will not show an entry for this. Oracle handles such indexes internally and few required dictionary tables are updated so that the optimizer can be made aware of its presence and generate an execution plan considering such indexes.</p>
<p>7. Interval Partition and System Partition </p>
<p>Interval partitioning is an extension of range partitioning, where the system is able to create new partitions as they are required. The PARTITION BY RANGE clause is used in the normal way to identify the transition point for the partition, then the new INTERVAL clause used to calculate the range for new partitions when the values go beyond the existing transition point.</p>
<p>The following code shows an example of a table using interval partitioning. </p>
<p>CREATE TABLE interval_PART (</p>
<p>  EMPid           NUMBER,</p>
<p>  DEPTcode         VARCHAR2(10),</p>
<p>INTERVAL_descr  VARCHAR2(50),</p>
<p>created DATE</p>
<p>)</p>
<p>PARTITION BY RANGE (created)</p>
<p>INTERVAL (NUMTOYMINTERVAL(1,’MONTH’))</p>
<p>(</p>
<p>PARTITION part_01 values LESS THAN (TO_DATE(‘01-NOV-2007’,’DD-MON-YYYY’))</p>
<p>);</p>
<p>System Partition </p>
<p>System partitioning allows large tables to be broken down into smaller partitions, but unlike other partitioning schemes, the database has no control over the placement of rows during insert operations. The following example shows the creation of a system partitioned table. </p>
<p>CREATE TABLE part_system ( </p>
<p> empid           NUMBER, </p>
<p> deptcode         VARCHAR2(10), </p>
<p> description  VARCHAR2(50), </p>
<p> created DATE </p>
<p>) </p>
<p>PARTITION BY SYSTEM </p>
<p>( </p>
<p>  PARTITION part_1, </p>
<p>  PARTITION part_2 </p>
<p>); </p>
<p>8. Query Result Cache</p>
<p>A separate shared memory pool is now used for storing and retrieving cached results. Query retrieval from the query result cache is faster than rerunning the query. Frequently executed queries will see performance improvements when using the query result cache.</p>
<p>The new query result cache enables explicit caching of results in database memory. Subsequent queries using the cached results will experience significant performance improvements.</p>
<p>Enable Result Caching :</p>
<p>You can set the RESULT_CACHE_MODE initialization parameter to control whether the SQL query result cache is used for all queries (when possible).</p>
<p>This parameter can be set at the system, session, or table level to the following values:</p>
<p>MANUAL &#8211; The results of a query can only be stored in the result cache by using the result_cache hint.<br />
FORCE &#8211; All results are stored in the result cache.</p>
<p>Example:<br />
If the RESULT_CACHE_MODE parameter is set to MANUAL then you must explicitly use the /*+ result_cache */ hint in your query to store the results of a query in the result cache.</p>
<p>SELECT /*+ result_cache */ deptno, avg(sal)<br />
FROM emp<br />
GROUP BY deptno;</p>
<p>If the RESULT_CACHE_MODE parameter is set to FORCE, and you do not wish to include the result of the query in the result cache, then you must use the /*+ no_result_cache */ hint in your query.</p>
<p>SELECT /*+ no_result_cache */ deptno, avg(sal)<br />
FROM emp<br />
GROUP BY deptno;</p>
<p>The database automatically invalidates a cached result whenever a transaction modifies the data or metadata of any of the database objects used to construct that cached result.</p>
<p>9. ADDM  RAC Enhancements </p>
<p>Oracle Database 11g now offers what it calls database ADDM, or the ability to run ADDM reports at the overall clustered database level as well as at the individual database instance level. Whenever a new Automatic Workload Repository (AWR) snapshot is requested, or whenever an ADDM analysis has been executed against a set of existing AWR snapshots, ADDM first analyzes each individual RAC instance’s performance (aka instance ADDM) and then immediately performs an ADDM database analysis.</p>
<p>10. SQL Plan Management and SQL Plan Baselines </p>
<p>The SQL statement is hard parsed, the cost based optimizer produces several execution plans and selects the one with the lowest cost. If a SQL plan baseline is present, the optimizer tries to find a matching plan in the SQL plan baseline that is flagged as accepted. If a matching plan is found, the optimizer will uses the plan. If the SQL plan baseline doesn\&#8217;t contain a matching plan, the optimizer evaluates the accepted plans in the SQL plan baseline and uses the one with the lowest cost. If the execution plan originally produced by the optimizer has a lower cost than those present in the SQL plan baseline, it is added to the baseline as a not-accepted plan, so it is not used until it is verified not to cause a reduction in performance. If a system change affects all existing accepted plans, the optimizer will use the original plan with the lowest cost and mark this as accepted.</p>
<p>Oracle call this a \&#8221;conservative plan selection strategy\&#8221;, as the optimizer preferentially uses a tried an tested execution plan, even if a new plan looks like it might perform better. Only when the newer plan is proved to perform well will it be accepted for use.</p>
<p>The use of SQL plan baselines is controlled by the OPTIMIZER_USE_SQL_PLAN_BASELINES parameter, which is set to TRUE by default.</p>
<p>SQL Management Base </p>
<p>The SQL management base resides in the SYSAUX tablespace and stores SQL plan baselines, as well as statement logs, plan histories and SQL profiles. Space usage is controlled by altering two name-value attributes using the CONFIGURE procedure of the DBMS_SPM package.</p>
<p>·        space_budget_percent (default 10) : Maximum size as a percentage of SYSAUX space. Allowable values 1-50. </p>
<p>·        plan_retention_weeks (default 53) : Number of weeks unused plans are retained before being purged. Allowable values 5-523 weeks. </p>
<p>11. SQL Access Advisor &amp; Partition Advisor </p>
<p>SQL Access Advisor was introduced in Oracle 10g to make suggestions about additional indexes and materialized views which might improve system performance. Oracle 11g has made two significant changes to the SQL Access Advisor:</p>
<p>      The advisor now includes advice on partitioning schemes that may improve performance. </p>
<p>      The original workload manipulation has been deprecated and replaced by SQL tuning sets.</p>
<p>Partition Advisor </p>
<p>The SQL Access Advisor, originally introduced in Oracle 10g, has been updated to include advice on partitioning existing tables, materialized views and indexes. Partitioning exiting tables can be quite a lengthy process, so don\&#8217;t expect this advice to provide a quick fix.</p>
<p>Enhanced Statistics Collection for Partitioned Objects </p>
<p>Oracle 11g includes improvements to statistics collection for partitioned objects so untouched partitions are not rescanned. This significantly increases the speed of statistics collection on large tables where some of the partitions contain static data. Where partition exchange load (PEL) is used to add data to the a table, only the newly added partition must be scanned to update the global statistics.</p>
<p>12.SQL Query Repair Advisor </p>
<p>SQL Repair Advisor after a SQL statement fails with a critical error. The advisor analyzes the statement and in many cases recommends a patch to repair the statement. If you implement the recommendation, the applied SQL patch circumvents the failure by causing the query optimizer to choose an alternate execution plan for future executions. </p>
<p>13. SQL Performance Analyzer </p>
<p>SQL Performance Analyzer (SPA), a key feature of the Real Application Testing option introduced in Oracle Database 11g, can predict and prevent SQL execution performance problems caused by system changes.</p>
<p>SQL Performance Analyzer provides a granular view of the impact of changes on SQL execution plans and execution statistics by running the SQL statements in isolation before and after a change. SQL Performance Analyzer compares the SQL execution result, before and after the change, and generates a report outlining the net benefit on the workload due to the changes as well as the set of regressed SQL statements. For regressed SQL statements, appropriate executions plan details along with recommendations to remedy them are provided. SQL Performance Analyzer is well integrated with existing SQL Tuning Set (STS), SQL Tuning Advisor and SQL Plan Management functionalities. SQL Performance Analyzer completely automates and simplifies the manual and time-consuming process of assessing the impact of change on extremely large SQL workloads (thousands of SQL statements).</p>
<p>14.DBMS_STATS Enhancements</p>
<p>11g there have been some enhancements made to the DBMS_STATS package. Overall the GATHER_* processes run faster but what stands out to me is the speed and accuracy that DBMS_STATS.AUTO_SAMPLE_SIZE now gives. As a performance person, I often times make reference to letting the numbers tell the story, so lets dive into a comparison between 10.2.0.3 and 11.1.0.5.</p>
<p>15.The PL/SQL Result Cache</p>
<p>PL/SQL function result cache provides a simple way to boost the performance of PL/SQL functions by saving the results of function calls for specific combinations of input parameters in the SGA. These results can be reused by any session calling the same function with the same parameters. This can result in a significant performance boost when functions are called for each row in an SQL query, or within a loop in PL/SQL. This article describes the usage and administration of the function result cache.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/syedazad.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/syedazad.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/syedazad.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/syedazad.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/syedazad.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/syedazad.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/syedazad.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/syedazad.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/syedazad.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/syedazad.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/syedazad.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/syedazad.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/syedazad.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/syedazad.wordpress.com/26/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=syedazad.wordpress.com&amp;blog=8227940&amp;post=26&amp;subd=syedazad&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://syedazad.wordpress.com/2009/07/08/oracle-11g-new-features/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/777ca5b2b3bed1f2b4b0c2c205bfb78f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">syedazad</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle Connection Behind Firewall</title>
		<link>http://syedazad.wordpress.com/2009/07/08/oracle-connection-behind-firewall/</link>
		<comments>http://syedazad.wordpress.com/2009/07/08/oracle-connection-behind-firewall/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 11:39:51 +0000</pubDate>
		<dc:creator>syedazad</dc:creator>
				<category><![CDATA[DBA]]></category>
		<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://syedazad.wordpress.com/?p=22</guid>
		<description><![CDATA[PURPOSE This article is intended to present the solutions to the problems with connecting the Oracle client to the Oracle database behind a firewall. The major reference here is the well-known Note 125021.1 [1]from Oracle Metalink, the secure customer extranet only accessible for Oracle customers and employees. [edit] Oracle Behind a Firewall During a SQLPlus [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=syedazad.wordpress.com&amp;blog=8227940&amp;post=22&amp;subd=syedazad&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>PURPOSE<br />
This article is intended to present the solutions to the problems with connecting the Oracle client to the Oracle database behind a firewall. The major reference here is the well-known Note 125021.1 [1]from Oracle Metalink, the secure customer extranet only accessible for Oracle customers and employees.<br />
[edit]<br />
Oracle Behind a Firewall<br />
During a SQLPlus connection to the Oracle database, a remote Oracle client will check the database name supplied in the sqlplus line (sqlplus user/password@database)and search the tnsnames.ora file or the names server for a match. Once it obtains the address for the database server, the client will start an attempted connection to the server. The listener on the server is contacted, and then the information about the free port on the server is sent back to the client via the listener for the actual connection. Upon receiving the information, the client will try to connect the database server on that port.<br />
Port redirection may occur during that process depending on the operating system, the configuration of the init.ora file and/or the Oracle product under discussion. Port redirection requires the Oracle client to connect to the database using a different port (usually a randomly selected TCP port) than the default or originally configured one. If there is no firewall between the server and the client, port redirection will not affect the actual connection. However, if port redirection does occur with the server behind a firewall, the client will be likely to suffer from a connectivity failure. The reason is simple: the newly assigned port based on port redirection is often blocked by the firewall. Such failures are not uncommon on Windows platforms.<br />
[edit]<br />
Case 1<br />
[edit]<br />
Problem Briefing<br />
Reported Database Versions: Oracle 8.x &#8211; 9.2.0.7;<br />
Server OS: Windows 2003 Sp2, Windows XP Sp2;<br />
Client OS: Windows 2000 Sp4, Windows XP Sp2, Windows 2003 Sp2;<br />
Description: When the Windows firewall is enabled on the Oracle database server, the Oracle client connecting the server often receives such error messages as ora-12203 and ora-12535:<br />
ORA-12203: TNS:unable to connect to destination.<br />
There may be an error in the fields entered or the server may not be ready for a connection. You can check the server and retry, or continue.<br />
ORA-12535: TNS:operation timed out<br />
There may be an error in the fields entered or the server may not be ready for a connection. You can check the server and retry, or continue.<br />
[edit]<br />
Solution<br />
Step 1: Check to see whether Oracle Port 1521 has been added to the Windows Firewall exception list on the Oracle database server machine. If not, add Oracle Port 1521 to the Windows Firewall exception list on the server machine (which you can do through the Windows Firewall dialog in Control Panel &gt; Windows Firewall, or adding it in the registry).<br />
Step 2: Enable USE_SHARED_SOCKET on the Oracle database server. That will force the server machine to share its port 1521 and thus all clients will stay on that port when connecting to the database. Noticeably, port redirection will not occur with USE_SHARED_SOCKET enabled. To do this, you must add a string value USE_SHARED_SOCKET=TRUE in the HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE section of the server&#8217;s registry. (Refer to Endnote 1)<br />
Here is the text to create a reg key for both steps to add to your registry:<br />
Windows Registry Editor Version 5.00<br />
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List]<br />
&#8220;1521:TCP&#8221;=&#8221;1521:TCP:*:Enabled:Oracle Port 1521&#8243;<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE]<br />
&#8220;USE_SHARED_SOCKET&#8221;=&#8221;TRUE&#8221;<br />
Save the text into a file with the extension &#8220;.reg&#8221;. Then double-click the file on the server machine to add the information to its registry.<br />
[edit]<br />
Notice<br />
The workaround here, suggested in Oracle Metalink Note 125021.1, is a WINSOCK V2 API feature called Shared Sockets. This feature allows a socket to be shared among multiple processes.<br />
To use this functionality in a single Oracle Home enviroment, set USE_SHARED_SOCKET=TRUE in the HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE section of the registry. Noticeably, as WINSOCK V2 allows a socket to be shared between multiple processes, the listener cannot be restarted without shutting down the database first.<br />
A downfall of this solution is all connetions will stay on the listener port. If the listener is stopped or restarted all the connections will be severed from the database. Furthermore, USE_SHARED_SOCKET could be a performance bottleneck with multiple connections to the database. Please use it deliverately if many simultaneous connections to the database are involved.<br />
[edit]<br />
Case 2<br />
[edit]<br />
Problem Briefing<br />
Reported Database Versions: Oracle 8.x &#8211; 9.2.0.7;<br />
Server OS: Unix, including AIX, HP-UX, Linux and Solaris<br />
Description: Connectivity failures may occur on Oracle database servers behind a firewall if they run in multi-threaded server mode(MTS). The reason is that Oracle Multi-Threaded Server (MTS) on Unix platforms will cause port redirection, and that the reassigned port is likely to be blocked.(Refer to Endnote 1)<br />
[edit]<br />
Solution<br />
The workaround is to specify the port in the mts parameters of the init.ora file. The dispatcher will then be allowed to use the specified port, instead of the randomly selected port. Make sure that the specified port is open on the firewall. The following example shows the ports set to 8000 and 8001. Set the relevant parameters according to your individual systems.<br />
Example<br />
mts_dispatchers=&#8221;(address=(protocol=tcp)(host=hostname)(port=8000))(dispatchers=1)&#8221;<br />
mts_dispatchers=&#8221;(address=(protocol=tcp)(host=hostname)(port=8001))(dispatchers=1)&#8221;</p>
<p>[edit]<br />
ENDNOTE<br />
1. Here is the reference from Oracle Metalink Note 125021.1:<br />
A remote Oracle client making a connection to an Oracle database can fail if there is a firewall installed between the client and the server if there is port redirection. The firewall will block the port when the Oracle client connects to the database and can fail with the client receiving Oracle error ora-12203 or ora-12535. The Client connection failure is due to port redirection from the Windows operating system. Port redirection requires the Client to connect to the database using a different port than originally configured in the configuration ora files. Oracle MTS on Unix platforms, (without specifying the address with the ports in the init ora file), Oracle SSL, and NT platforms will cause port redirection.<br />
Note 125021.1 suggests the following workarounds:<br />
1.	Firewall Vendor: The first solution is to contact the firewall vendor and see if they have an upgrade to allow for oracle connectivity with OS port redirection. If the firewall software can be upgraded, it is the best solution to follow.<br />
2.	Connection Manager: Use Connection Manager so that the TNS CONNECT following the REDIRECT happens on the server side of the firewall.<br />
3.	Use_Shared_Socket: A third solution for NT servers is to add the use_shared_socket = true into the registry (see 124140.1). This will allow the OS to share port 1521 and clients will then stay on 1521 when connecting to the database and will not be port redirected. A downfall of this option is all connetions will stay on the listener port and if the listener is stopped or restarted all the connections will be severed from the database.<br />
2. Oracle Metalink Note 125021.1 also mentions how to solve the connecting problem in the SSL scenario:<br />
Using SSL will cause Port redirection. The workaround is to select and set the ports using MTS in the init.ora, or by setting the Ports with Connection Manager in the cman.ora file. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/syedazad.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/syedazad.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/syedazad.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/syedazad.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/syedazad.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/syedazad.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/syedazad.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/syedazad.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/syedazad.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/syedazad.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/syedazad.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/syedazad.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/syedazad.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/syedazad.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=syedazad.wordpress.com&amp;blog=8227940&amp;post=22&amp;subd=syedazad&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://syedazad.wordpress.com/2009/07/08/oracle-connection-behind-firewall/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/777ca5b2b3bed1f2b4b0c2c205bfb78f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">syedazad</media:title>
		</media:content>
	</item>
		<item>
		<title>Drop and Re-Create Database Console in Oracle</title>
		<link>http://syedazad.wordpress.com/2009/06/24/drop-and-re-create-database-console-in-oracle/</link>
		<comments>http://syedazad.wordpress.com/2009/06/24/drop-and-re-create-database-console-in-oracle/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 09:32:36 +0000</pubDate>
		<dc:creator>syedazad</dc:creator>
				<category><![CDATA[DBA]]></category>
		<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://syedazad.wordpress.com/?p=11</guid>
		<description><![CDATA[Drop Database Console :- To drop (remove) the configuration files and repository for Database Console, run: $ emca -deconfig dbcontrol db -repos drop STARTED EMCA at Jul 24, 2006 9:53:55 PM EM Configuration Assistant, Version 10.2.0.1.0 Production Copyright (c) 2003, 2005, Oracle. All rights reserved. Enter the following information: Database SID: TESTDB Listener port number: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=syedazad.wordpress.com&amp;blog=8227940&amp;post=11&amp;subd=syedazad&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Drop Database Console :-</p>
<p>To drop (remove) the configuration files and repository for Database Console, run:<br />
$ emca -deconfig dbcontrol db -repos drop</p>
<p>STARTED EMCA at Jul 24, 2006 9:53:55 PM<br />
EM Configuration Assistant, Version 10.2.0.1.0 Production<br />
Copyright (c) 2003, 2005, Oracle.  All rights reserved.</p>
<p>Enter the following information:<br />
Database SID: TESTDB<br />
Listener port number: 1521<br />
Password for SYS user: change_on_install<br />
Password for SYSMAN user: manager</p>
<p>Do you wish to continue? [yes(Y)/no(N)]: Y<br />
Jul 24, 2006 9:54:15 PM oracle.sysman.emcp.EMConfig perform<br />
INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/TESTDB/emca_2006-07-24_09-53-55-PM.log.<br />
Jul 24, 2006 9:54:16 PM oracle.sysman.emcp.util.DBControlUtil stopOMS<br />
INFO: Stopping Database Control (this may take a while) &#8230;<br />
Jul 24, 2006 9:54:35 PM oracle.sysman.emcp.EMReposConfig dropRepository<br />
INFO: Dropping the EM repository (this may take a while) &#8230;<br />
Jul 24, 2006 9:56:48 PM oracle.sysman.emcp.EMReposConfig invoke<br />
INFO: Repository successfully dropped<br />
Enterprise Manager configuration completed successfully<br />
FINISHED EMCA at Jul 24, 2006 9:56:48 PM</p>
<p>________________________________________<br />
Recreate Database Console :-</p>
<p>To recreate the configuration files and repository for Database Console, run:<br />
$ emca -config dbcontrol db -repos recreate</p>
<p>STARTED EMCA at Jul 24, 2006 10:08:20 PM<br />
EM Configuration Assistant, Version 10.2.0.1.0 Production<br />
Copyright (c) 2003, 2005, Oracle.  All rights reserved.</p>
<p>Enter the following information:<br />
Database SID: TESTDB<br />
Database Control is already configured for the database TESTDB<br />
You have chosen to configure Database Control for managing the database TESTDB<br />
This will remove the existing configuration and the default settings and perform a fresh configuration<br />
Do you wish to continue? [yes(Y)/no(N)]: Y<br />
Listener port number: 1521<br />
Password for SYS user: change_on_install<br />
Password for DBSNMP user: manager<br />
Password for SYSMAN user: manager<br />
Email address for notifications (optional):<br />
Outgoing Mail (SMTP) server for notifications (optional):<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>You have specified the following settings</p>
<p>Database ORACLE_HOME &#8230;&#8230;&#8230;&#8230;&#8230;. /u01/app/oracle/product/10.2.0/db_1</p>
<p>Database hostname &#8230;&#8230;&#8230;&#8230;&#8230;. linux3<br />
Listener port number &#8230;&#8230;&#8230;&#8230;&#8230;. 1521<br />
Database SID &#8230;&#8230;&#8230;&#8230;&#8230;. TESTDB<br />
Email address for notifications &#8230;&#8230;&#8230;&#8230;&#8230;<br />
Outgoing Mail (SMTP) server for notifications &#8230;&#8230;&#8230;&#8230;&#8230;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Do you wish to continue? [yes(Y)/no(N)]: Y</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/syedazad.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/syedazad.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/syedazad.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/syedazad.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/syedazad.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/syedazad.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/syedazad.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/syedazad.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/syedazad.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/syedazad.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/syedazad.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/syedazad.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/syedazad.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/syedazad.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=syedazad.wordpress.com&amp;blog=8227940&amp;post=11&amp;subd=syedazad&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://syedazad.wordpress.com/2009/06/24/drop-and-re-create-database-console-in-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/777ca5b2b3bed1f2b4b0c2c205bfb78f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">syedazad</media:title>
		</media:content>
	</item>
		<item>
		<title>Data Guard Configuration Steps</title>
		<link>http://syedazad.wordpress.com/2009/06/18/data-guard-configuration-steps/</link>
		<comments>http://syedazad.wordpress.com/2009/06/18/data-guard-configuration-steps/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 12:29:15 +0000</pubDate>
		<dc:creator>syedazad</dc:creator>
				<category><![CDATA[DBA]]></category>
		<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://syedazad.wordpress.com/?p=8</guid>
		<description><![CDATA[Always keep the Backup copy of the control file before any operation. Identify the Primary Database Datafiles Primary Make a Copy of the Primary Database Primary Create a Control File for the Standby Database Primary Prepare the Initialization Parameter File to be Copied to the Standby Database Primary Copy Files from the Primary System to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=syedazad.wordpress.com&amp;blog=8227940&amp;post=8&amp;subd=syedazad&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Always keep the Backup copy of the control file before any operation.</p>
<p>	Identify the Primary Database Datafiles 				Primary<br />
	Make a Copy of the Primary Database					Primary<br />
	Create a Control File for the Standby Database 				Primary<br />
	Prepare the Initialization Parameter File to be Copied to the Standby<br />
	Database								Primary<br />
	Copy Files from the Primary System to the Standby System 		Primary<br />
	Set Initialization Parameters on a Physical Standby Database 		Standby<br />
	Create a Windows Service 						Standby<br />
	Configure Listeners for the Primary and Standby Databases 		Primary and Standby</p>
<p>	Enable Dead Connection Detection on the Standby System 			Standby<br />
	Create Oracle Net Service Names 					Primary and Standby</p>
<p>	Create a Server Parameter File for the Standby Database 			Standby<br />
	Start the Physical Standby Database 					Standby<br />
	Initiate Log Apply Services 						Standby<br />
	Enable Archiving to the Physical Standby Database 			Primary</p>
<p>1.	Primary database should be in archive log mode:-<br />
Connect as sysdba<br />
SQL&gt;Select log_mode from v$database;	Or<br />
Sql&gt;Archive log list;<br />
Sql&gt;Alter database archivelog;</p>
<p>If  automatic archival is not enabled then enable it using:-<br />
Sql&gt;Alter system Archive log start;<br />
2.	Enable Force Logging to Primary database:-<br />
Sql&gt;Alter database force logging; (It force the writing of redo records. FORCE LOGGING is to ensure complete media recovery while it degrade the performance.)</p>
<p>Antonym:<br />
(Alter database noarchivelog;<br />
Alter database no force logging;)</p>
<p>3.	Set the local archive destination:-<br />
Sql&gt;Alter system set log_archive_dest_1=’LOCATION=d:\oradata\oraHome92\oradata\BST1 Mandatory’ scope=BOTH;<br />
4.	Identifying the Pr. Database datafile:-<br />
Sql&gt;Select name from V$DATAFILE;<br />
5.	Make a copy of the Pr.database file:-<br />
Sql&gt;Alter system switch logfile;<br />
Sql&gt;shutdown immediate;</p>
<p>Now copy all the datafile and place into a temp folder to transfer to Standby Site.</p>
<p>Sql&gt;Startup;</p>
<p>6.	Now make a standby control file:-<br />
Sql&gt;Alter database create standby controlfile as ‘d:\oradata\oraHome92\oradata\BST1\Stby_Cf.ctl’;<br />
7.	Prepare the Initialization Parameter file to be copied to the Standby Site:-<br />
Sql&gt;Create PFILE=’d:\oradata\oraHome92\dbs\InitStby.ora’ from SPFILE;</p>
<p>8.	Transfer the Backup datafile,Control file and InitStby initialization file to the Standby site at same position.<br />
9.	Modify the Initialization file on Primary and Standby site both as follows:-<br />
On Pr.Dbase:&#8212;<br />
Log_ 	archive_dest_1=’LOCATION=d:\oradata\oraHome92\oradata\BST1\Arch	_ive REOPEN=5 MAX_FAILURE=3’<br />
Log_archive_dest_2=’SERVICE=BST1SBY LGWR ASYNC 				AFFIRM’(or BST1 whatever oracleNetServiceName is.)<br />
Log_archive_dest_state_1=enable<br />
Log_archive_dest_state_2=enable</p>
<p>On Standby Site:&#8212;</p>
<p>Log_ archive_dest_1=’LOCATION=d:\oradata\oraHome92\oradata\BST1\Archive’<br />
Log_archive_dest_2=’SERVICE=BST1SBY LGWR ASYNC 				AFFIRM’(or BST1 whatever oracleNetServiceName is.)<br />
Log_archive_dest_state_1=enable<br />
Log_archive_dest_state_2=enable<br />
Log_archive_start=true<br />
Standby_file_management=AUTO<br />
Remote_archive_enable=true<br />
Remote_archive_dest=’D:\….\….\…\Archive’<br />
Fal_server=Primary1(net service name on the standby machine for Pr.Dbase)  optional<br />
Fal_Client=BST1SBY(net service name on the Pr.Dbase for standby<br />
dbase)  optional</p>
<p>10.	Create Oracle Net configuration on both the machine to connect each other.<br />
Eg.<br />
Tnsnames.ora File on Primary site will look like<br />
# standby db identification on Pr. Site<br />
BST1SBY.RAMTECH.COM =	 Net Service Name	  Standby host<br />
  (DESCRIPTION =			of Stby db.<br />
    (ADDRESS_LIST =<br />
      (ADDRESS = (PROTOCOL = TCP)(HOST = RAMTECH-144)(PORT = 1521))<br />
    )<br />
    (CONNECT_DATA =<br />
      (SID = KGIS)<br />
    )<br />
  )</p>
<p>Tnsnames.ora File on Standby site will look like<br />
# Primary db identification on Standby Site<br />
PRIMARY1.RAMTECH.COM =	 Net Service Name	  pr.Host<br />
  (DESCRIPTION =			of Pr.Db.<br />
    (ADDRESS_LIST =<br />
      (ADDRESS = (PROTOCOL = TCP)(HOST = RAMTECH-201)(PORT = 1521))<br />
    )<br />
    (CONNECT_DATA =<br />
      (SID = KGIS)<br />
    )<br />
  )<br />
BST1.RAMTECH.COM=-&gt;GLOBALNAME TO ACCESS FOR EX.CONNECT SYS/RAMTECH@BST1</p>
<p>  (DESCRIPTION =<br />
    (ADDRESS_LIST =<br />
      (ADDRESS = (PROTOCOL = TCP)(HOST = ramtech-117)(PORT = 1521))<br />
    )<br />
    (CONNECT_DATA =<br />
      (SERVER = DEDICATED)<br />
      (SID= BST1SBY)  &#8212;-&gt;&gt; ORADIM…SID NAME<br />
    )<br />
  )</p>
<p>Listener.ora File on Standby site will look like<br />
Add the standby database details in listener file on Standby machine.<br />
No changes reqd in listener file on Pr. Machine.</p>
<p>LISTENER =<br />
  (DESCRIPTION_LIST =<br />
    (DESCRIPTION =<br />
      (ADDRESS_LIST =<br />
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))<br />
      )<br />
      (ADDRESS_LIST =<br />
        (ADDRESS = (PROTOCOL = TCP)(HOST = ramtech-144)(PORT = 1521))<br />
      )<br />
    )<br />
  )</p>
<p>SID_LIST_LISTENER =<br />
  (SID_LIST =<br />
    (SID_DESC =<br />
      (SID_NAME = PLSExtProc)<br />
      (ORACLE_HOME = D:\oradata\oraHome92)<br />
      (PROGRAM = extproc)<br />
    )<br />
    (SID_DESC =<br />
      (GLOBAL_DBNAME = BST1)<br />
      (ORACLE_HOME = D:\oradata\oraHome92)<br />
      (SID_NAME = BST1SBY)<br />
    )<br />
)</p>
<p>11.	Create a window service on Standby machine:-<br />
C:\&gt;oradim –NEW –SID BST1SBY –STARTMODE MANUAL<br />
	–PFILE D:\oradata\oraHome92\dbs\file_name.ora</p>
<p>12.	Stop and Start the listener:-<br />
C:\&gt;lsnrctl stop/reload/start/status</p>
<p>13.	Enable the dead connection detection on the Standby site in SQLNET.ORA file in admin folder<br />
	SQLNET.Expire_time=2<br />
SQLNET.AUTHENTICATION_SERVICES= (NTS)</p>
<p>14.	Create a Password file on Standby site:-<br />
C:\&gt;orapwd file= D:\oradata\oraHome92\database\PWDBST1Sby.ora 	password=ramtech entries=10</p>
<p>15.	Create a Server parameter file on Standby database:<br />
Note:- Before creating SPFILE make sure that all the necessary Initialization 	parameter text file entries done.</p>
<p>Sql&gt;connect sys/ramtech@BST1 as sysdba<br />
	Connected to an idle instance.<br />
Note:&#8211;If there is End –Of-File Communication error comes,then first restart the service and after that connect to an idle instance and then create spfile from pfile.</p>
<p>Sql&gt;create SPFILE from PFILE=’       	D:\oradata\oraHome92\dbs\file_name.ora’</p>
<p>16.	start the standby database:-<br />
Sql&gt;startup nomount;<br />
Sql&gt;alter database mount standby database;<br />
Sql&gt;alter database recover managed standby 	database disconnect from session;<br />
17.	On Primary site:-<br />
	Enable archiving as follows:-<br />
Sql&gt;Alter system set 	log_archive_dest_2=’SERVICE=BST1SBY LGWR 	ASYNC AFFIRM’;</p>
<p>Sql&gt;Alter system set 								log_archive_dest_state_2=Enable;<br />
18.	Start Remote archiving on Pr.database to push log file manually:-<br />
Sql&gt;Alter system archive log current;</p>
<p>19.	Check the update on Standby site:-<br />
Sql&gt;alter database recover managed standby database 	CANCEL;<br />
Sql&gt;alter database open read only;<br />
Sql&gt;select * from scott.emp;(Check update if any)</p>
<p>20.	To bring up the database in recovery mode shutdown it first and then startup nomount……….like before till alter database recover …..statement.</p>
<p>For Maximum Protection:-<br />
Log_archive_dest_3=’SERVICE=BST1SBY LGWR SYNC AFFIRM’</p>
<p>Start database in mount mode (not open)<br />
Sql&gt;Alter database set standby database to maximize protection;</p>
<p>(By default protection mode is Maximize performance)</p>
<p>Note:-ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE {PROTECTION | AVAILABILITY | PERFORMANCE};<br />
You execute this statement on the primary database, which must be stopped and in the mount state.</p>
<p>Find Gap:<br />
select thread#,low_sequence#,high_sequence# from V$archive_gap;</p>
<p>Status of individual archived log on Standby site :-</p>
<p>select thread#,Sequence#,Applied,Registrar from V$Archived_Log;</p>
<p>ARCHIVE_LAG_TARGET<br />
Description<br />
Limits the amount of data that can be lost and effectively increases the availability<br />
of the standby database by forcing a log switch after the amount of time you specify<br />
(in seconds) elapses. The standby database will not miss redo logs generated from a<br />
time range longer than a value of the ARCHIVE_LAG_TARGET parameter.<br />
Role<br />
Applies to the primary database role<br />
Examples<br />
The following example sets the log switch interval to 30 minutes (a typical value):<br />
ARCHIVE_LAG_TARGET = 1800</p>
<p>Role Management 7-11<br />
7.2.1 Switchover Operations Involving a Physical Standby Database<br />
This section describes how to perform a switchover operation that changes roles<br />
between a primary database and a physical standby database. Always initiate the<br />
switchover operation on the primary database and complete it on the physical<br />
standby database. The following steps describe how to perform the switchover<br />
operation.<br />
On the current primary database<br />
Step 1 Verify that it is possible to perform a switchover operation.<br />
On the current primary database, query the SWITCHOVER_STATUS column of the<br />
V$DATABASE fixed view on the primary database to verify that it is possible to<br />
perform a switchover operation. For example:<br />
Role Transitions Involving Physical Standby Databases<br />
7-12 Oracle9i Data Guard Concepts and Administration<br />
SQL&gt; SELECT SWITCHOVER_STATUS FROM V$DATABASE;<br />
SWITCHOVER_STATUS<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
TO STANDBY<br />
1 row selected<br />
The TO STANDBY value in the SWITCHOVER_STATUS column indicates that it is<br />
possible to switch the primary database to the standby role. If the TO STANDBY<br />
value is not displayed, then verify that the Data Guard configuration is functioning<br />
correctly (for example, verify that all LOG_ARCHIVE_DEST_n parameter values are<br />
specified correctly).<br />
Step 2 Initiate the switchover operation on the primary database.<br />
To transition the current primary database to a physical standby database role, use<br />
the following SQL statement on the primary database:<br />
SQL&gt; ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY;<br />
After this statement completes, the primary database is converted into a standby<br />
database. The current control file is backed up to the current SQL session trace file<br />
before the switchover operation. This makes it possible to reconstruct a current<br />
control file, if necessary.<br />
Step 3 Shut down and restart the former primary instance.<br />
Shut down the former primary instance and restart it without mounting the<br />
database:<br />
SQL&gt; SHUTDOWN IMMEDIATE;<br />
SQL&gt; STARTUP NOMOUNT;<br />
Mount the database as a physical standby database:<br />
SQL&gt; ALTER DATABASE MOUNT STANDBY DATABASE;<br />
At this point in the switchover process, both databases are configured as standby<br />
databases (see Figure 7–3).<br />
See Also: Chapter 14 for information about other valid values for<br />
the SWITCHOVER_STATUS column of the V$DATABASE view<br />
Role Transitions Involving Physical Standby Databases<br />
Role Management 7-13<br />
On the target physical standby database<br />
Step 4 Verify the switchover status in the V$DATABASE view.<br />
After you transition the primary database to the physical standby role and the<br />
switchover notification is received by the standby databases in the configuration,<br />
you should verify if the switchover notification was processed by the target standby<br />
database by querying the SWITCHOVER_STATUS column of the V$DATABASE fixed<br />
view on the target standby database.<br />
For example:<br />
SQL&gt; SELECT SWITCHOVER_STATUS FROM V$DATABASE;<br />
SWITCHOVER_STATUS<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
SWITCHOVER PENDING<br />
1 row selected<br />
The SWITCHOVER PENDING value of the SWITCHOVER_STATUS column indicates<br />
the standby database is about to switch from the standby role to the primary role. If<br />
the SWITCHOVER PENDING value is not displayed, then verify that the Data Guard<br />
configuration is functioning correctly (for example, verify that all LOG_ARCHIVE_<br />
DEST_n parameter values are specified correctly).<br />
Step 5 Switch the physical standby database role to the primary role.<br />
You can switch a physical standby database from the standby role to the primary<br />
role when the standby database instance is either mounted in managed recovery<br />
mode or open for read-only access. It must be mounted in one of these modes so<br />
that the primary database switchover operation request can be coordinated.<br />
The SQL ALTER DATABASE statement used to perform the switchover<br />
automatically creates online redo logs if they do not already exist. This might<br />
significantly increase the time required to complete the COMMIT operation.<br />
Therefore, Oracle Corporation recommends that you always manually add online<br />
redo logs to the target standby database when you create it. Use one of the<br />
following methods to manually add the online redo logs if they do not already exist:<br />
_ Copy the existing online redo logs from the initial primary database site to the<br />
target standby database site and define the LOG_FILE_NAME_CONVERT<br />
initialization parameter to correctly associate the standby site path names to the<br />
new online redo logs (see Section 3.2.6).<br />
See Also: Chapter 14 for information about other valid values for<br />
the SWITCHOVER_STATUS column of the V$DATABASE view<br />
Role Transitions Involving Physical Standby Databases<br />
_ Drop any existing online redo logs at the target standby site and create new<br />
ones using the ALTER DATABASE ADD STANDBY LOGFILE statement.<br />
After you manually add the online redo logs, use the following SQL statement on<br />
the physical standby database that you want to transition to the primary role:<br />
SQL&gt; ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;<br />
Step 6 Shut down and restart the new primary database.<br />
Shut down the target standby instance and restart it using the appropriate<br />
initialization parameters for the primary role:<br />
SQL&gt; SHUTDOWN;<br />
SQL&gt; STARTUP;<br />
The target physical standby database is now transitioned to the primary database<br />
role.<br />
On the new physical standby database<br />
Step 7 Start managed recovery operations and log apply services.<br />
Issue the following statement to begin managed recovery operations on the new<br />
physical standby database:<br />
SQL&gt; ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;<br />
On the new primary database<br />
Step 8 Begin sending redo data to the standby databases.<br />
Issue the following statement on the new primary database:<br />
SQL&gt; ALTER SYSTEM ARCHIVE LOG CURRENT;</p>
<p>Media recovery:</p>
<p>SQL&gt;RECOVER MANAGED STANDBY DATABASE disconnect from session;<br />
SQL&gt; recover managed standby database cancel;<br />
Both the above 2 cmds for complete media recovery.<br />
Switchover</p>
<p>wanted to do a failover test. so i aborted my primary and activated my standby as primary using the following commands</p>
<p>recover managed standby database finish;<br />
alter database commit to switchover to primary with session shutdown;<br />
shutdown immediate;<br />
startup</p>
<p>Important:</p>
<p>1.	Initiate the failover operation on the target physical standby database<br />
Since our Data Guard configuration was set up in maximum performance mode, it was not configured with any standby redo logs. Therefore, run the following SQL statement from the target physical standby database to initiate the failover operation. Please keep in mind that this statement will cause (minimal) data loss as the latest information from the down primary database is not available anymore.<br />
SQL&gt; alter database recover managed standby database finish skip standby logfile;</p>
<p>Database altered.<br />
The above SQL statement performs incomplete<br />
recovery until the last SCN included in the latest archived redo log available at the physical standby database. The next section describes the final step which is to make the target standby database the primary.<br />
  	If your Data Guard configuration did contain standby redo logs (as required with protection modes like maximum availability and maximum protection AND you have not registered any partial archived redo log files, then you need to stop normal managed recovery and then initiate the failover operation using the following SQL statements:<br />
SQL&gt; alter database recover managed standby database cancel;</p>
<p>Database altered.</p>
<p>SQL&gt; alter database recover managed standby database finish;</p>
<p>Database altered.</p>
<p>2.	Convert the physical standby database to the primary role<br />
After the ALTER DATABASE RECOVER MANAGED STANDBY DATABASE &#8230; FINISH; SQL statement successfully completes, you will then need to transition the target physical standby database to the primary database role by issuing the following SQL statement:<br />
SQL&gt; alter database commit to switchover to primary;</p>
<p>The above SQL statement will only succeed if the correct &#8220;ALTER DATABASE RECOVER MANAGED STANDBY DATABASE &#8230; FINISH;&#8221; statement was issued (in the previous section). If you forgot the &#8220;&#8230;SKIP STANDBY LOGFILE&#8221; clause although you have no standby redo log files, the &#8220;COMMIT TO SWITCHOVER&#8221; will fail with the error that more media recovery is required here.<br />
If the &#8220;COMMIT TO SWITCHOVER&#8221; fails for any reason, you have to use the &#8220;ACTIVATE&#8221; SQL statement which forces the failover operation (and may cause data loss!):<br />
SQL&gt; alter database activate standby database;</p>
<p>Database altered.<br />
After the &#8220;COMMIT TO SWITCHOVER&#8221; successfully completes, you can no longer use this database as a standby database. Also, subsequent redo logs from the original primary database cannot be applied.<br />
Execute this statement if media recovery error comes:&#8211;<br />
SQL&gt; alter database activate standby database; and now shutdown as below…<br />
3.	Shutdown and restart the new primary database<br />
To complete the failover operation, you need to shutdown the new primary database and restart it in read/write mode using the appropriate initialization parameter file (or SPFILE) for the primary role:<br />
SQL&gt; shutdown immediate<br />
ORA-01507: database not mounted</p>
<p>ORACLE instance shut down.</p>
<p>SQL&gt; startup<br />
ORACLE instance started.</p>
<p>Total System Global Area  252777556 bytes<br />
Fixed Size                   451668 bytes<br />
Variable Size             218103808 bytes<br />
Database Buffers           33554432 bytes<br />
Redo Buffers                 667648 bytes<br />
Database mounted.<br />
Database opened.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/syedazad.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/syedazad.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/syedazad.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/syedazad.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/syedazad.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/syedazad.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/syedazad.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/syedazad.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/syedazad.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/syedazad.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/syedazad.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/syedazad.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/syedazad.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/syedazad.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=syedazad.wordpress.com&amp;blog=8227940&amp;post=8&amp;subd=syedazad&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://syedazad.wordpress.com/2009/06/18/data-guard-configuration-steps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/777ca5b2b3bed1f2b4b0c2c205bfb78f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">syedazad</media:title>
		</media:content>
	</item>
	</channel>
</rss>
