Post Upgrade SQL Performance Issue

Hello,
I Just Upgraded/Migrated my database from 11.1.0.6 SE to 11.2.0.3 EE. I did this with datapump export/import out of the 11.1.0.6 and into a new 11.2.0.3 database. Both the old and the new database are on the same Linux server. The new database has 2GB more RAM assigned to its SGA then the old one. Both DB are using AMM.
The strange part is I have a SQL statement that completes in 1 second in the Old DB and takes 30 seconds in the new one. I even moved the SQL Plan from the Old DB into the New DB so they are using the same plan.
To sum up the issue. I have one SQL statement using the same SQL Plan running at dramatically different speeds on two different databases on the same server. The databases are 11.1.0.7 SE and 11.2.0.3 EE.
Not sure what is going on or how to fix it, Any help would be great!
I have included Explains and Auto Traces from both NEW and OLD databases.
NEW DB Explain Plan (Slow)
Plan hash value: 1046170788
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 94861 | 193M| | 74043 (1)| 00:18:52 |
| 1 | SORT ORDER BY | | 94861 | 193M| 247M| 74043 (1)| 00:18:52 |
| 2 | VIEW | PBM_MEMBER_INTAKE_VW | 94861 | 193M| | 31803 (1)| 00:08:07 |
| 3 | UNION-ALL | | | | | | |
| 4 | NESTED LOOPS OUTER | | 1889 | 173K| | 455 (1)| 00:00:07 |
|* 5 | HASH JOIN | | 1889 | 164K| | 454 (1)| 00:00:07 |
| 6 | TABLE ACCESS FULL| PBM_CODES | 2138 | 21380 | | 8 (0)| 00:00:01 |
|* 7 | TABLE ACCESS FULL| PBM_MEMBER_INTAKE | 1889 | 145K| | 446 (1)| 00:00:07 |
|* 8 | INDEX UNIQUE SCAN | ADJ_PK | 1 | 5 | | 1 (0)| 00:00:01 |
| 9 | NESTED LOOPS | | 92972 | 9987K| | 31347 (1)| 00:08:00 |
| 10 | NESTED LOOPS OUTER| | 92972 | 8443K| | 31346 (1)| 00:08:00 |
|* 11 | TABLE ACCESS FULL| PBM_MEMBERS | 92972 | 7989K| | 31344 (1)| 00:08:00 |
|* 12 | INDEX UNIQUE SCAN| ADJ_PK | 1 | 5 | | 1 (0)| 00:00:01 |
|* 13 | INDEX UNIQUE SCAN | PBM_EMPLOYER_UK1 | 1 | 17 | | 1 (0)| 00:00:01 |
Predicate Information (identified by operation id):
5 - access("C"."CODE_ID"="MI"."STATUS_ID")
7 - filter("MI"."CLAIM_NUMBER" LIKE '%A0000250%' AND "MI"."CLAIM_NUMBER" IS NOT NULL)
8 - access("MI"."ADJUSTER_ID"="A"."ADJUSTER_ID"(+))
11 - filter("M"."THEIR_GROUP_ID" LIKE '%A0000250%' AND "M"."THEIR_GROUP_ID" IS NOT NULL)
12 - access("M"."ADJUSTER_ID"="A"."ADJUSTER_ID"(+))
13 - access("M"."GROUP_CODE"="E"."GROUP_CODE" AND "M"."EMPLOYER_CODE"="E"."EMPLOYER_CODE")
Note
- SQL plan baseline "SYS_SQL_PLAN_a3c20fdcecd98dfe" used for this statement
OLD DB Explain Plan (Fast)
Plan hash value: 1046170788
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 95201 | 193M| | 74262 (1)| 00:14:52 |
| 1 | SORT ORDER BY | | 95201 | 193M| 495M| 74262 (1)| 00:14:52 |
| 2 | VIEW | PBM_MEMBER_INTAKE_VW | 95201 | 193M| | 31853 (1)| 00:06:23 |
| 3 | UNION-ALL | | | | | | |
| 4 | NESTED LOOPS OUTER | | 1943 | 178K| | 486 (1)| 00:00:06 |
|* 5 | HASH JOIN | | 1943 | 168K| | 486 (1)| 00:00:06 |
| 6 | TABLE ACCESS FULL| PBM_CODES | 2105 | 21050 | | 7 (0)| 00:00:01 |
|* 7 | TABLE ACCESS FULL| PBM_MEMBER_INTAKE | 1943 | 149K| | 479 (1)| 00:00:06 |
|* 8 | INDEX UNIQUE SCAN | ADJ_PK | 1 | 5 | | 0 (0)| 00:00:01 |
| 9 | NESTED LOOPS | | 93258 | 9M| | 31367 (1)| 00:06:17 |
| 10 | NESTED LOOPS OUTER| | 93258 | 8469K| | 31358 (1)| 00:06:17 |
|* 11 | TABLE ACCESS FULL| PBM_MEMBERS | 93258 | 8014K| | 31352 (1)| 00:06:17 |
|* 12 | INDEX UNIQUE SCAN| ADJ_PK | 1 | 5 | | 0 (0)| 00:00:01 |
|* 13 | INDEX UNIQUE SCAN | PBM_EMPLOYER_UK1 | 1 | 17 | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
5 - access("C"."CODE_ID"="MI"."STATUS_ID")
7 - filter("MI"."CLAIM_NUMBER" LIKE '%A0000250%')
8 - access("MI"."ADJUSTER_ID"="A"."ADJUSTER_ID"(+))
11 - filter("M"."THEIR_GROUP_ID" LIKE '%A0000250%')
12 - access("M"."ADJUSTER_ID"="A"."ADJUSTER_ID"(+))
13 - access("M"."GROUP_CODE"="E"."GROUP_CODE" AND "M"."EMPLOYER_CODE"="E"."EMPLOYER_CODE")
NEW DB Auto trace (Slow)
active txn count during cleanout     0
blocks decrypted     0
buffer is not pinned count     664129
buffer is pinned count     3061793
bytes received via SQL*Net from client     3339
bytes sent via SQL*Net to client     28758
Cached Commit SCN referenced     662366
calls to get snapshot scn: kcmgss     3
calls to kcmgas     0
calls to kcmgcs     8
CCursor + sql area evicted     0
cell physical IO interconnect bytes     0
cleanout - number of ktugct calls     0
cleanouts only - consistent read gets     0
cluster key scan block gets     0
cluster key scans     0
commit cleanout failures: block lost     0
commit cleanout failures: callback failure      0
commit cleanouts     0
commit cleanouts successfully completed     0
Commit SCN cached     0
commit txn count during cleanout     0
concurrency wait time     0
consistent changes     0
consistent gets     985371
consistent gets - examination     2993
consistent gets direct     0
consistent gets from cache     985371
consistent gets from cache (fastpath)     982093
CPU used by this session     3551
CPU used when call started     3551
CR blocks created     0
cursor authentications     1
data blocks consistent reads - undo records applied     0
db block changes     0
db block gets     0
db block gets direct     0
db block gets from cache     0
db block gets from cache (fastpath)     0
DB time     3553
deferred (CURRENT) block cleanout applications     0
dirty buffers inspected     0
Effective IO time     0
enqueue releases     0
enqueue requests     0
execute count     3
file io wait time     0
free buffer inspected     0
free buffer requested     0
heap block compress     0
Heap Segment Array Updates     0
hot buffers moved to head of LRU     0
HSC Heap Segment Block Changes     0
immediate (CR) block cleanout applications     0
immediate (CURRENT) block cleanout applications     0
IMU Flushes     0
IMU ktichg flush     0
IMU Redo allocation size     0
IMU undo allocation size     0
index fast full scans (full)     2
index fetch by key     0
index scans kdiixs1     12944
lob reads     0
LOB table id lookup cache misses     0
lob writes     0
lob writes unaligned     0
logical read bytes from cache     -517775360
logons cumulative     0
logons current     0
messages sent     0
no buffer to keep pinned count     10
no work - consistent read gets     982086
non-idle wait count     6
non-idle wait time     0
Number of read IOs issued     0
opened cursors cumulative     4
opened cursors current     1
OS Involuntary context switches     853
OS Maximum resident set size     0
OS Page faults     0
OS Page reclaims     2453
OS System time used     9
OS User time used     3549
OS Voluntary context switches     238
parse count (failures)     0
parse count (hard)     0
parse count (total)     1
parse time cpu     0
parse time elapsed     0
physical read bytes     0
physical read IO requests     0
physical read total bytes     0
physical read total IO requests     0
physical read total multi block requests     0
physical reads     0
physical reads cache     0
physical reads cache prefetch     0
physical reads direct     0
physical reads direct (lob)     0
physical write bytes     0
physical write IO requests     0
physical write total bytes     0
physical write total IO requests     0
physical writes     0
physical writes direct     0
physical writes direct (lob)     0
physical writes non checkpoint     0
pinned buffers inspected     0
pinned cursors current     0
process last non-idle time     0
recursive calls     0
recursive cpu usage     0
redo entries     0
redo size     0
redo size for direct writes     0
redo subscn max counts     0
redo synch time     0
redo synch time (usec)     0
redo synch writes     0
Requests to/from client     3
rollbacks only - consistent read gets     0
RowCR - row contention     0
RowCR attempts     0
rows fetched via callback     0
session connect time     0
session cursor cache count     1
session cursor cache hits     3
session logical reads     985371
session pga memory     131072
session pga memory max     0
session uga memory     392928
session uga memory max     0
shared hash latch upgrades - no wait     284
shared hash latch upgrades - wait     0
sorts (memory)     3
sorts (rows)     243
sql area evicted     0
sql area purged     0
SQL*Net roundtrips to/from client     4
switch current to new buffer     0
table fetch by rowid     1861456
table fetch continued row     9
table scan blocks gotten     0
table scan rows gotten     0
table scans (short tables)     0
temp space allocated (bytes)     0
undo change vector size     0
user calls     7
user commits     0
user I/O wait time     0
workarea executions - optimal     10
workarea memory allocated     342
OLD DB Auto trace (Fast)
active txn count during cleanout     0
buffer is not pinned count     4
buffer is pinned count     101
bytes received via SQL*Net from client     1322
bytes sent via SQL*Net to client     9560
calls to get snapshot scn: kcmgss     15
calls to kcmgas     0
calls to kcmgcs     0
calls to kcmgrs     1
cleanout - number of ktugct calls     0
cluster key scan block gets     0
cluster key scans     0
commit cleanouts     0
commit cleanouts successfully completed     0
concurrency wait time     0
consistent changes     0
consistent gets     117149
consistent gets - examination     56
consistent gets direct     115301
consistent gets from cache     1848
consistent gets from cache (fastpath)     1792
CPU used by this session     118
CPU used when call started     119
cursor authentications     1
db block changes     0
db block gets     0
db block gets from cache     0
db block gets from cache (fastpath)     0
DB time     123
deferred (CURRENT) block cleanout applications     0
Effective IO time     2012
enqueue conversions     3
enqueue releases     2
enqueue requests     2
enqueue waits     1
execute count     2
free buffer requested     0
HSC Heap Segment Block Changes     0
IMU Flushes     0
IMU ktichg flush     0
index fast full scans (full)     0
index fetch by key     101
index scans kdiixs1     0
lob writes     0
lob writes unaligned     0
logons cumulative     0
logons current     0
messages sent     0
no work - consistent read gets     117080
Number of read IOs issued     1019
opened cursors cumulative     3
opened cursors current     1
OS Involuntary context switches     54
OS Maximum resident set size     7868
OS Page faults     12
OS Page reclaims     2911
OS System time used     57
OS User time used     71
OS Voluntary context switches     25
parse count (failures)     0
parse count (hard)     0
parse count (total)     3
parse time cpu     0
parse time elapsed     0
physical read bytes     944545792
physical read IO requests     1019
physical read total bytes     944545792
physical read total IO requests     1019
physical read total multi block requests     905
physical reads     115301
physical reads cache     0
physical reads cache prefetch     0
physical reads direct     115301
physical reads prefetch warmup     0
process last non-idle time     0
recursive calls     0
recursive cpu usage     0
redo entries     0
redo size     0
redo synch writes     0
rows fetched via callback     0
session connect time     0
session cursor cache count     1
session cursor cache hits     2
session logical reads     117149
session pga memory     -983040
session pga memory max     0
session uga memory     0
session uga memory max     0
shared hash latch upgrades - no wait     0
sorts (memory)     2
sorts (rows)     157
sql area purged     0
SQL*Net roundtrips to/from client     3
table fetch by rowid     0
table fetch continued row     0
table scan blocks gotten     117077
table scan rows gotten     1972604
table scans (direct read)     1
table scans (long tables)     1
table scans (short tables)     2
undo change vector size     0
user calls     5
user I/O wait time     0
workarea executions - optimal     4

