Sql Profile 11g
Hello Experts,
I was recently ran an sql tuning advisor in my 11g instance for a complex sql.
tuning advisor recomended to accept a "sql profile" to optimize my query.later when i google i understand sql profile will help to tune a query without touching the actual sql.it may suggest hints to use.my doubts are below.
1.can any give more about sql profile
2.if sql profile suggests hints or other details from which table we can get sql profile details
Thanks
Mohamed Sameer
SQL Profile is a set of hints which are applied by oracle itself to change the plan. I think even saying this is not really correct. SQL Profile basically would contain the environment information i.e. the variables, parameters and everything else which are required to prepare that plan. You should check in this forum for few discussions which have happened about it already including reading the link given by Rajesh.
HTH
Aman....
Similar Messages
-
Use of SQL Profiles where each schema has very different data distribution and volumes
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
Our architecture has multiple client schemas in the same database. Each schema has the same code base (tables, procedures etc) but each client's data is very different in terms of volumes and skew/distribution per table. This architecture was done based on cost - I know it's not ideal but it can't change.....
I am fairly seasoned with performance management and so know the usual tricks of when to eat up the table using parallel full table scans etc. I couldn't further optimise a given stmt for our largest table. I'll call it TSPCI and it has monthly partitions (2 years) and totals about 35Gb in the largest client schema.
Anyway, I was surprised when ADDM suggested that I could achieve 98% improvement if I were to use a given SQL Profile. Great?
So, here's my issue - I've found that the same SQL_ID is shared across all those different client schemas: I can't see how to get it to pick/use the SQL Profile in only a particular client schema - let's call it NEX - and not in another (lets call it COL).
If I generate a SQL Profile as NEX, has it analysed and built the SQL Profile based on the NEX schema and is it therefore invalid/undesirable to have that SQL Profile used in the COL schema??
I suppose that I could add a small change (say /*+ NEX */) to the SQL in the NEX schema to make the given sql unique there and then generate a SQL Profile for that..........
What am I missing here?Well, I can confirm the behaviour: accept a SQL Profile for a given SQL in one schema and verified that it is used in another schema (where the data volume and distribution is very different).
I can also confirm the workaround - simply add a hint to the SQL to make it unique such that I could use different sql profiles for the otherwise exact same sql in different schemas.
I'm happy enough with this workaround but I'll leave this thread unanswered in case someone can suggest a better approach. -
Sql profiles in 11.1.0.7
We just upgraded from 10.1.0.3 to 11.1.0.7 and some very complex queries are running slower. When I check the plans in a non-production 11g database, the join orders are slightly different. I also have traces from my 10g production database and that I loaded into a sql tuning set in production. I am running the sql tuning advisor. When I get a recommendation to use the old plan, I implement it in the 10.2.0.5 Oracle Enterprise manager grid control.
How do I tell the sql_id of the sql profile? Is it part of the name? So if I look in dba_sql_profiles and see
SYS_SQLPROF_012a8f339c4b0001
Is the last part the sql_id? When I search on that value, I do not see it in v$sql. It does not appear that my queries are using the sql profile. So there might a slight difference from these queries (space maybe) than the ones I have. How do I confirm that my queries are using a sql profile as well?Dear user11990507,
I do think that the value "012a8f339c4b0001" is nothing to do with the SQL_ID in the v$sql fixed view. It can be generated based on an algorithm like generating SQL_IDs. That is an internal information and i really don't know much about it.
You can also accept, alter or drop an SQL profile with the below commands;
DECLARE my_sqlprofile_name VARCHAR2(30);
BEGIN my_sqlprofile_name := DBMS_SQLTUNE.ACCEPT_SQL_PROFILE (task_name => 'my_sql_tuning_task', name => 'my_sql_profile', force_match => TRUE);
END;
BEGIN
DBMS_SQLTUNE.ALTER_SQL_PROFILE(name => 'my_sql_profile', attribute_name => 'STATUS', value => 'DISABLED');
END;
BEGIN
DBMS_SQLTUNE.DROP_SQL_PROFILE(name => 'my_sql_profile');
END;
DBA_SQL_PROFILES;
http://download.oracle.com/docs/cd/B28359_01/server.111/b28320/statviews_4256.htm#REFRN23477
Check the SQL_TEXT column for you particular SQLs.
Hope That Helps.
Ogan -
Question about moving a SQL profile to a different database
All,
I know in 11g I can move SQL baselines to another host. Does anyone know if I can more just a single SQL Profile and how that is accomplished. I'm not seeing a PL/SQL package do to this but I may be missing it. Also, no hits on Metalink or Ask Tom on how to do this. I have this vague memory that it is possible but I'll be dammed if I can figure out how to do it.
thanks in advance
J SebastianJust to inform
http://blog.flimatech.com/2010/06/08/how-does-one-move-sql-profiles-from-one-instance-to-another/
Have very good example how to move SQL profile -
Can sql profiles be moved from Oracle SE/SEO to XE
Hi all.
I use both: 10g XE, 11g XE as well as SE and SEO.
I'd like to know if i can export / import or move sql profiles from SE / SEO to Oracle XE.
Thanks in advance!!!Profiles? Need a bit more info on what you're after.
For sqlplus the $ORACLE_HOME/admin/glogin.sql file gets executed every time one starts sqlplus or does a connect. Or its %ORACLE_HOME% on windows hosts.
For export and import (also see the 11gR2 Utilities doc Overview of Oracle Data Pump ) but generally the tables, the data, stored procedures, functions, etc. will be compatible, the main caveat will be source and target RDBMS versions, features added (or absent) from one or the other. The first two digits, possibly all four digits of the release version number are relevant.
And the XE space limit has to apply, as well as the absence of some features not included in the engine see the XE license page Oracle® Database Express Edition it has details on what is/is not present. -
Sql Profile Error ORA-13786: missing SQL text of statement object "1"
Hi,
I am testing a Sql Profile sample executiion with the hint result_cache for faster execution of a query. I have created a tuning task but got no recommendations. But when i tried to create sql profile with the pkg dbms_sqltune.accept_sql_profile i am getting an error. The db version is 11.1.0.7. Given below is the sql and the output.
Please let me know if you have any suggestions.
-- Accept SQL Profiles
SET SERVEROUTPUT ON
DECLARE
l_sql_tune_task_id VARCHAR2(2000);
BEGIN
l_sql_tune_task_id := DBMS_SQLTUNE.accept_sql_profile (
task_name => 'Permissionstab_tuning_task',
name => 'Permissionstab_profile',
description => 'sql profile for Permissionstab_profile',
force_match => TRUE);
--profile_type => DBMS_SQLTUNE.PX_PROFILE);
DBMS_OUTPUT.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id);
END;
with profile_type commented out output
DECLARE
ERROR at line 1:
ORA-13786: missing SQL text of statement object "1" for tuning task "Permissionstab_tuning_task"
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.DBMS_SQLTUNE_INTERNAL", line 11049
ORA-06512: at "SYS.PRVT_SQLPROF_INFRA", line 30
ORA-06512: at "SYS.DBMS_SQLTUNE", line 5836
ORA-06512: at line 4
including profile_type
profile_type => DBMS_SQLTUNE.PX_PROFILE);
ERROR at line 9:
ORA-06550: line 9, column 35:
PLS-00302: component 'PX_PROFILE' must be declared
ORA-06550: line 4, column 5:
PL/SQL: Statement ignored
Given below is the complete script and output
CONN / AS SYSDBA
GRANT CREATE ANY SQL PROFILE TO ariba;
GRANT DROP ANY SQL PROFILE TO ariba;
GRANT ALTER ANY SQL PROFILE TO ariba;
conn ariba/****;
EXEC DBMS_SQLTUNE.DROP_TUNING_TASK('Permissionstab_tuning_task');
-- Tuning task created for a manually specified statement.
DECLARE
l_sql VARCHAR2(4000);
l_sql_tune_task_id VARCHAR2(1000);
BEGIN
l_sql := 'SELECT /*+ result_cache */ rootId, pe_DefaultingSetBits, pe_Version, pe_Creator, pe_Active, pe_AdapterSource, pe_AdapterFlag, pe_PartitionN
umber, '||
'pe_PurgeState, pe_TimeCreated, pe_TimeUpdated, pe_CommonId, pe_ServerVersion, pe_UniqueName, pe_Name, mls_DefaultingSetBits, '||
'mls_PrimaryString, mls_MaxTranslationID, mls_Translations, mls_PrimaryStringLanguageID, mls_LocalizationKey, pe_Description, '||
'mls0_DefaultingSetBits, mls0_PrimaryString, mls0_MaxTranslationID, mls0_Translations, mls0_PrimaryStringLanguageID, '||
'mls0_LocalizationKey, pe_Created, pe_Modified '||
'FROM PermissionTab '||
'where pe_UniqueName = '||''''||'PurchasingAgent'||''''||' '||
'and ( pe_PurgeState = :1 ) AND pe_PartitionNumber = :2';
l_sql_tune_task_id := DBMS_SQLTUNE.create_tuning_task (
sql_text => l_sql,
user_name => 'ARIBA',
scope => DBMS_SQLTUNE.scope_comprehensive,
time_limit => 60,
task_name => 'Permissionstab_tuning_task',
description => 'Tuning task for an Permissionstab query.');
DBMS_OUTPUT.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id);
END;
EXEC DBMS_SQLTUNE.execute_tuning_task(task_name => 'Permissionstab_tuning_task');
SELECT task_name, status FROM dba_advisor_log WHERE owner = 'ARIBA';
SET LONG 10000;
SET PAGESIZE 1000
SET LINESIZE 200
SELECT DBMS_SQLTUNE.report_tuning_task('Permissionstab_tuning_task') AS recommendations FROM dual;
SET PAGESIZE 24
-- Accept SQL Profiles
SET SERVEROUTPUT ON
DECLARE
l_sql_tune_task_id VARCHAR2(2000);
BEGIN
l_sql_tune_task_id := DBMS_SQLTUNE.accept_sql_profile (
task_name => 'Permissionstab_tuning_task',
name => 'Permissionstab_profile',
description => 'sql profile for Permissionstab_profile',
force_match => TRUE,
profile_type => DBMS_SQLTUNE.PX_PROFILE);
DBMS_OUTPUT.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id);
END;
11:17:17 SYS@FLBUYPM 02-APR-13> @sql_profile_result_cache.sql
Connected.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Connected.
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
TASK_NAME STATUS
Permissionstab_tuning_task COMPLETED
RECOMMENDATIONS
GENERAL INFORMATION SECTION
Tuning Task Name : Permissionstab_tuning_task
Tuning Task Owner : ARIBA
Workload Type : Single SQL Statement
Scope : COMPREHENSIVE
Time Limit(seconds): 60
Completion Status : COMPLETED
Started at : 04/02/2013 11:17:20
Completed at : 04/02/2013 11:17:20
Schema Name: ARIBA
SQL ID : 2y6yar7r71tj1
SQL Text : SELECT /*+ result_cache */ rootId, pe_DefaultingSetBits,
pe_Version, pe_Creator, pe_Active, pe_AdapterSource,
pe_AdapterFlag, pe_PartitionNumber, pe_PurgeState,
pe_TimeCreated, pe_TimeUpdated, pe_CommonId, pe_ServerVersion,
pe_UniqueName, pe_Name, mls_DefaultingSetBits,
mls_PrimaryString, mls_MaxTranslationID, mls_Translations,
mls_PrimaryStringLanguageID, mls_LocalizationKey,
pe_Description, mls0_DefaultingSetBits, mls0_PrimaryString,
mls0_MaxTranslationID, mls0_Translations,
mls0_PrimaryStringLanguageID, mls0_LocalizationKey, pe_Created,
pe_Modified FROM PermissionTab where pe_UniqueName =
'PurchasingAgent' and ( pe_PurgeState = :1 ) AND
pe_PartitionNumber = :2
ADDITIONAL INFORMATION SECTION
- At least one important bind value was missing for this sql statement. The
accuracy of the advisor's analysis may depend on all important bind values
being supplied.
EXPLAIN PLANS SECTION
1- Original
Plan hash value: 778402129
| Id | Operation | Name | Rows | Byte
s | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 29
8 | 1 (0)| 00:00:01 |
| 1 | RESULT CACHE | 9qsg9vxnpk5r13h9gb3wcgujg1 | |
| | |
|* 2 | TABLE ACCESS BY INDEX ROWID| PERMISSIONTAB | 1 | 29
8 | 1 (0)| 00:00:01 |
|* 3 | INDEX UNIQUE SCAN | ARIBAINDEX341 | 1 |
| 1 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - filter("PE_PURGESTATE"=TO_NUMBER(:1))
3 - access("PE_UNIQUENAME"='PurchasingAgent' AND "PE_PARTITIONNUMBER"=TO_NUMB
ER(:2))
Result Cache Information (identified by operation id):
1 - column-count=30; dependencies=(ARIBA.PERMISSIONTAB); attributes=(single-r
ow); parameters=(nls, :1, :2); name="SELECT /*+ result_cache */ rootId, pe_Defau
ltingSetBits, pe_Version, pe_Creator, pe_Active, pe_AdapterSource, pe_AdapterFla
g, pe"
DECLARE
ERROR at line 1:
ORA-13786: missing SQL text of statement object "1" for tuning task "Permissionstab_tuning_task"
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.DBMS_SQLTUNE_INTERNAL", line 11049
ORA-06512: at "SYS.PRVT_SQLPROF_INFRA", line 30
ORA-06512: at "SYS.DBMS_SQLTUNE", line 5836
ORA-06512: at line 4
11:17:20 ARIBA@FLBUYPM 02-APR-13>
profile_type => DBMS_SQLTUNE.PX_PROFILE);
ERROR at line 9:
ORA-06550: line 9, column 35:
PLS-00302: component 'PX_PROFILE' must be declared
ORA-06550: line 4, column 5:
PL/SQL: Statement ignored
Edited by: 997562 on Apr 2, 2013 8:34 AMHi Experts,
i too getting this error while attaching the tuning task to the sql profiler, below are the details, appreciate any help on this.
SQL> SQL> VAR profile_name VARCHAR2(30);
SQL> BEGIN
:profile_name := DBMS_SQLTUNE.ACCEPT_SQL_PROFILE(task_name => 'sql_tuning_task');
END;
/ 2 3 4
BEGIN
ERROR at line 1:
ORA-13786: missing SQL text of statement object "1" for tuning task "sql_tuning_task"
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.DBMS_SQLTUNE_INTERNAL", line 16442
ORA-06512: at "SYS.PRVT_SQLPROF_INFRA", line 31
ORA-06512: at "SYS.DBMS_SQLTUNE", line 7544
ORA-06512: at line 2
SQL> select banner from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production -
Using Get Data From Aggregation event class in SQL Profiler - SSAS 2012
Hi,
I'd like to understand better the use of the Get data from aggregation event class in SQL Profiler to monitor a MDX query and which info provide. Fe, does it return the MDX query? Is it possible to use this event class in order to monitor MDX query vs a
Tabular model?
In the TechNet documentation, this event class is handled briefly.
ThanksHi pscorca,
This event is raised when the storage engine reads data from an aggregation, it may have a negative impact on performance when turned on. If you need to monitor SSAS instance status, we can also use dynamic management view:
Use Dynamic Management Views (DMVs) to Monitor Analysis Services:
http://msdn.microsoft.com/en-us/library/hh230820.aspx
Regards,
Elvis Long
TechNet Community Support -
Trace for a specific IP address in SQL Profiler
Hello,
I am looking for a way to trace from a specific ip address in sql profiler, Is there any filter that we can use to trace the database calls from a specific ip address.
Thanks in advance.Thanks for the reply, I have tried by selecting hostname from column filters and gave my system name in Like.
When i run application from localhost then it returns trace results, but on live domain it is not returning trace results, M i missing something in configuring filters? -
Hi All,
We have slow runnig query problem with below queries:
QUERY 1
=======
SELECT "PC0".pxObjClass AS "pxObjClass", "PC0".PXINSNAME AS "pxInsName"
, "PC0".WORKTYPENAME AS "WorkTypeName" , "PC0".PYSTATUSWORK AS
"pyStatusWork" , "PC0".PXCREATEDATETIME AS "pxCreateDateTime",
"PC0".LINKEDREFTO as "pxInsHandle" FROM V_FORM_RELATIONSHIPS_R_1_0
"PC0" WHERE ( "PC0".LINKEDREFFROM = :1 ) AND ( "PC0".pxObjClass = :2
) ORDER BY "PC0".PXINSNAME DESC , "PC0".PXCREATEDATETIME
QUERY 2
=======
SELECT PYID AS "pyID" , PXOBJCLASS AS "pxObjClass" , PZINSKEY AS
"pzInsKey", PZINSKEY as "pxInsHandle" FROM V_WORK_R_1_0 WHERE (
PYID = :1 ) AND ( pxObjClass = :2 )
V_WORK_R_1_0 is a view which union all of two table without any where clause
V_FORM_RELATIONSHIPS_R_1_0 is another view that is made up of V_WORK_R_1_0 view and one more table.
Production DBA accepted both the SQL PROFILE created for these two queries.
FROM DBA_HIST_SQLSTATS it looks like sometime the profile getting used and sometime old plan is being used.How to ensure that correct SQLPROFILE once accepted is used?
This is 4 node RAC oracle 11.2.0.2.0 on Linux
For first query below are sql stats
col BEGIN_INTERVAL_TIME for a26
col end_INTERVAL_TIME for a26
col ROWS_PROCESSED_TOTAL for 99999
col ROWS_PROCESSED_delta for 99999
select s.begin_interval_time, s.end_interval_time , q.snap_id, q.dbid, q.sql_id, q.plan_hash_value, q.optimizer_cost, q.optimizer_mode
--,ROWS_PROCESSED_TOTAL,ROWS_PROCESSED_delta--,CPU_TIME_TOTAL,CPU_TIME_DELTA,ELAPSED_TIME_TOTAL,ELAPSED_TIME_DELTA
from dba_hist_sqlstat q, dba_hist_snapshot s
where q.dbid = 4026476544 and q.sql_id = '1um96ykvtwrh4'
and q.snap_id = s.snap_id
and s.begin_interval_time between sysdate-2 and sysdate
order by 1,s.snap_id desc;
BEGIN_INTERVAL_TIME END_INTERVAL_TIME SNAP_ID DBID SQL_ID PLAN_HASH_VALUE OPTIMIZER_COST OPTIMIZER_
03-JUL-13 06.00.33.805 AM 03-JUL-13 07.00.21.439 AM 17316 4026476544 1um96ykvtwrh4 377865450 20 ALL_ROWS
03-JUL-13 06.00.33.843 AM 03-JUL-13 07.00.21.475 AM 17316 4026476544 1um96ykvtwrh4 377865450 20 ALL_ROWS
03-JUL-13 06.00.33.843 AM 03-JUL-13 07.00.21.475 AM 17316 4026476544 1um96ykvtwrh4 1122713586 179350 ALL_ROWS
03-JUL-13 06.00.33.843 AM 03-JUL-13 07.00.21.474 AM 17316 4026476544 1um96ykvtwrh4 377865450 20 ALL_ROWS
03-JUL-13 07.00.21.475 AM 03-JUL-13 08.00.06.051 AM 17317 4026476544 1um96ykvtwrh4 377865450 20 ALL_ROWS
03-JUL-13 08.00.06.023 AM 03-JUL-13 09.00.11.626 AM 17318 4026476544 1um96ykvtwrh4 377865450 20 ALL_ROWS
03-JUL-13 08.00.06.023 AM 03-JUL-13 09.00.11.626 AM 17318 4026476544 1um96ykvtwrh4 1122713586 179350 ALL_ROWS
03-JUL-13 08.00.06.051 AM 03-JUL-13 09.00.11.596 AM 17318 4026476544 1um96ykvtwrh4 377865450 20 ALL_ROWS
03-JUL-13 08.00.06.051 AM 03-JUL-13 09.00.11.623 AM 17318 4026476544 1um96ykvtwrh4 1122713586 179350 ALL_ROWS
03-JUL-13 08.00.06.051 AM 03-JUL-13 09.00.11.596 AM 17318 4026476544 1um96ykvtwrh4 1122713586 179350 ALL_ROWS
03-JUL-13 11.00.10.502 AM 03-JUL-13 12.00.16.034 PM 17321 4026476544 1um96ykvtwrh4 1122713586 179350 ALL_ROWS
03-JUL-13 11.00.10.502 AM 03-JUL-13 12.00.16.033 PM 17321 4026476544 1um96ykvtwrh4 1122713586 179350 ALL_ROWS
03-JUL-13 11.00.10.503 AM 03-JUL-13 12.00.16.034 PM 17321 4026476544 1um96ykvtwrh4 377865450 20 ALL_ROWS
03-JUL-13 12.00.16.034 PM 03-JUL-13 01.00.42.715 PM 17322 4026476544 1um96ykvtwrh4 377865450 ALL_ROWS
03-JUL-13 01.00.42.685 PM 03-JUL-13 02.00.10.200 PM 17323 4026476544 1um96ykvtwrh4 1122713586 179350 ALL_ROWS
03-JUL-13 01.00.42.714 PM 03-JUL-13 02.00.10.200 PM 17323 4026476544 1um96ykvtwrh4 1122713586 179350 ALL_ROWS
03-JUL-13 03.00.15.887 PM 03-JUL-13 04.00.05.570 PM 17325 4026476544 1um96ykvtwrh4 1122713586 179347 ALL_ROWS
03-JUL-13 03.00.15.887 PM 03-JUL-13 04.00.05.570 PM 17325 4026476544 1um96ykvtwrh4 377865450 30585 ALL_ROWS
03-JUL-13 03.00.15.914 PM 03-JUL-13 04.00.05.541 PM 17325 4026476544 1um96ykvtwrh4 1122713586 179347 ALL_ROWS
03-JUL-13 03.00.15.915 PM 03-JUL-13 04.00.05.570 PM 17325 4026476544 1um96ykvtwrh4 377865450 30585 ALL_ROWS
03-JUL-13 04.00.05.541 PM 03-JUL-13 05.00.09.865 PM 17326 4026476544 1um96ykvtwrh4 1122713586 179347 ALL_ROWS
03-JUL-13 05.00.09.866 PM 03-JUL-13 06.00.26.710 PM 17327 4026476544 1um96ykvtwrh4 1122713586 179347 ALL_ROWS
03-JUL-13 08.00.12.716 PM 03-JUL-13 09.00.00.960 PM 17330 4026476544 1um96ykvtwrh4 1122713586 179347 ALL_ROWS
03-JUL-13 08.00.12.716 PM 03-JUL-13 09.00.00.989 PM 17330 4026476544 1um96ykvtwrh4 1122713586 179347 ALL_ROWS
377865450 is the sql_hash of explain plan given by SQL_PROFILE
select
2 extractvalue(value(d), '/hint') as outline_hints
3 from
4 xmltable('/*/outline_data/hint'
5 passing (
6 select
7 xmltype(other_xml) as xmlval
8 from
9 dba_hist_sql_plan
10 where
11 sql_id = '&sql_id'
12 and plan_hash_value = &plan_hash_value
13 and other_xml is not null
14 15 ) d;
Enter value for sql_id: 1um96ykvtwrh4
old 11: sql_id = '&sql_id'
new 11: sql_id = '1um96ykvtwrh4'
Enter value for plan_hash_value: 377865450
old 12: and plan_hash_value = &plan_hash_value
new 12: and plan_hash_value = 377865450
OUTLINE_HINTS
IGNORE_OPTIM_EMBEDDED_HINTS
OPTIMIZER_FEATURES_ENABLE('11.2.0.2')
DB_VERSION('11.2.0.2')
ALL_ROWS
OUTLINE_LEAF(@"SEL$B01C6807")
OUTLINE_LEAF(@"SEL$8E13D68A")
OUTLINE_LEAF(@"SET$5715CE2E")
PUSH_PRED(@"SEL$F5BB74E1" "VW"@"SEL$2" 3)
OUTLINE_LEAF(@"SEL$F5BB74E1")
MERGE(@"SEL$2")
OUTLINE(@"SEL$3")
OUTLINE_HINTS
OUTLINE(@"SEL$4")
OUTLINE(@"SET$1")
OUTLINE(@"SEL$F5BB74E1")
MERGE(@"SEL$2")
OUTLINE(@"SEL$1")
OUTLINE(@"SEL$2")
INDEX_RS_ASC(@"SEL$F5BB74E1" "LR"@"SEL$2" ("LINK_RELATIONSHIP"."PXLINKEDREFFROM"
NO_ACCESS(@"SEL$F5BB74E1" "VW"@"SEL$2")
LEADING(@"SEL$F5BB74E1" "LR"@"SEL$2" "VW"@"SEL$2")
OUTLINE_HINTS
USE_NL(@"SEL$F5BB74E1" "VW"@"SEL$2")
INDEX_RS_ASC(@"SEL$8E13D68A" "W"@"SEL$4" ("WORK_COMMON"."PZINSKEY"))
INDEX_RS_ASC(@"SEL$B01C6807" "WORK_BATCH"@"SEL$3" ("WORK_BATCH"."PZINSKEY"))
select id, operation, options, object_name, cost
from dba_hist_sql_plan
where dbid = 4026476544 and sql_id = '1um96ykvtwrh4'
and plan_hash_value = 377865450 2 3 4
5 ;
ID OPERATION OPTIONS OBJECT_NAME COST
0 SELECT STATEMENT 20
1 SORT ORDER BY 20
2 FILTER
3 NESTED LOOPS 19
4 TABLE ACCESS BY INDEX ROWID LINK_RELATIONSHIP 5
5 INDEX RANGE SCAN RELATIONSHIP_REFFROM 3
6 VIEW V_WORK_R_1_0 7
7 UNION ALL PUSHED PREDICATE
8 TABLE ACCESS BY INDEX ROWID WORK_BATCH 4
9 INDEX UNIQUE SCAN WORK_BATCH_PK 3
10 TABLE ACCESS BY INDEX ROWID WORK_COMMON 3
11 INDEX UNIQUE SCAN WORK_COMMON_PK 2
EXPLAIN PLAN OF SQL_PROFILE PROVIDED
select * from table(dbms_xplan.display_awr('1um96ykvtwrh4',377865450,4026476544, 'ALL +peeked_binds +ALLSTATS LAST'));
PLAN_TABLE_OUTPUT
SQL_ID 1um96ykvtwrh4
SELECT "PC0".pxObjClass AS "pxObjClass", "PC0".PXINSNAME AS "pxInsName"
, "PC0".WORKTYPENAME AS "WorkTypeName" , "PC0".PYSTATUSWORK AS
"pyStatusWork" , "PC0".PXCREATEDATETIME AS "pxCreateDateTime",
"PC0".LINKEDREFTO as "pxInsHandle" FROM V_FORM_RELATIONSHIPS_R_1_0
"PC0" WHERE ( "PC0".LINKEDREFFROM = :1 ) AND ( "PC0".pxObjClass = :2
) ORDER BY "PC0".PXINSNAME DESC , "PC0".PXCREATEDATETIME
Plan hash value: 377865450
| Id | Operation | Name | E-Rows |E-Bytes| Cost (%CPU)| E-Time |
| 0 | SELECT STATEMENT | | | | 20 (100)| |
| 1 | SORT ORDER BY | | 2 | 1362 | 20 (5)| 00:00:01 |
| 2 | FILTER | | | | | |
| 3 | NESTED LOOPS | | 2 | 1362 | 19 (0)| 00:00:01 |
| 4 | TABLE ACCESS BY INDEX ROWID | LINK_RELATIONSHIP | 2 | 204 | 5 (0)| 00:00:01 |
| 5 | INDEX RANGE SCAN | RELATIONSHIP_REFFROM | 2 | | 3 (0)| 00:00:01 |
| 6 | VIEW | V_WORK_R_1_0 | 1 | 579 | 7 (0)| 00:00:01 |
| 7 | UNION ALL PUSHED PREDICATE | | | | | |
| 8 | TABLE ACCESS BY INDEX ROWID| WORK_BATCH | 1 | 89 | 4 (0)| 00:00:01 |
| 9 | INDEX UNIQUE SCAN | WORK_BATCH_PK | 1 | | 3 (0)| 00:00:01 |
| 10 | TABLE ACCESS BY INDEX ROWID| WORK_COMMON | 1 | 109 | 3 (0)| 00:00:01 |
| 11 | INDEX UNIQUE SCAN | WORK_COMMON_PK | 1 | | 2 (0)| 00:00:01 |
Query Block Name / Object Alias (identified by operation id):
1 - SEL$F5BB74E1
4 - SEL$F5BB74E1 / LR@SEL$2
5 - SEL$F5BB74E1 / LR@SEL$2
6 - SET$5715CE2E / VW@SEL$2
7 - SET$5715CE2E
8 - SEL$B01C6807 / WORK_BATCH@SEL$3
9 - SEL$B01C6807 / WORK_BATCH@SEL$3
10 - SEL$8E13D68A / W@SEL$4
11 - SEL$8E13D68A / W@SEL$4
Peeked Binds (identified by position):
1 - :1 (VARCHAR2(30), CSID=873): 'xxxx-xxx-SERVICEREQUEST-WORK-ACCTMAINT AM-13640'
Note
- Warning: basic plan statistics not available. These are only collected when:
* hint 'gather_plan_statistics' is used for the statement or
* parameter 'statistics_level' is set to 'ALL', at session or system level
OLD EXPLAIN PLAN IS
select * from table(dbms_xplan.display_awr('1um96ykvtwrh4',1122713586,4026476544, 'ALL +peeked_binds +ALLSTATS LAST'));
PLAN_TABLE_OUTPUT
SQL_ID 1um96ykvtwrh4
SELECT "PC0".pxObjClass AS "pxObjClass", "PC0".PXINSNAME AS "pxInsName"
, "PC0".WORKTYPENAME AS "WorkTypeName" , "PC0".PYSTATUSWORK AS
"pyStatusWork" , "PC0".PXCREATEDATETIME AS "pxCreateDateTime",
"PC0".LINKEDREFTO as "pxInsHandle" FROM V_FORM_RELATIONSHIPS_R_1_0
"PC0" WHERE ( "PC0".LINKEDREFFROM = :1 ) AND ( "PC0".pxObjClass = :2
) ORDER BY "PC0".PXINSNAME DESC , "PC0".PXCREATEDATETIME
Plan hash value: 1122713586
| Id | Operation | Name | E-Rows |E-Bytes|E-Temp | Cost (%CPU)| E-Time |
| 0 | SELECT STATEMENT | | | | | 171K(100)| |
| 1 | SORT ORDER BY | | 32220 | 20M| 22M| 171K (1)| 00:34:18 |
| 2 | FILTER | | | | | | |
| 3 | HASH JOIN | | 32220 | 20M| 3560K| 166K (1)| 00:33:22 |
| 4 | VIEW | index$_join$_002 | 31931 | 3180K| | 1648 (1)| 00:00:20 |
| 5 | HASH JOIN | | | | | | |
| 6 | INDEX RANGE SCAN | RELATIONSHIP_REFFROM | 31931 | 3180K| | 430 (1)| 00:00:06 |
| 7 | INDEX FAST FULL SCAN| AK1_LINK_RELATIONSHIP | 31931 | 3180K| | 1096 (1)| 00:00:14 |
| 8 | VIEW | V_WORK_R_1_0 | 3946K| 2178M| | 54733 (1)| 00:10:57 |
| 9 | UNION-ALL | | | | | | |
| 10 | TABLE ACCESS FULL | WORK_BATCH | 3910K| 331M| | 53959 (1)| 00:10:48 |
| 11 | TABLE ACCESS FULL | WORK_COMMON | 35334 | 3761K| | 774 (1)| 00:00:10 |
Query Block Name / Object Alias (identified by operation id):
1 - SEL$F5BB74E1
4 - SEL$838CAA44 / LR@SEL$2
5 - SEL$838CAA44
6 - SEL$838CAA44 / indexjoin$_alias$_001@SEL$838CAA44
7 - SEL$838CAA44 / indexjoin$_alias$_002@SEL$838CAA44
8 - SET$1 / VW@SEL$2
9 - SET$1
10 - SEL$3 / WORK_BATCH@SEL$3
11 - SEL$4 / W@SEL$4
Peeked Binds (identified by position):
1 - :1 (VARCHAR2(30), CSID=873): 'xxxxxx-xxx-SERVICEREQUEST-WORK-BD-DOCUMENTREQUEST ACE_BD_DR-166646'
Note
- Warning: basic plan statistics not available. These are only collected when:
* hint 'gather_plan_statistics' is used for the statement or
* parameter 'statistics_level' is set to 'ALL', at session or system level
52 rows selected.
Select sql_id,plan_hash_value,old_hash_value,child_number,OUTLINE_CATEGORY,CPU_TIME,ELAPSED_TIME,SQL_PROFILE from gv$sql where sql_id='1um96ykvtwrh4';
SQL_ID PLAN_HASH_VALUE OLD_HASH_VALUE CHILD_NUMBER OUTLINE_CA CPU_TIME ELAPSED_TIME SQL_PROFILE
1um96ykvtwrh4 377865450 3763442152 2 81989 198629 SYS_SQLPROF_013fa7a18f7c0001
1um96ykvtwrh4 1122713586 3763442152 0 44147289 172322738
1um96ykvtwrh4 1122713586 3763442152 1 1905933242 6101663681
1um96ykvtwrh4 377865450 3763442152 3 55988 108690 SYS_SQLPROF_013fa7a18f7c0001
FOR QUERY 2
col BEGIN_INTERVAL_TIME for a26
col end_INTERVAL_TIME for a26
select s.begin_interval_time, s.end_interval_time , q.snap_id, q.dbid, q.sql_id,q.VERSION_COUNT, q.plan_hash_value, q.optimizer_cost, q.optimizer_mode
from dba_hist_sqlstat q, dba_hist_snapshot s
where q.dbid = 4026476544 and q.sql_id = '4prk4w6sdtxa5'
and q.snap_id = s.snap_id
and s.begin_interval_time between sysdate-2 and sysdate
order by 1,s.snap_id desc;
BEGIN_INTERVAL_TIME END_INTERVAL_TIME SNAP_ID DBID SQL_ID PLAN_HASH_VALUE OPTIMIZER_COST OPTIMIZER_
04-JUL-13 12.00.01.427 PM 04-JUL-13 01.00.02.453 PM 17346 4026476544 4prk4w6sdtxa5 3168544609 56710 ALL_ROWS
04-JUL-13 12.00.01.430 PM 04-JUL-13 01.00.02.413 PM 17346 4026476544 4prk4w6sdtxa5 455675889 985 ALL_ROWS
04-JUL-13 12.00.01.430 PM 04-JUL-13 01.00.02.413 PM 17346 4026476544 4prk4w6sdtxa5 3168544609 56710 ALL_ROWS
04-JUL-13 12.00.01.430 PM 04-JUL-13 01.00.02.413 PM 17346 4026476544 4prk4w6sdtxa5 455675889 985 ALL_ROWS
04-JUL-13 12.00.01.430 PM 04-JUL-13 01.00.02.413 PM 17346 4026476544 4prk4w6sdtxa5 3168544609 56710 ALL_ROWS
OLD EXPLAIN PAL
select * from table(dbms_xplan.display_awr('4prk4w6sdtxa5',3168544609,4026476544, 'ALL +peeked_binds +ALLSTATS LAST'));
PLAN_TABLE_OUTPUT
SQL_ID 4prk4w6sdtxa5
SELECT PYID AS "pyID" , PXOBJCLASS AS "pxObjClass" , PZINSKEY AS
"pzInsKey", PZINSKEY as "pxInsHandle" FROM V_WORK_R_1_0 WHERE (
PYID = :1 ) AND ( pxObjClass = :2 )
Plan hash value: 3168544609
| Id | Operation | Name | E-Rows |E-Bytes| Cost (%CPU)| E-Time |
| 0 | SELECT STATEMENT | | | | 53846 (100)| |
| 1 | VIEW | V_WORK_R_1_0 | 2 | 1238 | 53846 (1)| 00:10:47 |
| 2 | UNION-ALL | | | | | |
| 3 | FILTER | | | | | |
| 4 | TABLE ACCESS FULL | WORK_BATCH | 1 | 67 | 53844 (1)| 00:10:47 |
| 5 | FILTER | | | | | |
| 6 | TABLE ACCESS BY INDEX ROWID| WORK_COMMON | 1 | 578 | 2 (0)| 00:00:01 |
| 7 | INDEX RANGE SCAN | AK1_WORK_COMMON | 1 | | 1 (0)| 00:00:01 |
Query Block Name / Object Alias (identified by operation id):
1 - SET$1 / V_WORK_R_1_0@SEL$1
2 - SET$1
3 - SEL$2
4 - SEL$2 / WORK_BATCH@SEL$2
5 - SEL$3
6 - SEL$3 / W@SEL$3
7 - SEL$3 / W@SEL$3
Peeked Binds (identified by position):
1 - :1 (VARCHAR2(30), CSID=873): 'CM-22180'
Note
- dynamic sampling used for this statement (level=2)
- Warning: basic plan statistics not available. These are only collected when:
* hint 'gather_plan_statistics' is used for the statement or
* parameter 'statistics_level' is set to 'ALL', at session or system level
NEW EXPLAIN PLAN IS
select * from table(dbms_xplan.display_awr('4prk4w6sdtxa5',455675889,4026476544, 'ALL +peeked_binds +ALLSTATS LAST'));
PLAN_TABLE_OUTPUT
SQL_ID 4prk4w6sdtxa5
SELECT PYID AS "pyID" , PXOBJCLASS AS "pxObjClass" , PZINSKEY AS
"pzInsKey", PZINSKEY as "pxInsHandle" FROM V_WORK_R_1_0 WHERE (
PYID = :1 ) AND ( pxObjClass = :2 )
Plan hash value: 455675889
| Id | Operation | Name | E-Rows |E-Bytes| Cost (%CPU)| E-Time | TQ |IN-OUT| PQ Distrib |
| 0 | SELECT STATEMENT | | | | 985 (100)| | | | |
| 1 | PX COORDINATOR | | | | | | | | |
| 2 | PX SEND QC (RANDOM) | :TQ10001 | 2 | 1238 | 985 (1)| 00:00:12 | Q1,01 | P->S | QC (RAND) |
| 3 | BUFFER SORT | | 2 | 1238 | | | Q1,01 | PCWP | |
| 4 | VIEW | V_WORK_R_1_0 | 2 | 1238 | 985 (1)| 00:00:12 | Q1,01 | PCWP | |
| 5 | UNION-ALL | | | | | | Q1,01 | PCWP | |
| 6 | FILTER | | | | | | Q1,01 | PCWC | |
| 7 | PX BLOCK ITERATOR | | 1 | 67 | 983 (1)| 00:00:12 | Q1,01 | PCWC | |
| 8 | TABLE ACCESS FULL | WORK_BATCH | 1 | 67 | 983 (1)| 00:00:12 | Q1,01 | PCWP | |
| 9 | BUFFER SORT | | | | | | Q1,01 | PCWC | |
| 10 | PX RECEIVE | | 1 | 59 | 2 (0)| 00:00:01 | Q1,01 | PCWP | |
| 11 | PX SEND ROUND-ROBIN | :TQ10000 | 1 | 59 | 2 (0)| 00:00:01 | | S->P | RND-ROBIN |
| 12 | FILTER | | | | | | | | |
| 13 | TABLE ACCESS BY INDEX ROWID| WORK_COMMON | 1 | 59 | 2 (0)| 00:00:01 | | | |
| 14 | INDEX RANGE SCAN | AK1_WORK_COMMON | 1 | | 1 (0)| 00:00:01 | | | |
Query Block Name / Object Alias (identified by operation id):
1 - SEL$1
4 - SET$1 / V_WORK_R_1_0@SEL$1
5 - SET$1
6 - SEL$2
8 - SEL$2 / WORK_BATCH@SEL$2
12 - SEL$3
13 - SEL$3 / W@SEL$3
14 - SEL$3 / W@SEL$3
Peeked Binds (identified by position):
1 - :1 (VARCHAR2(30), CSID=873): 'AM-15042'
Note
- automatic DOP: Computed Degree of Parallelism is 64
- SQL profile "SYS_SQLPROF_013fa79ff2ee0000" used for this statement
- Warning: basic plan statistics not available. These are only collected when:
* hint 'gather_plan_statistics' is used for the statement or
* parameter 'statistics_level' is set to 'ALL', at session or system level
53 rows selected.
HINT USED IN EXPLAIN PLAN GIVEN BY SQL_PROFILE
select
extractvalue(value(d), '/hint') as outline_hints
from
xmltable('/*/outline_data/hint'
passing (
select
xmltype(other_xml) as xmlval
from
dba_hist_sql_plan
where
sql_id = '&sql_id'
and plan_hash_value = &plan_hash_value
and other_xml is not null
)) d;
OUTLINE_HINTS
IGNORE_OPTIM_EMBEDDED_HINTS
OPTIMIZER_FEATURES_ENABLE('11.2.0.2')
DB_VERSION('11.2.0.2')
OPT_PARAM('optimizer_dynamic_sampling' 5)
ALL_ROWS
SHARED(64)
OUTLINE_LEAF(@"SEL$2")
OUTLINE_LEAF(@"SEL$3")
OUTLINE_LEAF(@"SET$1")
OUTLINE_LEAF(@"SEL$1")
NO_ACCESS(@"SEL$1" "V_WORK_R_1_0"@"SEL$1")
INDEX_RS_ASC(@"SEL$3" "W"@"SEL$3" ("WORK_COMMON"."PYID"))
FULL(@"SEL$2" "WORK_BATCH"@"SEL$2")
col OUTLINE_CATEGORY for a10
col SQL_PROFILE for a30
select sql_id,plan_hash_value,old_hash_value,child_number,OUTLINE_CATEGORY,CPU_TIME,ELAPSED_TIME,SQL_PROFILE from gv$sql where sql_id='4prk4w6sdtxa5';
SQL_ID PLAN_HASH_VALUE OLD_HASH_VALUE CHILD_NUMBER OUTLINE_CA CPU_TIME ELAPSED_TIME SQL_PROFILE
4prk4w6sdtxa5 3168544609 353644632 0 2633226703 4.4271E+10
4prk4w6sdtxa5 455675889 353644632 1 27225852 759830164 SYS_SQLPROF_013fa79ff2ee0000
4prk4w6sdtxa5 455675889 353644632 2 119988890 9664144040 SYS_SQLPROF_013fa79ff2ee0000
4prk4w6sdtxa5 455675889 353644632 3 85872011 5942746451 SYS_SQLPROF_013fa79ff2ee0000
4prk4w6sdtxa5 3168544609 353644632 0 335776954 337580538
4prk4w6sdtxa5 3168544609 353644632 1 399056329 401261240
4prk4w6sdtxa5 3168544609 353644632 2 484240383 486679352
4prk4w6sdtxa5 3168544609 353644632 3 401375979 492360355
4prk4w6sdtxa5 3168544609 353644632 4 930830490 2.2156E+10
4prk4w6sdtxa5 3168544609 353644632 5 403837610 472368680
4prk4w6sdtxa5 3168544609 353644632 6 1136393235 2.5397E+10
4prk4w6sdtxa5 3168544609 353644632 7 858015552 1.6636E+10
4prk4w6sdtxa5 455675889 353644632 8 68884598 6001624174 SYS_SQLPROF_013fa79ff2ee0000
4prk4w6sdtxa5 455675889 353644632 9 21730702 629077530 SYS_SQLPROF_013fa79ff2ee0000
4prk4w6sdtxa5 455675889 353644632 10 93504893 8216578447 SYS_SQLPROF_013fa79ff2ee0000
OTHER INFO
SQL> select table_name,owner,index_name,INDEX_TYPE from dba_indexes where table_name in ('WORK_BATCH','WORK_COMMON','LINK_RELATIONSHIP');
TABLE_NAME OWNER INDEX_NAME INDEX_TYPE
LINK_RELATIONSHIP ACE SYS_IL0000120332C00018$$ LOB
WORK_BATCH ACE SYS_IL0000120308C00085$$ LOB
WORK_COMMON ACE SYS_IL0000243612C00085$$ LOB
LINK_RELATIONSHIP ACE LINK_RELATIONSHIP_PK NORMAL
LINK_RELATIONSHIP ACE AK1_LINK_RELATIONSHIP NORMAL
LINK_RELATIONSHIP ACE RELATIONSHIP_REFFROM NORMAL
WORK_BATCH ACE WORK_BATCH_PK NORMAL
WORK_BATCH ACE IDX1_WORK_BATCH NORMAL
WORK_COMMON ACE AK2_WORK_COMMON NORMAL
WORK_COMMON ACE AK1_WORK_COMMON NORMAL
WORK_COMMON ACE WORK_COMMON_PK NORMAL
col object_name for a25
select created,object_name,object_type,owner,LAST_DDL_TIME from dba_objects where object_name in ('WORK_BATCH','WORK_COMMON','WORK_BATCH_PK','WORK_COMMON_PK','AK1_LINK_RELATIONSHIP','RELATIONSHIP_REFFROM')
2
CREATED OBJECT_NAME OBJECT_TYPE OWNER LAST_DDL_TI
28-JUN-2012 WORK_BATCH TABLE ACE 15-JUN-2013
28-JUN-2012 WORK_BATCH_PK INDEX ACE 29-MAY-2013
30-NOV-2012 RELATIONSHIP_REFFROM INDEX ACE 03-JUL-2013
23-FEB-2013 AK1_LINK_RELATIONSHIP INDEX ACE 23-FEB-2013
15-JUN-2013 WORK_COMMON TABLE ACE 15-JUN-2013
15-JUN-2013 WORK_COMMON_PK INDEX ACE 15-JUN-2013
09-MAR-2013 WORK_BATCH SYNONYM ACE_USER 09-MAR-2013
col COLUMN_NAME for a20
Select INDEX_NAME,TABLE_NAME,COLUMN_NAME,COLUMN_POSITION from dba_ind_columns where table_name in ('WORK_BATCH','WORK_COMMON','LINK_RELATIONSHIP');
INDEX_NAME TABLE_NAME COLUMN_NAME COLUMN_POSITION
RELATIONSHIP_REFFROM LINK_RELATIONSHIP PXLINKEDREFFROM 1
AK1_LINK_RELATIONSHIP LINK_RELATIONSHIP PXLINKEDREFTO 1
LINK_RELATIONSHIP_PK LINK_RELATIONSHIP PZINSKEY 1
IDX1_WORK_BATCH WORK_BATCH CAPTUREUNIQUEID 1
WORK_BATCH_PK WORK_BATCH PZINSKEY 1
WORK_COMMON_PK WORK_COMMON PZINSKEY 1
AK1_WORK_COMMON WORK_COMMON PYID 1
AK2_WORK_COMMON WORK_COMMON PXOBJCLASS 1
SQL> select distinct tablespace_name from dba_tablespaces where tablespace_name like '%INDEX%';
TABLESPACE_NAME
ACE_INDEXES_M
RBS_INDEXES_S
SPS_INDEXES_S
ACE_INDEXES_S
ACE_INDEXES_L
FI_INDEXES_S
FI_INDEXES_M
RBS_INDEXES_M
8 rows selected.
col SEARCH_CONDITION for a25
col OWNER for a10
select OWNER,CONSTRAINT_NAME,CONSTRAINT_TYPE,TABLE_NAME,SEARCH_CONDITION,INDEX_NAME from dba_constraints where TABLE_NAME in ('WORK_BATCH','WORK_COMMON','LINK_RELATIONSHIP')
OWNER CONSTRAINT_NAME C TABLE_NAME SEARCH_CONDITION INDEX_NAME
ACE SYS_C00150550 C WORK_COMMON "PZINSKEY" IS NOT NULL
ACE WORK_BATCH_PK P WORK_BATCH WORK_BATCH_PK
ACE LINK_RELATIONSHIP_PK P LINK_RELATIONSHIP LINK_RELATIONSHIP_PK
ACE WORK_COMMON_PK P WORK_COMMON WORK_COMMON_PK
select attr_val hint
from dba_sql_profiles p, sqlprof$attr h
where p.signature = h.signature
and name like ('SYS_SQLPROF_013fa7a18f7c0001')
order by attr#
select LAST_ANALYZED,SAMPLE_SIZE,num_rows from dba_tables where table_name in ('WORK_BATCH','WORK_COMMON','LINK_RELATIONSHIP');
LAST_ANALYZ SAMPLE_SIZE NUM_ROWS
02-JUL-2013 4122880 4122880
02-JUL-2013 81108 81108
03-JUL-2013 40802 40802
SQL> select count(pzinskey) from ace.WORK_BATCH;
COUNT(PZINSKEY)
4138044
SQL> select count(pzinskey) from ace.WORK_COMMON;
COUNT(PZINSKEY)
40805Hi,
i think you should give a try on baseline.
Profiles are more subject to stats ad dynamic sampling.
You can find this useful:
Kerry Osborne SQL Profiles Disable Automatic Dynamic Sampling
This doesn't match your case but can give some advices.
Regs,
Drew -
How to check if an SQL profile is being used or not?
Hi,
We have a couple of SQL profiles and outlines in the database. There has been a couple of code changes and it is now difficult to keep track if an SQL profile or an Outline is still being used? Is there any way to find that?
Thanks in advanceFind the entry corresponding to the SQL statement you are reviewing in V$SQL. Look at OUTLINE_CATEGORY and SQL_PROFILE columns. NULL indicates that no Outline/Profile was used.
-
Oracle 10g RAC SQL profiles not working for both the nodes
We have identified a long running sql.
Used Advisor to tune the sql
Applied the suggested sql_profile as per the recommendation.
when we re-run the sql from application, due to RAC setup the sql hit the other node, used the sql profile as indicated by v$sql but was long running.
it generated a new sql_id due to which we think it was not working.
Could you please advice how to apply sql_profile for both nodes?HI Arun
Would you please post that in the GRID RAC section of this forum please ?
Please consult the following documents to get support on your question:
http://download.oracle.com/docs/cd/B19306_01/rac.102/b14197/votocr.htm#sthref211
http://download.oracle.com/docs/cd/B19306_01/install.102/b14205/undrstnd.htm#RISOL2610
Thanks -
Explain plan and SQL profile.
Hi ,
I got a sql tuning result for one query , and i need to understand the below fileds in the explain plan
operation lineid object object_type order rows bytes cost time cpucost iocost
any document to understand will be appreciated
and in recomendation i got Consider accepting the recommended SQL profile. suppose if it was not feasible after accepting the SQL profile can i revert back.
Thanksuser12266475 wrote:
Hi ,
I got a sql tuning result for one query , and i need to understand the below fileds in the explain plan
operation lineid object object_type order rows bytes cost time cpucost iocost
any document to understand will be appreciated
and in recomendation i got Consider accepting the recommended SQL profile. suppose if it was not feasible after accepting the SQL profile can i revert back.
Thankshttp://docs.oracle.com/cd/E11882_01/server.112/e16638/toc.htm
Thread: HOW TO: Post a SQL statement tuning request - template posting
HOW TO: Post a SQL statement tuning request - template posting -
What is Oracle Equivalent of SQL Profiler
Hi All,
Iam new to oracle world. I have a problem, I have a website which was build by someone and it uses Oracle 9i/10g as its back end and I dont have the code for that website. I have to develop an interface which simulates some of the button clicks in the web site. For achieving this i have to know what are all the tables thatare effected by the button click. If it is MS SQL world we used to put SQL Profiler and get all the SQL queries executed for that particular event. In Oracle how can we achieve this. PLease help iam in a dire necessity for this PLEASE
--Phani
Edited by: user3654627 on Apr 29, 2009 9:57 AMI don't get it:
If someone clearly states to be a newbie, but willing and eager to learn, if you realize that this is a community, that means: we all learn when we need to be teached and teach others when others need to learn, we SHARE KNOWLEDGE:
Why do you suggest OP to change jobs, when he's only asked his second question on this forum???
This forum is not about doing your work for free, and it is not for the lazy who can't be bothered to do their own work. If you are not > up to the task, consider changing jobs.Come on...you can't be serious here, either that, or you've got some human malfunction in your brain. ( bad marriage? )
You're like:
Create table sybrand (my_answer_is_always varchar2(16) default 'READ ORACLE DOCS' NOT NULL)
So, whatever we insert, it doesn't matter, same resultset in return, regardless of who fires the query on table sybrand...fine, have it your way.
Regardless of teaching a rookie or an expert.
If you don't wanna teach/learn, and just be a repeating frame, I suggest you buzz off to the Reports Forum. -
ORA-06528: Error executing PL/SQL profiler
Hai
I would like to see the outcome of package (to view the report on the package).In order to get that
I installed the below package connect as internal
sql>d:\oracle\orq81\rdbms\admin\profload.sql
In order to use dbms_profiler,after that i need to have installed profilling tables ,in order to get i ran proftab.sql ,and its created three tables are
plsql_profiler_data,plsql_profiler_units,plsql+profiler_runs
after that i ran the below procedure
create or replace procedure do_mod as
cnt number := 0;
begin
dbms_profiler.start_profiler( 'mod' );
for i in 1 .. 500000
loop
cnt := cnt + 1;
if ( mod(cnt,1000) = 0 )
then
commit;
end if;
end loop;
dbms_profiler.stop_profiler;
end;/
PL/SQL procedure successfully completed.
exec no_mod
PL/SQL procedure successfully completed.
In order to see the report on packge ,i had query the table , RUN_TOTAL_TIME IS 3.5190E+11(this is seconds)
my qusetion is
1)
Please explain me that is total amount time in seconds or minutes,i donnot understand what is 3.5190e+11
SQL> select RUNID,RUN_COMMENT,RUN_TOTAL_TIME FROM PLSQL_PROFILER_RUNS;
RUNID
RUN_COMMENT
RUN_TOTAL_TIME
1
mod
7.0975E+11
2
mod
6.9767E+11
RUNID
RUN_COMMENT
RUN_TOTAL_TIME
3
no mod
3.5190E+11
2)
I had ran the above script one of the schema ,and successfully created above procedure.When i execte,it retuns below error message
SQL> exec do_mod;
BEGIN do_mod; END;
ERROR at line 1:
ORA-06528: Error executing PL/SQL profiler
ORA-06512: at "SYS.DBMS_PROFILER", line 123
ORA-06512: at "SYS.DBMS_PROFILER", line 132
ORA-06512: at "MOHAN1.DO_MOD", line 4
ORA-06512: at line 1
Any one any idea about that
Regards
mohan1) Run_total_time is the elapsed total time in nanoseconds.
A nanosecond is one billionth of a second.
It is displayed in scientific notation
where E stands for "times ten to the power of".
So, 3.5190E+11 nanoseconds
= 3.5190 * 100000000000 nanoseconds
= 351900000000 nanoseconds
= 351900000000 billionths of a second
= 351900000000 / 1000000000 seconds
= 351.9 seconds
If you want to display it in seconds, use:
SELECT runid,
run_comment,
run_total_time / 1000000000 AS seconds
FROM plsql_profiler_runs;
2) The only thing that looks wrong about your do_mod procedure
is the last line:
end;/
The / should be on the next line.
Other than that, I don't see any possible cause for
the error. -
06528. 00000 - "Error executing PL/SQL profiler"
HI.
i am getting an error -
ORA-06528: Error executing PL/SQL profiler
ORA-06512: at "SYS.DBMS_PROFILER", line 258
ORA-06512: at line 3
06528. 00000 - "Error executing PL/SQL profiler"
*Cause: An error occurred in during execution of a PL/SQL profiler
procedure.
when i try to run the following block
BEGIN
DBMS_PROFILER.START_PROFILER( sysdate,'');
DBMS_PROFILER.FLUSH_DATA;
END;
plz helpRun proftab.sql first. look st the test case. Hopefully you have installed dbms_profiler package. The first anonymous block is to test that, second block is your block which is failing.
SQL> ed
Wrote file afiedt.buf
1 declare
2 var1 binary_integer;
3 var2 binary_integer;
4 begin
5 DBMS_PROFILER.GET_VERSION(Var1,var2);
6 dbms_output.put_line('Var1 '||Var1);
7* end;
8 /
Var1 2
PL/SQL procedure successfully completed.
SQL> BEGIN
2 DBMS_PROFILER.START_PROFILER( sysdate,'');
3 DBMS_PROFILER.FLUSH_DATA;
4 END;
5 /
BEGIN
ERROR at line 1:
ORA-06528: Error executing PL/SQL profiler
ORA-06512: at "SYS.DBMS_PROFILER", line 123
ORA-06512: at "SYS.DBMS_PROFILER", line 132
ORA-06512: at line 2
SQL> @C:\oraclexe\app\oracle\product\10.2.0\server\RDBMS\ADMIN\proftab.sql
SQL> BEGIN
2 DBMS_PROFILER.START_PROFILER( sysdate,'');
3 DBMS_PROFILER.FLUSH_DATA;
4 END;
5 /
PL/SQL procedure successfully completed.
Maybe you are looking for
-
Date format not working in XML Publisher
Hi, We have applied a date format while formatting the report layout using the Template. The same is not getting reflected. The output is as follows : 5/1/2006 0:0:0 i.e date with time stamp. We require DD-Mon-RRRR format. The same has been tried usi
-
How to see how many users are working on a Dynpro application?
Hello, Is it possible to see somwhere at the portal or on the WAS how many users are currently working with my Web Dynpro application?
-
How can i find and replace xml tags?
Hi, i am using xml in my workflow and want to be able to remove certain tags if they contain particular text. here is an example of my xml structure- <entry> <name>DEFAULT</name> <tel>DEFAULT</tel> <address>DEFAULT</address> </entry> I am
-
HT1338 my new mac book air can't mirror but my ipad can
my new mac book air can't mirror with apple tv but my ipad can. How do I fix this?
-
Layer mask with background animation
Hi all, I am looking to create a video for my YouTube channel using Layer Mask but I am not too competent in using masks. The logo for my channel is here: I would like to create a moving background in where the coloured image is but I want to mask ou