<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[Oracle Forum - The Knowledge Center for Oracle Professionals - Looking Beyond the Possibilities - Oracle Database ]]></title>
		<link>http://www.oraerp.com/</link>
		<description><![CDATA[Oracle Forum - The Knowledge Center for Oracle Professionals - Looking Beyond the Possibilities - http://www.oraerp.com]]></description>
		<pubDate>Mon, 29 Jun 2026 22:07:23 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[sizing of SGA]]></title>
			<link>http://www.oraerp.com/thread-71331.html</link>
			<pubDate>Sat, 17 Jan 2015 10:09:02 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://www.oraerp.com/member.php?action=profile&uid=36940">Arshad Ch</a>]]></dc:creator>
			<guid isPermaLink="false">http://www.oraerp.com/thread-71331.html</guid>
			<description><![CDATA[Hi All, Oracle DB Version:11.2.0.1 and Operating System is Linux<br />
We are facing perfromance issue in one of database and below is the instance effected area as per the AWR reprot. The DB is using AMM and the SGA alloacted is 1GB<br />
if we will increase SGA size, will it resolve the issue ?<br />
Guidence is requried<br />
kind regards,<br />
Arshad]]></description>
			<content:encoded><![CDATA[Hi All, Oracle DB Version:11.2.0.1 and Operating System is Linux<br />
We are facing perfromance issue in one of database and below is the instance effected area as per the AWR reprot. The DB is using AMM and the SGA alloacted is 1GB<br />
if we will increase SGA size, will it resolve the issue ?<br />
Guidence is requried<br />
kind regards,<br />
Arshad]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[oracle database 12c installation error]]></title>
			<link>http://www.oraerp.com/thread-71259.html</link>
			<pubDate>Thu, 11 Dec 2014 15:24:46 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://www.oraerp.com/member.php?action=profile&uid=38963">Ahmad Mujeeb</a>]]></dc:creator>
			<guid isPermaLink="false">http://www.oraerp.com/thread-71259.html</guid>
			<description><![CDATA[Hey friends, require your help for step-by-step instructions to install Oracle Database 12c Release 1 on Windows 7. i tried but was stuck in number of issues.<br />
advance thanks<br />
Kind Regards,<br />
Ahmad]]></description>
			<content:encoded><![CDATA[Hey friends, require your help for step-by-step instructions to install Oracle Database 12c Release 1 on Windows 7. i tried but was stuck in number of issues.<br />
advance thanks<br />
Kind Regards,<br />
Ahmad]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[ORA-01722: invalid number - Error during implicit conversion]]></title>
			<link>http://www.oraerp.com/thread-71258.html</link>
			<pubDate>Thu, 11 Dec 2014 06:01:51 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://www.oraerp.com/member.php?action=profile&uid=38962">Hassan Habib</a>]]></dc:creator>
			<guid isPermaLink="false">http://www.oraerp.com/thread-71258.html</guid>
			<description><![CDATA[trying to figure out oracle error for few SELECT queries in 11g which were working pretty well in 10g environment of client<br />
<br />
 our Oracle Version:<br />
10.2.0.5.0<br />
to<br />
11.2.0.3.0<br />
We are storing numeric values under CHAR or VARCHAR2 column in few tables. This is known design issue &amp; it can't be changed for now. Require any help ...........<br />
Hassan]]></description>
			<content:encoded><![CDATA[trying to figure out oracle error for few SELECT queries in 11g which were working pretty well in 10g environment of client<br />
<br />
 our Oracle Version:<br />
10.2.0.5.0<br />
to<br />
11.2.0.3.0<br />
We are storing numeric values under CHAR or VARCHAR2 column in few tables. This is known design issue &amp; it can't be changed for now. Require any help ...........<br />
Hassan]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[How to Troubleshoot ORA-600]]></title>
			<link>http://www.oraerp.com/thread-71257.html</link>
			<pubDate>Wed, 10 Dec 2014 10:51:42 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://www.oraerp.com/member.php?action=profile&uid=38961">Ali Rizwan</a>]]></dc:creator>
			<guid isPermaLink="false">http://www.oraerp.com/thread-71257.html</guid>
			<description><![CDATA[Getting following error <br />
ORA-600 [17281] "Error closing all cursors for an instantiation" <br />
help to patch this ???]]></description>
			<content:encoded><![CDATA[Getting following error <br />
ORA-600 [17281] "Error closing all cursors for an instantiation" <br />
help to patch this ???]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[location of alert log in 11g]]></title>
			<link>http://www.oraerp.com/thread-71234.html</link>
			<pubDate>Sat, 22 Nov 2014 08:29:57 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://www.oraerp.com/member.php?action=profile&uid=38993">Erica Kristen</a>]]></dc:creator>
			<guid isPermaLink="false">http://www.oraerp.com/thread-71234.html</guid>
			<description><![CDATA[Need quick help.. not able to figure out......What is the location of alert log file in 11g as it has diagnostic des?]]></description>
			<content:encoded><![CDATA[Need quick help.. not able to figure out......What is the location of alert log file in 11g as it has diagnostic des?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[How to debug long stored procedures and how to create backend logging mechanism?]]></title>
			<link>http://www.oraerp.com/thread-71155.html</link>
			<pubDate>Wed, 03 Sep 2014 04:39:15 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://www.oraerp.com/member.php?action=profile&uid=25">fanni339</a>]]></dc:creator>
			<guid isPermaLink="false">http://www.oraerp.com/thread-71155.html</guid>
			<description><![CDATA[<a href="http://syedfarhanashraf.blogspot.ae/2014/09/how-to-debug-long-stored-procedures-and.html" target="_blank" rel="noopener" class="mycode_url">http://syedfarhanashraf.blogspot.ae/2014...s-and.html</a>]]></description>
			<content:encoded><![CDATA[<a href="http://syedfarhanashraf.blogspot.ae/2014/09/how-to-debug-long-stored-procedures-and.html" target="_blank" rel="noopener" class="mycode_url">http://syedfarhanashraf.blogspot.ae/2014...s-and.html</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[ORA-00600: internal error code, arguments: [17182] - adding standby database to broke]]></title>
			<link>http://www.oraerp.com/thread-71147.html</link>
			<pubDate>Fri, 29 Aug 2014 11:23:08 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://www.oraerp.com/member.php?action=profile&uid=38">Pryia Rai</a>]]></dc:creator>
			<guid isPermaLink="false">http://www.oraerp.com/thread-71147.html</guid>
			<description><![CDATA[Hi Guys,<br />
we are facing problem and the ORA600 error is coming on new standby database<br />
<br />
with the addition of new standby database STANDBY_xx to the existing data guard broker configuration. when we are enabling the database, DGMGRL on primary hangs (eventually timing out) while the alert log on standby database shows ORA-600 errors. The new database remains in a error state in the broker. The logs start to ship to the new STANDBY_xx database, but the ORA600 errors is keep coming &amp; we disabled the database in DGB then the error is stopping.<br />
Cheers!]]></description>
			<content:encoded><![CDATA[Hi Guys,<br />
we are facing problem and the ORA600 error is coming on new standby database<br />
<br />
with the addition of new standby database STANDBY_xx to the existing data guard broker configuration. when we are enabling the database, DGMGRL on primary hangs (eventually timing out) while the alert log on standby database shows ORA-600 errors. The new database remains in a error state in the broker. The logs start to ship to the new STANDBY_xx database, but the ORA600 errors is keep coming &amp; we disabled the database in DGB then the error is stopping.<br />
Cheers!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Oracle error messages]]></title>
			<link>http://www.oraerp.com/thread-71140.html</link>
			<pubDate>Wed, 27 Aug 2014 17:45:47 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://www.oraerp.com/member.php?action=profile&uid=38">Pryia Rai</a>]]></dc:creator>
			<guid isPermaLink="false">http://www.oraerp.com/thread-71140.html</guid>
			<description><![CDATA[we all can search Oracle error message in HTML format. If you only have access to the Oracle Documentation CD, you can browse the error messages by range. Once you find the specific range, use your browser's "find in page" feature to locate the specific message. When connected to the Internet, you can search for a specific error message using the error message search feature of the Oracle online documentation.<br />
All messages displayed are prefixed by text that indicates which program issued the message. For example, the prefix "ORA" shows that the message was generated by the Oracle products. The location of messages in this book depends on the prefix of the message. All messages are listed in order by the message code number. To look up a message, use the message code number.<br />
You can search error message from this reference.<br />
<a href="http://docs.oracle.com/cd/E11882_01/server.112/e17766/toc.htm" target="_blank" rel="noopener" class="mycode_url">http://docs.oracle.com/cd/E11882_01/serv...66/toc.htm</a>]]></description>
			<content:encoded><![CDATA[we all can search Oracle error message in HTML format. If you only have access to the Oracle Documentation CD, you can browse the error messages by range. Once you find the specific range, use your browser's "find in page" feature to locate the specific message. When connected to the Internet, you can search for a specific error message using the error message search feature of the Oracle online documentation.<br />
All messages displayed are prefixed by text that indicates which program issued the message. For example, the prefix "ORA" shows that the message was generated by the Oracle products. The location of messages in this book depends on the prefix of the message. All messages are listed in order by the message code number. To look up a message, use the message code number.<br />
You can search error message from this reference.<br />
<a href="http://docs.oracle.com/cd/E11882_01/server.112/e17766/toc.htm" target="_blank" rel="noopener" class="mycode_url">http://docs.oracle.com/cd/E11882_01/serv...66/toc.htm</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[ORA-04052: error occurred when looking up remote object]]></title>
			<link>http://www.oraerp.com/thread-71139.html</link>
			<pubDate>Mon, 25 Aug 2014 20:15:20 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://www.oraerp.com/member.php?action=profile&uid=37">Sara Khan</a>]]></dc:creator>
			<guid isPermaLink="false">http://www.oraerp.com/thread-71139.html</guid>
			<description><![CDATA[Hi,<br />
I have created a function in which a table is accessed through the database link<br />
when I compile it shows the following error:<br />
<br />
ORA-04052: error occurred when looking up remote object abc_OWNER.ALL_TAB_COLUMNS@db_abc_LINK<br />
ORA-00604: error occurred at recursive SQL level 1<br />
ORA-12170: TNS:Connect timeout occurred<br />
<br />
Can anyone help?]]></description>
			<content:encoded><![CDATA[Hi,<br />
I have created a function in which a table is accessed through the database link<br />
when I compile it shows the following error:<br />
<br />
ORA-04052: error occurred when looking up remote object abc_OWNER.ALL_TAB_COLUMNS@db_abc_LINK<br />
ORA-00604: error occurred at recursive SQL level 1<br />
ORA-12170: TNS:Connect timeout occurred<br />
<br />
Can anyone help?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Oracle 11gR2 How to find user session]]></title>
			<link>http://www.oraerp.com/thread-71096.html</link>
			<pubDate>Sun, 06 Jul 2014 18:34:16 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://www.oraerp.com/member.php?action=profile&uid=37">Sara Khan</a>]]></dc:creator>
			<guid isPermaLink="false">http://www.oraerp.com/thread-71096.html</guid>
			<description><![CDATA[Hi All,<br />
I have a quick question, need to get the user session log based on user name.<br />
suppose user 'A' logged in to database through sqlplus and he ran some query. As a DBA i need to know how to get the user 'A' session log from DBA side so that can find out queries, he is running. <br />
<br />
Thanks]]></description>
			<content:encoded><![CDATA[Hi All,<br />
I have a quick question, need to get the user session log based on user name.<br />
suppose user 'A' logged in to database through sqlplus and he ran some query. As a DBA i need to know how to get the user 'A' session log from DBA side so that can find out queries, he is running. <br />
<br />
Thanks]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[ORACLE HOME issue with DBCA]]></title>
			<link>http://www.oraerp.com/thread-70961.html</link>
			<pubDate>Mon, 06 May 2013 08:26:52 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://www.oraerp.com/member.php?action=profile&uid=94">Richard</a>]]></dc:creator>
			<guid isPermaLink="false">http://www.oraerp.com/thread-70961.html</guid>
			<description><![CDATA[Folks,<br />
I am trying to create a new database with 11.2.0.3 binaries, which is cloned from R12 PROD, But failed due to the dbca invoking wrong OH. I opened the dbca source code[file], the OH parameter value is wrongly defined. I corrected the parameter and i tried but its taking same path again [Wrong one]. <br />
<br />
If any one please, let me know what are all the files that dbca using while creating the database.]]></description>
			<content:encoded><![CDATA[Folks,<br />
I am trying to create a new database with 11.2.0.3 binaries, which is cloned from R12 PROD, But failed due to the dbca invoking wrong OH. I opened the dbca source code[file], the OH parameter value is wrongly defined. I corrected the parameter and i tried but its taking same path again [Wrong one]. <br />
<br />
If any one please, let me know what are all the files that dbca using while creating the database.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[ORA-00439: feature not enabled: Managed Standby]]></title>
			<link>http://www.oraerp.com/thread-70940.html</link>
			<pubDate>Sat, 16 Feb 2013 15:50:58 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://www.oraerp.com/member.php?action=profile&uid=94">Richard</a>]]></dc:creator>
			<guid isPermaLink="false">http://www.oraerp.com/thread-70940.html</guid>
			<description><![CDATA[Hello,<br />
I am configuring data guard. When I setting the parameter log_archive_dest_2 i got following error. <br />
I don't know why it is not allowing to set this parameter. <br />
<br />
ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=TURKDR NOAFFIRM ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=TURKDR'<br />
*<br />
ERROR at line 1:<br />
ORA-32017: failure in updating SPFILE<br />
ORA-00439: feature not enabled: Managed Standby<br />
<br />
Please someone help me to get rectify this issue.]]></description>
			<content:encoded><![CDATA[Hello,<br />
I am configuring data guard. When I setting the parameter log_archive_dest_2 i got following error. <br />
I don't know why it is not allowing to set this parameter. <br />
<br />
ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=TURKDR NOAFFIRM ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=TURKDR'<br />
*<br />
ERROR at line 1:<br />
ORA-32017: failure in updating SPFILE<br />
ORA-00439: feature not enabled: Managed Standby<br />
<br />
Please someone help me to get rectify this issue.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[SQL Performance Analyzer in Oracle Database 11g]]></title>
			<link>http://www.oraerp.com/thread-111.html</link>
			<pubDate>Mon, 28 Mar 2011 07:31:06 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://www.oraerp.com/member.php?action=profile&uid=1">admin</a>]]></dc:creator>
			<guid isPermaLink="false">http://www.oraerp.com/thread-111.html</guid>
			<description><![CDATA[<span style="font-size: medium;" class="mycode_size">SQL Performance Analyzer in Oracle Database 11g</span> <br />
<br />
The concept of SQL tuning sets, along with the DBMS_SQLTUNE package to manipulate them, was introduced in Oracle 10g as part of the Automatic SQL Tuning functionality. Oracle 11g makes further use of SQL tuning sets with the SQL Performance Analyzer, which compares the performance of the statements in a tuning set before and after a database change. The database change can be as major or minor as you like, such as: <br />
<ul class="mycode_list"><li>Database, operating system, or hardware upgrades. <br />
</li>
<li>Database, operating system, or hardware configuration changes. <br />
</li>
<li>Database initialization parameter changes. <br />
</li>
<li>Schema changes, such as adding indexes or materialized views. <br />
</li>
<li>Refreshing optimizer statistics. <br />
</li>
<li>Creating or changing SQL profiles.</li>
</ul>
 <br />
Unlike Database Replay , the SQL Performance Analyzer does not try and replicate the workload on the system. It just plugs through each statement gathering performance statistics. <br />
<br />
The SQL Performance Analyzer can be run manually using the DBMS_SQLPA package or using Enterprise Manager. This article gives an overview of both methods. <br />
<ul class="mycode_list"><li><a href="http://www.oracle-base.com/articles/11g/SqlPerformanceAnalyzer_11gR1.php#setting_up" target="_blank" rel="noopener" class="mycode_url">Setting Up the Test</a> <br />
</li>
<li><a href="http://www.oracle-base.com/articles/11g/SqlPerformanceAnalyzer_11gR1.php#tuning_set_api" target="_blank" rel="noopener" class="mycode_url">Creating SQL Tuning Sets using the DBMS_SQLTUNE Package</a> <br />
</li>
<li><a href="http://www.oracle-base.com/articles/11g/SqlPerformanceAnalyzer_11gR1.php#sql_performance_analyzer_api" target="_blank" rel="noopener" class="mycode_url">Running the SQL Performance Analyzer using the DBMS_SQLPA Package</a> <br />
</li>
<li><a href="http://www.oracle-base.com/articles/11g/SqlPerformanceAnalyzer_11gR1.php#tuning_set_em" target="_blank" rel="noopener" class="mycode_url">Creating SQL Tuning Sets using Enterprise Manager</a> <br />
</li>
<li><a href="http://www.oracle-base.com/articles/11g/SqlPerformanceAnalyzer_11gR1.php#sql_performance_analyzer_em" target="_blank" rel="noopener" class="mycode_url">Running the SQL Performance Analyzer using Enterprise Manager</a> <br />
</li>
<li><a href="http://www.oracle-base.com/articles/11g/SqlPerformanceAnalyzer_11gR1.php#optimizer_upgrade_simulation" target="_blank" rel="noopener" class="mycode_url">Optimizer Upgrade Simulation</a> <br />
</li>
<li><a href="http://www.oracle-base.com/articles/11g/SqlPerformanceAnalyzer_11gR1.php#parameter_change" target="_blank" rel="noopener" class="mycode_url">Parameter Change</a> <br />
</li>
<li><a href="http://www.oracle-base.com/articles/11g/SqlPerformanceAnalyzer_11gR1.php#transferring_tuning_sets" target="_blank" rel="noopener" class="mycode_url">Transferring SQL Tuning Sets</a></li>
</ul>
 <br />
<span style="font-size: medium;" class="mycode_size">Setting Up the Test</span> <br />
<br />
The SQL performance analyzer requires SQL tuning sets, and SQL tuning sets are pointless unless they contain SQL, so the first task should be to issue some SQL statements. We are only trying to demonstrate the technology, so the example can be really simple. The following code creates a test user called SPA_TEST_USER. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>CONN / AS SYSDBA <br />
<br />
CREATE USER spa_test_user IDENTIFIED BY spa_test_user <br />
QUOTA UNLIMITED ON users; <br />
<br />
GRANT CONNECT, CREATE TABLE TO spa_test_user; </blockquote>
 <br />
Next, connect to the test user and create a test table called MY_OBJECTS using a query from the ALL_OBJECTS view. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>CONN spa_test_user/spa_test_user <br />
<br />
CREATE TABLE my_objects AS <br />
SELECT * FROM all_objects; <br />
<br />
EXEC DBMS_STATS.gather_table_stats(USER, 'MY_OBJECTS', cascade =&gt; TRUE); </blockquote>
This schema represents our "before" state. Still logged in as the test user, issue the following statements.<blockquote class="mycode_quote"><cite>Quote:</cite>SELECT COUNT(*) FROM my_objects WHERE object_id &lt;= 100; <br />
SELECT object_name FROM my_objects WHERE object_id = 100; <br />
SELECT COUNT(*) FROM my_objects WHERE object_id &lt;= 1000; <br />
SELECT object_name FROM my_objects WHERE object_id = 1000; <br />
SELECT COUNT(*) FROM my_objects WHERE object_id BETWEEN 100 AND 1000; </blockquote>
 <br />
Notice, all statements make reference to the currently unindexed OBJECT_ID column. Later we will be indexing this column to create our changed "after" state. <br />
<br />
The select statements are now in the shared pool, so we can start creating an SQL tuning set. <br />
<br />
<span style="font-size: medium;" class="mycode_size">Creating SQL Tuning Sets using the DBMS_SQLTUNE Package</span> <br />
<br />
The DBMS_SQLTUNE package contains procedures and functions that allow us to create, manipulate and drop SQL tuning sets. The first step is to create an SQL tuning set called spa_test_sqlset using the CREATE_SQLSET procedure. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>CONN / AS SYSDBA <br />
<br />
EXEC DBMS_SQLTUNE.create_sqlset(sqlset_name =&gt; 'spa_test_sqlset'); </blockquote>
 <br />
Next, the SELECT_CURSOR_CACHE table function is used to retrieve a cursor containing all SQL statements that were parsed by the SPA_TEST_USER schema and contain the word "my_objects". The resulting cursor is loaded into the tuning set using the LOAD_SQLSET procedure. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>DECLARE <br />
l_cursor DBMS_SQLTUNE.sqlset_cursor; <br />
BEGIN <br />
OPEN l_cursor FOR <br />
SELECT VALUE(a) <br />
FROM TABLE( <br />
DBMS_SQLTUNE.select_cursor_cache( <br />
basic_filter =&gt; 'sql_text LIKE ''%my_objects%'' and parsing_schema_name = ''SPA_TEST_USER''', <br />
attribute_list =&gt; 'ALL') <br />
) a; <br />
<br />
<br />
DBMS_SQLTUNE.load_sqlset(sqlset_name =&gt; 'spa_test_sqlset', <br />
populate_cursor =&gt; l_cursor); <br />
END; <br />
/ </blockquote>
 <br />
The DBA_SQLSET_STATEMENTS view allows us to see which statements have been associated with the tuning set. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>SELECT sql_text <br />
FROM dba_sqlset_statements <br />
WHERE sqlset_name = 'spa_test_sqlset'; <br />
<br />
SQL_TEXT <br />
-------------------------------------------------------------------------------- <br />
SELECT object_name FROM my_objects WHERE object_id = 100 <br />
SELECT COUNT(*) FROM my_objects WHERE object_id &lt;= 100 <br />
SELECT COUNT(*) FROM my_objects WHERE object_id BETWEEN 100 AND 1000 <br />
SELECT COUNT(*) FROM my_objects WHERE object_id &lt;= 1000 <br />
SELECT object_name FROM my_objects WHERE object_id = 1000 <br />
<br />
5 rows selected. <br />
<br />
SQL&gt; </blockquote>
 <br />
Now we have an SQL tuning set, we can start using the SQL performance analyzer. <br />
<br />
<span style="font-size: medium;" class="mycode_size">Running the SQL Performance Analyzer using the DBMS_SQLPA Package</span> <br />
<br />
The DBMS_SQLPA package is the PL/SQL API used to manage the SQL performance ananlyzer. The first step is to create an analysis task using the CREATE_ANALYSIS_TASK function, passing in the SQL tuning set name and making a note of the resulting task name. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>CONN / AS SYSDBA <br />
<br />
VARIABLE v_task VARCHAR2(64); <br />
EXEC :v_task := DBMS_SQLPA.create_analysis_task(sqlset_name =&gt; 'spa_test_sqlset'); <br />
<br />
PL/SQL procedure successfully completed. <br />
<br />
SQL&gt; PRINT :v_task <br />
<br />
V_TASK <br />
-------------------------------------------------------------------------------- <br />
TASK_122 <br />
<br />
SQL&gt; </blockquote>
 <br />
Next, use the EXECUTE_ANALYSIS_TASK procedure to execute the contents of the SQL tuning set against the current state of the database to gather information about the performance before any modifications are made. This analysis run is named before_change. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>BEGIN <br />
DBMS_SQLPA.execute_analysis_task( <br />
task_name =&gt; :v_task, <br />
execution_type =&gt; 'test execute', <br />
execution_name =&gt; 'before_change'); <br />
END; <br />
/ </blockquote>
 <br />
Now we have the "before" performance information, we need to make a change so we can test the "after" performance. For this example we will simply add an index to the test table on the OBJECT_ID column. In a new SQL*Plus session create the index using the following statements. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>CONN spa_test_user/spa_test_user <br />
<br />
CREATE INDEX my_objects_index_01 ON my_objects(object_id); <br />
<br />
EXEC DBMS_STATS.gather_table_stats(USER, 'MY_OBJECTS', cascade =&gt; TRUE); </blockquote>
 <br />
Now, we can return to our original session and test the performance after the database change. Once again use the EXECUTE_ANALYSIS_TASK procedure, naming the analysis task "after_change". <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>BEGIN <br />
DBMS_SQLPA.execute_analysis_task( <br />
task_name =&gt; :v_task, <br />
execution_type =&gt; 'test execute', <br />
execution_name =&gt; 'after_change'); <br />
END; <br />
/ </blockquote>
 <br />
Once the before and after analysis tasks are complete, we must run a comparison analysis task. The following code explicitly names the analysis tasks to compare using name-value pairs in the EXECUTION_PARAMS parameter. If this is ommited, the latest two analysis runs are compared. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>BEGIN <br />
DBMS_SQLPA.execute_analysis_task( <br />
task_name =&gt; :v_task, <br />
execution_type =&gt; 'compare performance', <br />
execution_params =&gt; dbms_advisor.arglist( <br />
'execution_name1', <br />
'before_change', <br />
'execution_name2', <br />
'after_change') <br />
); <br />
END; <br />
/ </blockquote>
 <br />
With this final analysis run complete, we can check out the comparison report using the REPORT_ANALYSIS_TASK function. The function returns a CLOB containing the report in 'TEXT', 'XML' or 'HTML' format. Its usage is shown below. <br />
<br />
Note. Oracle 11gR2 also includes an 'ACTIVE' format that looks more like the Enterprise Manager output. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>SET PAGESIZE 0 <br />
SET LINESIZE 1000 <br />
SET LONG 1000000 <br />
SET LONGCHUNKSIZE 1000000 <br />
SET TRIMSPOOL ON <br />
SET TRIM ON <br />
<br />
SPOOL /tmp/execute_comparison_report.htm <br />
<br />
SELECT DBMS_SQLPA.report_analysis_task(:v_task, 'HTML', 'ALL') <br />
FROM dual; <br />
<br />
SPOOL OFF </blockquote>
 <br />
An example of this file for each available type is shown below. <br />
<ul class="mycode_list"><li><a href="http://www.oracle-base.com/articles/11g/execute_comparison_report_text.txt" target="_blank" rel="noopener" class="mycode_url">TEXT</a> <br />
</li>
<li><a href="http://www.oracle-base.com/articles/11g/execute_comparison_report_html.htm" target="_blank" rel="noopener" class="mycode_url">HTML</a> <br />
</li>
<li><a href="http://www.oracle-base.com/articles/11g/execute_comparison_report_xml.xml" target="_blank" rel="noopener" class="mycode_url">XML</a> <br />
</li>
<li><a href="http://www.oracle-base.com/articles/11g/execute_comparison_report_active.htm" target="_blank" rel="noopener" class="mycode_url">ACTIVE</a> - Active HTML available in 11gR2 requires a download of Javascript libraries from an Oracle website, so must be used on a PC connected to the internet.</li>
</ul>
 <br />
<span style="font-size: medium;" class="mycode_size">Creating SQL Tuning Sets using Enterprise Manager</span> <br />
<br />
Click on the "SQL Tuning Sets" link towards the bottom of the "Performance" tab. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/01-SqlTuningSetsLink.jpg" loading="lazy"  alt="[Image: 01-SqlTuningSetsLink.jpg]" class="mycode_img" /> <br />
<br />
On the "SQL Tuning Sets" screen, click the "Create" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/02-SqlTuningSets.jpg" loading="lazy"  alt="[Image: 02-SqlTuningSets.jpg]" class="mycode_img" /> <br />
<br />
Enter a name for the SQL tuning set and click the "Next" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/03-Options.jpg" loading="lazy"  alt="[Image: 03-Options.jpg]" class="mycode_img" /> <br />
<br />
Select the "Load SQL statements one time only" option, select the "Cursor Cache" as the data source, then click the "Next" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/04-LoadMethods.jpg" loading="lazy"  alt="[Image: 04-LoadMethods.jpg]" class="mycode_img" /> <br />
<br />
Set the appropriate values for the "Parsing Schema Name" and "SQL Text" filter attributes, remove any extra attributes by clicking their remove icons, then click the "Next" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/05-FilterOptions.jpg" loading="lazy"  alt="[Image: 05-FilterOptions.jpg]" class="mycode_img" /> <br />
<br />
Accept the immediate schedule by clicking the "Next" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/06-Schedule.jpg" loading="lazy"  alt="[Image: 06-Schedule.jpg]" class="mycode_img" /> <br />
<br />
Assuming the review information looks correct, click the "Submit" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/07-Review.jpg" loading="lazy"  alt="[Image: 07-Review.jpg]" class="mycode_img" /> <br />
<br />
The "SQL Tuning Sets" screen shows the confirmation of the tuning set creation and the scheduled job to populate it. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/08-Confirmation.jpg" loading="lazy"  alt="[Image: 08-Confirmation.jpg]" class="mycode_img" /> <br />
<br />
Once the population job completes, clicking on the SQL tuning set displays its contents. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/09-SqlTuningSetContents.jpg" loading="lazy"  alt="[Image: 09-SqlTuningSetContents.jpg]" class="mycode_img" /> <br />
<br />
Now we have an SQL tuning set, we can start using the SQL performance analyzer. <br />
<br />
<span style="font-size: medium;" class="mycode_size">Running the SQL Performance Analyzer using Enterprise Manager</span> <br />
<br />
Click the "SQL Performance Analayzer" link on the "Software and Support" tab. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/10-SqlPerformanceAnalyzerLink.jpg" loading="lazy"  alt="[Image: 10-SqlPerformanceAnalyzerLink.jpg]" class="mycode_img" /> <br />
<br />
Click the "Guided Workflow" link on the "SQL Performance Analayzer" screen. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/11-GuidedWorkflow.jpg" loading="lazy"  alt="[Image: 11-GuidedWorkflow.jpg]" class="mycode_img" /> <br />
<br />
Click the execute icon on the first step to create the SQL Performance Analyzer task. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/12-CreateSpaTaskIcon.jpg" loading="lazy"  alt="[Image: 12-CreateSpaTaskIcon.jpg]" class="mycode_img" /> <br />
<br />
Enter a name for the SPA task, select the SQL tuning set to associate with it, then click the "Create" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/13-CreateSpaTask.jpg" loading="lazy"  alt="[Image: 13-CreateSpaTask.jpg]" class="mycode_img" /> <br />
<br />
When the status of the previous step becomes a green tick, click the execute icon on the second step to capture the SQL tuning set performance information of the "before" state. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/14-ReplayBeforeIcon.jpg" loading="lazy"  alt="[Image: 14-ReplayBeforeIcon.jpg]" class="mycode_img" /> <br />
<br />
Enter a "Replay Trial Name" of "before_change", check the "Trial environment established" checkbox, then click the "Submit" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/15-ReplayBefore.jpg" loading="lazy"  alt="[Image: 15-ReplayBefore.jpg]" class="mycode_img" /> <br />
<br />
When the status of the previous step becomes a green tick, click the execute icon on the third step to capture the SQL tuning set performance information of the "after" state. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/16-ReplayAfterIcon.jpg" loading="lazy"  alt="[Image: 16-ReplayAfterIcon.jpg]" class="mycode_img" /> <br />
<br />
Alter the state of the database by creating an index on the OBJECT_ID column of the test table. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>CONN spa_test_user/spa_test_user@prod <br />
<br />
CREATE INDEX my_objects_index_01 ON my_objects(object_id); <br />
<br />
EXEC DBMS_STATS.gather_table_stats(USER, 'MY_OBJECTS', cascade =&gt; TRUE); </blockquote>
 <br />
Enter a "Replay Trial Name" of "after_change", check the "Trial environment established" checkbox, then click the "Submit" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/17-ReplayAfter.jpg" loading="lazy"  alt="[Image: 17-ReplayAfter.jpg]" class="mycode_img" /> <br />
<br />
When the status of the previous step becomes a green tick, click the execute icon on the forth step to run a comparison analysis task. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/18-CompareIcon.jpg" loading="lazy"  alt="[Image: 18-CompareIcon.jpg]" class="mycode_img" /> <br />
<br />
Accept the default "Trial 1 Name" and "Trial 2 Name" settings by clicking the "Submit" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/19-Compare.jpg" loading="lazy"  alt="[Image: 19-Compare.jpg]" class="mycode_img" /> <br />
<br />
When the status of the previous step becomes a green tick, click the execute icon on the fifth step to view the comparison report. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/20-ReportIcon.jpg" loading="lazy"  alt="[Image: 20-ReportIcon.jpg]" class="mycode_img" /> <br />
<br />
The resulting page contains the comparison report for the SQL Performance Analyzer task. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/21-Report.jpg" loading="lazy"  alt="[Image: 21-Report.jpg]" class="mycode_img" /> <br />
<br />
Clicking on a specific SQL ID displays the statement specific results, along with the before and after execution plans. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/22-SqlReport.jpg" loading="lazy"  alt="[Image: 22-SqlReport.jpg]" class="mycode_img" /> <br />
<br />
<span style="font-size: medium;" class="mycode_size">Optimizer Upgrade Simulation</span> <br />
<br />
The SQL Performance Analyzer allows you to test the affects of optimizer version changes on SQL tuning sets. Click the "Optimizer Upgrade Simulation" link on the "SQL Performance Analyzer" page. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/23-OptimizerUpgradeSimulationLink.jpg" loading="lazy"  alt="[Image: 23-OptimizerUpgradeSimulationLink.jpg]" class="mycode_img" /> <br />
<br />
Enter a task name, select the two optimizer versions to compare, then click the "Submit" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/24-OptimizerUpgradeSimulation.jpg" loading="lazy"  alt="[Image: 24-OptimizerUpgradeSimulation.jpg]" class="mycode_img" /> <br />
<br />
The task is listed in the "SQL Performance Analyzer Tasks" section. Refresh the page intermittently until the task status becomes a green tick, then click on the task name. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/25-TaskList.jpg" loading="lazy"  alt="[Image: 25-TaskList.jpg]" class="mycode_img" /> <br />
<br />
The resulting screen shows details of the selected task. Click on the "Comparison Report" classes icon allows you to view the comparison report. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/26-TaskDetails.jpg" loading="lazy"  alt="[Image: 26-TaskDetails.jpg]" class="mycode_img" /> <br />
<br />
<span style="font-size: medium;" class="mycode_size">Parameter Change</span> <br />
<br />
The SQL Performance Analyzer provides a shortcut for setting up tests of initialization parameter changes on SQL tuning sets. Click the "Parameter" link on the "SQL Performance Analyzer" page. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/27-ParameterChangeLink.jpg" loading="lazy"  alt="[Image: 27-ParameterChangeLink.jpg]" class="mycode_img" /> <br />
<br />
Enter a task name and the parameter you wish to test. Enter the base and changed value, then click the "Submit" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/28-ParameterChange.jpg" loading="lazy"  alt="[Image: 28-ParameterChange.jpg]" class="mycode_img" /> <br />
<br />
The task is listed in the "SQL Performance Analyzer Tasks" section. Refresh the page intermittently until the task status becomes a green tick, then click on the task name. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/29-TaskList.jpg" loading="lazy"  alt="[Image: 29-TaskList.jpg]" class="mycode_img" /> <br />
<br />
The resulting screen shows details of the selected task. Click on the "Comparison Report" classes icon allows you to view the comparison report. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/30-TaskDetails.jpg" loading="lazy"  alt="[Image: 30-TaskDetails.jpg]" class="mycode_img" /> <br />
<br />
<span style="font-size: medium;" class="mycode_size">Transferring SQL Tuning Sets</span> <br />
<br />
In the examples listed above, the tests have been performed on the same system. In reality you are more likely to want to create a tuning set on your production system, then run the SQL Performance Analyzer against it on a test system. Fortunately, the DBMS_SQLTUNE package allows you to transport SQL tuning sets by storing them in a staging table. <br />
<br />
First, create the staging table using the CREATE_STGTAB_SQLSET procedure. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>CONN sys/password@prod AS SYSDBA <br />
<br />
BEGIN <br />
DBMS_SQLTUNE.create_stgtab_sqlset(table_name =&gt; 'SQLSET_TAB', <br />
schema_name =&gt; 'SPA_TEST_USER', <br />
tablespace_name =&gt; 'USERS'); <br />
END; <br />
/ </blockquote>
 <br />
Next, use the PACK_STGTAB_SQLSET procedure to export SQL tuning set into the staging table. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>BEGIN <br />
DBMS_SQLTUNE.pack_stgtab_sqlset(sqlset_name =&gt; 'SPA_TEST_SQLSET', <br />
sqlset_owner =&gt; 'SYS', <br />
staging_table_name =&gt; 'SQLSET_TAB', <br />
staging_schema_owner =&gt; 'SPA_TEST_USER'); <br />
END; <br />
/ </blockquote>
 <br />
Once the SQL tuning set is packed into the staging table, the table can be transferred to the test system using Datapump, Export/Import or via a database link. Once on the test system, the SQL tuning set can be imported using the UNPACK_STGTAB_SQLSET procedure. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>BEGIN <br />
DBMS_SQLTUNE.unpack_stgtab_sqlset(sqlset_name =&gt; '%', <br />
sqlset_owner =&gt; 'SYS', <br />
replace =&gt; TRUE, <br />
staging_table_name =&gt; 'SQLSET_TAB', <br />
staging_schema_owner =&gt; 'SPA_TEST_USER'); <br />
END; <br />
/ </blockquote>
 <br />
The SQL tuning set can now be used with the SQL Performance Analyzer on the test system. <br />
<br />
More details you can find from attached Doc. <br />
<br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="http://www.oraerp.com/images/attachtypes/pdf.gif" title="Adobe Acrobat PDF" border="0" alt=".pdf" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=21" target="_blank" title="">Oracle SQL Performance Analyzer.pdf</a> (Size: 55 KB / Downloads: 191)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<span style="font-size: medium;" class="mycode_size">SQL Performance Analyzer in Oracle Database 11g</span> <br />
<br />
The concept of SQL tuning sets, along with the DBMS_SQLTUNE package to manipulate them, was introduced in Oracle 10g as part of the Automatic SQL Tuning functionality. Oracle 11g makes further use of SQL tuning sets with the SQL Performance Analyzer, which compares the performance of the statements in a tuning set before and after a database change. The database change can be as major or minor as you like, such as: <br />
<ul class="mycode_list"><li>Database, operating system, or hardware upgrades. <br />
</li>
<li>Database, operating system, or hardware configuration changes. <br />
</li>
<li>Database initialization parameter changes. <br />
</li>
<li>Schema changes, such as adding indexes or materialized views. <br />
</li>
<li>Refreshing optimizer statistics. <br />
</li>
<li>Creating or changing SQL profiles.</li>
</ul>
 <br />
Unlike Database Replay , the SQL Performance Analyzer does not try and replicate the workload on the system. It just plugs through each statement gathering performance statistics. <br />
<br />
The SQL Performance Analyzer can be run manually using the DBMS_SQLPA package or using Enterprise Manager. This article gives an overview of both methods. <br />
<ul class="mycode_list"><li><a href="http://www.oracle-base.com/articles/11g/SqlPerformanceAnalyzer_11gR1.php#setting_up" target="_blank" rel="noopener" class="mycode_url">Setting Up the Test</a> <br />
</li>
<li><a href="http://www.oracle-base.com/articles/11g/SqlPerformanceAnalyzer_11gR1.php#tuning_set_api" target="_blank" rel="noopener" class="mycode_url">Creating SQL Tuning Sets using the DBMS_SQLTUNE Package</a> <br />
</li>
<li><a href="http://www.oracle-base.com/articles/11g/SqlPerformanceAnalyzer_11gR1.php#sql_performance_analyzer_api" target="_blank" rel="noopener" class="mycode_url">Running the SQL Performance Analyzer using the DBMS_SQLPA Package</a> <br />
</li>
<li><a href="http://www.oracle-base.com/articles/11g/SqlPerformanceAnalyzer_11gR1.php#tuning_set_em" target="_blank" rel="noopener" class="mycode_url">Creating SQL Tuning Sets using Enterprise Manager</a> <br />
</li>
<li><a href="http://www.oracle-base.com/articles/11g/SqlPerformanceAnalyzer_11gR1.php#sql_performance_analyzer_em" target="_blank" rel="noopener" class="mycode_url">Running the SQL Performance Analyzer using Enterprise Manager</a> <br />
</li>
<li><a href="http://www.oracle-base.com/articles/11g/SqlPerformanceAnalyzer_11gR1.php#optimizer_upgrade_simulation" target="_blank" rel="noopener" class="mycode_url">Optimizer Upgrade Simulation</a> <br />
</li>
<li><a href="http://www.oracle-base.com/articles/11g/SqlPerformanceAnalyzer_11gR1.php#parameter_change" target="_blank" rel="noopener" class="mycode_url">Parameter Change</a> <br />
</li>
<li><a href="http://www.oracle-base.com/articles/11g/SqlPerformanceAnalyzer_11gR1.php#transferring_tuning_sets" target="_blank" rel="noopener" class="mycode_url">Transferring SQL Tuning Sets</a></li>
</ul>
 <br />
<span style="font-size: medium;" class="mycode_size">Setting Up the Test</span> <br />
<br />
The SQL performance analyzer requires SQL tuning sets, and SQL tuning sets are pointless unless they contain SQL, so the first task should be to issue some SQL statements. We are only trying to demonstrate the technology, so the example can be really simple. The following code creates a test user called SPA_TEST_USER. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>CONN / AS SYSDBA <br />
<br />
CREATE USER spa_test_user IDENTIFIED BY spa_test_user <br />
QUOTA UNLIMITED ON users; <br />
<br />
GRANT CONNECT, CREATE TABLE TO spa_test_user; </blockquote>
 <br />
Next, connect to the test user and create a test table called MY_OBJECTS using a query from the ALL_OBJECTS view. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>CONN spa_test_user/spa_test_user <br />
<br />
CREATE TABLE my_objects AS <br />
SELECT * FROM all_objects; <br />
<br />
EXEC DBMS_STATS.gather_table_stats(USER, 'MY_OBJECTS', cascade =&gt; TRUE); </blockquote>
This schema represents our "before" state. Still logged in as the test user, issue the following statements.<blockquote class="mycode_quote"><cite>Quote:</cite>SELECT COUNT(*) FROM my_objects WHERE object_id &lt;= 100; <br />
SELECT object_name FROM my_objects WHERE object_id = 100; <br />
SELECT COUNT(*) FROM my_objects WHERE object_id &lt;= 1000; <br />
SELECT object_name FROM my_objects WHERE object_id = 1000; <br />
SELECT COUNT(*) FROM my_objects WHERE object_id BETWEEN 100 AND 1000; </blockquote>
 <br />
Notice, all statements make reference to the currently unindexed OBJECT_ID column. Later we will be indexing this column to create our changed "after" state. <br />
<br />
The select statements are now in the shared pool, so we can start creating an SQL tuning set. <br />
<br />
<span style="font-size: medium;" class="mycode_size">Creating SQL Tuning Sets using the DBMS_SQLTUNE Package</span> <br />
<br />
The DBMS_SQLTUNE package contains procedures and functions that allow us to create, manipulate and drop SQL tuning sets. The first step is to create an SQL tuning set called spa_test_sqlset using the CREATE_SQLSET procedure. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>CONN / AS SYSDBA <br />
<br />
EXEC DBMS_SQLTUNE.create_sqlset(sqlset_name =&gt; 'spa_test_sqlset'); </blockquote>
 <br />
Next, the SELECT_CURSOR_CACHE table function is used to retrieve a cursor containing all SQL statements that were parsed by the SPA_TEST_USER schema and contain the word "my_objects". The resulting cursor is loaded into the tuning set using the LOAD_SQLSET procedure. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>DECLARE <br />
l_cursor DBMS_SQLTUNE.sqlset_cursor; <br />
BEGIN <br />
OPEN l_cursor FOR <br />
SELECT VALUE(a) <br />
FROM TABLE( <br />
DBMS_SQLTUNE.select_cursor_cache( <br />
basic_filter =&gt; 'sql_text LIKE ''%my_objects%'' and parsing_schema_name = ''SPA_TEST_USER''', <br />
attribute_list =&gt; 'ALL') <br />
) a; <br />
<br />
<br />
DBMS_SQLTUNE.load_sqlset(sqlset_name =&gt; 'spa_test_sqlset', <br />
populate_cursor =&gt; l_cursor); <br />
END; <br />
/ </blockquote>
 <br />
The DBA_SQLSET_STATEMENTS view allows us to see which statements have been associated with the tuning set. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>SELECT sql_text <br />
FROM dba_sqlset_statements <br />
WHERE sqlset_name = 'spa_test_sqlset'; <br />
<br />
SQL_TEXT <br />
-------------------------------------------------------------------------------- <br />
SELECT object_name FROM my_objects WHERE object_id = 100 <br />
SELECT COUNT(*) FROM my_objects WHERE object_id &lt;= 100 <br />
SELECT COUNT(*) FROM my_objects WHERE object_id BETWEEN 100 AND 1000 <br />
SELECT COUNT(*) FROM my_objects WHERE object_id &lt;= 1000 <br />
SELECT object_name FROM my_objects WHERE object_id = 1000 <br />
<br />
5 rows selected. <br />
<br />
SQL&gt; </blockquote>
 <br />
Now we have an SQL tuning set, we can start using the SQL performance analyzer. <br />
<br />
<span style="font-size: medium;" class="mycode_size">Running the SQL Performance Analyzer using the DBMS_SQLPA Package</span> <br />
<br />
The DBMS_SQLPA package is the PL/SQL API used to manage the SQL performance ananlyzer. The first step is to create an analysis task using the CREATE_ANALYSIS_TASK function, passing in the SQL tuning set name and making a note of the resulting task name. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>CONN / AS SYSDBA <br />
<br />
VARIABLE v_task VARCHAR2(64); <br />
EXEC :v_task := DBMS_SQLPA.create_analysis_task(sqlset_name =&gt; 'spa_test_sqlset'); <br />
<br />
PL/SQL procedure successfully completed. <br />
<br />
SQL&gt; PRINT :v_task <br />
<br />
V_TASK <br />
-------------------------------------------------------------------------------- <br />
TASK_122 <br />
<br />
SQL&gt; </blockquote>
 <br />
Next, use the EXECUTE_ANALYSIS_TASK procedure to execute the contents of the SQL tuning set against the current state of the database to gather information about the performance before any modifications are made. This analysis run is named before_change. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>BEGIN <br />
DBMS_SQLPA.execute_analysis_task( <br />
task_name =&gt; :v_task, <br />
execution_type =&gt; 'test execute', <br />
execution_name =&gt; 'before_change'); <br />
END; <br />
/ </blockquote>
 <br />
Now we have the "before" performance information, we need to make a change so we can test the "after" performance. For this example we will simply add an index to the test table on the OBJECT_ID column. In a new SQL*Plus session create the index using the following statements. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>CONN spa_test_user/spa_test_user <br />
<br />
CREATE INDEX my_objects_index_01 ON my_objects(object_id); <br />
<br />
EXEC DBMS_STATS.gather_table_stats(USER, 'MY_OBJECTS', cascade =&gt; TRUE); </blockquote>
 <br />
Now, we can return to our original session and test the performance after the database change. Once again use the EXECUTE_ANALYSIS_TASK procedure, naming the analysis task "after_change". <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>BEGIN <br />
DBMS_SQLPA.execute_analysis_task( <br />
task_name =&gt; :v_task, <br />
execution_type =&gt; 'test execute', <br />
execution_name =&gt; 'after_change'); <br />
END; <br />
/ </blockquote>
 <br />
Once the before and after analysis tasks are complete, we must run a comparison analysis task. The following code explicitly names the analysis tasks to compare using name-value pairs in the EXECUTION_PARAMS parameter. If this is ommited, the latest two analysis runs are compared. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>BEGIN <br />
DBMS_SQLPA.execute_analysis_task( <br />
task_name =&gt; :v_task, <br />
execution_type =&gt; 'compare performance', <br />
execution_params =&gt; dbms_advisor.arglist( <br />
'execution_name1', <br />
'before_change', <br />
'execution_name2', <br />
'after_change') <br />
); <br />
END; <br />
/ </blockquote>
 <br />
With this final analysis run complete, we can check out the comparison report using the REPORT_ANALYSIS_TASK function. The function returns a CLOB containing the report in 'TEXT', 'XML' or 'HTML' format. Its usage is shown below. <br />
<br />
Note. Oracle 11gR2 also includes an 'ACTIVE' format that looks more like the Enterprise Manager output. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>SET PAGESIZE 0 <br />
SET LINESIZE 1000 <br />
SET LONG 1000000 <br />
SET LONGCHUNKSIZE 1000000 <br />
SET TRIMSPOOL ON <br />
SET TRIM ON <br />
<br />
SPOOL /tmp/execute_comparison_report.htm <br />
<br />
SELECT DBMS_SQLPA.report_analysis_task(:v_task, 'HTML', 'ALL') <br />
FROM dual; <br />
<br />
SPOOL OFF </blockquote>
 <br />
An example of this file for each available type is shown below. <br />
<ul class="mycode_list"><li><a href="http://www.oracle-base.com/articles/11g/execute_comparison_report_text.txt" target="_blank" rel="noopener" class="mycode_url">TEXT</a> <br />
</li>
<li><a href="http://www.oracle-base.com/articles/11g/execute_comparison_report_html.htm" target="_blank" rel="noopener" class="mycode_url">HTML</a> <br />
</li>
<li><a href="http://www.oracle-base.com/articles/11g/execute_comparison_report_xml.xml" target="_blank" rel="noopener" class="mycode_url">XML</a> <br />
</li>
<li><a href="http://www.oracle-base.com/articles/11g/execute_comparison_report_active.htm" target="_blank" rel="noopener" class="mycode_url">ACTIVE</a> - Active HTML available in 11gR2 requires a download of Javascript libraries from an Oracle website, so must be used on a PC connected to the internet.</li>
</ul>
 <br />
<span style="font-size: medium;" class="mycode_size">Creating SQL Tuning Sets using Enterprise Manager</span> <br />
<br />
Click on the "SQL Tuning Sets" link towards the bottom of the "Performance" tab. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/01-SqlTuningSetsLink.jpg" loading="lazy"  alt="[Image: 01-SqlTuningSetsLink.jpg]" class="mycode_img" /> <br />
<br />
On the "SQL Tuning Sets" screen, click the "Create" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/02-SqlTuningSets.jpg" loading="lazy"  alt="[Image: 02-SqlTuningSets.jpg]" class="mycode_img" /> <br />
<br />
Enter a name for the SQL tuning set and click the "Next" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/03-Options.jpg" loading="lazy"  alt="[Image: 03-Options.jpg]" class="mycode_img" /> <br />
<br />
Select the "Load SQL statements one time only" option, select the "Cursor Cache" as the data source, then click the "Next" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/04-LoadMethods.jpg" loading="lazy"  alt="[Image: 04-LoadMethods.jpg]" class="mycode_img" /> <br />
<br />
Set the appropriate values for the "Parsing Schema Name" and "SQL Text" filter attributes, remove any extra attributes by clicking their remove icons, then click the "Next" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/05-FilterOptions.jpg" loading="lazy"  alt="[Image: 05-FilterOptions.jpg]" class="mycode_img" /> <br />
<br />
Accept the immediate schedule by clicking the "Next" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/06-Schedule.jpg" loading="lazy"  alt="[Image: 06-Schedule.jpg]" class="mycode_img" /> <br />
<br />
Assuming the review information looks correct, click the "Submit" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/07-Review.jpg" loading="lazy"  alt="[Image: 07-Review.jpg]" class="mycode_img" /> <br />
<br />
The "SQL Tuning Sets" screen shows the confirmation of the tuning set creation and the scheduled job to populate it. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/08-Confirmation.jpg" loading="lazy"  alt="[Image: 08-Confirmation.jpg]" class="mycode_img" /> <br />
<br />
Once the population job completes, clicking on the SQL tuning set displays its contents. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/09-SqlTuningSetContents.jpg" loading="lazy"  alt="[Image: 09-SqlTuningSetContents.jpg]" class="mycode_img" /> <br />
<br />
Now we have an SQL tuning set, we can start using the SQL performance analyzer. <br />
<br />
<span style="font-size: medium;" class="mycode_size">Running the SQL Performance Analyzer using Enterprise Manager</span> <br />
<br />
Click the "SQL Performance Analayzer" link on the "Software and Support" tab. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/10-SqlPerformanceAnalyzerLink.jpg" loading="lazy"  alt="[Image: 10-SqlPerformanceAnalyzerLink.jpg]" class="mycode_img" /> <br />
<br />
Click the "Guided Workflow" link on the "SQL Performance Analayzer" screen. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/11-GuidedWorkflow.jpg" loading="lazy"  alt="[Image: 11-GuidedWorkflow.jpg]" class="mycode_img" /> <br />
<br />
Click the execute icon on the first step to create the SQL Performance Analyzer task. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/12-CreateSpaTaskIcon.jpg" loading="lazy"  alt="[Image: 12-CreateSpaTaskIcon.jpg]" class="mycode_img" /> <br />
<br />
Enter a name for the SPA task, select the SQL tuning set to associate with it, then click the "Create" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/13-CreateSpaTask.jpg" loading="lazy"  alt="[Image: 13-CreateSpaTask.jpg]" class="mycode_img" /> <br />
<br />
When the status of the previous step becomes a green tick, click the execute icon on the second step to capture the SQL tuning set performance information of the "before" state. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/14-ReplayBeforeIcon.jpg" loading="lazy"  alt="[Image: 14-ReplayBeforeIcon.jpg]" class="mycode_img" /> <br />
<br />
Enter a "Replay Trial Name" of "before_change", check the "Trial environment established" checkbox, then click the "Submit" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/15-ReplayBefore.jpg" loading="lazy"  alt="[Image: 15-ReplayBefore.jpg]" class="mycode_img" /> <br />
<br />
When the status of the previous step becomes a green tick, click the execute icon on the third step to capture the SQL tuning set performance information of the "after" state. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/16-ReplayAfterIcon.jpg" loading="lazy"  alt="[Image: 16-ReplayAfterIcon.jpg]" class="mycode_img" /> <br />
<br />
Alter the state of the database by creating an index on the OBJECT_ID column of the test table. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>CONN spa_test_user/spa_test_user@prod <br />
<br />
CREATE INDEX my_objects_index_01 ON my_objects(object_id); <br />
<br />
EXEC DBMS_STATS.gather_table_stats(USER, 'MY_OBJECTS', cascade =&gt; TRUE); </blockquote>
 <br />
Enter a "Replay Trial Name" of "after_change", check the "Trial environment established" checkbox, then click the "Submit" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/17-ReplayAfter.jpg" loading="lazy"  alt="[Image: 17-ReplayAfter.jpg]" class="mycode_img" /> <br />
<br />
When the status of the previous step becomes a green tick, click the execute icon on the forth step to run a comparison analysis task. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/18-CompareIcon.jpg" loading="lazy"  alt="[Image: 18-CompareIcon.jpg]" class="mycode_img" /> <br />
<br />
Accept the default "Trial 1 Name" and "Trial 2 Name" settings by clicking the "Submit" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/19-Compare.jpg" loading="lazy"  alt="[Image: 19-Compare.jpg]" class="mycode_img" /> <br />
<br />
When the status of the previous step becomes a green tick, click the execute icon on the fifth step to view the comparison report. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/20-ReportIcon.jpg" loading="lazy"  alt="[Image: 20-ReportIcon.jpg]" class="mycode_img" /> <br />
<br />
The resulting page contains the comparison report for the SQL Performance Analyzer task. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/21-Report.jpg" loading="lazy"  alt="[Image: 21-Report.jpg]" class="mycode_img" /> <br />
<br />
Clicking on a specific SQL ID displays the statement specific results, along with the before and after execution plans. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/22-SqlReport.jpg" loading="lazy"  alt="[Image: 22-SqlReport.jpg]" class="mycode_img" /> <br />
<br />
<span style="font-size: medium;" class="mycode_size">Optimizer Upgrade Simulation</span> <br />
<br />
The SQL Performance Analyzer allows you to test the affects of optimizer version changes on SQL tuning sets. Click the "Optimizer Upgrade Simulation" link on the "SQL Performance Analyzer" page. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/23-OptimizerUpgradeSimulationLink.jpg" loading="lazy"  alt="[Image: 23-OptimizerUpgradeSimulationLink.jpg]" class="mycode_img" /> <br />
<br />
Enter a task name, select the two optimizer versions to compare, then click the "Submit" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/24-OptimizerUpgradeSimulation.jpg" loading="lazy"  alt="[Image: 24-OptimizerUpgradeSimulation.jpg]" class="mycode_img" /> <br />
<br />
The task is listed in the "SQL Performance Analyzer Tasks" section. Refresh the page intermittently until the task status becomes a green tick, then click on the task name. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/25-TaskList.jpg" loading="lazy"  alt="[Image: 25-TaskList.jpg]" class="mycode_img" /> <br />
<br />
The resulting screen shows details of the selected task. Click on the "Comparison Report" classes icon allows you to view the comparison report. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/26-TaskDetails.jpg" loading="lazy"  alt="[Image: 26-TaskDetails.jpg]" class="mycode_img" /> <br />
<br />
<span style="font-size: medium;" class="mycode_size">Parameter Change</span> <br />
<br />
The SQL Performance Analyzer provides a shortcut for setting up tests of initialization parameter changes on SQL tuning sets. Click the "Parameter" link on the "SQL Performance Analyzer" page. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/27-ParameterChangeLink.jpg" loading="lazy"  alt="[Image: 27-ParameterChangeLink.jpg]" class="mycode_img" /> <br />
<br />
Enter a task name and the parameter you wish to test. Enter the base and changed value, then click the "Submit" button. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/28-ParameterChange.jpg" loading="lazy"  alt="[Image: 28-ParameterChange.jpg]" class="mycode_img" /> <br />
<br />
The task is listed in the "SQL Performance Analyzer Tasks" section. Refresh the page intermittently until the task status becomes a green tick, then click on the task name. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/29-TaskList.jpg" loading="lazy"  alt="[Image: 29-TaskList.jpg]" class="mycode_img" /> <br />
<br />
The resulting screen shows details of the selected task. Click on the "Comparison Report" classes icon allows you to view the comparison report. <br />
<br />
<img src="http://www.oracle-base.com/articles/11g/images/sql_performance_analyzer/30-TaskDetails.jpg" loading="lazy"  alt="[Image: 30-TaskDetails.jpg]" class="mycode_img" /> <br />
<br />
<span style="font-size: medium;" class="mycode_size">Transferring SQL Tuning Sets</span> <br />
<br />
In the examples listed above, the tests have been performed on the same system. In reality you are more likely to want to create a tuning set on your production system, then run the SQL Performance Analyzer against it on a test system. Fortunately, the DBMS_SQLTUNE package allows you to transport SQL tuning sets by storing them in a staging table. <br />
<br />
First, create the staging table using the CREATE_STGTAB_SQLSET procedure. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>CONN sys/password@prod AS SYSDBA <br />
<br />
BEGIN <br />
DBMS_SQLTUNE.create_stgtab_sqlset(table_name =&gt; 'SQLSET_TAB', <br />
schema_name =&gt; 'SPA_TEST_USER', <br />
tablespace_name =&gt; 'USERS'); <br />
END; <br />
/ </blockquote>
 <br />
Next, use the PACK_STGTAB_SQLSET procedure to export SQL tuning set into the staging table. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>BEGIN <br />
DBMS_SQLTUNE.pack_stgtab_sqlset(sqlset_name =&gt; 'SPA_TEST_SQLSET', <br />
sqlset_owner =&gt; 'SYS', <br />
staging_table_name =&gt; 'SQLSET_TAB', <br />
staging_schema_owner =&gt; 'SPA_TEST_USER'); <br />
END; <br />
/ </blockquote>
 <br />
Once the SQL tuning set is packed into the staging table, the table can be transferred to the test system using Datapump, Export/Import or via a database link. Once on the test system, the SQL tuning set can be imported using the UNPACK_STGTAB_SQLSET procedure. <br />
<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>BEGIN <br />
DBMS_SQLTUNE.unpack_stgtab_sqlset(sqlset_name =&gt; '%', <br />
sqlset_owner =&gt; 'SYS', <br />
replace =&gt; TRUE, <br />
staging_table_name =&gt; 'SQLSET_TAB', <br />
staging_schema_owner =&gt; 'SPA_TEST_USER'); <br />
END; <br />
/ </blockquote>
 <br />
The SQL tuning set can now be used with the SQL Performance Analyzer on the test system. <br />
<br />
More details you can find from attached Doc. <br />
<br /><!-- start: postbit_attachments_attachment -->
<br /><!-- start: attachment_icon -->
<img src="http://www.oraerp.com/images/attachtypes/pdf.gif" title="Adobe Acrobat PDF" border="0" alt=".pdf" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=21" target="_blank" title="">Oracle SQL Performance Analyzer.pdf</a> (Size: 55 KB / Downloads: 191)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Script for Undo Information]]></title>
			<link>http://www.oraerp.com/thread-86.html</link>
			<pubDate>Fri, 28 Jan 2011 14:35:29 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://www.oraerp.com/member.php?action=profile&uid=38">Pryia Rai</a>]]></dc:creator>
			<guid isPermaLink="false">http://www.oraerp.com/thread-86.html</guid>
			<description><![CDATA[REM:**********************************************************************************************<br />
REM: Script : Undo Informations<br />
REM: Author: Kumar Menon<br />
REM: Date Submitted: 16-July-2009<br />
REM:FileName: Undoinfo.sql<br />
REM:<br />
REM: NOTE: PLEASE TEST THIS SCRIPT BEFORE USE.<br />
REM: Author will not be responsible for any damage that may be cause by this script.<br />
****************************************************************************************************<br />
<br />
<br />
spool d:\undoinfo.txt<br />
SELECT (UR * (UPS * DBS)) + (DBS * 24) AS "Bytes" <br />
FROM (SELECT value AS UR FROM v&#36;parameter WHERE name = 'undo_retention'), <br />
(SELECT (SUM(undoblks)/SUM(((end_time - begin_time)*86400))) AS UPS FROM v&#36;undostat), <br />
(SELECT value AS DBS FROM v&#36;parameter WHERE name = 'db_block_size') ;<br />
<br />
SELECT r.name rbs, <br />
NVL(s.username, 'None') oracle_user, <br />
s.osuser client_user, <br />
p.username unix_user, <br />
TO_CHAR(s.sid)||','||TO_CHAR(s.serial#) as sid_serial, <br />
p.spid unix_pid, <br />
t.used_ublk * TO_NUMBER(x.value)/1024 as undo_kb <br />
FROM v&#36;process p, <br />
v&#36;rollname r, <br />
v&#36;session s, <br />
v&#36;transaction t, <br />
v&#36;parameter x <br />
WHERE s.taddr = t.addr <br />
AND s.paddr = p.addr(+) <br />
AND r.usn = t.xidusn(+) <br />
AND x.name = 'db_block_size' <br />
ORDER <br />
BY r.name ; <br />
<br />
select l.sid, s.segment_name from dba_rollback_segs s, v&#36;transaction t, v&#36;lock l <br />
where t.xidusn=s.segment_id and t.addr=l.addr ;<br />
select to_char(begin_time,'hh24:mi<img src="http://www.oraerp.com/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />s'),to_char(end_time,'hh24:mi<img src="http://www.oraerp.com/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />s') <br />
, maxquerylen,ssolderrcnt,nospaceerrcnt,undoblks,txncount from v&#36;undostat <br />
order by undoblks ;<br />
set lines 160 pages 40 <br />
col machine format A20 <br />
col username format A15 <br />
select xidusn, xidslot, trans.status, start_time, ses.sid, ses.username, ses.machine ,proc.spid, used_ublk <br />
from v&#36;transaction trans, v&#36;session ses , v&#36;process proc <br />
where trans.ses_addr =ses.saddr and ses.paddr=proc.addr <br />
order by start_time ;<br />
<br />
select to_char(begin_time,'hh24:mi<img src="http://www.oraerp.com/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />s'),to_char(end_time,'hh24:mi<img src="http://www.oraerp.com/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />s') <br />
, maxquerylen,ssolderrcnt,nospaceerrcnt,undoblks,txncount from v&#36;undostat <br />
order by undoblks ;<br />
Promot "following to show how much undo is being used:"<br />
<br />
set pagesize 24 <br />
set lin 132 <br />
set verify off <br />
col owner format a13 <br />
col segment_name format a25 heading 'Segment Name' <br />
col segment_type format a15 heading 'Segment Type' <br />
col tablespace_name format a15 heading 'Tablespace Name' <br />
col extents format 99999999 heading 'Extent' <br />
select <br />
owner, segment_name, segment_type, tablespace_name, <br />
(bytes / 1048576) "Mbytes", <br />
extents <br />
from sys.dba_segments <br />
where tablespace_name = '&amp;UNDO01' <br />
order by owner, segment_name ;<br />
<br />
spool off]]></description>
			<content:encoded><![CDATA[REM:**********************************************************************************************<br />
REM: Script : Undo Informations<br />
REM: Author: Kumar Menon<br />
REM: Date Submitted: 16-July-2009<br />
REM:FileName: Undoinfo.sql<br />
REM:<br />
REM: NOTE: PLEASE TEST THIS SCRIPT BEFORE USE.<br />
REM: Author will not be responsible for any damage that may be cause by this script.<br />
****************************************************************************************************<br />
<br />
<br />
spool d:\undoinfo.txt<br />
SELECT (UR * (UPS * DBS)) + (DBS * 24) AS "Bytes" <br />
FROM (SELECT value AS UR FROM v&#36;parameter WHERE name = 'undo_retention'), <br />
(SELECT (SUM(undoblks)/SUM(((end_time - begin_time)*86400))) AS UPS FROM v&#36;undostat), <br />
(SELECT value AS DBS FROM v&#36;parameter WHERE name = 'db_block_size') ;<br />
<br />
SELECT r.name rbs, <br />
NVL(s.username, 'None') oracle_user, <br />
s.osuser client_user, <br />
p.username unix_user, <br />
TO_CHAR(s.sid)||','||TO_CHAR(s.serial#) as sid_serial, <br />
p.spid unix_pid, <br />
t.used_ublk * TO_NUMBER(x.value)/1024 as undo_kb <br />
FROM v&#36;process p, <br />
v&#36;rollname r, <br />
v&#36;session s, <br />
v&#36;transaction t, <br />
v&#36;parameter x <br />
WHERE s.taddr = t.addr <br />
AND s.paddr = p.addr(+) <br />
AND r.usn = t.xidusn(+) <br />
AND x.name = 'db_block_size' <br />
ORDER <br />
BY r.name ; <br />
<br />
select l.sid, s.segment_name from dba_rollback_segs s, v&#36;transaction t, v&#36;lock l <br />
where t.xidusn=s.segment_id and t.addr=l.addr ;<br />
select to_char(begin_time,'hh24:mi<img src="http://www.oraerp.com/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />s'),to_char(end_time,'hh24:mi<img src="http://www.oraerp.com/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />s') <br />
, maxquerylen,ssolderrcnt,nospaceerrcnt,undoblks,txncount from v&#36;undostat <br />
order by undoblks ;<br />
set lines 160 pages 40 <br />
col machine format A20 <br />
col username format A15 <br />
select xidusn, xidslot, trans.status, start_time, ses.sid, ses.username, ses.machine ,proc.spid, used_ublk <br />
from v&#36;transaction trans, v&#36;session ses , v&#36;process proc <br />
where trans.ses_addr =ses.saddr and ses.paddr=proc.addr <br />
order by start_time ;<br />
<br />
select to_char(begin_time,'hh24:mi<img src="http://www.oraerp.com/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />s'),to_char(end_time,'hh24:mi<img src="http://www.oraerp.com/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />s') <br />
, maxquerylen,ssolderrcnt,nospaceerrcnt,undoblks,txncount from v&#36;undostat <br />
order by undoblks ;<br />
Promot "following to show how much undo is being used:"<br />
<br />
set pagesize 24 <br />
set lin 132 <br />
set verify off <br />
col owner format a13 <br />
col segment_name format a25 heading 'Segment Name' <br />
col segment_type format a15 heading 'Segment Type' <br />
col tablespace_name format a15 heading 'Tablespace Name' <br />
col extents format 99999999 heading 'Extent' <br />
select <br />
owner, segment_name, segment_type, tablespace_name, <br />
(bytes / 1048576) "Mbytes", <br />
extents <br />
from sys.dba_segments <br />
where tablespace_name = '&amp;UNDO01' <br />
order by owner, segment_name ;<br />
<br />
spool off]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Oracle 11g Upgrade]]></title>
			<link>http://www.oraerp.com/thread-85.html</link>
			<pubDate>Tue, 25 Jan 2011 05:30:07 +0000</pubDate>
			<dc:creator><![CDATA[<a href="http://www.oraerp.com/member.php?action=profile&uid=37">Sara Khan</a>]]></dc:creator>
			<guid isPermaLink="false">http://www.oraerp.com/thread-85.html</guid>
			<description><![CDATA[I want to upgrade the oracle 10g databases to oracle 11g databases. What is the best method to upgrade to 11g.<br />
For some databases one DBA is doing exp/imp method for other databases he is using conventional upgrade (manual upgrade through scripts, Database Upgrade Assistant). Please let me know when to use exp/imp method ? and when to use conventional upgrade ?<br />
<br />
any update]]></description>
			<content:encoded><![CDATA[I want to upgrade the oracle 10g databases to oracle 11g databases. What is the best method to upgrade to 11g.<br />
For some databases one DBA is doing exp/imp method for other databases he is using conventional upgrade (manual upgrade through scripts, Database Upgrade Assistant). Please let me know when to use exp/imp method ? and when to use conventional upgrade ?<br />
<br />
any update]]></content:encoded>
		</item>
	</channel>
</rss>