Hi Srini,
Yes the stats on the tables and indexes are current in both DBs. However the NEW DB has "System Stats" in sys.aux_stats$ and the OLD DB does not. The old DB has optimizer_index_caching=0 and optimizer_index_cost_adj=100. The new DB as them at optimizer_index_caching=90 and optimizer_index_cost_adj=25 but should not be using them because of the "System Stats".
Also I thought none of the SQL Optimize stuff would matter because I forced in my own SQL Plan using SPM.
Differences in init.ora
OLD-11     optimizerpush_pred_cost_based = FALSE
NEW-15     audit_sys_operations = FALSE
     audit_trail = "DB, EXTENDED"
     awr_snapshot_time_offset = 0
OLD-16     audit_sys_operations = TRUE
     audit_trail = "XML, EXTENDED"
NEW-22     cell_offload_compaction = "ADAPTIVE"
     cell_offload_decryption = TRUE
     cell_offload_plan_display = "AUTO"
     cell_offload_processing = TRUE
NEW-28     clonedb = FALSE
NEW-32     compatible = "11.2.0.0.0"
OLD-27     compatible = "11.1.0.0.0"
NEW-37     cursor_bind_capture_destination = "memory+disk"
     cursor_sharing = "FORCE"
OLD-32     cursor_sharing = "EXACT"
NEW-50     db_cache_size = 4294967296
     db_domain = "my.com"
OLD-44     db_cache_size = 0
NEW-54     db_flash_cache_size = 0
NEW-58     db_name = "NEWDB"
     db_recovery_file_dest_size = 214748364800
OLD-50     db_name = "OLDDB"
     db_recovery_file_dest_size = 8438939648
NEW-63     db_unique_name = "NEWDB"
     db_unrecoverable_scn_tracking = TRUE
     db_writer_processes = 2
OLD-55     db_unique_name = "OLDDB"
     db_writer_processes = 1
NEW-68     deferred_segment_creation = TRUE
NEW-71     dispatchers = "(PROTOCOL=TCP) (SERVICE=NEWDBXDB)"
OLD-61     dispatchers = "(PROTOCOL=TCP) (SERVICE=OLDDBXDB)"
NEW-73     dml_locks = 5068
     dst_upgrade_insert_conv = TRUE
OLD-63     dml_locks = 3652
     drs_start = FALSE
NEW-80     filesystemio_options = "SETALL"
OLD-70     filesystemio_options = "none"
NEW-87     instance_name = "NEWDB"
OLD-77     instance_name = "OLDDB"
NEW-94     job_queue_processes = 1000
OLD-84     job_queue_processes = 100
NEW-104     log_archive_dest_state_11 = "enable"
     log_archive_dest_state_12 = "enable"
     log_archive_dest_state_13 = "enable"
     log_archive_dest_state_14 = "enable"
     log_archive_dest_state_15 = "enable"
     log_archive_dest_state_16 = "enable"
     log_archive_dest_state_17 = "enable"
     log_archive_dest_state_18 = "enable"
     log_archive_dest_state_19 = "enable"
NEW-114     log_archive_dest_state_20 = "enable"
     log_archive_dest_state_21 = "enable"
     log_archive_dest_state_22 = "enable"
     log_archive_dest_state_23 = "enable"
     log_archive_dest_state_24 = "enable"
     log_archive_dest_state_25 = "enable"
     log_archive_dest_state_26 = "enable"
     log_archive_dest_state_27 = "enable"
     log_archive_dest_state_28 = "enable"
     log_archive_dest_state_29 = "enable"
NEW-125     log_archive_dest_state_30 = "enable"
     log_archive_dest_state_31 = "enable"
NEW-139     log_buffer = 7012352
OLD-108     log_buffer = 34412032
OLD-112     max_commit_propagation_delay = 0
NEW-144     max_enabled_roles = 150
     memory_max_target = 12884901888
     memory_target = 8589934592
     nls_calendar = "GREGORIAN"
OLD-114     max_enabled_roles = 140
     memory_max_target = 6576668672
     memory_target = 6576668672
NEW-149     nls_currency = "$"
     nls_date_format = "DD-MON-RR"
     nls_date_language = "AMERICAN"
     nls_dual_currency = "$"
     nls_iso_currency = "AMERICA"
NEW-157     nls_numeric_characters = ".,"
     nls_sort = "BINARY"
NEW-160     nls_time_format = "HH.MI.SSXFF AM"
     nls_time_tz_format = "HH.MI.SSXFF AM TZR"
     nls_timestamp_format = "DD-MON-RR HH.MI.SSXFF AM"
     nls_timestamp_tz_format = "DD-MON-RR HH.MI.SSXFF AM TZR"
NEW-172     optimizer_features_enable = "11.2.0.3"
     optimizer_index_caching = 90
     optimizer_index_cost_adj = 25
OLD-130     optimizer_features_enable = "11.1.0.6"
     optimizer_index_caching = 0
     optimizer_index_cost_adj = 100
NEW-184     parallel_degree_limit = "CPU"
     parallel_degree_policy = "MANUAL"
     parallel_execution_message_size = 16384
     parallel_force_local = FALSE
OLD-142     parallel_execution_message_size = 2152
NEW-189     parallel_max_servers = 320
OLD-144     parallel_max_servers = 0
NEW-192     parallel_min_time_threshold = "AUTO"
NEW-195     parallel_servers_target = 128
NEW-197     permit_92_wrap_format = TRUE
OLD-154     plsql_native_library_subdir_count = 0
NEW-220     result_cache_max_size = 21495808
OLD-173     result_cache_max_size = 0
NEW-230     service_names = "NEWDB, NEWDB.my.com, NEW"
OLD-183     service_names = "OLDDB, OLD.my.com"
NEW-233     sessions = 1152
     sga_max_size = 12884901888
OLD-186     sessions = 830
     sga_max_size = 6576668672
NEW-238     shared_pool_reserved_size = 35232153
OLD-191     shared_pool_reserved_size = 53687091
OLD-199     sql_version = "NATIVE"
NEW-248     star_transformation_enabled = "TRUE"
OLD-202     star_transformation_enabled = "FALSE"
NEW-253     timed_os_statistics = 60
OLD-207     timed_os_statistics = 5
NEW-256     transactions = 1267
OLD-210     transactions = 913
NEW-262     use_large_pages = "TRUE"

