Oracle9 - Oracle 10: Same SQL different records
We want to migrate from "Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production" to "Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi" but there are some problems with Sql-statements that are being used.
In oracle9 the SQL-statement below is not giving any records back which is what I want but in Oracle10 I am getting lots of records back.
Is there an explaination for this? In the real situation the '100' and the '' in the decodes are actually parameters which are passed.
select distinct p.plate_id
from lims_sys.aliquot a,lims_sys.sample sa,lims_sys.sdg sd,lims_sys.plate p
where sd.sdg_id = sa.sdg_id
and sa.sample_id = a.sample_id
and a.plate_id = p.plate_id
and
sd.name = DECODE('100','',sd.name ,'100')
or sd.name = DECODE('','',sd.name ,'')
I can not see what is causing the difference.
Oracle9
SQL Statement which produced this data:
select * from table(dbms_xplan.display)
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes | Cost |
| 0 | SELECT STATEMENT | | 1009 | 29261 | 1725 |
| 1 | SORT UNIQUE | | 1009 | 29261 | 1725 |
|* 2 | FILTER | | | | |
|* 3 | HASH JOIN | | 1009 | 29261 | 1718 |
|* 4 | TABLE ACCESS BY INDEX ROWID | ALIQUOT | 2 | 16 | 3 |
| 5 | NESTED LOOPS | | 1009 | 24216 | 1703 |
| 6 | NESTED LOOPS | | 561 | 8976 | 20 |
| 7 | TABLE ACCESS BY INDEX ROWID | SDG | 2 | 16 | 3 |
| 8 | BITMAP CONVERSION TO ROWIDS | | | | |
| 9 | BITMAP OR | | | | |
| 10 | BITMAP CONVERSION FROM ROWIDS| | | | |
|* 11 | INDEX RANGE SCAN | AK_SDG_NAME | | | 1 |
| 12 | BITMAP CONVERSION FROM ROWIDS| | | | |
|* 13 | INDEX RANGE SCAN | AK_SDG_NAME | | | 1 |
| 14 | TABLE ACCESS BY INDEX ROWID | SAMPLE | 697K| 5448K| 8 |
|* 15 | INDEX RANGE SCAN | FK_SAMPLE_SDG | 281 | | 2 |
|* 16 | INDEX RANGE SCAN | FK_ALIQUOT_SAMPLE | 3 | | 2 |
| 17 | TABLE ACCESS FULL | PLATE | 11695 | 58475 | 14 |
|* 18 | INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1 | 5 | |
|* 19 | INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1 | 5 | |
|* 20 | INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1 | 5 | |
|* 21 | INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1 | 5 | |
Predicate Information (identified by operation id):
2 - filter(("SYS_ALIAS_1"."GROUP_ID" IS NULL OR EXISTS (SELECT /*+ */ 0 FROM "LIMS"."O
PERATOR_GROUP" "OPERATOR_GROUP" WHERE "OPERATOR_GROUP"."OPERATOR_ID"="LIMS".
"LIMS_OPERATOR"() AND "OPERATOR_GROUP"."GROUP_ID"=:B1)) AND ("SYS_ALIAS_2"."
GROUP_ID" IS NULL OR EXISTS (SELECT /*+ */ 0 FROM "LIMS"."OPERATOR_GROUP" "
OPERATOR_GROUP" WHERE "OPERATOR_GROUP"."OPERATOR_ID"="LIMS"."LIMS_OPERATOR"(
) AND "OPERATOR_GROUP"."GROUP_ID"=:B2)) AND ("SYS_ALIAS_3"."GROUP_ID" IS NUL
L OR EXISTS (SELECT /*+ */ 0 FROM "LIMS"."OPERATOR_GROUP" "OPERATOR_GROUP"
WHERE "OPERATOR_GROUP"."OPERATOR_ID"="LIMS"."LIMS_OPERATOR"() AND "OPERATOR_
GROUP"."GROUP_ID"=:B3)) AND ("SYS_ALIAS_4"."GROUP_ID" IS NULL OR EXISTS (SE
LECT /*+ */ 0 FROM "LIMS"."OPERATOR_GROUP" "OPERATOR_GROUP" WHERE "OPERATOR_
GROUP"."OPERATOR_ID"="LIMS"."LIMS_OPERATOR"() AND "OPERATOR_GROUP"."GROUP_ID
"=:B4)))
3 - access("SYS_ALIAS_4"."PLATE_ID"="SYS_ALIAS_1"."PLATE_ID")
4 - filter("SYS_ALIAS_4"."PLATE_ID" IS NOT NULL)
11 - access("SYS_ALIAS_2"."NAME"='100')
13 - access("SYS_ALIAS_2"."NAME"='')
15 - access("SYS_ALIAS_2"."SDG_ID"="SYS_ALIAS_3"."SDG_ID")
16 - access("SYS_ALIAS_3"."SAMPLE_ID"="SYS_ALIAS_4"."SAMPLE_ID")
18 - access("OPERATOR_GROUP"."GROUP_ID"=:B1 AND "OPERATOR_GROUP"."OPERATOR_ID"="LIMS"."L
IMS_OPERATOR"())
19 - access("OPERATOR_GROUP"."GROUP_ID"=:B1 AND "OPERATOR_GROUP"."OPERATOR_ID"="LIMS"."L
IMS_OPERATOR"())
20 - access("OPERATOR_GROUP"."GROUP_ID"=:B1 AND "OPERATOR_GROUP"."OPERATOR_ID"="LIMS"."L
IMS_OPERATOR"())
21 - access("OPERATOR_GROUP"."GROUP_ID"=:B1 AND "OPERATOR_GROUP"."OPERATOR_ID"="LIMS"."L
IMS_OPERATOR"())
Note: cpu costing is off
[pre/]
Oracle10
[pre]
SQL Statement which produced this data:
select * from table(dbms_xplan.display)
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)|
| 0 | SELECT STATEMENT | | 10932 | 896K| | 23913 (2)|
| 1 | HASH UNIQUE | | 10932 | 896K| 105M| 23913 (2)|
|* 2 | FILTER | | | | | |
|* 3 | HASH JOIN | | 1186K| 95M| | 15669 (2)|
| 4 | TABLE ACCESS FULL | PLATE | 11071 | 194K| | 55 (0)|
|* 5 | HASH JOIN | | 1186K| 74M| | 15607 (2)|
|* 6 | TABLE ACCESS FULL | SDG | 2386 | 52492 | | 11 (0)|
|* 7 | HASH JOIN | | 1186K| 49M| 21M| 15589 (2)|
| 8 | TABLE ACCESS FULL| SAMPLE | 675K| 14M| | 3566 (1)|
|* 9 | TABLE ACCESS FULL| ALIQUOT | 1173K| 24M| | 9031 (2)|
|* 10 | INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1 | 7 | | 0 (0)|
|* 11 | INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1 | 7 | | 0 (0)|
|* 12 | INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1 | 7 | | 0 (0)|
|* 13 | INDEX UNIQUE SCAN | PK_OPERATOR_GROUP | 1 | 7 | | 0 (0)|
Predicate Information (identified by operation id):
2 - filter(("GROUP_ID" IS NULL OR EXISTS (SELECT /*+ */ 0 FROM
"LIMS"."OPERATOR_GROUP" "OPERATOR_GROUP" WHERE
"OPERATOR_ID"="LIMS$OPERATOR_ID"() AND "GROUP_ID"=:B1)) AND ("GROUP_ID" IS NULL
OR EXISTS (SELECT /*+ */ 0 FROM "LIMS"."OPERATOR_GROUP" "OPERATOR_GROUP" WHERE
"OPERATOR_ID"="LIMS$OPERATOR_ID"() AND "GROUP_ID"=:B2)) AND ("GROUP_ID" IS NULL
OR EXISTS (SELECT /*+ */ 0 FROM "LIMS"."OPERATOR_GROUP" "OPERATOR_GROUP" WHERE
"OPERATOR_ID"="LIMS$OPERATOR_ID"() AND "GROUP_ID"=:B3)) AND ("GROUP_ID" IS NULL
OR EXISTS (SELECT /*+ */ 0 FROM "LIMS"."OPERATOR_GROUP" "OPERATOR_GROUP" WHERE
"OPERATOR_ID"="LIMS$OPERATOR_ID"() AND "GROUP_ID"=:B4)))
3 - access("PLATE_ID"="PLATE_ID")
5 - access("SDG_ID"="SDG_ID")
6 - filter("NAME" IS NOT NULL OR "NAME"='100')
7 - access("SAMPLE_ID"="SAMPLE_ID")
9 - filter("PLATE_ID" IS NOT NULL)
10 - access("GROUP_ID"=:B1 AND "OPERATOR_ID"="LIMS$OPERATOR_ID"())
11 - access("GROUP_ID"=:B1 AND "OPERATOR_ID"="LIMS$OPERATOR_ID"())
12 - access("GROUP_ID"=:B1 AND "OPERATOR_ID"="LIMS$OPERATOR_ID"())
13 - access("GROUP_ID"=:B1 AND "OPERATOR_ID"="LIMS$OPERATOR_ID"())
Note
- 'PLAN_TABLE' is old version
[pre/]
Similar Messages
-
Same SQLs different in two versions of Oracle 12c RDF Developer's Guide
There are two versions of Oracle 12c RDF Developer's Guide, one has the SQL insert as
INSERT INTO articles_rdf_data VALUES (2,
SDO_RDF_TRIPLE_S ('articles','http://nature.example.com/Article1',
'http://purl.org/dc/elements/1.1/creator',
'Jane Smith'));
the other one has the change highlighted:
INSERT INTO articles_rdf_data VALUES (2,
SDO_RDF_TRIPLE_S ('articles','<http://nature.example.com/Article1>',
'<http://purl.org/dc/elements/1.1/creator>',
'"Jane Smith"'));
Which one is correct?
Thanks.The second one is correct. It is from the latest version of the user guide.
http://docs.oracle.com/cd/E16655_01/appdev.121/e17895/toc.htm
Thanks,
Matt -
Different execution plans for the same sql
Hi,
Im testing our new 10gR2 database on Linux and I can't understand why the same query use different plan.
Here are the details.
Table name: invoice_detail
Records: About 10,670,900
Columns:
No
seq (the primary key is No+Seq). Each invoices contains +/- 10 invoice_details.
category ( <- 10 different values )
State ( <- 3 different values )
Basically, I have an index on the primary key and another index on Category + State.
My request:
select *
from invoice_detail
where no=123456 <- Best index to use
and state <> 'CANCEL'
and category = 'INVOICE'
If i run this query from Toad or sql+, that's fine.
The same query (i'm watching it from EM) executed via Forms use the category+state index.
When I first import the database, the last thing I do is to run DBMS_STATS.GATHER_DATABASE_STATS.
At this point, Forms use the right index.
The day after (after the database has been analyzed with the predefined job via EM) Forms use the wrong index.
I re-analyzed everything with exec DBMS_STATS.GATHER_DATABASE_STATS but the problem is still there.
Thanks in advanceI'm already using bind variables.
I changed the "Estimated Percentage" to 100% in "Gather Optimizer Statistics Default Options" and now it seems to use the correct index. I'm stressed because I dont understand why it chooses different plan for the same sql.
Actually, my users test the migration 1 day after I load all the data (drop schema-create schema-load data-analyze database) and at this point everythings go fine. After the second analyze of the database, the DB choose the wrong indexes.
I really cannot migrate until I understand why it happens.
Any ideas?
TIA -
Using Same sql file in different database
Hi ,
I need to use same sql file which contains table ddl for sybase as well as oracle .
here If the db is sybase should run sybase ddl only and visa-ver.
Please help
RegardsIts already there, but you have any though on same file please write.My thoughts is that it sounds like a bad idea. Do you have a particular reason for wanting this in a single file?
-
Oracle dblink to sql server, accessing multiple database on same sql server under one dblink
Hi, we have successfully managed to set up an Oracle dblink over to sql server and retrieve data.
The sql server user were using via the dblink has access to more than one database on the same sql server
But the question is how in oracle (if at all possible) do you prefix the sql statement to access this ?
Eg:
Sqlserver_prod has user sqlserver_user which appears to be set up as default database on sqlserver_db1
But we have select access to sqlserver_db2
all work fine as sqlserver_user
select * from table_fromdb1
select * from dbo.table_fromdb1
select * from sqlserver_db1.dbo.table_fromdb1
as does
select * from sqlserver_db2.dbo.table_fromdb2
over in Oracle
Oracle_db has dblink sqlserver_prod.world connecting as sqlserver_user
all working fine
select * from "table_fromdb1"@sqlserver_prod
select * from "dbo"."table_fromdb1"@sqlserver_prod
but how (if at all possible) do I access from oracle
sqlserver_db2.dbo.table_fromdb2
without having to create a new sqlserver_db2_user referenced in a new dblink
if oracle to oracle would be
select * from remote_oracle_schema.table@remote_oracle_dbHi, ok cheers, I see, original gateway was connecting purely at host_name level
HS_FDS_CONNECT_INFO=sqlserver_host
Planning to amend this to be
HS_FDS_CONNECT_INFO=sqlserver_host//sqlserver_db1
With exisiting dblink
And to create new gateway
HS_FDS_CONNECT_INFO=sqlserver_host//sqlserver_db2
With new exisitng dblink,will see how we get on
Cheers again -
Different 'execution plans' for same sql in 10R2
DB=10.2.0.5
OS=RHEL 3
Im not sure of this, but seeing different plans for same SQL.
select sql_text from v$sqlarea where sql_id='92mb4z83fg4st'; <---TOP SQL from AWR
SELECT /*+ OPAQUE_TRANSFORM */ "ENDUSERID","LASTLOGINATTEMPTTIMESTAMP","LOGINSOURCECD","LOGINSUCCESSFLG",
"ENDUSERLOGINATTEMPTHISTORYID","VERSION_NUM","CREATEDATE"
FROM "BOMB"."ENDUSERLOGINATTEMPTHISTORY" "ENDUSERLOGINATTEMPTHISTORY";
SQL> set autotrace traceonly
SQL> SELECT /*+ OPAQUE_TRANSFORM */ "ENDUSERID","LASTLOGINATTEMPTTIMESTAMP","LOGINSOURCECD","LOGINSUCCESSFLG",
"ENDUSERLOGINATTEMPTHISTORYID","VERSION_NUM","CREATEDATE"
FROM "BOMB"."ENDUSERLOGINATTEMPTHISTORY" "ENDUSERLOGINATTEMPTHISTORY"; 2 3
1822203 rows selected.
Execution Plan
Plan hash value: 568996432
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1803K| 75M| 2919 (2)| 00:00:36 |
| 1 | TABLE ACCESS FULL| ENDUSERLOGINATTEMPTHISTORY | 1803K| 75M| 2919 (2)| 00:00:36 |
Statistics
0 recursive calls
0 db block gets
133793 consistent gets
0 physical reads
0 redo size
76637183 bytes sent via SQL*Net to client
1336772 bytes received via SQL*Net from client
121482 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1822203 rows processed
===================================== another plan ===============
SQL> select * from TABLE(dbms_xplan.display_awr('92mb4z83fg4st'));
15 rows selected.
Execution Plan
Plan hash value: 3015018810
| Id | Operation | Name |
| 0 | SELECT STATEMENT | |
| 1 | COLLECTION ITERATOR PICKLER FETCH| DISPLAY_AWR |
Note
- rule based optimizer used (consider using cbo)
Statistics
24 recursive calls
24 db block gets
49 consistent gets
0 physical reads
0 redo size
1529 bytes sent via SQL*Net to client
492 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
15 rows processed
=========second one shows only 15 rows...
Which one is correct ?Understood, second plan is for self 'dbms_xplan'.
Anyhow I opened a new session where I did NOT on 'auto-trace'. but plan is somewhat than the original.
SQL> /
PLAN_TABLE_OUTPUT
SQL_ID 92mb4z83fg4st
SELECT /*+ OPAQUE_TRANSFORM */ "ENDUSERID","LASTLOGINATTEMPTTIMESTAMP","LOGINSOURCECD","
LOGINSUCCESSFLG","ENDUSERLOGINATTEMPTHISTORYID","VERSION_NUM","CREATEDATE" FROM
"BOMB"."ENDUSERLOGINATTEMPTHISTORY" "ENDUSERLOGINATTEMPTHISTORY"
Plan hash value: 568996432
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
PLAN_TABLE_OUTPUT
| 0 | SELECT STATEMENT | | | | 2919 (100)| |
| 1 | TABLE ACCESS FULL| ENDUSERLOGINATTEMPTHISTORY | 1803K| 75M| 2919 (2)| 00:00:36 |
15 rows selected.
I am just wondering, which plan is the accurate and which I need to believe ? -
How to compare same SQL query performance in different DB servers.
We have Production and Validation Environment of Oracle11g DB on two Solaris OSs.
H/W and DB,etc configurations of two Oracle DBs are almost same in PROD and VAL.
But we detected large SQL query performace difference in PROD DB and VAL DB in same SQL query.
I would like to find and solve the cause of this situation.
How could I do that ?
I plan to compare SQL execution plan in PROD and VAL DB and index fragmentations.
Before that I thought I need to keep same condition of DB statistics information in PROD and VAL DB.
So, I plan to execute alter system FLUSH BUFFER_CACHE;
But I am worring about bad effects of alter system FLUSH BUFFER_CACHE; to end users
If we did alter system FLUSH BUFFER_CACHE; and got execution plan of that SQL query in the time end users do not use that system ,
there is not large bad effect to end users after those operations?
Could you please let me know the recomendation to compare SQL query performace ?Thank you.
I got AWR report for only VAL DB server but it looks strange.
Is there any thing wrong in DB or how to get AWR report ?
Host Name
Platform
CPUs
Cores
Sockets
Memory (GB)
xxxx
Solaris[tm] OE (64-bit)
.00
Snap Id
Snap Time
Sessions
Cursors/Session
Begin Snap:
xxxx
13-Apr-15 04:00:04
End Snap:
xxxx
14-Apr-15 04:00:22
Elapsed:
1,440.30 (mins)
DB Time:
0.00 (mins)
Report Summary
Cache Sizes
Begin
End
Buffer Cache:
M
M
Std Block Size:
K
Shared Pool Size:
0M
0M
Log Buffer:
K
Load Profile
Per Second
Per Transaction
Per Exec
Per Call
DB Time(s):
0.0
0.0
0.00
0.00
DB CPU(s):
0.0
0.0
0.00
0.00
Redo size:
Logical reads:
0.0
1.0
Block changes:
0.0
1.0
Physical reads:
0.0
1.0
Physical writes:
0.0
1.0
User calls:
0.0
1.0
Parses:
0.0
1.0
Hard parses:
W/A MB processed:
16.7
1,442,472.0
Logons:
Executes:
0.0
1.0
Rollbacks:
Transactions:
0.0
Instance Efficiency Percentages (Target 100%)
Buffer Nowait %:
Redo NoWait %:
Buffer Hit %:
In-memory Sort %:
Library Hit %:
96.69
Soft Parse %:
Execute to Parse %:
0.00
Latch Hit %:
Parse CPU to Parse Elapsd %:
% Non-Parse CPU:
Shared Pool Statistics
Begin
End
Memory Usage %:
% SQL with executions>1:
34.82
48.31
% Memory for SQL w/exec>1:
63.66
73.05
Top 5 Timed Foreground Events
Event
Waits
Time(s)
Avg wait (ms)
% DB time
Wait Class
DB CPU
0
100.00
Host CPU (CPUs: Cores: Sockets: )
Load Average Begin
Load Average End
%User
%System
%WIO
%Idle
Instance CPU
%Total CPU
%Busy CPU
%DB time waiting for CPU (Resource Manager)
Memory Statistics
Begin
End
Host Mem (MB):
SGA use (MB):
46,336.0
46,336.0
PGA use (MB):
713.6
662.6
% Host Mem used for SGA+PGA:
Time Model Statistics
No data exists for this section of the report.
Back to Wait Events Statistics
Back to Top
Operating System Statistics
No data exists for this section of the report.
Back to Wait Events Statistics
Back to Top
Operating System Statistics - Detail
No data exists for this section of the report.
Back to Wait Events Statistics
Back to Top
Foreground Wait Class
s - second, ms - millisecond - 1000th of a second
ordered by wait time desc, waits desc
%Timeouts: value of 0 indicates value was < .5%. Value of null is truly 0
Captured Time accounts for % of Total DB time .00 (s)
Total FG Wait Time: (s) DB CPU time: .00 (s)
Wait Class
Waits
%Time -outs
Total Wait Time (s)
Avg wait (ms)
%DB time
DB CPU
0
100.00
Back to Wait Events Statistics
Back to Top
Foreground Wait Events
No data exists for this section of the report.
Back to Wait Events Statistics
Back to Top
Background Wait Events
ordered by wait time desc, waits desc (idle events last)
Only events with Total Wait Time (s) >= .001 are shown
%Timeouts: value of 0 indicates value was < .5%. Value of null is truly 0
Event
Waits
%Time -outs
Total Wait Time (s)
Avg wait (ms)
Waits /txn
% bg time
log file parallel write
527,034
0
2,209
4
527,034.00
db file parallel write
381,966
0
249
1
381,966.00
os thread startup
2,650
0
151
57
2,650.00
latch: messages
125,526
0
89
1
125,526.00
control file sequential read
148,662
0
54
0
148,662.00
control file parallel write
41,935
0
28
1
41,935.00
Log archive I/O
5,070
0
14
3
5,070.00
Disk file operations I/O
8,091
0
10
1
8,091.00
log file sequential read
3,024
0
6
2
3,024.00
db file sequential read
1,299
0
2
2
1,299.00
latch: shared pool
722
0
1
1
722.00
enq: CF - contention
4
0
1
208
4.00
reliable message
1,316
0
1
1
1,316.00
log file sync
71
0
1
9
71.00
enq: CR - block range reuse ckpt
36
0
0
13
36.00
enq: JS - queue lock
459
0
0
1
459.00
log file single write
414
0
0
1
414.00
enq: PR - contention
5
0
0
57
5.00
asynch descriptor resize
67,076
100
0
0
67,076.00
LGWR wait for redo copy
5,184
0
0
0
5,184.00
rdbms ipc reply
1,234
0
0
0
1,234.00
ADR block file read
384
0
0
0
384.00
SQL*Net message to client
189,490
0
0
0
189,490.00
latch free
559
0
0
0
559.00
db file scattered read
17
0
0
6
17.00
resmgr:internal state change
1
100
0
100
1.00
direct path read
301
0
0
0
301.00
enq: RO - fast object reuse
35
0
0
2
35.00
direct path write
122
0
0
1
122.00
latch: cache buffers chains
260
0
0
0
260.00
db file parallel read
1
0
0
41
1.00
ADR file lock
144
0
0
0
144.00
latch: redo writing
55
0
0
1
55.00
ADR block file write
120
0
0
0
120.00
wait list latch free
2
0
0
10
2.00
latch: cache buffers lru chain
44
0
0
0
44.00
buffer busy waits
3
0
0
2
3.00
latch: call allocation
57
0
0
0
57.00
SQL*Net more data to client
55
0
0
0
55.00
ARCH wait for archivelog lock
78
0
0
0
78.00
rdbms ipc message
3,157,653
40
4,058,370
1285
3,157,653.00
Streams AQ: qmn slave idle wait
11,826
0
172,828
14614
11,826.00
DIAG idle wait
170,978
100
172,681
1010
170,978.00
dispatcher timer
1,440
100
86,417
60012
1,440.00
Streams AQ: qmn coordinator idle wait
6,479
48
86,413
13337
6,479.00
shared server idle wait
2,879
100
86,401
30011
2,879.00
Space Manager: slave idle wait
17,258
100
86,324
5002
17,258.00
pmon timer
46,489
62
86,252
1855
46,489.00
smon timer
361
66
86,145
238628
361.00
VKRM Idle
1
0
14,401
14400820
1.00
SQL*Net message from client
253,909
0
419
2
253,909.00
class slave wait
379
0
0
0
379.00
Back to Wait Events Statistics
Back to Top
Wait Event Histogram
No data exists for this section of the report.
Back to Wait Events Statistics
Back to Top
Wait Event Histogram Detail (64 msec to 2 sec)
No data exists for this section of the report.
Back to Wait Events Statistics
Back to Top
Wait Event Histogram Detail (4 sec to 2 min)
No data exists for this section of the report.
Back to Wait Events Statistics
Back to Top
Wait Event Histogram Detail (4 min to 1 hr)
No data exists for this section of the report.
Back to Wait Events Statistics
Back to Top
Service Statistics
No data exists for this section of the report.
Back to Wait Events Statistics
Back to Top
Service Wait Class Stats
No data exists for this section of the report.
Back to Wait Events Statistics
Back to Top
SQL Statistics
SQL ordered by Elapsed Time
SQL ordered by CPU Time
SQL ordered by User I/O Wait Time
SQL ordered by Gets
SQL ordered by Reads
SQL ordered by Physical Reads (UnOptimized)
SQL ordered by Executions
SQL ordered by Parse Calls
SQL ordered by Sharable Memory
SQL ordered by Version Count
Complete List of SQL Text
Back to Top
SQL ordered by Elapsed Time
No data exists for this section of the report.
Back to SQL Statistics
Back to Top
SQL ordered by CPU Time
No data exists for this section of the report.
Back to SQL Statistics
Back to Top
SQL ordered by User I/O Wait Time
No data exists for this section of the report.
Back to SQL Statistics
Back to Top
SQL ordered by Gets
No data exists for this section of the report.
Back to SQL Statistics
Back to Top
SQL ordered by Reads
No data exists for this section of the report.
Back to SQL Statistics
Back to Top
SQL ordered by Physical Reads (UnOptimized)
No data exists for this section of the report.
Back to SQL Statistics
Back to Top
SQL ordered by Executions
No data exists for this section of the report.
Back to SQL Statistics
Back to Top
SQL ordered by Parse Calls
No data exists for this section of the report.
Back to SQL Statistics
Back to Top
SQL ordered by Sharable Memory
No data exists for this section of the report.
Back to SQL Statistics
Back to Top
SQL ordered by Version Count
No data exists for this section of the report.
Back to SQL Statistics
Back to Top
Complete List of SQL Text
No data exists for this section of the report.
Back to SQL Statistics
Back to Top
Instance Activity Statistics
Instance Activity Stats
Instance Activity Stats - Absolute Values
Instance Activity Stats - Thread Activity
Back to Top
Instance Activity Stats
No data exists for this section of the report.
Back to Instance Activity Statistics
Back to Top
Instance Activity Stats - Absolute Values
No data exists for this section of the report.
Back to Instance Activity Statistics
Back to Top
Instance Activity Stats - Thread Activity
Statistics identified by '(derived)' come from sources other than SYSSTAT
Statistic
Total
per Hour
log switches (derived)
69
2.87
Back to Instance Activity Statistics
Back to Top
IO Stats
IOStat by Function summary
IOStat by Filetype summary
IOStat by Function/Filetype summary
Tablespace IO Stats
File IO Stats
Back to Top
IOStat by Function summary
'Data' columns suffixed with M,G,T,P are in multiples of 1024 other columns suffixed with K,M,G,T,P are in multiples of 1000
ordered by (Data Read + Write) desc
Function Name
Reads: Data
Reqs per sec
Data per sec
Writes: Data
Reqs per sec
Data per sec
Waits: Count
Avg Tm(ms)
Others
28.8G
20.55
.340727
16.7G
2.65
.198442
1803K
0.01
Direct Reads
43.6G
57.09
.517021
411M
0.59
.004755
0
LGWR
19M
0.02
.000219
41.9G
21.87
.496493
2760
0.08
Direct Writes
16M
0.00
.000185
8.9G
1.77
.105927
0
DBWR
0M
0.00
0M
6.7G
4.42
.079670
0
Buffer Cache Reads
3.1G
3.67
.037318
0M
0.00
0M
260.1K
3.96
TOTAL:
75.6G
81.33
.895473
74.7G
31.31
.885290
2065.8K
0.51
Back to IO Stats
Back to Top
IOStat by Filetype summary
'Data' columns suffixed with M,G,T,P are in multiples of 1024 other columns suffixed with K,M,G,T,P are in multiples of 1000
Small Read and Large Read are average service times, in milliseconds
Ordered by (Data Read + Write) desc
Filetype Name
Reads: Data
Reqs per sec
Data per sec
Writes: Data
Reqs per sec
Data per sec
Small Read
Large Read
Data File
53.2G
78.33
.630701
8.9G
7.04
.105197
0.37
21.51
Log File
13.9G
0.18
.164213
41.9G
21.85
.496123
0.02
2.93
Archive Log
0M
0.00
0M
13.9G
0.16
.164213
Temp File
5.6G
0.67
.066213
8.1G
0.80
.096496
5.33
3713.27
Control File
2.9G
2.16
.034333
2G
1.46
.023247
0.05
19.98 -
Is it possible to install Oracle 9i and SQL server on same machine
1. Is it possible to install Oracle 9i and SQL server on same machine ?
2. If yes, what are the problems i may encounter during installation
3. What should be hardware configuration for installing both databases in same machine like hard disk space, RAM speed etc,Hi,
1. Yes you can do it.
2. There shouldn't be any problems
3. Depends on your needs
Jarek -
Ruleframe + Updates in same table on different records
I have following problem :
Change event with DML for one column in one record have to result in an update of different records in same table
if business rule is validated, I get a problem in the cg$AUS trigger, No data found.
In the business rule (on after row triggering level), I call a procedure, which do the updates on the same table.
What do I do wrong. Do I have to start a new transaction for this ?
I hope someone can help me.
Regards
Jo-anJo-an,
You definitely don't have to start a new transaction, you should just use the tapi upd procedure to perform the update, as described in the Headstart User's Guide.
Could you try again and report back if you still have the problem?
kind regards,
Sandra -
Can clips made with different recording modes (SP/LP) be put in same movie?
My cousin recorded the family reunion in LP mode while I had my digital camcorder set to SP. I'm using Premiere Elements 4 to make a DVD using everybody's stills and the two digital camcorders' movie clips. Does it matter about the different recording modes? Can I put clips of both speeds in the same authored movie? If not, I guess I could make two movies and burn both files to the same DVD disk. Can they have the same menu? Or how do I make it easy for viewers to play both movies on their TV (not on a computer)? Thanks for your help and for any suggestions.
If you're talking about a miniDV camcorder that's recorded in both LP and SP -- it won't make any difference at all. Digital data is digital data, as far as Premiere Elements is concerned.
-
Connecting DB Oracle/SQL server using the same SQL Navigator release 5.1.0
I have
SQL Navigator release 5.1.0.655 installed in my desktop
License version X-pert Edition
Licensed Options
PL/SQL Debugger
CodeXpert
Knowledge Xpert For Pl/SQL
Xper Tuning
Currently I have the access of Oracle DB using this SQL navigator and MS-SQL server using MS-Sql server Query Analyzer
My question is -- using the same SQL Navigator can I connect MS-SQL server DB/Tables and can I run sql query using this..
Thanks in advance.
MashWhy, in an Oracle forum, are you asking a question about a Quest product connecting to a Microsoft product?
How does this relate to the Oracle Database? -
Questions About Chapter 2 in Oracle DB 10g: SQL Fundamentals II
Hello,
first of all i'm glad to be a member of your forum. I have joined a beginner Oracle Course: Intro to SQL. I'm facing some problems understanding some concepts in Chapter 2 of Oracle Database 10g: SQL Fundamentals II text book. I got about 15 questions. However, i will only ask two questions at first. Since i'm a newbie, please answer it in a simplistic form. Excuse me if you see grammatical mistakes.
Dropping a column can take a while if the column has a large number of values. In this case it may be better to set it to be unused and drop it when the number of users on the system are fewer to avoid extended locks.
Questions:
"when the number of users on the system are fewer to avoid extended locks."
1. Can you explain this to me please?! fewer than before? fewer than? What if users kept increasing during the years! then this "fewer" may not happen until the company collapse!
2. Why do we need to use unused columns? When should we use unused columns?Great! .... I got more questions, i just do not want to open a new same thread. Thus, i will just post the questions in here and i hope i will get help from experts...Please bare with me guys...The questions are numbered, unnumbered parts are information that helps you understand my question.
Note: just answer what you are willing to, one question or whatever you want. I'm not expecting to get all the answers from one member :)
Thanks for understanding
Page 2-7:
Certain columns can never be dropped such as columns that form part of the partitioning
key for a partitioned table or columns that form part of the primary key of an index- organized table.
Questions:
"columns that form part of the partitioning key for a partitioned table"
*1. Do they mean one table can be split into two different storage? What is the thing that*
link these both tables to make Oracle Server realize these two tables are actually one table? Is is tablespace_name?
"columns that form part of the primary key of an index-organized table."
*2. Can you clarify the above sentence please*
*3. If i have set of columns that has large amount of data, i rather set them unused then*
drop them because the response time is going to be faster! I do not get it, can you
explain please? What i know is drop drops the column and release the disk space whilst
unused column make the columns useless and does not release disk space yet until we drop them, so
drop column does it in one step unlike taking the unused column process. In brief, i would like to know
why dropping unused columns that has large set of data is faster then dropping the column
directly...
Page 2-12
4. ALTER TABLE emp2 ADD CONSTRAINT emp_dt_fk
FOREIGN KEY (Department_id)
REFERENCES departments ON DELETE CASCADE);
The above query is written in text book. I think it should be written as
ALTER TABLE emp2 ADD CONSTRAINT emp_dt_fk
FOREIGN KEY (Department_id)
REFERENCES departments(dept_id) ON DELETE CASCADE;
Am i correct?
*5. Can you tell me what deferring constraints is in one sentence please? Why do we need it? When do we need it in real-life?*
*7. You can defer checking constraints for validity until the end of the transaction. A*
constraint is deferred if the system checks that it is satisfied only on commit. If a
deferred constraint is violated, then commit causes the transaction to roll back.
I do not understand the above paragraph, please explain. What i know is "end of
transaction" ends with ; or commit
Page 2-18
create table test1 (
pk NUMBER PRIMARY KEY,
fk NUMBER,
col1 NUMBER,
col2 NUMBER,
CONSTRAINT fk_constraint FOREIGN KEY (fk) REFERENCES test1,
CONSTRAINT ck1 CHECK (pk > 0 and col1 > 0),
CONSTRAINT ck2 CHECK (col2 > 0) );
-- "CONSTRAINT fk_constraint FOREIGN KEY (fk) REFERENCES test1"
*8. This is wrong isn't it? It references to test1 but no column specified.*
An error is returned for the following statements:
ALTER TABLE test1 DROP (pk); -- pk is a parent key.
*9. We can not drop it because we did not mention ON DELETE CASCADE. Am i right?*
ALTER TABLE test1 DROP (col1) -- col1 is referenced by multicolumn constraint ck1.
*10. I do not get it, can you explain please. col1 is not referenced, i see CHECK constraint is applied*
but no references made. Secondly, is ck1 considered multicolumn because it check two columns?
Or multicolumn here represents something else?
ALTER TABLE emp2
DROP COLUMN employee_id CASCADE CONSTRAINTS;
*11. This drop employee_id column and all its child. Correct?*
ALTER TABLE test1
DROP (pk, fk, col1) CASCADE CONSTRAINTS;
*12. This drops three columns and all its child if there are any. Correct?*
*13. Then what's the difference between ON DELETE CASCADE and CASCADE CONSTRAINTS?*
For example, What if employee_id in emp2 table definition does not have ON DELETE CASCADE,
will CASCADE CONSTRAINTS work? Please explain...
Page 2-22
When you are expecting a large data load and want to speed the operation. You may want
to disable the constraints while performing the load and then enable them, in which case
having a unique index on the primary key will still cause the data to be verified during
the load. So you can first create a nonunique index on the column designated as PRIMARY
KEY, and then create the PRIMARY KEY column and specify that it should use the existing
index.
Example:
1. create the table
create table new_emp
(employee_id number(6),
first_name varchar2(10)
2. create the index
create index emp_id_idx2 on new_emp(employee_id);
"You may want to disable the constraints while performing the load and then enable them"
so i suggest to load all data i want into new_emp.
3. create the primary key
alter table new_emp ADD primary key (employee_id) USING index emp_id_idx2;
What i understand is the following:
If we want to load large data into the new_emp, its better to create the table without any
constraints - in our case the constraint is primary key. After that, we create nonunique
index points to employee_id and then load data into new_emp. Finally, specify employee_id
as primary key using the nonunique index.
*14. Is my explanation correct?*
"in which case having a unique index on the primary key will still cause the data to be
verified during the load."
*15. Data to be verified against what? Is it to be verified whether its NULL or NOT NULL? I*
know primary key does not take NULL and every value must be unique.
After loading all data we want, what if i did
"alter table new_emp ADD primary key (employee_id);"
*16. Will i face any problems or inefficient process?*
I do not think we need step two, we could do the following:
1. create the table
create table new_emp
(employee_id number(6),
first_name varchar2(10)
"You may want to disable the constraints while performing the load and then enable them"
so i suggest to load all data i want itno new_emp.
2. create the primary key
alter table new_emp ADD primary key (employee_id);
*17. The above steps are as efficient as the three steps i mentioned above. The only difference*
is we let index be created implicitly. Right? If no, why?
Page 2-23
CREATE INDEX upper_dept_name_idx ON dept2(UPPER(department_name));
The following statement may use the index, but without the WHERE clause the
Oracle server may perform a full table scan:
select *
from employees
where UPPER(last_name) IS NOT NULL
ORDER BY UPPER (last_name);
"but without the WHERE clause the Oracle server may perform a full table scan"
*18. The above query let oracle server perform full table scan anyway! Right? It has to go*
through every field and check is it not null or not. I know we are using function-based
index but there are alot of not null last_name! so oracle server must scan one by one. If
we only had one not null field, then i would say Oracle server can point to that field
immediately by the aid of function-based index we created above. Can you clarify please...
Another related topic statement that i do not get it yet:
"The oracle server treats indexes with columns marked DESC as function-based indexes."
*19. The bove statements is so general. What if we have a column ordered by DESC order and we*
did not create any function-based indexes, will statement be true?!
Lets go back the above query:
ORDER BY UPPER (last_name);
*20. Its not DESC. To me, the above query does not flow with this statement "The oracle server treats*
*indexes with columns marked DESC as function-based indexes."?*
Page 2-27
Regarding FLASHBACK TABLE, you can invoke a flashback table operation on one or more
tables, even on tables in different schema. You specify the point in time to which you
want to revert by providing a valid timestamp. By default, database triggers are disabled
for all tables involved. You can override this default behavior by specifying the ENABLE
TRIGGERS clause.
"By default, database triggers are disabled for all tables involved. You can override this
default behavior by specifying the ENABLE TRIGGERS clause."
*21. What are database triggers?*
*22. About External Tables. What are external tables? When is it used in real-life? Why do*
we want External Tables?
Page 2-30
Oracle server provides two major access drivers for external tables. They are
ORACLE_LOADER access driver and ORACLE_DATAPUMP access driver. ORACLE_DATAPUMP used to
both import and export data using a platform-independent format.
"platform-independent format."
*23. What is the format? Is it .dat?*
Page 2-35
CREATE TABLE oldemp ( fname char(25), lname char(25) )
ORGANIZATION EXTERNAL
(TYPE ORACLE_LOADER
DEFAULT DIRECTORY emp_dir
ACCESS PARAMETERS
(RECORDS DELIMINATED BT NEWLINE
NOBADFILE
NOLOGFILE
FIELDS TERMINATED BY ',' (fname POSITION (1:20) CHAR, lname POSITION (22:41) CHAR)
LOCATION ('emp.dat') )
PARALLEL 5
REJECT LIMIT 200;
*24. Can you please explain the below part:*
ACCESS PARAMETERS
(RECORDS DELIMINATED BT NEWLINE
NOBADFILE
NOLOGFILE
FIELDS TERMINATED BY ',' (fname POSITION (1:20) CHAR, lname POSITION (22:41) CHAR)
*25. Can you please explain what is PARALLEL 5? and Why do we need it?*
Again, any help is appreciated...
Edited by: user11164565 on Jul 21, 2009 4:41 AM -
How do you compare Oracle 10G with SQL Server 2005?
exept for performance and pricing...
We haven't decide to upgrade SQL Server 2000 to SQL Server 2005 or buy more license for Oracle 10G...
Any comments are welcome!OK I only came here because of APC's referral down the piece (I was curious where all the hits came from - cheers Andrew). Comments embedded anyway
Thanks Gaff!
* Staff Experience with product - how flexible is
your staff?
--Staff need to learn sth. new...:)That's a fair motivation if recruitment and retention of staff is an issue - if you want reliability giving business systems to people who don't know the tech is a rather foolish move.
* Current product use Corporation/group - if you have
15 SQL Server boxes and no Oracle, what is the
impetus for change? Same if you have 15 Oracle boxes
and no SQL Server ones.
--80% SQL server and 20% Oracle. We are thinking to
balance to 50%-50%.I'm curious as to the reasoning behind this? I don't really see what the benefit is.
* Features - Do you want/need text handling
capabilities? Data mining? Storage of non-text
records? XML?
--I think both of DB system can do these.They can
* Scalability - Is one Windows box going to meet your
needs or do you need to scale (now or eventually) to
multiple boxes of multiple CPUs?
--This is really a benefit feature of Oracle better
than SQL Server.SQLServer scales - it just scales in a different way (federated databases vs RAC).
Thank u for ur US$.02Are you evaluating the platform for an in-house development or a database neutral application - if the latter I'd be sorely tempted to find out what the development platform is or read the docs for clues. For example we are looking at a product that supports SQLServer,MSDE and Oracle. In the FAQ "how do I choose between SQLServer and MSDE?", if we do implement it will be on an MS platform.
I consider this probably the most crucial factor since SQLServer and Oracle have different architectural features they tend to generate different development approaches - porting one to the other nearly always hurts the new platform. Plus if I need support I'd be hoping that I got a bug fix from a developer and not from a developer whose fix was then ported.
The same applies to in-house dev obviously, but there at least you can hire people with the right skillset for the app development.
Cheers
Niall Litchfield
Oracle DBA
http://www.niall.litchfield.dial.pipex.com -
Sql retrives record but fails when used in a view
Hi,
I have a unique problem. I am able to retrive a record based on a certain criteria using a SQL.
When the same sql is used in a create view statement the records do not show up.
I did a count on records using the sql and get 54,521 where
a count on the number of records from a view created using the same sql gives a lower number 40,967
Here is the script
/* Formatted on 2009/10/07 16:22 (Formatter Plus v4.8.8) */
CREATE OR REPLACE FORCE VIEW ssvsec2_js (term_code_key,
crn_key,
seq_number_key,
active_section_ind,
active_course_ind,
course_coreq_ind,
course_prereq_ind,
section_coreq_ind,
section_prereq_ind,
course_eff_term_code,
coll_code,
dept_code,
levl_code1,
levl_code2,
levl_code3,
levl_code4,
divs_code,
subj_code,
crse_number,
ceu_ind,
csta_code,
credit_hours,
credit_hours_low,
credit_hours_high,
credit_hours_ind,
billing_hours,
billing_hours_low,
billing_hours_high,
billing_hours_ind,
ssts_code,
camp_code,
gmod_code,
title,
sapr_code,
census_enrollment1,
census_enrollment_date1,
census_enrollment2,
census_enrollment_date2,
projected_enrollment,
maximum_enrollment,
actual_enrollment,
seats_available,
ptrm_code,
ptrm_start_date,
ptrm_end_date,
link_identifier,
begin_time1,
end_time1,
bldg_code1,
room_code1,
schd_code_meet1,
monday_ind1,
tuesday_ind1,
wednesday_ind1,
thursday_ind1,
friday_ind1,
saturday_ind1,
sunday_ind1,
begin_time2,
end_time2,
bldg_code2,
room_code2,
schd_code_meet2,
monday_ind2,
tuesday_ind2,
wednesday_ind2,
thursday_ind2,
friday_ind2,
saturday_ind2,
sunday_ind2,
begin_time3,
end_time3,
bldg_code3,
room_code3,
schd_code_meet3,
monday_ind3,
tuesday_ind3,
wednesday_ind3,
thursday_ind3,
friday_ind3,
saturday_ind3,
sunday_ind3,
begin_time4,
end_time4,
bldg_code4,
room_code4,
schd_code_meet4,
monday_ind4,
tuesday_ind4,
wednesday_ind4,
thursday_ind4,
friday_ind4,
saturday_ind4,
sunday_ind4,
begin_time5,
end_time5,
bldg_code5,
room_code5,
schd_code_meet5,
monday_ind5,
tuesday_ind5,
wednesday_ind5,
thursday_ind5,
friday_ind5,
saturday_ind5,
sunday_ind5,
begin_time6,
end_time6,
bldg_code6,
room_code6,
schd_code_meet6,
monday_ind6,
tuesday_ind6,
wednesday_ind6,
thursday_ind6,
friday_ind6,
saturday_ind6,
sunday_ind6,
begin_time7,
end_time7,
bldg_code7,
room_code7,
schd_code_meet7,
monday_ind7,
tuesday_ind7,
wednesday_ind7,
thursday_ind7,
friday_ind7,
saturday_ind7,
sunday_ind7,
begin_time8,
end_time8,
bldg_code8,
room_code8,
schd_code_meet8,
monday_ind8,
tuesday_ind8,
wednesday_ind8,
thursday_ind8,
friday_ind8,
saturday_ind8,
sunday_ind8,
begin_time9,
end_time9,
bldg_code9,
room_code9,
schd_code_meet9,
monday_ind9,
tuesday_ind9,
wednesday_ind9,
thursday_ind9,
friday_ind9,
saturday_ind9,
sunday_ind9,
begin_time10,
end_time10,
bldg_code10,
room_code10,
schd_code_meet10,
monday_ind10,
tuesday_ind10,
wednesday_ind10,
thursday_ind10,
friday_ind10,
saturday_ind10,
sunday_ind10,
attr_code1,
attr_code2,
additional_attributes_ind,
primary_instructor_id,
primary_instructor_last_name,
primary_instructor_first_name,
primary_instructor_middle_init,
instructor_id2,
instructor_last_name2,
instructor_first_name2,
instructor_middle_init2,
instructor_id3,
instructor_last_name3,
instructor_first_name3,
instructor_middle_init3,
additional_instructors_ind,
coll_code_override,
divs_code_override,
dept_code_override,
schd_code1,
schd_workload1,
schd_max_enrl1,
schd_adj_workload1,
schd_code2,
schd_workload2,
schd_max_enrl2,
schd_adj_workload2,
schd_code3,
schd_workload3,
schd_max_enrl3,
schd_adj_workload3,
schd_code4,
schd_workload4,
schd_max_enrl4,
schd_adj_workload4
AS
SELECT ssbsect_term_code, ssbsect_crn, ssbsect_seq_numb,
SUBSTR (f_active_section_ind (ssbsect_ssts_code), 1, 1),
SUBSTR (f_active_course_ind (a.scbcrse_csta_code), 1, 1),
SUBSTR (f_check_for_course_coreqs (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code
1,
1
SUBSTR (f_check_for_course_prereqs (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
1,
1
SUBSTR (f_check_for_section_coreqs (ssbsect_term_code, ssbsect_crn),
1,
1
SUBSTR (f_check_for_section_prereqs (ssbsect_term_code,
ssbsect_crn,
1,
1
a.scbcrse_eff_term, a.scbcrse_coll_code, a.scbcrse_dept_code,
SUBSTR (f_get_course_levels (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
1
1,
2
SUBSTR (f_get_course_levels (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
2
1,
2
SUBSTR (f_get_course_levels (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
3
1,
2
SUBSTR (f_get_course_levels (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
4
1,
2
a.scbcrse_divs_code, ssbsect_subj_code, ssbsect_crse_numb,
a.scbcrse_ceu_ind, a.scbcrse_csta_code,
NVL (ssbsect_credit_hrs, a.scbcrse_credit_hr_low),
a.scbcrse_credit_hr_low, a.scbcrse_credit_hr_high,
a.scbcrse_credit_hr_ind,
NVL (ssbsect_bill_hrs, a.scbcrse_bill_hr_low),
a.scbcrse_bill_hr_low, a.scbcrse_bill_hr_high,
a.scbcrse_bill_hr_ind, ssbsect_ssts_code, ssbsect_camp_code,
NVL (ssbsect_gmod_code,
SUBSTR (f_default_gmod (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code
1,
1
NVL (ssbsect_crse_title, a.scbcrse_title), ssbsect_sapr_code,
ssbsect_census_enrl, ssbsect_census_enrl_date,
ssbsect_census_2_enrl, ssbsect_census_2_date, ssbsect_proj_enrl,
ssbsect_max_enrl, ssbsect_enrl, ssbsect_seats_avail,
ssbsect_ptrm_code, ssbsect_ptrm_start_date, ssbsect_ptrm_end_date,
ssbsect_link_ident, k.ssrmeet_begin_time, k.ssrmeet_end_time,
k.ssrmeet_bldg_code, k.ssrmeet_room_code, k.ssrmeet_schd_code,
k.ssrmeet_mon_day, k.ssrmeet_tue_day, k.ssrmeet_wed_day,
k.ssrmeet_thu_day, k.ssrmeet_fri_day, k.ssrmeet_sat_day,
k.ssrmeet_sun_day, l.ssrmeet_begin_time, l.ssrmeet_end_time,
l.ssrmeet_bldg_code, l.ssrmeet_room_code, l.ssrmeet_schd_code,
l.ssrmeet_mon_day, l.ssrmeet_tue_day, l.ssrmeet_wed_day,
l.ssrmeet_thu_day, l.ssrmeet_fri_day, l.ssrmeet_sat_day,
l.ssrmeet_sun_day, m.ssrmeet_begin_time, m.ssrmeet_end_time,
m.ssrmeet_bldg_code, m.ssrmeet_room_code, m.ssrmeet_schd_code,
m.ssrmeet_mon_day, m.ssrmeet_tue_day, m.ssrmeet_wed_day,
m.ssrmeet_thu_day, m.ssrmeet_fri_day, m.ssrmeet_sat_day,
m.ssrmeet_sun_day, n.ssrmeet_begin_time, n.ssrmeet_end_time,
n.ssrmeet_bldg_code, n.ssrmeet_room_code, n.ssrmeet_schd_code,
n.ssrmeet_mon_day, n.ssrmeet_tue_day, n.ssrmeet_wed_day,
n.ssrmeet_thu_day, n.ssrmeet_fri_day, n.ssrmeet_sat_day,
n.ssrmeet_sun_day, o.ssrmeet_begin_time, o.ssrmeet_end_time,
o.ssrmeet_bldg_code, o.ssrmeet_room_code, o.ssrmeet_schd_code,
o.ssrmeet_mon_day, o.ssrmeet_tue_day, o.ssrmeet_wed_day,
o.ssrmeet_thu_day, o.ssrmeet_fri_day, o.ssrmeet_sat_day,
o.ssrmeet_sun_day, p.ssrmeet_begin_time, p.ssrmeet_end_time,
p.ssrmeet_bldg_code, p.ssrmeet_room_code, p.ssrmeet_schd_code,
p.ssrmeet_mon_day, p.ssrmeet_tue_day, p.ssrmeet_wed_day,
p.ssrmeet_thu_day, p.ssrmeet_fri_day, p.ssrmeet_sat_day,
p.ssrmeet_sun_day, q.ssrmeet_begin_time, q.ssrmeet_end_time,
q.ssrmeet_bldg_code, q.ssrmeet_room_code, q.ssrmeet_schd_code,
q.ssrmeet_mon_day, q.ssrmeet_tue_day, q.ssrmeet_wed_day,
q.ssrmeet_thu_day, q.ssrmeet_fri_day, q.ssrmeet_sat_day,
q.ssrmeet_sun_day, r.ssrmeet_begin_time, r.ssrmeet_end_time,
r.ssrmeet_bldg_code, r.ssrmeet_room_code, r.ssrmeet_schd_code,
r.ssrmeet_mon_day, r.ssrmeet_tue_day, r.ssrmeet_wed_day,
r.ssrmeet_thu_day, r.ssrmeet_fri_day, r.ssrmeet_sat_day,
r.ssrmeet_sun_day, s.ssrmeet_begin_time, s.ssrmeet_end_time,
s.ssrmeet_bldg_code, s.ssrmeet_room_code, s.ssrmeet_schd_code,
s.ssrmeet_mon_day, s.ssrmeet_tue_day, s.ssrmeet_wed_day,
s.ssrmeet_thu_day, s.ssrmeet_fri_day, s.ssrmeet_sat_day,
s.ssrmeet_sun_day, t.ssrmeet_begin_time, t.ssrmeet_end_time,
t.ssrmeet_bldg_code, t.ssrmeet_room_code, t.ssrmeet_schd_code,
t.ssrmeet_mon_day, t.ssrmeet_tue_day, t.ssrmeet_wed_day,
t.ssrmeet_thu_day, t.ssrmeet_fri_day, t.ssrmeet_sat_day,
t.ssrmeet_sun_day, e1.ssrattr_attr_code, e2.ssrattr_attr_code,
SUBSTR (f_more_attributes (scbcrse_subj_code,
scbcrse_crse_numb,
scbcrse_eff_term
1,
1
x.spriden_id, NVL (x.spriden_last_name, 'STAFF'),
x.spriden_first_name, SUBSTR (x.spriden_mi, 1, 1), y.spriden_id,
y.spriden_last_name, y.spriden_first_name,
SUBSTR (y.spriden_mi, 1, 1), z.spriden_id, z.spriden_last_name,
z.spriden_first_name, SUBSTR (z.spriden_mi, 1, 1),
DECODE (u.spriden_pidm, NULL, 'N', 'Y'), ssbovrr_coll_code,
ssbovrr_divs_code, ssbovrr_dept_code, f1.scrschd_schd_code,
f1.scrschd_workload, f1.scrschd_max_enrl, f1.scrschd_adj_workload,
f2.scrschd_schd_code, f2.scrschd_workload, f2.scrschd_max_enrl,
f2.scrschd_adj_workload, f3.scrschd_schd_code, f3.scrschd_workload,
f3.scrschd_max_enrl, f3.scrschd_adj_workload, f4.scrschd_schd_code,
f4.scrschd_workload, f4.scrschd_max_enrl, f4.scrschd_adj_workload
FROM scbcrse a,
ssbovrr,
spriden x,
spriden y,
ssrmeet k,
ssrmeet l,
ssrmeet m,
ssrmeet n,
ssrmeet o,
ssrmeet p,
ssrmeet q,
ssrmeet r,
ssrmeet s,
ssrmeet t,
scrschd f1,
scrschd f2,
scrschd f3,
scrschd f4,
ssrattr e1,
ssrattr e2,
spriden z,
spriden u,
ssbsect
WHERE x.ROWID(+) =
f_get_instr_spriden_rowid (ssbsect_crn,
ssbsect_term_code,
'Y',
AND y.ROWID(+) =
f_get_instr_spriden_rowid (ssbsect_crn, ssbsect_term_code, '', 1)
AND z.ROWID(+) =
f_get_instr_spriden_rowid (ssbsect_crn, ssbsect_term_code, '', 2)
AND u.ROWID(+) =
f_get_instr_spriden_rowid (ssbsect_crn, ssbsect_term_code, '', 3)
AND ssbovrr_term_code(+) = ssbsect_term_code
AND ssbovrr_crn(+) = ssbsect_crn
AND a.scbcrse_subj_code = ssbsect_subj_code
AND a.scbcrse_crse_numb = ssbsect_crse_numb
AND a.scbcrse_eff_term =
(SELECT MAX (b.scbcrse_eff_term)
FROM scbcrse b
WHERE b.scbcrse_subj_code = ssbsect_subj_code
AND b.scbcrse_crse_numb = ssbsect_crse_numb
AND b.scbcrse_eff_term <= ssbsect_term_code)
AND k.ROWID(+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
1
AND l.ROWID(+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
2
AND m.ROWID(+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
3
AND n.ROWID(+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
4
AND o.ROWID(+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
5
AND p.ROWID(+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
6
AND q.ROWID(+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
7
AND r.ROWID(+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
8
AND s.ROWID(+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
9
AND t.ROWID(+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
10
AND f1.ROWID(+) =
f_get_scrschd_rowid (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
1
AND f2.ROWID(+) =
f_get_scrschd_rowid (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
2
AND f3.ROWID(+) =
f_get_scrschd_rowid (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
3
AND f4.ROWID(+) =
f_get_scrschd_rowid (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
4
AND e1.ssrattr_term_code(+) = ssbsect_term_code
AND e1.ssrattr_crn(+) = ssbsect_crn
AND e1.ssrattr_attr_code(+) = 'SWS'
AND e2.ssrattr_term_code(+) = ssbsect_term_code
AND e2.ssrattr_crn(+) = ssbsect_crn
AND e2.ssrattr_attr_code(+) LIKE 'TM%';
Thanks ,
IreneWelcome to the forums !
If this issue is not related to a database upgrade, pl post the question in the "SQL and PL/SQL" or "Database - General" forums for a better/faster response.
http://forums.oracle.com/forums/category.jspa?categoryID=18
HTH
Srini -
Multiple Executions Plans for the same SQL statement
Dear experts,
awrsqrpt.sql is showing multiple executions plans for a single SQL statement. How is it possible that one SQL statement will have multiple Executions Plans within the same AWR report.
Below is the awrsqrpt's output for your reference.
WORKLOAD REPOSITORY SQL Report
Snapshot Period Summary
DB Name DB Id Instance Inst Num Release RAC Host
TESTDB 2157605839 TESTDB1 1 10.2.0.3.0 YES testhost1
Snap Id Snap Time Sessions Curs/Sess
Begin Snap: 32541 11-Oct-08 21:00:13 248 141.1
End Snap: 32542 11-Oct-08 21:15:06 245 143.4
Elapsed: 14.88 (mins)
DB Time: 12.18 (mins)
SQL Summary DB/Inst: TESTDB/TESTDB1 Snaps: 32541-32542
Elapsed
SQL Id Time (ms)
51szt7b736bmg 25,131
Module: SQL*Plus
UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL,0) + NVL(ACCT_DR_BAL,
0)) FROM ACCT WHERE ACCT_TRN_DT = (:B1 ) AND TEST_ACC_NB = ACCT_ACC_NB(+)) WHERE
TEST_BATCH_DT = (:B1 )
SQL ID: 51szt7b736bmg DB/Inst: TESTDB/TESTDB1 Snaps: 32541-32542
-> 1st Capture and Last Capture Snap IDs
refer to Snapshot IDs witin the snapshot range
-> UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL,0) + NVL(AC...
Plan Hash Total Elapsed 1st Capture Last Capture
# Value Time(ms) Executions Snap ID Snap ID
1 2960830398 25,131 1 32542 32542
2 3834848140 0 0 32542 32542
Plan 1(PHV: 2960830398)
Plan Statistics DB/Inst: TESTDB/TESTDB1 Snaps: 32541-32542
-> % Total DB Time is the Elapsed Time of the SQL statement divided
into the Total Database Time multiplied by 100
Stat Name Statement Per Execution % Snap
Elapsed Time (ms) 25,131 25,130.7 3.4
CPU Time (ms) 23,270 23,270.2 3.9
Executions 1 N/A N/A
Buffer Gets 2,626,166 2,626,166.0 14.6
Disk Reads 305 305.0 0.3
Parse Calls 1 1.0 0.0
Rows 371,735 371,735.0 N/A
User I/O Wait Time (ms) 564 N/A N/A
Cluster Wait Time (ms) 0 N/A N/A
Application Wait Time (ms) 0 N/A N/A
Concurrency Wait Time (ms) 0 N/A N/A
Invalidations 0 N/A N/A
Version Count 2 N/A N/A
Sharable Mem(KB) 26 N/A N/A
Execution Plan
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | UPDATE STATEMENT | | | | 1110 (100)| |
| 1 | UPDATE | TEST | | | | |
| 2 | TABLE ACCESS FULL | TEST | 116K| 2740K| 1110 (2)| 00:00:14 |
| 3 | TABLE ACCESS BY INDEX ROWID| ACCT | 1 | 26 | 5 (0)| 00:00:01 |
| 4 | INDEX RANGE SCAN | ACCT_DT_ACC_IDX | 1 | | 4 (0)| 00:00:01 |
Plan 2(PHV: 3834848140)
Plan Statistics DB/Inst: TESTDB/TESTDB1 Snaps: 32541-32542
-> % Total DB Time is the Elapsed Time of the SQL statement divided
into the Total Database Time multiplied by 100
Stat Name Statement Per Execution % Snap
Elapsed Time (ms) 0 N/A 0.0
CPU Time (ms) 0 N/A 0.0
Executions 0 N/A N/A
Buffer Gets 0 N/A 0.0
Disk Reads 0 N/A 0.0
Parse Calls 0 N/A 0.0
Rows 0 N/A N/A
User I/O Wait Time (ms) 0 N/A N/A
Cluster Wait Time (ms) 0 N/A N/A
Application Wait Time (ms) 0 N/A N/A
Concurrency Wait Time (ms) 0 N/A N/A
Invalidations 0 N/A N/A
Version Count 2 N/A N/A
Sharable Mem(KB) 26 N/A N/A
Execution Plan
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | UPDATE STATEMENT | | | | 2 (100)| |
| 1 | UPDATE | TEST | | | | |
| 2 | TABLE ACCESS BY INDEX ROWID| TEST | 1 | 28 | 2 (0)| 00:00:01 |
| 3 | INDEX RANGE SCAN | TEST_DT_IND | 1 | | 1 (0)| 00:00:01 |
| 4 | TABLE ACCESS BY INDEX ROWID| ACCT | 1 | 26 | 4 (0)| 00:00:01 |
| 5 | INDEX RANGE SCAN | INDX_ACCT_DT | 1 | | 3 (0)| 00:00:01 |
Full SQL Text
SQL ID SQL Text
51szt7b736bm UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL, 0) +
NVL(ACCT_DR_BAL, 0)) FROM ACCT WHERE ACCT_TRN_DT = (:B1 ) AND PB
RN_ACC_NB = ACCT_ACC_NB(+)) WHERE TEST_BATCH_DT = (:B1 )Your input is highly appreciated.
Thanks for taking your time in answering my question.
RegardsOracle Lover3 wrote:
Dear experts,
awrsqrpt.sql is showing multiple executions plans for a single SQL statement. How is it possible that one SQL statement will have multiple Executions Plans within the same AWR report.If you're using bind variables and you've histograms on your columns which can be created by default in 10g due to the "SIZE AUTO" default "method_opt" parameter of DBMS_STATS.GATHER__STATS it is quite normal that you get different execution plans for the same SQL statement. Depending on the values passed when the statement is hard parsed (this feature is called "bind variable peeking" and enabled by default since 9i) an execution plan is determined and re-used for all further executions of the same "shared" SQL statement.
If now your statement ages out of the shared pool or is invalidated due to some DDL or statistics gathering activity it will be re-parsed and again the values passed in that particular moment will determine the execution plan. If you have skewed data distribution and a histogram in place that reflects that skewness you might get different execution plans depending on the actual values used.
Since this "flip-flop" behaviour can sometimes be counter-productive if you're unlucky and the values used to hard parse the statement leading to a plan that is unsuitable for the majority of values used afterwards, 11g introduced the "adaptive" cursor sharing that attempts to detect such a situation and can automatically re-evaluate the execution plan of the statement.
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/
Maybe you are looking for
-
NetBeans and Gimp don't launch
I've reported that NetBeans works only command-line[1]. I've now noticed that also GIMP has problems on my machine, that's clicking on the icon twice will show it for a sec but then close. I therefore suspect there's something wrong with my mac, and
-
Fingerprints and expired passwords
Hi Community, I have recently encountered this problem and I've yet to find a solution for it. Maybe someone here has experienced something similar before and can shed some light on how to fix it. I'm on a T410 with XP. I use an ActiveDirectory login
-
Hi, I have turn on the audit function in database but I don't know how to track the record changes. for example: I have a temp table with values '123' and update to "345". I have checked the following 2 audit tables and want to see what data changes
-
Can i use adobe export pdf on an imac? [was: brian newcombe]
Can i use adobe export pdf on an imac?
-
Incompatibility issues when saving BW workbook in early excel versions
When saving a BW workbooks to my desktop for example so that I can then send it to a user to view the report I get incompatibility issues when saving workbook to earlier excel versions. I am currently using 2007 and when I save the workbook to Excel