2026-07-11 16:10:39
This commit is contained in:
@@ -1,102 +0,0 @@
|
|||||||
SQL>REM
|
|
||||||
SQL>REM $Header: 215187.1 coe_xfr_sql_profile_9t7jvx0gm0m95_1509575125.sql 11.4.4.4 2026/07/08 carlos.sierra $
|
|
||||||
SQL>REM
|
|
||||||
SQL>REM Copyright (c) 2000-2012, Oracle Corporation. All rights reserved.
|
|
||||||
SQL>REM
|
|
||||||
SQL>REM AUTHOR
|
|
||||||
SQL>REM carlos.sierra@oracle.com
|
|
||||||
SQL>REM
|
|
||||||
SQL>REM SCRIPT
|
|
||||||
SQL>REM coe_xfr_sql_profile_9t7jvx0gm0m95_1509575125.sql
|
|
||||||
SQL>REM
|
|
||||||
SQL>REM DESCRIPTION
|
|
||||||
SQL>REM This script is generated by coe_xfr_sql_profile.sql
|
|
||||||
SQL>REM It contains the SQL*Plus commands to create a custom
|
|
||||||
SQL>REM SQL Profile for SQL_ID 9t7jvx0gm0m95 based on plan hash
|
|
||||||
SQL>REM value 1509575125.
|
|
||||||
SQL>REM The custom SQL Profile to be created by this script
|
|
||||||
SQL>REM will affect plans for SQL commands with signature
|
|
||||||
SQL>REM matching the one for SQL Text below.
|
|
||||||
SQL>REM Review SQL Text and adjust accordingly.
|
|
||||||
SQL>REM
|
|
||||||
SQL>REM PARAMETERS
|
|
||||||
SQL>REM None.
|
|
||||||
SQL>REM
|
|
||||||
SQL>REM EXAMPLE
|
|
||||||
SQL>REM SQL> START coe_xfr_sql_profile_9t7jvx0gm0m95_1509575125.sql;
|
|
||||||
SQL>REM
|
|
||||||
SQL>REM NOTES
|
|
||||||
SQL>REM 1. Should be run as SYSTEM or SYSDBA.
|
|
||||||
SQL>REM 2. User must have CREATE ANY SQL PROFILE privilege.
|
|
||||||
SQL>REM 3. SOURCE and TARGET systems can be the same or similar.
|
|
||||||
SQL>REM 4. To drop this custom SQL Profile after it has been created:
|
|
||||||
SQL>REM EXEC DBMS_SQLTUNE.DROP_SQL_PROFILE('coe_9t7jvx0gm0m95_1509575125');
|
|
||||||
SQL>REM 5. Be aware that using DBMS_SQLTUNE requires a license
|
|
||||||
SQL>REM for the Oracle Tuning Pack.
|
|
||||||
SQL>REM 6. If you modified a SQL putting Hints in order to produce a desired
|
|
||||||
SQL>REM Plan, you can remove the artifical Hints from SQL Text pieces below.
|
|
||||||
SQL>REM By doing so you can create a custom SQL Profile for the original
|
|
||||||
SQL>REM SQL but with the Plan captured from the modified SQL (with Hints).
|
|
||||||
SQL>REM
|
|
||||||
SQL>WHENEVER SQLERROR EXIT SQL.SQLCODE;
|
|
||||||
SQL>REM
|
|
||||||
SQL>VAR signature NUMBER;
|
|
||||||
SQL>VAR signaturef NUMBER;
|
|
||||||
SQL>REM
|
|
||||||
SQL>DECLARE
|
|
||||||
2 sql_txt CLOB;
|
|
||||||
3 h SYS.SQLPROF_ATTR;
|
|
||||||
4 PROCEDURE wa (p_line IN VARCHAR2) IS
|
|
||||||
5 BEGIN
|
|
||||||
6 DBMS_LOB.WRITEAPPEND(sql_txt, LENGTH(p_line), p_line);
|
|
||||||
7 END wa;
|
|
||||||
8 BEGIN
|
|
||||||
9 DBMS_LOB.CREATETEMPORARY(sql_txt, TRUE);
|
|
||||||
10 DBMS_LOB.OPEN(sql_txt, DBMS_LOB.LOB_READWRITE);
|
|
||||||
11 -- SQL Text pieces below do not have to be of same length.
|
|
||||||
12 -- So if you edit SQL Text (i.e. removing temporary Hints),
|
|
||||||
13 -- there is no need to edit or re-align unmodified pieces.
|
|
||||||
14 wa(q'[select * from t1 where i=5000]');
|
|
||||||
15 DBMS_LOB.CLOSE(sql_txt);
|
|
||||||
16 h := SYS.SQLPROF_ATTR(
|
|
||||||
17 q'[BEGIN_OUTLINE_DATA]',
|
|
||||||
18 q'[IGNORE_OPTIM_EMBEDDED_HINTS]',
|
|
||||||
19 q'[OPTIMIZER_FEATURES_ENABLE('19.1.0')]',
|
|
||||||
20 q'[DB_VERSION('19.1.0')]',
|
|
||||||
21 q'[ALL_ROWS]',
|
|
||||||
22 q'[OUTLINE_LEAF(@"SEL$1")]',
|
|
||||||
23 q'[INDEX_RS_ASC(@"SEL$1" "T1"@"SEL$1" ("T1"."I"))]',
|
|
||||||
24 q'[BATCH_TABLE_ACCESS_BY_ROWID(@"SEL$1" "T1"@"SEL$1")]',
|
|
||||||
25 q'[END_OUTLINE_DATA]');
|
|
||||||
26 :signature := DBMS_SQLTUNE.SQLTEXT_TO_SIGNATURE(sql_txt);
|
|
||||||
27 :signaturef := DBMS_SQLTUNE.SQLTEXT_TO_SIGNATURE(sql_txt, TRUE);
|
|
||||||
28 DBMS_SQLTUNE.IMPORT_SQL_PROFILE (
|
|
||||||
29 sql_text => sql_txt,
|
|
||||||
30 profile => h,
|
|
||||||
31 name => 'coe_9t7jvx0gm0m95_1509575125',
|
|
||||||
32 description => 'coe 9t7jvx0gm0m95 1509575125 '||:signature||' '||:signaturef||'',
|
|
||||||
33 category => 'DEFAULT',
|
|
||||||
34 validate => TRUE,
|
|
||||||
35 replace => TRUE,
|
|
||||||
36 force_match => FALSE /* TRUE:FORCE (match even when different literals in SQL). FALSE:EXACT (similar to CURSOR_SHARING) */ );
|
|
||||||
37 DBMS_LOB.FREETEMPORARY(sql_txt);
|
|
||||||
38 END;
|
|
||||||
39 /
|
|
||||||
|
|
||||||
PL/SQL procedure successfully completed.
|
|
||||||
|
|
||||||
SQL>WHENEVER SQLERROR CONTINUE
|
|
||||||
SQL>SET ECHO OFF;
|
|
||||||
|
|
||||||
SIGNATURE
|
|
||||||
---------------------
|
|
||||||
7022249984800062696
|
|
||||||
|
|
||||||
|
|
||||||
SIGNATUREF
|
|
||||||
---------------------
|
|
||||||
17325452017562678592
|
|
||||||
|
|
||||||
|
|
||||||
... manual custom SQL Profile has been created
|
|
||||||
|
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
SPO coe_xfr_sql_profile_9t7jvx0gm0m95_1509575125.log;
|
|
||||||
SET ECHO ON TERM ON LIN 2000 TRIMS ON NUMF 99999999999999999999;
|
|
||||||
REM
|
|
||||||
REM $Header: 215187.1 coe_xfr_sql_profile_9t7jvx0gm0m95_1509575125.sql 11.4.4.4 2026/07/08 carlos.sierra $
|
|
||||||
REM
|
|
||||||
REM Copyright (c) 2000-2012, Oracle Corporation. All rights reserved.
|
|
||||||
REM
|
|
||||||
REM AUTHOR
|
|
||||||
REM carlos.sierra@oracle.com
|
|
||||||
REM
|
|
||||||
REM SCRIPT
|
|
||||||
REM coe_xfr_sql_profile_9t7jvx0gm0m95_1509575125.sql
|
|
||||||
REM
|
|
||||||
REM DESCRIPTION
|
|
||||||
REM This script is generated by coe_xfr_sql_profile.sql
|
|
||||||
REM It contains the SQL*Plus commands to create a custom
|
|
||||||
REM SQL Profile for SQL_ID 9t7jvx0gm0m95 based on plan hash
|
|
||||||
REM value 1509575125.
|
|
||||||
REM The custom SQL Profile to be created by this script
|
|
||||||
REM will affect plans for SQL commands with signature
|
|
||||||
REM matching the one for SQL Text below.
|
|
||||||
REM Review SQL Text and adjust accordingly.
|
|
||||||
REM
|
|
||||||
REM PARAMETERS
|
|
||||||
REM None.
|
|
||||||
REM
|
|
||||||
REM EXAMPLE
|
|
||||||
REM SQL> START coe_xfr_sql_profile_9t7jvx0gm0m95_1509575125.sql;
|
|
||||||
REM
|
|
||||||
REM NOTES
|
|
||||||
REM 1. Should be run as SYSTEM or SYSDBA.
|
|
||||||
REM 2. User must have CREATE ANY SQL PROFILE privilege.
|
|
||||||
REM 3. SOURCE and TARGET systems can be the same or similar.
|
|
||||||
REM 4. To drop this custom SQL Profile after it has been created:
|
|
||||||
REM EXEC DBMS_SQLTUNE.DROP_SQL_PROFILE('coe_9t7jvx0gm0m95_1509575125');
|
|
||||||
REM 5. Be aware that using DBMS_SQLTUNE requires a license
|
|
||||||
REM for the Oracle Tuning Pack.
|
|
||||||
REM 6. If you modified a SQL putting Hints in order to produce a desired
|
|
||||||
REM Plan, you can remove the artifical Hints from SQL Text pieces below.
|
|
||||||
REM By doing so you can create a custom SQL Profile for the original
|
|
||||||
REM SQL but with the Plan captured from the modified SQL (with Hints).
|
|
||||||
REM
|
|
||||||
WHENEVER SQLERROR EXIT SQL.SQLCODE;
|
|
||||||
REM
|
|
||||||
VAR signature NUMBER;
|
|
||||||
VAR signaturef NUMBER;
|
|
||||||
REM
|
|
||||||
DECLARE
|
|
||||||
sql_txt CLOB;
|
|
||||||
h SYS.SQLPROF_ATTR;
|
|
||||||
PROCEDURE wa (p_line IN VARCHAR2) IS
|
|
||||||
BEGIN
|
|
||||||
DBMS_LOB.WRITEAPPEND(sql_txt, LENGTH(p_line), p_line);
|
|
||||||
END wa;
|
|
||||||
BEGIN
|
|
||||||
DBMS_LOB.CREATETEMPORARY(sql_txt, TRUE);
|
|
||||||
DBMS_LOB.OPEN(sql_txt, DBMS_LOB.LOB_READWRITE);
|
|
||||||
-- SQL Text pieces below do not have to be of same length.
|
|
||||||
-- So if you edit SQL Text (i.e. removing temporary Hints),
|
|
||||||
-- there is no need to edit or re-align unmodified pieces.
|
|
||||||
wa(q'[select * from t1 where i=5000]');
|
|
||||||
DBMS_LOB.CLOSE(sql_txt);
|
|
||||||
h := SYS.SQLPROF_ATTR(
|
|
||||||
q'[BEGIN_OUTLINE_DATA]',
|
|
||||||
q'[IGNORE_OPTIM_EMBEDDED_HINTS]',
|
|
||||||
q'[OPTIMIZER_FEATURES_ENABLE('19.1.0')]',
|
|
||||||
q'[DB_VERSION('19.1.0')]',
|
|
||||||
q'[ALL_ROWS]',
|
|
||||||
q'[OUTLINE_LEAF(@"SEL$1")]',
|
|
||||||
q'[INDEX_RS_ASC(@"SEL$1" "T1"@"SEL$1" ("T1"."I"))]',
|
|
||||||
q'[BATCH_TABLE_ACCESS_BY_ROWID(@"SEL$1" "T1"@"SEL$1")]',
|
|
||||||
q'[END_OUTLINE_DATA]');
|
|
||||||
:signature := DBMS_SQLTUNE.SQLTEXT_TO_SIGNATURE(sql_txt);
|
|
||||||
:signaturef := DBMS_SQLTUNE.SQLTEXT_TO_SIGNATURE(sql_txt, TRUE);
|
|
||||||
DBMS_SQLTUNE.IMPORT_SQL_PROFILE (
|
|
||||||
sql_text => sql_txt,
|
|
||||||
profile => h,
|
|
||||||
name => 'coe_9t7jvx0gm0m95_1509575125',
|
|
||||||
description => 'coe 9t7jvx0gm0m95 1509575125 '||:signature||' '||:signaturef||'',
|
|
||||||
category => 'DEFAULT',
|
|
||||||
validate => TRUE,
|
|
||||||
replace => TRUE,
|
|
||||||
force_match => FALSE /* TRUE:FORCE (match even when different literals in SQL). FALSE:EXACT (similar to CURSOR_SHARING) */ );
|
|
||||||
DBMS_LOB.FREETEMPORARY(sql_txt);
|
|
||||||
END;
|
|
||||||
/
|
|
||||||
WHENEVER SQLERROR CONTINUE
|
|
||||||
SET ECHO OFF;
|
|
||||||
PRINT signature
|
|
||||||
PRINT signaturef
|
|
||||||
PRO
|
|
||||||
PRO ... manual custom SQL Profile has been created
|
|
||||||
PRO
|
|
||||||
SET TERM ON ECHO OFF LIN 80 TRIMS OFF NUMF "";
|
|
||||||
SPO OFF;
|
|
||||||
PRO
|
|
||||||
PRO COE_XFR_SQL_PROFILE_9t7jvx0gm0m95_1509575125 completed
|
|
||||||
Reference in New Issue
Block a user