Similar Messages

  • SQL Performance issue: Using user defined function with group by

    Hi Everyone,
    im new here and I really could need some help on a weird performance issue. I hope this is the right topic for SQL performance issues.
    Well ok, i create a function for converting a date from timezone GMT to a specified timzeone.
    CREATE OR REPLACE FUNCTION I3S_REP_1.fnc_user_rep_date_to_local (date_in IN date, tz_name_in IN VARCHAR2) RETURN date
    IS
    tz_name VARCHAR2(100);
    date_out date;
    BEGIN
    SELECT
    to_date(to_char(cast(from_tz(cast( date_in AS TIMESTAMP),'GMT')AT
    TIME ZONE (tz_name_in) AS DATE),'dd-mm-yyyy hh24:mi:ss'),'dd-mm-yyyy hh24:mi:ss')
    INTO date_out
    FROM dual;
    RETURN date_out;
    END fnc_user_rep_date_to_local;The following statement is just an example, the real statement is much more complex. So I select some date values from a table and aggregate a little.
    select
    stp_end_stamp,
    count(*) noi
    from step
    where
    stp_end_stamp
    BETWEEN
    to_date('23-05-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')      
    AND
    to_date('23-07-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')
    group by
    stp_end_stampThis statement selects ~70000 rows and needs ~ 70ms
    If i use the function it selects the same number of rows ;-) and takes ~ 4 sec ...
    select
    fnc_user_rep_date_to_local(stp_end_stamp,'Europe/Berlin'),
    count(*) noi
    from step
    where
    stp_end_stamp
    BETWEEN
    to_date('23-05-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')      
    AND
    to_date('23-07-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')
    group by
    fnc_user_rep_date_to_local(stp_end_stamp,'Europe/Berlin')I understand that the DB has to execute the function for each row.
    But if I execute the following statement, it takes only ~90ms ...
    select
    fnc_user_rep_date_to_gmt(stp_end_stamp,'Europe/Berlin','ny21654'),
    noi
    from
    select
    stp_end_stamp,
    count(*) noi
    from step
    where
    stp_end_stamp
    BETWEEN
    to_date('23-05-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')      
    AND
    to_date('23-07-2009 00:00:00','dd-mm-yyyy hh24:mi:ss')
    group by
    stp_end_stamp
    )The execution plan for all three statements is EXACTLY the same!!!
    Usually i would say, that I use the third statement and the world is in order. BUT I'm working on a BI project with a tool called Business Objects and it generates SQL, so my hands are bound and I can't make this tool to generate the SQL as a subselect.
    My questions are:
    Why is the second statement sooo much slower than the third?
    and
    Howcan I force the optimizer to do whatever he is doing to make the third statement so fast?
    I would really appreciate some help on this really weird issue.
    Thanks in advance,
    Andi

    Hi,
    The execution plan for all three statements is EXACTLY the same!!!Not exactly. Plans are the same - true. They uses slightly different approach to call function. See:
    drop table t cascade constraints purge;
    create table t as select mod(rownum,10) id, cast('x' as char(500)) pad from dual connect by level <= 10000;
    exec dbms_stats.gather_table_stats(user, 't');
    create or replace function test_fnc(p_int number) return number is
    begin
        return trunc(p_int);
    end;
    explain plan for select id from t group by id;
    select * from table(dbms_xplan.display(null,null,'advanced'));
    explain plan for select test_fnc(id) from t group by test_fnc(id);
    select * from table(dbms_xplan.display(null,null,'advanced'));
    explain plan for select test_fnc(id) from (select id from t group by id);
    select * from table(dbms_xplan.display(null,null,'advanced'));Output:
    PLAN_TABLE_OUTPUT
    Plan hash value: 47235625
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   1 |  HASH GROUP BY     |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   2 |   TABLE ACCESS FULL| T    | 10000 | 30000 |   159   (1)| 00:00:02 |
    Query Block Name / Object Alias (identified by operation id):
       1 - SEL$1
       2 - SEL$1 / T@SEL$1
    Outline Data
      /*+
          BEGIN_OUTLINE_DATA
          FULL(@"SEL$1" "T"@"SEL$1")
          OUTLINE_LEAF(@"SEL$1")
          ALL_ROWS
          OPTIMIZER_FEATURES_ENABLE('10.2.0.4')
          IGNORE_OPTIM_EMBEDDED_HINTS
          END_OUTLINE_DATA
    Column Projection Information (identified by operation id):
       1 - (#keys=1) "ID"[NUMBER,22]
       2 - "ID"[NUMBER,22]
    34 rows selected.
    SQL>
    Explained.
    SQL>
    PLAN_TABLE_OUTPUT
    Plan hash value: 47235625
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   1 |  HASH GROUP BY     |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   2 |   TABLE ACCESS FULL| T    | 10000 | 30000 |   159   (1)| 00:00:02 |
    Query Block Name / Object Alias (identified by operation id):
       1 - SEL$1
       2 - SEL$1 / T@SEL$1
    Outline Data
      /*+
          BEGIN_OUTLINE_DATA
          FULL(@"SEL$1" "T"@"SEL$1")
          OUTLINE_LEAF(@"SEL$1")
          ALL_ROWS
          OPTIMIZER_FEATURES_ENABLE('10.2.0.4')
          IGNORE_OPTIM_EMBEDDED_HINTS
          END_OUTLINE_DATA
    Column Projection Information (identified by operation id):
       1 - (#keys=1) "TEST_FNC"("ID")[22]
       2 - "ID"[NUMBER,22]
    34 rows selected.
    SQL>
    Explained.
    SQL> select * from table(dbms_xplan.display(null,null,'advanced'));
    PLAN_TABLE_OUTPUT
    Plan hash value: 47235625
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   1 |  HASH GROUP BY     |      |    10 |    30 |   162   (3)| 00:00:02 |
    |   2 |   TABLE ACCESS FULL| T    | 10000 | 30000 |   159   (1)| 00:00:02 |
    Query Block Name / Object Alias (identified by operation id):
       1 - SEL$F5BB74E1
       2 - SEL$F5BB74E1 / T@SEL$2
    Outline Data
      /*+
          BEGIN_OUTLINE_DATA
          FULL(@"SEL$F5BB74E1" "T"@"SEL$2")
          OUTLINE(@"SEL$2")
          OUTLINE(@"SEL$1")
          MERGE(@"SEL$2")
          OUTLINE_LEAF(@"SEL$F5BB74E1")
          ALL_ROWS
          OPTIMIZER_FEATURES_ENABLE('10.2.0.4')
          IGNORE_OPTIM_EMBEDDED_HINTS
          END_OUTLINE_DATA
    Column Projection Information (identified by operation id):
       1 - (#keys=1) "ID"[NUMBER,22]
       2 - "ID"[NUMBER,22]
    37 rows selected.

  • Comples SQL performance issues in 11g

    We are facing Performance Issues for a Complex SQL in Version 11.2. But earlier in 11.1 this SQL is performing well..
    We dont have previous versions SQL Plan for this SQL Statement.
    We Dont want to rewrite the SQL as this SQL has performed Well in previous versions.
    Do we need to change the optimizer parameters so that the Query will be tuned automatically.
    Please help me out

    If you're licensed for the SQL Tuning Pack, you could run the query through the SQL Tuning Advisor see if it can improve.
    It will probably recommend a SQL profile which you can accept.
    You could also hint the SQL directly - you might just want to look at /*+ OPT_PARAM('OPTIMIZER_FEATURES_ENABLE','11.1.0.x') */ 'x' depending on your exact 11.1 version.
    You could alter the session, set optimizer_features_enable and capture a SQL profile manually for the 11.1 plan.
    You could do some root cause analysis as suggested by Karthick.
    See threads:
    How to post a SQL tuning request: HOW TO: Post a SQL statement tuning request - template posting
    When your query takes too long: When your query takes too long ...
    For some recent relevant examples about identifying plans changes following upgrade, see also Coskan Gundogar's blog:
    http://coskan.wordpress.com/2011/02/14/plan-stability-through-upgrade-why-is-my-plan-changed-bugfixes-1/
    http://coskan.wordpress.com/2011/02/15/plan-stability-through-upgrade-why-is-my-plan-changed-bugfixes-2/
    http://coskan.wordpress.com/2011/02/17/plan-stability-through-upgrade-why-is-my-plan-changed-new-optimizer-parameters/

  • How to resolve most of the Oracle SQL , PL/SQL Performance issues with help of quick Checklist/guidelines ?

    Please go thru below important checklist/guidelines to identify issue in any Perforamnce issue and resolution in no time.
    Checklist for Quick Performance  problem Resolution
    ·         get trace, code and other information for given PE case
              - Latest Code from Production env
              - Trace (sql queries, statistics, row source operations with row count, explain plan, all wait events)
              - Program parameters & their frequently used values
              - Run Frequency of the program
              - existing Run-time/response time in Production
              - Business Purpose
    ·         Identify most time consuming SQL taking more than 60 % of program time using Trace & Code analysis
    ·         Check all mandatory parameters/bind variables are directly mapped to index columns of large transaction tables without any functions
    ·         Identify most time consuming operation(s) using Row Source Operation section
    ·         Study program parameter input directly mapped to SQL
    ·         Identify all Input bind parameters being used to SQL
    ·         Is SQL query returning large records for given inputs
    ·         what are the large tables and their respective columns being used to mapped with input parameters
    ·         which operation is scanning highest number of records in Row Source operation/Explain Plan
    ·         Is Oracle Cost Based Optimizer using right Driving table for given SQL ?
    ·         Check the time consuming index on large table and measure Index Selectivity
    ·         Study Where clause for input parameters mapped to tables and their columns to find the correct/optimal usage of index
    ·         Is correct index being used for all large tables?
    ·         Is there any Full Table Scan on Large tables ?
    ·         Is there any unwanted Table being used in SQL ?
    ·         Evaluate Join condition on Large tables and their columns
    ·         Is FTS on large table b'cos of usage of non index columns
    ·         Is there any implicit or explicit conversion causing index not getting used ?
    ·         Statistics of all large tables are upto date ?
    Quick Resolution tips
    1) Use Bulk Processing feature BULK COLLECT with LIMIT and FOR ALL for DML instead of row by row processing
    2) Use Data Caching Technique/Options to cache static data
    3) Use Pipe Line Table Functions whenever possible
    4) Use Global Temporary Table, Materialized view to process complex records
    5) Try avoiding multiple network trips for every row between two database using dblink, Use Global temporary table or set operator to reduce network trip
    6) Use EXTERNAL Table to build interface rather then creating custom table and program to Load and validate the data
    7) Understand Oracle's Cost based Optimizer and Tune most expensive SQL queries with help of Explain plan
    8) Follow Oracle PL/SQL Best Practices
    9) Review tables and their indexes being used in the SQL queries and avoid unnecessary Table scanning
    10) Avoid costly Full Table Scan on Big Transaction tables with Huge data volume,
    11) Use appropriate filtration condition on index columns of seeded Oracle tables directly mapped to program parameters
    12) Review Join condition on existing query explain plan
    13) Use Oracle hint to guide Oracle Cost based optimizer to choose best plan for your custom queries
    14) Avoid applying SQL functions on index columns
    15) Use appropriate hint to guide Oracle CBO to choose best plan to reduce response time
    Thanks
    Praful

    I understand you were trying to post something helpful to people, but sorry, this list is appalling.
    1) Use Bulk Processing feature BULK COLLECT with LIMIT and FOR ALL for DML instead of row by row processing
    No, use pure SQL.
    2) Use Data Caching Technique/Options to cache static data
    No, use pure SQL, and the database and operating system will handle caching.
    3) Use Pipe Line Table Functions whenever possible
    No, use pure SQL
    4) Use Global Temporary Table, Materialized view to process complex records
    No, use pure SQL
    5) Try avoiding multiple network trips for every row between two database using dblink, Use Global temporary table or set operator to reduce network trip
    No, use pure SQL
    6) Use EXTERNAL Table to build interface rather then creating custom table and program to Load and validate the data
    Makes no sense.
    7) Understand Oracle's Cost based Optimizer and Tune most expensive SQL queries with help of Explain plan
    What about using the execution trace?
    8) Follow Oracle PL/SQL Best Practices
    Which are?
    9) Review tables and their indexes being used in the SQL queries and avoid unnecessary Table scanning
    You mean design your database and queries properly?  And table scanning is not always bad.
    10) Avoid costly Full Table Scan on Big Transaction tables with Huge data volume,
    It depends if that is necessary or not.
    11) Use appropriate filtration condition on index columns of seeded Oracle tables directly mapped to program parameters
    No, consider that too many indexes can have an impact on overall performance and can prevent the CBO from picking the best plan.  There's far more to creating indexes than just picking every column that people are likely to search on; you have to consider the cardinality and selectivity of data, as well as the volumes of data being searched and the most common search requirements.
    12) Review Join condition on existing query explain plan
    Well, if you don't have your join conditions right then your query won't work, so that's obvious.
    13) Use Oracle hint to guide Oracle Cost based optimizer to choose best plan for your custom queries
    No.  Oracle recommends you do not use hints for query optimization (it says so in the documentation).  Only certain hints such as APPEND etc. which are more related to certain operations such as inserting data etc. are acceptable in general.  Oracle recommends you use the query optimization tools to help optimize your queries rather than use hints.
    14) Avoid applying SQL functions on index columns
    Why?  If there's a need for a function based index, then it should be used.
    15) Use appropriate hint to guide Oracle CBO to choose best plan to reduce response time
    See 13.
    In short, there are no silver bullets for dealing with performance.  Each situation is different and needs to be evaluated on its own merits.

  • SQL Performance Issues after migrating to 10.2.0.3 from 9i

    Hi,
    We recently migrated our database from 9i (9.2.0.8) to 10.2.0.3 (Test Environment), we have Windows 32 bit server on RAC+ASM, we have noticed several of our SQL which ran prettry efficiently in 9i are just taking hours to complete. I opened a SR with Oracle support and it is still WIP, but I would like to ask if anyone has similar kind of experience and what they did to resolve it ? Any feedback is appreciated.
    Regards
    Mansoor

    The first thing to do would be to take a SQL Trace of the same SQL from both 9i and 10g installations and compare the results. That should give you the clue as to where to look for.
    Also, it is always recommended to gather the statistics after an upgrade in major version. I hope it is done already.

  • DELETE performance issue

    Dear All,
    I am posting again my performance issue for a delete statement (this time according to the instructions for posting SQL statements tunning request). The following delete statement was running more than 2 hours without success. Please note that the tables are indexed on the used fields in the query. If i try simple select it is done within 16 seconds:
    DELETE FROM aux_exist_relationship_3 aer_3
            WHERE EXISTS (SELECT ''
                          FROM aux_kind_of_control_1 akc_1
                          WHERE aer_3.cons_rel_id_new= akc_1.cons_rel_id)
            AND NOT EXISTS (SELECT ''
                            FROM aux_kind_of_control_3 akc_3
                            WHERE akc_3.cons_rel_id=aer_3.cons_rel_id_new)The version of the DB is 10.2.0.4
    These are the parameters relevant to the optimizer:
    show parameter optimizer
    NAME TYPE VALUE
    optimizer_dynamic_sampling integer 2
    optimizer_features_enable string 10.2.0.4
    optimizer_index_caching integer 0
    optimizer_index_cost_adj integer 100
    optimizer_mode string ALL_ROWS
    optimizer_secure_view_merging boolean TRUE
    SQL> show parameter db_file_multi
    NAME TYPE VALUE
    db_file_multiblock_read_count integer 128
    SQL>
    SQL>
    SQL> show parameter db_block_size
    NAME TYPE VALUE
    db_block_size integer 8192
    SQL>
    SQL> show parameter cursor_sharing;
    NAME TYPE VALUE
    cursor_sharing string EXACT
    SQL>
    SQL> column sname format a20
    SQL> column pname format a20
    SQL> column pval2 format a20
    SQL>
    SQL> select sname, pname, pval1, pval2 from sys.aux_stats$;
    SNAME PNAME PVAL1 PVAL2
    SYSSTATS_INFO STATUS COMPLETED
    SYSSTATS_INFO DSTART 10-30-2008 16:28
    SYSSTATS_INFO DSTOP 10-30-2008 16:28
    SYSSTATS_INFO FLAGS 1
    SYSSTATS_MAIN CPUSPEEDNW 1217.17877
    SYSSTATS_MAIN IOSEEKTIM 10
    SYSSTATS_MAIN IOTFRSPEED 4096
    SYSSTATS_MAIN SREADTIM
    SYSSTATS_MAIN MREADTIM
    SYSSTATS_MAIN CPUSPEED
    SYSSTATS_MAIN MBRC
    SNAME PNAME PVAL1 PVAL2
    SYSSTATS_MAIN MAXTHR
    SYSSTATS_MAIN SLAVETHR
    13 rows selected.
    Here is the output of EXPLAIN PLAN
    explain plan for
    2 DELETE FROM aux_exist_relationship_3 aer_3
    3 WHERE EXISTS (SELECT ''
    4 FROM aux_kind_of_control_1 akc_1
    5 WHERE aer_3.cons_rel_id_new= akc_1.cons_rel_id)
    6 AND NOT EXISTS (SELECT ''
    7 FROM aux_kind_of_control_3 akc_3
    8 WHERE akc_3.cons_rel_id=aer_3.cons_rel_id_new);
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 4002353621
    | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU) | Time |
    | 0 | DELETE STATEMENT | | 2334 | 42012 | | 1174 (1) | 00:00:15 |
    | 1 | DELETE | AUX_EXIST_RELATIONSHIP_3 | | | | | |
    |* 2 | HASH JOIN SEMI | | 2334 | 42012 | | 1174 (1) |00:00:15 |
    |* 3 | HASH JOIN ANTI | | 2334 | 28008 | 1992K | 989 (1) | 00:00:12 |
    | 4 | TABLE ACCESS FULL | AUX_EXIST_RELATIONSHIP_3 | 113K| 663K| | 718 (1) | 00:00:09 |
    | 5 | INDEX FAST FULL SCAN| AUX_KIND_OF_CONTROL_3_IDX1 | 113K| 663K| | 74 (2) | 00:00:01 |
    | 6 | INDEX FAST FULL SCAN | AUX_KIND_OF_CONTROL_1_IDX1 | 221K| 1298K| | 183 (2) | 00:00:03 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
    2 - access("AER_3"."CONS_REL_ID_NEW"="AKC_1"."CONS_REL_ID")
    3 - access("AKC_3"."CONS_REL_ID"="AER_3"."CONS_REL_ID_NEW")
    19 rows selected.
    I will be very grateful if someone can tel me where might be the problem. i got suggestions yesterday for using MINUS in the delete clause:
    DELETE  FROM aux_exist_relationship_3 aer_3
          WHERE aer_3.cons_rel_id_new IN(SELECT akc_1.cons_rel_id
                                           FROM aux_kind_of_control_1 akc_1
                                         MINUS
                                         SELECT akc_3.cons_rel_id
                                           FROM aux_kind_of_control_3 akc_3)or using view, but it did not help.
    My guess is that this is linked to the UNDO_TABLESPACE but how to prove it? Or perhaps I am wrong?

    Good day to everyone!
    Thanks a lot for th suggestions.
    I have tested the same query in a different DB where I have imported the 3 tables together with the data and the execution took 2.54 seconds. I guess the problem might be coming from the UNDO_TABLESPACE. I have found the following query:
    select b.tablespace_name, tbs_size SizeMb, a.free_space FreeMb
    from  (select tablespace_name, round(sum(bytes)/1024/1024 ,2) as free_space
           from dba_free_space
           group by tablespace_name) a,
          (select tablespace_name, sum(bytes)/1024/1024 as tbs_size
           from dba_data_files
           group by tablespace_name) b
    where a.tablespace_name(+)=b.tablespace_name;and the result is:
    TABLESPACE_NAME | SIZEMB | FREEMB
    SYSAUX | 600 | 48
    UNDOTBS | 9500 | 2.44
    SYSTEM | 400 | 122.69
    EGR_TBS_DATA | 13000 | 96.56
    and also
    select SEGMENT_SPACE_MANAGEMENT,RETENTION,MAX_EXTENTS
    from dba_tablespaces
    where tablespace_name = 'UNDOTBS'result:
    SEGMENT_SPACE_MANAGEMENT |RETENTION | MAX_EXTENTS
    MANUAL | NOGUARANTEE | 2147483645
    so perhaps it is from the UNDO_TABLESPACE.
    Do you think this could be the issue?

  • Post Netapp DOT Upgrade Performance Issue

    We recently did some NetApp DOT upgrades. Everything went smoothly.Since then, one of our application development teams has started to report poor performance. We investigated all troubleshooting possibilities that we can think of - Windows servers layer, esxi host, storage and networks etc but to no avail.  We've also engaged the software vendor and they have confirmed the app and db are adequately resourced. We also have a DBA investigating for us also.
    One thing the application owner did mention is that performance started to degrade around  Monday the 20th of July. Coincidentally or not, we did the Netapp DOT upgrade on the weekend of 18th/19th.The performance issues may not be linked at all but I just wondered if any others had experienced similar issues?Thanks.

    Whats the controller model? Going from 8.1 to 8.2 on the entry \ some mid level controllers will have a performance impact

  • ASU-process POST Upgrade Step on SQL database

    Hi All,
    To check this message in the right format kindly click on reply first then click on quote original icon ("").
    I am performing an upgrade from R/3 4.7 to ERP 6.0 SR3, while doing upgrade sapup asking me To perform the manual application specific post upgrade step.
    This phase says to run ASU toolbox by using tx /n/asu/upgrade. when i run this tx is show the below list of steps to be performed with showing severity level of some as optional and many as obligatory.
    Task List                                                                                Severity     SAP R/3 release frm     SAP R/3 release to
    IS-OIL Application Test 600                                                 Optional          
    KP06xx: Termination SYNTAX_ERROR                                                 Obligatory     470                           500
    CGPL: Entries are blank after upgrade                                                Obligatory          
    Error handling of task group execution                                Optional          
    Mobile device cannot confirm TO after release upgrade     Obligatory     470                         600
    Mobile device doesn't find transfer orders after upgrade     Obligatory     470                          600
    Grantee Management - Upgrade from EA-PS 2.00 to ECC 600     Obligatory          
    Convert customizing for warehouse funds ctr scenarios     Optional          
    Various problems classification commitment items (class type     Obligatory          
    Unauthorized error messages udring fiscal year change/reassi     Obligatory          
    RFFMUDX1 migrates incomplete budgeting tables                          Obligatory          
    Non-7bit-ASCII character used for BCS key figures             Obligatory          
    Changes in TKEDR for /ISDFPS/RFFMDISTDERIVALE          Obligatory          
    BCS - Tool for Deleting Obsolete Derivation Strategies     Obligatory          
    BCS Syntax Error on Upgrade from EA-PS 2.00 to ECC 600     Obligatory          
    Migration to ERP 6.0 (EA-PS 6.00)                                         Obligatory          
    Migration EA-PS 2.00 to ERP 5.0 (EA-PS 5.00)                      Obligatory          
    Missing initialization of new fields in table ANLZ                  Obligatory     46C                       470
    Activating VMC for the Internet Pricing and Configurator     Obligatory          
    Customer specific BSEG-fields not transferred                  Optional          
    Conversion of report headers in drilldown-reporting            Optional                                   600
    IBase: Upgrade to Release 4.6C and higher                         Optional     46C                         600
    ZSAPRCKML_COGS: Upgrade to release 4.7 or higher     Optional     46C                      470
    Conversion of CO-Total-Tables                                              Obligatory     46C                      500
    Conversion of CO-line-item table COEP                                Obligatory     46C                       600
    New General Ledger, problems in CO-documents                 Obligatory                               500
    No receivers found in allocations                                          Obligatory     46C                        470
    Conversion Of New Process Parameter Long Texts For Search     Optional     110                       600
    Migration of process parameters in recipe management     Optional     110                        600
    FAQ new depreciation calculation                                        Optional                                600
    Upgrading to SAP R/3 47x200 and SAP ECC 500 with RMGMT     Obligatory     100                       500
    Reloading Table T512W                                                        Optional          
    Converting Short Texts                                                         Obligatory          
    Migrating Data                                                                         Optional     4.7     
    Activating SAP ECC Extensions                                          Optional          
    I am not sure about which steps I have to perform, I am a bit confused.. because some are optional and some are not relevant to my release (as target or source release is different from mine). and also few things are not applied in my envirnoment hence those steps are also not relevant.
    Please suggest me, how to proceed and what to do. please guide if i skip this step now and later  on I apply latest SP than still I need to do all this.
    Regards
    Vinay

    Hi All,
    I also faced a similar issue during upgrade. Some useful findings.
    1. Only super user can access this /n/ASU/START
    2. All the obligatory executable tasks are automatically performed by the system automatically during upgrade.      SAPADM. Only errors (if any) are to be corrected.
    3. Some of the tasks are only to go through some SAP notes as a precaution before upgrade.
    4.  Execute all the checks /n/ASU/UPGRADE
    5. This surely can be skipped, but not advisable.
    regards,
    Amit

  • Performance issue with pl/sql code

    Hi Oracle Gurus,
    I am in need of your recommendations for a performance issue that I am facing in production envrionment. There is a pl/sql procedure which executes with different elapsed time at different executions. Elapsed Times are 30minutes , 40 minutes, 65 minutes , 3 minutes ,3 seconds.
    Expected elapsed time is maximum of 3 minutes. ( But some times it took 3 seconds too...! )
    Output on all different executions are same that is deletion and insertion of 12K records into a table.
    Here is the auto trace details of two different scenarios.
    Slow execution - 33.65 minutes
    Stat Name                                Statement   Per Execution % Snap
    Elapsed Time (ms)                         1,712,343    1,712,342.6    41.4
    CPU Time (ms)                             1,679,689    1,679,688.6    44.7
    Executions                                        1            N/A     N/A
    Buffer Gets                              ##########  167,257,973.0    86.9
    Disk Reads                                    1,284        1,284.0     0.4
    Parse Calls                                       1            1.0     0.0
    User I/O Wait Time (ms)                       4,264            N/A     N/A
    Cluster Wait Time (ms)                        3,468            N/A     N/A
    Application Wait Time (ms)                        0            N/A     N/A
    Concurrency Wait Time (ms)                        6            N/A     N/A
    Invalidations                                     0            N/A     N/A
    Version Count                                     4            N/A     N/A
    Sharable Mem(KB)                                 85            N/A     N/A
              -------------------------------------------------------------Fast Exection : 5 seconds
    Stat Name                                Statement   Per Execution % Snap
    Elapsed Time (ms)                            41,550       41,550.3     0.7
    CPU Time (ms)                                40,776       40,776.3     1.0
    Executions                                        1            N/A     N/A
    Buffer Gets                               2,995,677    2,995,677.0     4.2
    Disk Reads                                       22           22.0     0.0
    Parse Calls                                       1            1.0     0.0
    User I/O Wait Time (ms)                         162            N/A     N/A
    Cluster Wait Time (ms)                          621            N/A     N/A
    Application Wait Time (ms)                        0            N/A     N/A
    Concurrency Wait Time (ms)                       55            N/A     N/A
    Invalidations                                     0            N/A     N/A
    Version Count                                     4            N/A     N/A
    Sharable Mem(KB)                                 85            N/A     N/A
              -------------------------------------------------------------For security reasons, I cannot share the actual code. Its a report generating code that deletes and load the data into table using insert into select statement.
    Delete from table ;
    cursor X to get the master data ( 98 records )
    For each X loop
    insert into tableA select * from tables where a= X.a and b= X.b and c=X.c ..... ;
    -- 12 K records inserted on average
    insert into tableB select * from tables where a= X.a and b= X.b and c=X.c ..... ;
    -- 12 K records inserted on average
    end loop ;1. The select query is complex with bind variables ( explain plan varies for each values )
    2. I have checked the tablespace of the tables involved, it is 82% used. DBA confirmed that it is not the reason.
    3. Disk reads are high during long execution.
    4. At long running times, I can see a db sequential read wait event on a index object. This index is on the table where data is inserted.
    All I need to find is why this code is taking 3 seconds and 60 minutes on the same day and on the consecutive executions ?
    Is there any other approach to find the root cause of this behaviour and to fix it ? Kindly adivse.
    Thanks in advance your help.
    Regards,
    Hari
    Edited by: BluShadow on 26-Sep-2012 08:24
    edited to add {noformat}{noformat} tags.  You've been a member long enough to know to do this yourself... so please do so in future.  ({message:id=9360002})                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hariharan ST wrote:
    Hi Oracle Gurus,
    I am in need of your recommendations for a performance issue that I am facing in production envrionment. There is a pl/sql procedure which executes with different elapsed time at different executions. Please reedit your post and add some code tags around the trace information. This would improve readability greatly and will help us to help you
    example
    {<b></b>code}
    select * from dual;{<b></b>code}
    Based upon your description I can imagine two things.
    a) The execution plan for the select query does change frequently.
    A typical reason can be not up to date statistics.
    b) Some locking / wait conflict. For example upon a UK index.
    Are there any other operations going on while it is slow? If anybody inserts a value, then your session will wait, if the same (PK/UK) value also is to be inserted.
    Those wait events can be recognized using standard tools like oracle sql developer or enterprise manager while the query is slow.
    Also go through the links that are in the FAQ. They tell you how to get better information for makeing a tuning request.
    SQL and PL/SQL FAQ
    Edited by: Sven W. on Sep 25, 2012 6:41 PM

  • Performance issues since upgrade

    I am on a late 2011 MacBook Pro and am having severs performance issues since upgrading to Mavericks. I fear my issues may be related to company installed anti-virus (which I cannot remove), but I was hoping someone could look over my EtreCheck for other potential solutions.
    One really odd issue I am having, which I cannot seem to find good information for on Google, is at least 4-5 times a day my Mac just stops. No beach ball, no anything, for about 1-5 minutes. Then it's fine. Maybe just me grasping at straws, but it seems related to a when webpage loads a bunch of images? I always use Safari btw, but testing other browsers, like Chrome & Firefox, it happens as well.
    I have also removed TotalFinder and have noticed no improvement and still have the above issue.
    Thanks in advance!
    Here is my EtreCheck:
    Problem description:
    slow performance on Mavericks
    EtreCheck version: 2.0.11 (98)
    Report generated November 11, 2014 at 8:51:26 AM EST
    Hardware Information: ℹ️
      MacBook Pro (17-inch, Late 2011) (Verified)
      MacBook Pro - model: MacBookPro8,3
      1 2.5 GHz Intel Core i7 CPU: 4-core
      8 GB RAM Upgradeable
      BANK 0/DIMM0
      4 GB DDR3 1333 MHz ok
      BANK 1/DIMM0
      4 GB DDR3 1333 MHz ok
      Bluetooth: Old - Handoff/Airdrop2 not supported
      Wireless:  en1: 802.11 a/b/g/n
    Video Information: ℹ️
      Intel HD Graphics 3000 - VRAM: 512 MB
      AMD Radeon HD 6770M - VRAM: 1024 MB
      Color LCD 1920 x 1200
      LED Cinema Display 1920 x 1200
    System Software: ℹ️
      OS X 10.9.5 (13F34) - Uptime: 0:46:22
    Disk Information: ℹ️
      APPLE HDD HTS727575A9E362 disk0 : (750.16 GB)
      S.M.A.R.T. Status: Verified
      EFI (disk0s1) <not mounted> : 210 MB
      Macintosh HD (disk0s2) /  [Startup]: 749.30 GB (256.69 GB free)
      Recovery HD (disk0s3) <not mounted>  [Recovery]: 650 MB
      MATSHITADVD-R   UJ-8A8
    USB Information: ℹ️
      Apple Inc. FaceTime HD Camera (Built-in)
      Fitbit Inc. Fitbit Base Station
      Apple Inc. BRCM2070 Hub
      Apple Inc. Bluetooth USB Host Controller
      Apple Inc. Apple Internal Keyboard / Trackpad
      Apple, Inc. Keyboard Hub
      Apple, Inc Apple Keyboard
      Tablet PTZ-630
      Logitech Logitech USB Headset
      Apple Inc. Display iSight
      Apple Inc. Apple LED Cinema Display
      Apple Inc. Display Audio
      Apple Computer, Inc. IR Receiver
    Firewire Information: ℹ️
      Iomega HDD unknown_device 800mbit - 800mbit max
      S.M.A.R.T. Status: Verified
      disk1s1 (disk1s1) <not mounted> : 32 KB
      Iomega HDD (disk1s3) /Volumes/Iomega HDD : 500.04 GB (22.88 GB free)
      Files (disk1s5) /Volumes/Files : 499.90 GB (416.87 GB free)
    Thunderbolt Information: ℹ️
      Apple Inc. thunderbolt_bus
    Gatekeeper: ℹ️
      Anywhere
    Kernel Extensions: ℹ️
      /Library/Application Support/Symantec/Protector
      [not loaded] com.symantec.kext.protector.panther (1.0f5) Support
      [not loaded] com.symantec.kext.protector.tigerplus (1.0f5) Support
      /Library/StartupItems/SymAutoProtect
      [loaded] com.Symantec.kext.SAVAPComm (11.0.6) Support
      /System/Library/Extensions
      [loaded] com.Cycling74.driver.Soundflower (1.5.1) Support
      [loaded] com.InnovationTechnology.driver.ComputerAudio (1.01 - SDK 10.7) Support
      [not loaded] com.cisco.nke.ipsec (2.0.1) Support
      [not loaded] com.wacom.kext.wacomtablet (6.3.7 - SDK 10.8) Support
    Startup Items: ℹ️
      CiscoVPN: Path: /System/Library/StartupItems/CiscoVPN
      NortonMissedTasks: Path: /Library/StartupItems/NortonMissedTasks
      SMC: Path: /Library/StartupItems/SMC
      SymAutoProtect: Path: /Library/StartupItems/SymAutoProtect
      SymProtector: Path: /Library/StartupItems/SymProtector
      Startup items are obsolete and will not work in future versions of OS X
    Launch Agents: ℹ️
      [not loaded] com.adobe.AAM.Updater-1.0.plist Support
      [loaded] com.adobe.CS5ServiceManager.plist Support
      [loaded] com.google.keystone.agent.plist Support
      [running] com.jamfsoftware.jamf.agent.plist Support
      [loaded] com.oracle.java.Java-Updater.plist Support
      [running] com.symantec.quickmenu.application.plist Support
      [running] com.wacom.wacomtablet.plist Support
      [running] net.juniper.pulsetray.plist Support
    Launch Daemons: ℹ️
      [loaded] com.adobe.fpsaud.plist Support
      [running] com.fitbit.fitbitd.plist Support
      [running] com.fitbit.galileod.plist Support
      [loaded] com.google.keystone.daemon.plist Support
      [running] com.jamfsoftware.jamf.daemon.plist Support
      [not loaded] com.jamfsoftware.startupItem.plist Support
      [loaded] com.jamfsoftware.task.1.plist Support
      [loaded] com.microsoft.office.licensing.helper.plist Support
      [loaded] com.oracle.java.Helper-Tool.plist Support
      [loaded] com.oracle.java.JavaUpdateHelper.plist Support
      [loaded] com.rogueamoeba.instanton-agent.plist Support
      [running] net.juniper.AccessService.plist Support
      [loaded] net.juniper.UninstallPulse.plist Support
    User Launch Agents: ℹ️
      [loaded] com.valvesoftware.steamclean.plist Support
      [running] ws.agile.1PasswordAgent.plist Support
    User Login Items: ℹ️
      gfxCardStatus Application (/Users/[redacted]/Downloads/gfxCardStatus.app)
      Dropbox Application (/Applications/Dropbox.app)
      Microsoft Database Daemon Application (/Applications/Microsoft Office 2011/Office/Microsoft Database Daemon.app)
      cdn Volume (/Volumes/cdn)
      TotalFinder Application (/Applications/TotalFinder.app)
      SAVDiskMountNotify Application (/Library/Application Support/Symantec/AntiVirus/SAVDiskMountNotify.app)
      ScanNotification Application (/Library/Application Support/Symantec/AntiVirus/ScanNotification.app)
      SymSecondaryLaunch Application (/Library/Application Support/Norton Solutions Support/Scheduler/SymSecondaryLaunch.app)
    Internet Plug-ins: ℹ️
      OfficeLiveBrowserPlugin: Version: 12.3.6 Support
      Flash Player: Version: 15.0.0.189 - SDK 10.6 Mismatch! Adobe recommends 15.0.0.223
      AdobePDFViewer: Version: 10.0.2 Support
      Unity Web Player: Version: UnityPlayer version 4.5.4f1 - SDK 10.6 Support
      googletalkbrowserplugin: Version: 5.38.6.0 - SDK 10.8 Support
      AdobeExManDetect: Version: AdobeExManDetect 1.1.0.0 - SDK 10.7 Support
      iPhotoPhotocast: Version: 7.0
      DirectorShockwave: Version: 11.5.9r620 Support
      QuickTime Plugin: Version: 7.7.3
      FlashPlayer-10.6: Version: 15.0.0.189 - SDK 10.6 Support
      Silverlight: Version: 4.0.60310.0 Support
      MeetingJoinPlugin: Version: (null) - SDK 10.6 Support
      net.juniper.DSSafariExtensions: Version: (null) Support
      Default Browser: Version: 537 - SDK 10.9
      Flip4Mac WMV Plugin: Version: 2.3.1.2 Support
      o1dbrowserplugin: Version: 5.38.6.0 - SDK 10.8 Support
      WacomTabletPlugin: Version: WacomTabletPlugin 2.1.0.2 Support
      SharePointBrowserPlugin: Version: 14.4.5 - SDK 10.6 Support
      JavaAppletPlugin: Version: Java 7 Update 71 Check version
      WacomNetscape: Version: 2.1.0-1 - SDK 10.8 Support
    User Internet Plug-ins: ℹ️
      SOEWebInstaller: Version: 1.0 - SDK 10.5 Support
      Aspera Web 3.1.2.72265: Version: (null) - SDK 10.6 Support
    Safari Extensions: ℹ️
      1Password
      Adblock Plus
      Reddit Enhancement Suite
    3rd Party Preference Panes: ℹ️
      Flash Player  Support
      Flip4Mac WMV  Support
      Java  Support
      MacFUSE  Support
      SymAutoProtect
      Symantec\nQuickMenu  Support
      WacomTablet  Support
    Time Machine: ℹ️
      Skip System Files: NO
      Mobile backups: ON
      Auto backup: YES
      Destinations:
      Iomega HDD [Local]
      Total size: 500.04 GB
      Total number of backups: 37
      Oldest backup: 2014-10-14 14:11:11 +0000
      Last backup: 2014-11-11 13:27:48 +0000
      Size of backup disk: Excellent
      Backup size 500.04 GB > (Disk size 0 B X 3)
    Top Processes by CPU: ℹ️
          36% com.apple.WebKit.Plugin.64
          34% SymAutoProtect
          13% WindowServer
          9% Unity
          4% Activity Monitor
    Top Processes by Memory: ℹ️
      455 MB Safari
      361 MB com.apple.WebKit.Plugin.64
      292 MB Unity
      77 MB com.apple.WebKit.Networking
      77 MB com.apple.WebKit.WebContent
    Virtual Memory Information: ℹ️
      2.08 GB Free RAM
      2.39 GB Active RAM
      1.34 GB Inactive RAM
      1.40 GB Wired RAM
      1.11 GB Page-ins
      5.54 GB Page-outs

    Activity Monitor - Mavericks  also Yosemite
    Activity Monitor in Mavericks has significant changes
    Performance Guide
    Why is my computer slow
    Why your Mac runs slower than it should
    Slow Mac After Mavericks
    Things you can do to resolve slowdowns  see post by Kappy

  • SQL Query with a little bit more complicated WHERE clause performance issue

    Hello, I have some performance issue in this case:
    Very simplified query:
    SELECT COUNT(*) FROM Items
    WHERE
    ConditionA OR
    ConditionB OR
    ConditionC OR ...
    Simply I have to determine how many Items the user has access through some complicated conditions.
    When there is a large number of records (100,000+) in the Items table and say ~10 complicated conditions concatenated in WHERE clause, I get the result about 2 seconds in my case. The problem is when very few conditions are met, f.e. when I get only
    10 Items from 100,000.
    How can I improve the performace in this "Get my items" case?
    Additional information:
    the query is generated by EF 6.1
    MS SQL 2012 Express
    Here is the main part of the real SQL Execution Plan:

    Can you post table/index DDL?  Query?
    Sample query:
    exec sp_executesql N'SELECT
    [GroupBy1].[A1] AS [C1]
    FROM ( SELECT
    COUNT(1) AS [A1]
    FROM [dbo].[Tickets] AS [Extent1]
    LEFT OUTER JOIN [dbo].[Services] AS [Extent2] ON [Extent1].[ServiceId] = [Extent2].[Id]
    WHERE (@p__linq__0 = 1) OR ([Extent1].[SubmitterKey] = @p__linq__1) OR ([Extent1].[OperatorKey] = @p__linq__2) OR (([Extent1].[OperatorKey] IS NULL) AND (@p__linq__2 IS NULL)) OR ([Extent1].[SolverKey] = @p__linq__3) OR (([Extent1].[SolverKey] IS NULL) AND (@p__linq__3 IS NULL)) OR ([Extent1].[Incident2ndLineSupportKey] = @p__linq__4) OR (([Extent1].[Incident2ndLineSupportKey] IS NULL) AND (@p__linq__4 IS NULL)) OR ((@p__linq__5 = 1) AND ((1 = CAST( [Extent1].[TicketType] AS int)) OR ((@p__linq__6 = 1) AND (((2 = CAST( [Extent1].[TicketType] AS int)) AND (([Extent2].[IncidentManager] = @p__linq__7) OR (([Extent2].[IncidentManager] IS NULL) AND (@p__linq__7 IS NULL)))) OR ((3 = CAST( [Extent1].[TicketType] AS int)) AND (([Extent2].[ServiceRequestManager] = @p__linq__8) OR (([Extent2].[ServiceRequestManager] IS NULL) AND (@p__linq__8 IS NULL)))) OR ((4 = CAST( [Extent1].[TicketType] AS int)) AND (([Extent2].[ProblemManager] = @p__linq__9) OR (([Extent2].[ProblemManager] IS NULL) AND (@p__linq__9 IS NULL)))) OR ((5 = CAST( [Extent1].[TicketType] AS int)) AND (([Extent2].[ChangeManager] = @p__linq__10) OR (([Extent2].[ChangeManager] IS NULL) AND (@p__linq__10 IS NULL)))))) OR ( EXISTS (SELECT
    1 AS [C1]
    FROM [dbo].[ServiceDeputyManagers] AS [Extent3]
    WHERE ([Extent1].[ServiceId] = [Extent3].[ServiceId]) AND ( CAST( [Extent3].[TicketType] AS int) = CAST( [Extent1].[TicketType] AS int)) AND ([Extent3].[UserProviderKey] = @p__linq__11)
    )))) OR ((2 = CAST( [Extent1].[TicketType] AS int)) AND (([Extent2].[AllowAccessToOtherOperatorsIncidents] = 1) OR ((201 = [Extent1].[TicketStateValue]) AND ([Extent2].[WfDisableIncidentTakeFromQueueAction] <> cast(1 as bit)))) AND ([Extent2].[Incident1stLineSupportLimitedAccess] <> cast(1 as bit))) OR ((3 = CAST( [Extent1].[TicketType] AS int)) AND (([Extent2].[AllowAccessToOtherOperatorsServiceRequests] = 1) OR ((301 = [Extent1].[TicketStateValue]) AND ([Extent2].[WfDisableServiceRequestTakeFromQueueAction] <> cast(1 as bit)))) AND ([Extent2].[ServiceRequestLimitedAccess] <> cast(1 as bit))) OR ((4 = CAST( [Extent1].[TicketType] AS int)) AND ([Extent2].[AllowAccessToOtherOperatorsProblems] = 1) AND ([Extent2].[ProblemLimitedAccess] <> cast(1 as bit))) OR ((5 = CAST( [Extent1].[TicketType] AS int)) AND (([Extent2].[AllowAccessToOtherOperatorsChanges] = 1) OR ((501 = [Extent1].[TicketStateValue]) AND ([Extent2].[WfDisableChangeTakeFromQueueAction] <> cast(1 as bit)))) AND ([Extent2].[ChangeLimitedAccess] <> cast(1 as bit))) OR ((2 = CAST( [Extent1].[TicketType] AS int)) AND (([Extent2].[AllowAccessToOtherOperatorsIncidents] = 1) OR ((201 = [Extent1].[TicketStateValue]) AND ([Extent2].[WfDisableIncidentTakeFromQueueAction] <> cast(1 as bit)))) AND (( EXISTS (SELECT
    1 AS [C1]
    FROM [dbo].[ServiceOperators] AS [Extent4]
    WHERE ([Extent1].[ServiceId] = [Extent4].[ServiceId]) AND (2 = CAST( [Extent4].[TicketType] AS int)) AND ([Extent4].[UserProviderKey] = @p__linq__12) AND (1 = [Extent4].[SupportLine])
    )) OR ( EXISTS (SELECT
    1 AS [C1]
    FROM [dbo].[OperatorGroupUsers] AS [Extent5]
    WHERE ([Extent5].[UserProviderKey] = @p__linq__13) AND ( EXISTS (SELECT
    1 AS [C1]
    FROM [dbo].[ServiceOperatorGroups] AS [Extent6]
    WHERE ([Extent6].[ServiceId] = [Extent1].[ServiceId]) AND (2 = CAST( [Extent6].[TicketType] AS int)) AND (1 = [Extent6].[SupportLine]) AND ([Extent6].[OperatorGroupId] = [Extent5].[OperatorGroupId])
    )))) OR ((2 = CAST( [Extent1].[TicketType] AS int)) AND ([Extent1].[IncidentFunctionEscalatedTo2ndLineSupport] = 1) AND ([Extent1].[Incident2ndLineSupportKey] IS NULL) AND (([Extent2].[Incident2ndLineSupportLimitedAccess] <> cast(1 as bit)) OR ( EXISTS (SELECT
    1 AS [C1]
    FROM [dbo].[ServiceOperators] AS [Extent7]
    WHERE ([Extent1].[ServiceId] = [Extent7].[ServiceId]) AND (2 = CAST( [Extent7].[TicketType] AS int)) AND ([Extent7].[UserProviderKey] = @p__linq__14) AND (2 = [Extent7].[SupportLine])
    )) OR ( EXISTS (SELECT
    1 AS [C1]
    FROM [dbo].[OperatorGroupUsers] AS [Extent8]
    WHERE ([Extent8].[UserProviderKey] = @p__linq__15) AND ( EXISTS (SELECT
    1 AS [C1]
    FROM [dbo].[ServiceOperatorGroups] AS [Extent9]
    WHERE ([Extent9].[ServiceId] = [Extent1].[ServiceId]) AND (2 = CAST( [Extent9].[TicketType] AS int)) AND (2 = [Extent9].[SupportLine]) AND ([Extent9].[OperatorGroupId] = [Extent8].[OperatorGroupId])
    )))) OR ((3 = CAST( [Extent1].[TicketType] AS int)) AND (([Extent2].[AllowAccessToOtherOperatorsServiceRequests] = 1) OR ((301 = CAST( [Extent1].[TicketState] AS int)) AND ([Extent2].[WfDisableServiceRequestTakeFromQueueAction] <> cast(1 as bit)))) AND (( EXISTS (SELECT
    1 AS [C1]
    FROM [dbo].[ServiceOperators] AS [Extent10]
    WHERE ([Extent1].[ServiceId] = [Extent10].[ServiceId]) AND (3 = CAST( [Extent10].[TicketType] AS int)) AND ([Extent10].[UserProviderKey] = @p__linq__16)
    )) OR ( EXISTS (SELECT
    1 AS [C1]
    FROM [dbo].[OperatorGroupUsers] AS [Extent11]
    WHERE ([Extent11].[UserProviderKey] = @p__linq__17) AND ( EXISTS (SELECT
    1 AS [C1]
    FROM [dbo].[ServiceOperatorGroups] AS [Extent12]
    WHERE ([Extent12].[ServiceId] = [Extent1].[ServiceId]) AND (3 = CAST( [Extent12].[TicketType] AS int)) AND ([Extent12].[OperatorGroupId] = [Extent11].[OperatorGroupId])
    )))) OR ((4 = CAST( [Extent1].[TicketType] AS int)) AND ([Extent2].[AllowAccessToOtherOperatorsProblems] = 1) AND (( EXISTS (SELECT
    1 AS [C1]
    FROM [dbo].[ServiceOperators] AS [Extent13]
    WHERE ([Extent1].[ServiceId] = [Extent13].[ServiceId]) AND (4 = CAST( [Extent13].[TicketType] AS int)) AND ([Extent13].[UserProviderKey] = @p__linq__18)
    )) OR ( EXISTS (SELECT
    1 AS [C1]
    FROM [dbo].[OperatorGroupUsers] AS [Extent14]
    WHERE ([Extent14].[UserProviderKey] = @p__linq__19) AND ( EXISTS (SELECT
    1 AS [C1]
    FROM [dbo].[ServiceOperatorGroups] AS [Extent15]
    WHERE ([Extent15].[ServiceId] = [Extent1].[ServiceId]) AND (4 = CAST( [Extent15].[TicketType] AS int)) AND ([Extent15].[OperatorGroupId] = [Extent14].[OperatorGroupId])
    )))) OR ((5 = CAST( [Extent1].[TicketType] AS int)) AND (([Extent2].[AllowAccessToOtherOperatorsChanges] = 1) OR ((501 = [Extent1].[TicketStateValue]) AND ([Extent2].[WfDisableChangeTakeFromQueueAction] <> cast(1 as bit)))) AND (( EXISTS (SELECT
    1 AS [C1]
    FROM [dbo].[ServiceOperators] AS [Extent16]
    WHERE ([Extent1].[ServiceId] = [Extent16].[ServiceId]) AND (5 = CAST( [Extent16].[TicketType] AS int)) AND ([Extent16].[UserProviderKey] = @p__linq__20)
    )) OR ( EXISTS (SELECT
    1 AS [C1]
    FROM [dbo].[OperatorGroupUsers] AS [Extent17]
    WHERE ([Extent17].[UserProviderKey] = @p__linq__21) AND ( EXISTS (SELECT
    1 AS [C1]
    FROM [dbo].[ServiceOperatorGroups] AS [Extent18]
    WHERE ([Extent18].[ServiceId] = [Extent1].[ServiceId]) AND (5 = CAST( [Extent18].[TicketType] AS int)) AND ([Extent18].[OperatorGroupId] = [Extent17].[OperatorGroupId])
    )))) OR ( EXISTS (SELECT
    1 AS [C1]
    FROM [dbo].[TicketInvitations] AS [Extent19]
    WHERE ([Extent19].[TicketId] = [Extent1].[Id]) AND (([Extent19].[InvitedUserProviderKey] = @p__linq__22) OR (([Extent19].[InvitedUserProviderKey] IS NULL) AND (@p__linq__22 IS NULL)))
    )) OR ( EXISTS (SELECT
    1 AS [C1]
    FROM (SELECT
    [Extent20].[CustomerId] AS [CustomerId]
    FROM [dbo].[CustomerUsers] AS [Extent20]
    WHERE ([Extent20].[UserProviderKey] = @p__linq__23) AND ([Extent20].[CanAccessOthersTickets] = 1)
    INTERSECT
    SELECT
    [Extent21].[CustomerId] AS [CustomerId]
    FROM [dbo].[CustomerUsers] AS [Extent21]
    WHERE [Extent21].[UserProviderKey] = [Extent1].[SubmitterKey]) AS [Intersect1]
    )) OR ( EXISTS (SELECT
    1 AS [C1]
    FROM (SELECT
    [Extent22].[InternalGroupId] AS [InternalGroupId]
    FROM [dbo].[InternalGroupUsers] AS [Extent22]
    WHERE ([Extent22].[UserProviderKey] = @p__linq__24) AND ([Extent22].[CanAccessOthersTickets] = 1)
    INTERSECT
    SELECT
    [Extent23].[InternalGroupId] AS [InternalGroupId]
    FROM [dbo].[InternalGroupUsers] AS [Extent23]
    WHERE [Extent23].[UserProviderKey] = [Extent1].[SubmitterKey]) AS [Intersect2]
    ) AS [GroupBy1]',N'@p__linq__0 bit,@p__linq__1 varchar(8000),@p__linq__2 varchar(8000),@p__linq__3 varchar(8000),@p__linq__4 varchar(8000),@p__linq__5 bit,@p__linq__6 bit,@p__linq__7 varchar(8000),@p__linq__8 varchar(8000),@p__linq__9 varchar(8000),@p__linq__10 varchar(8000),@p__linq__11 varchar(8000),@p__linq__12 varchar(8000),@p__linq__13 varchar(8000),@p__linq__14 varchar(8000),@p__linq__15 varchar(8000),@p__linq__16 varchar(8000),@p__linq__17 varchar(8000),@p__linq__18 varchar(8000),@p__linq__19 varchar(8000),@p__linq__20 varchar(8000),@p__linq__21 varchar(8000),@p__linq__22 varchar(8000),@p__linq__23 varchar(8000),@p__linq__24 varchar(8000)',@p__linq__0=0,@p__linq__1='31555851-b89d-4a15-bb05-5a6fd42f9552',@p__linq__2='31555851-b89d-4a15-bb05-5a6fd42f9552',@p__linq__3='31555851-b89d-4a15-bb05-5a6fd42f9552',@p__linq__4='31555851-b89d-4a15-bb05-5a6fd42f9552',@p__linq__5=1,@p__linq__6=0,@p__linq__7='31555851-b89d-4a15-bb05-5a6fd42f9552',@p__linq__8='31555851-b89d-4a15-bb05-5a6fd42f9552',@p__linq__9='31555851-b89d-4a15-bb05-5a6fd42f9552',@p__linq__10='31555851-b89d-4a15-bb05-5a6fd42f9552',@p__linq__11='31555851-b89d-4a15-bb05-5a6fd42f9552',@p__linq__12='31555851-b89d-4a15-bb05-5a6fd42f9552',@p__linq__13='31555851-b89d-4a15-bb05-5a6fd42f9552',@p__linq__14='31555851-b89d-4a15-bb05-5a6fd42f9552',@p__linq__15='31555851-b89d-4a15-bb05-5a6fd42f9552',@p__linq__16='31555851-b89d-4a15-bb05-5a6fd42f9552',@p__linq__17='31555851-b89d-4a15-bb05-5a6fd42f9552',@p__linq__18='31555851-b89d-4a15-bb05-5a6fd42f9552',@p__linq__19='31555851-b89d-4a15-bb05-5a6fd42f9552',@p__linq__20='31555851-b89d-4a15-bb05-5a6fd42f9552',@p__linq__21='31555851-b89d-4a15-bb05-5a6fd42f9552',@p__linq__22='31555851-b89d-4a15-bb05-5a6fd42f9552',@p__linq__23='31555851-b89d-4a15-bb05-5a6fd42f9552',@p__linq__24='31555851-b89d-4a15-bb05-5a6fd42f9552'
    Generated DDL for related tables: (indexes are primary on PKs and FKs)
    CREATE TABLE [dbo].[CustomerUsers](
    [UserProviderKey] [varchar](184) NOT NULL,
    [CustomerId] [int] NOT NULL,
    [CanAccessOthersTickets] [bit] NOT NULL,
    CONSTRAINT [PK_dbo.CustomerUsers] PRIMARY KEY CLUSTERED
    [UserProviderKey] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    /****** Object: Table [dbo].[InternalGroupUsers] Script Date: 7.5.2014 8:39:38 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[InternalGroupUsers](
    [UserProviderKey] [varchar](184) NOT NULL,
    [InternalGroupId] [int] NOT NULL,
    [CanAccessOthersTickets] [bit] NOT NULL,
    CONSTRAINT [PK_dbo.InternalGroupUsers] PRIMARY KEY CLUSTERED
    [UserProviderKey] ASC,
    [InternalGroupId] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    /****** Object: Table [dbo].[OperatorGroupUsers] Script Date: 7.5.2014 8:39:38 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[OperatorGroupUsers](
    [UserProviderKey] [varchar](184) NOT NULL,
    [OperatorGroupId] [int] NOT NULL,
    CONSTRAINT [PK_dbo.OperatorGroupUsers] PRIMARY KEY CLUSTERED
    [UserProviderKey] ASC,
    [OperatorGroupId] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    /****** Object: Table [dbo].[ServiceDeputyManagers] Script Date: 7.5.2014 8:39:38 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[ServiceDeputyManagers](
    [UserProviderKey] [varchar](184) NOT NULL,
    [ServiceId] [int] NOT NULL,
    [TicketType] [int] NOT NULL,
    CONSTRAINT [PK_dbo.ServiceDeputyManagers] PRIMARY KEY CLUSTERED
    [UserProviderKey] ASC,
    [ServiceId] ASC,
    [TicketType] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    /****** Object: Table [dbo].[ServiceOperatorGroups] Script Date: 7.5.2014 8:39:38 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[ServiceOperatorGroups](
    [ServiceId] [int] NOT NULL,
    [OperatorGroupId] [int] NOT NULL,
    [TicketTypeValue] [int] NOT NULL,
    [SupportLine] [int] NOT NULL,
    [TicketType] [int] NOT NULL,
    CONSTRAINT [PK_dbo.ServiceOperatorGroups] PRIMARY KEY CLUSTERED
    [ServiceId] ASC,
    [OperatorGroupId] ASC,
    [TicketTypeValue] ASC,
    [SupportLine] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    /****** Object: Table [dbo].[ServiceOperators] Script Date: 7.5.2014 8:39:38 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[ServiceOperators](
    [UserProviderKey] [varchar](184) NOT NULL,
    [ServiceId] [int] NOT NULL,
    [TicketTypeValue] [int] NOT NULL,
    [SupportLine] [int] NOT NULL,
    [TicketType] [int] NOT NULL,
    CONSTRAINT [PK_dbo.ServiceOperators] PRIMARY KEY CLUSTERED
    [UserProviderKey] ASC,
    [ServiceId] ASC,
    [TicketTypeValue] ASC,
    [SupportLine] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    /****** Object: Table [dbo].[Services] Script Date: 7.5.2014 8:39:38 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[Services](
    [Id] [int] IDENTITY(1,1) NOT NULL,
    [ParentId] [int] NULL,
    [Name] [nvarchar](256) NOT NULL,
    [Description] [nvarchar](max) NULL,
    [Disabled] [bit] NOT NULL,
    [NewTicketLimitedAccess] [bit] NOT NULL,
    [Incident1stLineSupportLimitedAccess] [bit] NOT NULL,
    [Incident2ndLineSupportLimitedAccess] [bit] NOT NULL,
    [ServiceRequestLimitedAccess] [bit] NOT NULL,
    [ProblemLimitedAccess] [bit] NOT NULL,
    [ServiceRequestManager] [varchar](184) NOT NULL,
    [IncidentManager] [varchar](184) NOT NULL,
    [ProblemManager] [varchar](184) NOT NULL,
    [Deleted] [bit] NOT NULL,
    [WfDisableIncidentAssignedState] [bit] NOT NULL,
    [WfDisableIncidentConfirmedState] [bit] NOT NULL,
    [WfDisableIncidentTakeFromQueueAction] [bit] NOT NULL,
    [WfDisableIncidentFinishSolutionAction] [bit] NOT NULL,
    [WfDisableServiceRequestAssignedState] [bit] NOT NULL,
    [WfDisableServiceRequestConfirmedState] [bit] NOT NULL,
    [WfDisableServiceRequestTakeFromQueueAction] [bit] NOT NULL,
    [WfDisableServiceRequestFinishSolutionAction] [bit] NOT NULL,
    [WfDisableServiceRequestPostponeAction] [bit] NOT NULL,
    [ChangeLimitedAccess] [bit] NOT NULL,
    [ChangeManager] [varchar](184) NOT NULL,
    [WfDisableChangeTakeFromQueueAction] [bit] NOT NULL,
    [WfDisableChangeAssignedState] [bit] NOT NULL,
    [WfDisableChangeStartPreparationAction] [bit] NOT NULL,
    [IsDepartment] [bit] NOT NULL,
    [InheritsFromDepartment] [bit] NOT NULL,
    [AllowSelectSolverBySubmitterForIncidents] [bit] NOT NULL,
    [AllowSelectSolverBySubmitterForServiceRequests] [bit] NOT NULL,
    [AllowSelectSolverBySubmitterForProblems] [bit] NOT NULL,
    [AllowSelectSolverBySubmitterForChanges] [bit] NOT NULL,
    [AllowAccessToOtherOperatorsIncidents] [bit] NOT NULL,
    [AllowAccessToOtherOperatorsServiceRequests] [bit] NOT NULL,
    [AllowAccessToOtherOperatorsProblems] [bit] NOT NULL,
    [AllowAccessToOtherOperatorsChanges] [bit] NOT NULL,
    [AllowChangeDeadlineForIncidents] [bit] NOT NULL,
    [AllowChangeDeadlineForServiceRequests] [bit] NOT NULL,
    [AllowChangeDeadlineForProblems] [bit] NOT NULL,
    [AllowChangeDeadlineForChanges] [bit] NOT NULL,
    [AllowSelectPriorityForServiceRequests] [bit] NOT NULL,
    [WfDisableIncidentCompletedState] [bit] NOT NULL,
    [WfDoIncidentCompleteActionBySubmittersMessage] [bit] NOT NULL,
    [WfDisableServiceRequestCompletedState] [bit] NOT NULL,
    [WfDoServiceRequestCompleteActionBySubmittersMessage] [bit] NOT NULL,
    CONSTRAINT [PK_dbo.Services] PRIMARY KEY CLUSTERED
    [Id] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    /****** Object: Table [dbo].[TicketInvitations] Script Date: 7.5.2014 8:39:38 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[TicketInvitations](
    [Id] [int] IDENTITY(1,1) NOT NULL,
    [TicketId] [int] NOT NULL,
    [InitiatorUserProviderKey] [varchar](184) NULL,
    [InitiatorFullName] [nvarchar](max) NULL,
    [InvitedUserProviderKey] [varchar](184) NULL,
    [InvitedFullName] [nvarchar](max) NULL,
    [Type] [int] NOT NULL,
    [CreatedUTC] [datetime] NOT NULL,
    CONSTRAINT [PK_dbo.TicketInvitations] PRIMARY KEY CLUSTERED
    [Id] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    /****** Object: Table [dbo].[Tickets] Script Date: 7.5.2014 8:39:38 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[Tickets](
    [Id] [int] IDENTITY(1,1) NOT NULL,
    [ParentId] [int] NULL,
    [ServiceId] [int] NULL,
    [ServiceMailboxId] [int] NULL,
    [TicketTypeValue] [int] NOT NULL,
    [TicketTypeIdREF] [int] NOT NULL,
    [SubmitterKey] [varchar](184) NOT NULL,
    [SubmitterFullName] [nvarchar](256) NULL,
    [CustomerId] [int] NULL,
    [SolverKey] [varchar](184) NULL,
    [SolverFullName] [nvarchar](256) NULL,
    [Subject] [nvarchar](max) NULL,
    [CreatedUTC] [datetime] NOT NULL,
    [Archived] [bit] NOT NULL,
    [MarkedAsSolvedUTC] [datetime] NULL,
    [ArchivedUTC] [datetime] NULL,
    [TicketSourceValue] [int] NOT NULL,
    [OperatorKey] [varchar](184) NULL,
    [DeadlineUTC] [datetime] NULL,
    [DeadlineLastNotificatedPercentage] [int] NULL,
    [UrgencyValue] [int] NULL,
    [ImpactValue] [int] NULL,
    [PriorityValue] [int] NULL,
    [TicketStateValue] [int] NOT NULL,
    [IncidentFunctionEscalatedTo2ndLineSupport] [bit] NOT NULL,
    [Incident2ndLineSupportKey] [varchar](184) NULL,
    [Incident2ndLineSupportFullName] [nvarchar](max) NULL,
    [TicketType] [int] NOT NULL,
    [Source] [int] NOT NULL,
    [TicketState] [int] NOT NULL,
    [Urgency] [int] NULL,
    [Impact] [int] NULL,
    [TicketSummaryState] [int] NOT NULL,
    [ResolutionText] [nvarchar](max) NULL,
    [ResolutionModifiedUTC] [datetime] NULL,
    [ResolutionEdited] [bit] NOT NULL,
    [ResolutionUserProviderKey] [varchar](184) NULL,
    [ResolutionFullName] [nvarchar](max) NULL,
    [TicketSubType] [int] NULL,
    [ChangeRiskProbabilityValue] [int] NULL,
    [ChangeImpactValue] [int] NULL,
    [ChangeRiskCategoryValue] [int] NULL,
    [RfcText] [nvarchar](max) NULL,
    [RfcModifiedUTC] [datetime] NULL,
    [RfcEdited] [bit] NOT NULL,
    [RfcUserProviderKey] [varchar](184) NULL,
    [RfcFullName] [nvarchar](max) NULL,
    [ManualDeadline] [bit] NOT NULL,
    [ContactInformation] [nvarchar](256) NULL,
    [Imported] [bit] NOT NULL,
    [ForceClosed] [bit] NOT NULL,
    CONSTRAINT [PK_dbo.Tickets] PRIMARY KEY CLUSTERED
    [Id] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    /****** Object: Index [IX_CustomerId] Script Date: 7.5.2014 8:39:38 ******/
    CREATE NONCLUSTERED INDEX [IX_CustomerId] ON [dbo].[CustomerUsers]
    [CustomerId] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    /****** Object: Index [IX_InternalGroupId] Script Date: 7.5.2014 8:39:38 ******/
    CREATE NONCLUSTERED INDEX [IX_InternalGroupId] ON [dbo].[InternalGroupUsers]
    [InternalGroupId] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    /****** Object: Index [IX_OperatorGroupId] Script Date: 7.5.2014 8:39:38 ******/
    CREATE NONCLUSTERED INDEX [IX_OperatorGroupId] ON [dbo].[OperatorGroupUsers]
    [OperatorGroupId] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    /****** Object: Index [IX_ServiceId] Script Date: 7.5.2014 8:39:38 ******/
    CREATE NONCLUSTERED INDEX [IX_ServiceId] ON [dbo].[ServiceDeputyManagers]
    [ServiceId] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    /****** Object: Index [IX_OperatorGroupId] Script Date: 7.5.2014 8:39:38 ******/
    CREATE NONCLUSTERED INDEX [IX_OperatorGroupId] ON [dbo].[ServiceOperatorGroups]
    [OperatorGroupId] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    /****** Object: Index [IX_ServiceId] Script Date: 7.5.2014 8:39:38 ******/
    CREATE NONCLUSTERED INDEX [IX_ServiceId] ON [dbo].[ServiceOperatorGroups]
    [ServiceId] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    /****** Object: Index [IX_ServiceId] Script Date: 7.5.2014 8:39:38 ******/
    CREATE NONCLUSTERED INDEX [IX_ServiceId] ON [dbo].[ServiceOperators]
    [ServiceId] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    /****** Object: Index [IX_ParentId] Script Date: 7.5.2014 8:39:38 ******/
    CREATE NONCLUSTERED INDEX [IX_ParentId] ON [dbo].[Services]
    [ParentId] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    /****** Object: Index [IX_TicketId] Script Date: 7.5.2014 8:39:38 ******/
    CREATE NONCLUSTERED INDEX [IX_TicketId] ON [dbo].[TicketInvitations]
    [TicketId] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    SET ANSI_PADDING ON
    GO
    /****** Object: Index [IX_TicketInvitations_InvitedUserProviderKey_TicketId] Script Date: 7.5.2014 8:39:38 ******/
    CREATE UNIQUE NONCLUSTERED INDEX [IX_TicketInvitations_InvitedUserProviderKey_TicketId] ON [dbo].[TicketInvitations]
    [InvitedUserProviderKey] ASC,
    [TicketId] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    /****** Object: Index [IX_CustomerId] Script Date: 7.5.2014 8:39:38 ******/
    CREATE NONCLUSTERED INDEX [IX_CustomerId] ON [dbo].[Tickets]
    [CustomerId] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    /****** Object: Index [IX_ParentId] Script Date: 7.5.2014 8:39:38 ******/
    CREATE NONCLUSTERED INDEX [IX_ParentId] ON [dbo].[Tickets]
    [ParentId] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    /****** Object: Index [IX_ServiceId] Script Date: 7.5.2014 8:39:38 ******/
    CREATE NONCLUSTERED INDEX [IX_ServiceId] ON [dbo].[Tickets]
    [ServiceId] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    /****** Object: Index [IX_ServiceMailboxId] Script Date: 7.5.2014 8:39:38 ******/
    CREATE NONCLUSTERED INDEX [IX_ServiceMailboxId] ON [dbo].[Tickets]
    [ServiceMailboxId] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    SET ANSI_PADDING ON
    GO
    /****** Object: Index [IX_SolverFullName] Script Date: 7.5.2014 8:39:38 ******/
    CREATE NONCLUSTERED INDEX [IX_SolverFullName] ON [dbo].[Tickets]
    [SolverFullName] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    SET ANSI_PADDING ON
    GO
    /****** Object: Index [IX_SolverKey] Script Date: 7.5.2014 8:39:38 ******/
    CREATE NONCLUSTERED INDEX [IX_SolverKey] ON [dbo].[Tickets]
    [SolverKey] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    SET ANSI_PADDING ON
    GO
    /****** Object: Index [IX_SubmitterFullName] Script Date: 7.5.2014 8:39:38 ******/
    CREATE NONCLUSTERED INDEX [IX_SubmitterFullName] ON [dbo].[Tickets]
    [SubmitterFullName] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    SET ANSI_PADDING ON
    GO
    /****** Object: Index [IX_SubmitterKey] Script Date: 7.5.2014 8:39:38 ******/
    CREATE NONCLUSTERED INDEX [IX_SubmitterKey] ON [dbo].[Tickets]
    [SubmitterKey] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    /****** Object: Index [IX_Tickets_TicketType_TicketTypeIdREF] Script Date: 7.5.2014 8:39:38 ******/
    CREATE UNIQUE NONCLUSTERED INDEX [IX_Tickets_TicketType_TicketTypeIdREF] ON [dbo].[Tickets]
    [TicketType] ASC,
    [TicketTypeIdREF] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    ALTER TABLE [dbo].[CustomerUsers] WITH CHECK ADD CONSTRAINT [FK_dbo.CustomerUsers_dbo.Customers_CustomerId] FOREIGN KEY([CustomerId])
    REFERENCES [dbo].[Customers] ([Id])
    ON DELETE CASCADE
    GO
    ALTER TABLE [dbo].[CustomerUsers] CHECK CONSTRAINT [FK_dbo.CustomerUsers_dbo.Customers_CustomerId]
    GO
    ALTER TABLE [dbo].[InternalGroupUsers] WITH CHECK ADD CONSTRAINT [FK_dbo.InternalGroupUsers_dbo.InternalGroups_InternalGroupId] FOREIGN KEY([InternalGroupId])
    REFERENCES [dbo].[InternalGroups] ([Id])
    ON DELETE CASCADE
    GO
    ALTER TABLE [dbo].[InternalGroupUsers] CHECK CONSTRAINT [FK_dbo.InternalGroupUsers_dbo.InternalGroups_InternalGroupId]
    GO
    ALTER TABLE [dbo].[OperatorGroupUsers] WITH CHECK ADD CONSTRAINT [FK_dbo.OperatorGroupUsers_dbo.OperatorGroups_OperatorGroupId] FOREIGN KEY([OperatorGroupId])
    REFERENCES [dbo].[OperatorGroups] ([Id])
    ON DELETE CASCADE
    GO
    ALTER TABLE [dbo].[OperatorGroupUsers] CHECK CONSTRAINT [FK_dbo.OperatorGroupUsers_dbo.OperatorGroups_OperatorGroupId]
    GO
    ALTER TABLE [dbo].[ServiceDeputyManagers] WITH CHECK ADD CONSTRAINT [FK_dbo.ServiceDeputyManagers_dbo.Services_ServiceId] FOREIGN KEY([ServiceId])
    REFERENCES [dbo].[Services] ([Id])
    ON DELETE CASCADE
    GO
    ALTER TABLE [dbo].[ServiceDeputyManagers] CHECK CONSTRAINT [FK_dbo.ServiceDeputyManagers_dbo.Services_ServiceId]
    GO
    ALTER TABLE [dbo].[ServiceOperatorGroups] WITH CHECK ADD CONSTRAINT [FK_dbo.ServiceOperatorGroups_dbo.OperatorGroups_OperatorGroupId] FOREIGN KEY([OperatorGroupId])
    REFERENCES [dbo].[OperatorGroups] ([Id])
    ON DELETE CASCADE
    GO
    ALTER TABLE [dbo].[ServiceOperatorGroups] CHECK CONSTRAINT [FK_dbo.ServiceOperatorGroups_dbo.OperatorGroups_OperatorGroupId]
    GO
    ALTER TABLE [dbo].[ServiceOperatorGroups] WITH CHECK ADD CONSTRAINT [FK_dbo.ServiceOperatorGroups_dbo.Services_ServiceId] FOREIGN KEY([ServiceId])
    REFERENCES [dbo].[Services] ([Id])
    ON DELETE CASCADE
    GO
    ALTER TABLE [dbo].[ServiceOperatorGroups] CHECK CONSTRAINT [FK_dbo.ServiceOperatorGroups_dbo.Services_ServiceId]
    GO
    ALTER TABLE [dbo].[ServiceOperators] WITH CHECK ADD CONSTRAINT [FK_dbo.ServiceOperators_dbo.Services_ServiceId] FOREIGN KEY([ServiceId])
    REFERENCES [dbo].[Services] ([Id])
    ON DELETE CASCADE
    GO
    ALTER TABLE [dbo].[ServiceOperators] CHECK CONSTRAINT [FK_dbo.ServiceOperators_dbo.Services_ServiceId]
    GO
    ALTER TABLE [dbo].[Services] WITH CHECK ADD CONSTRAINT [FK_dbo.Services_dbo.Services_ParentId] FOREIGN KEY([ParentId])
    REFERENCES [dbo].[Services] ([Id])
    GO
    ALTER TABLE [dbo].[Services] CHECK CONSTRAINT [FK_dbo.Services_dbo.Services_ParentId]
    GO
    ALTER TABLE [dbo].[TicketInvitations] WITH CHECK ADD CONSTRAINT [FK_dbo.TicketInvitations_dbo.Tickets_TicketId] FOREIGN KEY([TicketId])
    REFERENCES [dbo].[Tickets] ([Id])
    ON DELETE CASCADE
    GO
    ALTER TABLE [dbo].[TicketInvitations] CHECK CONSTRAINT [FK_dbo.TicketInvitations_dbo.Tickets_TicketId]
    GO
    ALTER TABLE [dbo].[Tickets] WITH CHECK ADD CONSTRAINT [FK_dbo.Tickets_dbo.Customers_CustomerId] FOREIGN KEY([CustomerId])
    REFERENCES [dbo].[Customers] ([Id])
    GO
    ALTER TABLE [dbo].[Tickets] CHECK CONSTRAINT [FK_dbo.Tickets_dbo.Customers_CustomerId]
    GO
    ALTER TABLE [dbo].[Tickets] WITH CHECK ADD CONSTRAINT [FK_dbo.Tickets_dbo.ServiceMailboxes_ServiceMailboxId] FOREIGN KEY([ServiceMailboxId])
    REFERENCES [dbo].[ServiceMailboxes] ([Id])
    GO
    ALTER TABLE [dbo].[Tickets] CHECK CONSTRAINT [FK_dbo.Tickets_dbo.ServiceMailboxes_ServiceMailboxId]
    GO
    ALTER TABLE [dbo].[Tickets] WITH CHECK ADD CONSTRAINT [FK_dbo.Tickets_dbo.Services_ServiceId] FOREIGN KEY([ServiceId])
    REFERENCES [dbo].[Services] ([Id])
    GO
    ALTER TABLE [dbo].[Tickets] CHECK CONSTRAINT [FK_dbo.Tickets_dbo.Services_ServiceId]
    GO
    ALTER TABLE [dbo].[Tickets] WITH CHECK ADD CONSTRAINT [FK_dbo.Tickets_dbo.Tickets_ParentId] FOREIGN KEY([ParentId])
    REFERENCES [dbo].[Tickets] ([Id])
    GO
    ALTER TABLE [dbo].[Tickets] CHECK CONSTRAINT [FK_dbo.Tickets_dbo.Tickets_ParentId]
    GO

  • Change Log issues - Post Upgrade

    Hi Experts,
    We are in the process of Upgrading BW from 3.X to BI 7. As part of this we copied our existing Production system into the sand box and basis did the technical upgrade on the same (Sand Box). Later we ran some post upgrade Jobs as part of the SAP defined Upgrade Process.
    1) But after the upgrade i can notice that most of the ODS objects, doesn't have 'Change Log' table in the 'Information (Log/Status)' screen.
    2) Even when i try to view the change log content in Manage screen, it gives me a pop up to enter the change log table, instead of directly taking me to the selection screen.
    3) When i try to activate a request, even that fails with an SQL error 'SAPSQL_EMPTY_TABNAME'.
    Is there any process that has to be run to link the Older version change log tables to the corresponding ODSs after Upgrade?
    Has anyone come accross similar issues? If yes, how was it solved? All suggestions are invited.
    Thanks and Regards,
    Jay

    HI JayaPrasad,
    Chek the note : 1059171 which is related to Change log,
    I too faced this issue when upgraded to Bi7.0 on SP12, but as soon as SP13 is installed the issue is solved, so I suggest to go for SP 13 for upgrading to Bi7.0.
    Regards,
    Srinivas

  • Performance issue while wrapping the sql in pl/sql block

    Hi All,
    I am facing performance issue in a query while wrapping the sql in pl/sql block.
    I have a complex view. while quering the view using
    Select * from v_csp_tabs(Name of View I am using), it is taking 10 second to fetch 50,000 records.
    But when I am using some conditions on the view, Like
    Select * from v_csp_tabs where clientid = 500006 and programid = 1 and vendorid = 1, it is taking more then 250 secs. to return the result set.
    now the weird part is this is happening only for one programID, that is 1
    I am using Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    Any one please suggest what are the things i need to check..
    I am sorry, I could not provide you the explain plan, because this is in production and I do not have enough prevelage.
    Thank you in advance.
    Thnx,
    Bits

    Bits wrote:
    I have a complex view. while quering the view using
    Select * from v_csp_tabs(Name of View I am using), it is taking 10 second to fetch 50,000 records.
    But when I am using some conditions on the view, Like
    Select * from v_csp_tabs where clientid = 500006 and programid = 1 and vendorid = 1, it is taking more then 250 secs. to return the result set.That's one problem with views - you never know how they will be used in the future, nor what performance implications variant uses can have.
    >
    now the weird part is this is happening only for one programID, that is 1
    Any one please suggest what are the things i need to check..
    I am sorry, I could not provide you the explain plan, because this is in production and I do not have enough prevelage.I understand what you are saying - I have worked at similar sites. HiddenName is correct in suggesting that you need to get execution plans but sometimes getting privileges from the DBA group is simply Not Going To Happen. Its wrong but that's the way it is. Follow through on HiddenName's suggested to get help from somebody who has the privleges needed
    Post the query that view view is executing. Desk checking a query is NOT ideal but is one thing we can do.
    I don't suppose you can see V$ views on production - V$SQL and V$SQL_PLAN (probably not if you can't generate plans, but its worth a thought)

  • DB Performance Issues after 10g Upgrade in EBS Instance

    We have upgraded our Database from 9i to 10g as first part of EBS 11.5.9 to 11.5.10.2 upgrade. Currently our production is running on 11.5.9 apps with 10g DB.
    Facing performance problems now. one of the them is, one Valueset query not using funcion based index while fired from the front end. but the same query when collected from SQL trace tkprofed file and executed from SQL Plus, it uses all proper indexes. We are not getting the cause of this.
    Had anyone faced same kind of issues before. please suggest.
    thanks,
    Raj.

    Make sure you have all of the recommended performance patches for 11.5.9, and gather stats for SYS and SYSTEM in the following manner:
    Oracle E-Business Suite Recommended Performance Patches
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=244040.1
    Collecting Statistics with Oracle Apps 11i
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=368252.1
    execute dbms_stats.unlock_schema_stats('SYS');
    execute dbms_stats.unlock_schema_stats('SYSTEM');
    exec dbms_stats.gather_schema_stats('SYSTEM',options=>'GATHER', estimate_percent => 100, method_opt => 'FOR ALL COLUMNS SIZE AUTO', cascade => TRUE);
    exec dbms_stats.gather_schema_stats('SYS',options=>'GATHER', estimate_percent => 100, method_opt => 'FOR ALL COLUMNS SIZE AUTO', cascade => TRUE);
    exec dbms_stats.gather_fixed_objects_stats();
    commit;
    exec dbms_stats.DELETE_TABLE_STATS('SYS','X$KCCRSR');
    exec dbms_stats.LOCK_TABLE_STATS('SYS','X$KCCRSR');
    commit;
    The last 3 commands resolve problems with RMAN, in case you are using it.
    Rman Backup is Very Slow selecting from V$RMAN_STATUS
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=375386.1
    Poor performance when accessing V$RMAN_BACKUP_JOB_DETAILS
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=420200.1
    Troubleshooting Oracle Applications Performance Issues
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=169935.1
    Debugging General Performance Issues with Oracle Apps
    http://blogs.oracle.com/schan/newsItems/departments/optimizingPerformance/2007/05/18#a1548
    Performance Tuning the Apps Database Layer
    http://blogs.oracle.com/schan/newsItems/departments/optimizingPerformance/2007/05/17#a1562
    Preventing Apps 11i Performance Issues in Four Steps
    http://blogs.oracle.com/schan/newsItems/departments/optimizingPerformance/2007/05/21#a1566

  • Performance issue with Crystal when upgrading Oracle to 11g

    Dear,
    I am facing performance issue in crystal report and oracle 11g as below:
    In ther report server, I have created a ODBC for connect to another Oracle 11g server. also in report server I have created and published a folder to content all of my crystal report. These report can connect to oracle 11g server via ODBC.
    and I have a tomcat server to run my application in my application I refer to report folder in report server.
    This way can work with SQL server and oracle 9 or 10g but it facing performance issue in oracle 11g.
    please let me know the root cause.
    Notes: report server, tomcate server are win 32bit, but oracle is in win 64bit, and i have upgraded DataDirect connect ODBC version 6.1 but the issue can not resolve.
    Please help me to solve it.
    Thanks so much,
    Anh

    Hi Anh,
    Use a third party ODBC test tool now. SQL Plus will be using the Native Oracle client so you can't compare performance.
    Download our old tool called SQLCON: https://smpdl.sap-ag.de/~sapidp/012002523100006252882008E/sqlcon32.zip
    Connect and then click on the SQL tab and paste in the SQL from the report and time that test.
    I believe the issue is because the Oracle client is 64 bit, you should install the 32 bit Oracle Client. If using the 64 bit client then the client must thunk ( convert 64 bit data to 32 bit data format ) which is going to take more time.
    If you can use OLE DB or using the Oracle Server driver ( native driver ) should be faster. ODBC puts another layer on top of the Oracle client so it too takes time to communicate between the layers.
    Thank you
    Don

Maybe you are looking for

  • Problem printing to OKI - error msg = "filter" failed

    Okidata usually updates drivers for Mac OS upgrades but does not have one for Yosemite (yet? I hope?). The error message on the printer reads: "filter" failed. I've never seen that before. Anyone know what this means and/or how to work around it? Sam

  • Cannot Copy and/or Paste?

    Hey, I have Leopard and I can no longer copy or paste. This happened in the past 24 hours, no changes have been made that I am aware of. Even with the mouse I cannot copy and paste. Any help or ideas would be geatly appreciated. I also cannot drag an

  • Strange looking Safari and crashes?

    Hey there, I have recently had some real stability issues with Safari. It often hangs (with the Beach Ball of Doom) for around 2 minutes when scrolling, and often crashes. Another problem I have is that when scrolling, very often that not the text an

  • Unable to sync files to creative cloud

    I cant sync my files to creative cloud from my mac. It says syncronising is turned of, but i havent turned any thing of ?

  • "An internal error has occurred" error when exiting

    hey Adobe you've got a bug in your updater... read here: http://www.adobeforums.com/webx/.3c06325e/0 I also experience this weird "An internal error has occurred" when quitting Acrobat 8.1.2 its there since the very minute i updated from 8.1... now i