Cursor_sharing=similar or cursor_sharing=exact
Hai,
I have doubt regarding setting cursor_sharing parameter exact and similar at session level.
On my database cursor_sharing is set similar at system level.
test >show parameter cursor
NAME TYPE VALUE
cursor_sharing string SIMILARI have fired a simple select statement without setting any cursor_sharing at session level
TEST >variable b1 number;
TEST >exec :b1:=7499;
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
TEST >select empno,job from emp where job='SALESMAN' and empno=:b1;
EMPNO JOB
7499 SALESMANchecking the hash value for query fired
test >select sql_text,invalidations,hash_value,executions,loads from v$sqlarea
16:14:50 2 where sql_text like '%select empno,job from%';
SQL_TEXT
INVALIDATIONS HASH_VALUE EXECUTIONS LOADS
select empno,job from emp where job=:"SYS_B_0" and empno=:b1
0 3727168047 1 1Literal job='SALESMAN' is converted into system generated bind variable job=:"SYS_B_0" as my cursor_sharing=similar
Fired the same statement by setting cursor_sharing=exact at session level
TEST >alter session set cursor_sharing=exact;
Session altered.
Elapsed: 00:00:00.00
16:15:25 TEST >select empno,job from emp where job='SALESMAN' and empno=:b1;Checking the hash value for newly fired query with cursor_sharing=exact
SQL_TEXT
INVALIDATIONS HASH_VALUE EXECUTIONS LOADS
select empno,job from emp where job='SALESMAN' and empno=:b1
0 2065003705 1 1
select empno,job from emp where job=:"SYS_B_0" and empno=:b1
0 3727168047 1 1literal job='SALESMAN' is not converted into bind variable as my cursor_sharing=exact
At the same session fired the same query by setting cursor_sharing=similar ..to check which hash value would be shared.
16:15:28 TEST >alter session set cursor_sharing=similar;
Session altered.
Elapsed: 00:00:04.09
17:27:54 TEST >select empno,job from emp where job='SALESMAN' and empno=:b1;
EMPNO JOB
7499 SALESMAN
16:28:26 test >select sql_text,invalidations,hash_value,executions,loads from v$sqlarea
17:28:13 2 where sql_text like '%select empno,job from%';
SQL_TEXT
INVALIDATIONS HASH_VALUE EXECUTIONS LOADS
select empno,job from emp where job='SALESMAN' and empno=:b1
0 2065003705 2 *2*
select empno,job from emp where job=:"SYS_B_0" and empno=:b1
0 3727168047 1 1The hash value 2065003705 (cursor_sharing=exact) is shared as executions column is changed from 1 to 2.
So after setting parameter cursor_sharing = similar why the hash value of 3727168047(cursor_sharing=similar)
is not shared?I guess something is cached at session level but i want to know the exact reason..
Again i flushed the shared pool
test >alter system flush shared_pool;
System altered.
Elapsed: 00:00:03.09
17:39:40 test >select sql_text,invalidations,hash_value,executions,loads from v$sqlarea
17:39:44 2 where sql_text like '%select empno,job from%';
SQL_TEXT
INVALIDATIONS HASH_VALUE EXECUTIONS LOADS
select empno,job from emp where job='SALESMAN' and empno=:b1
0 2065003705 0 2The hash value of 3727168047(cursor_sharing=similar) is removed ..not hash value 2065003705
What is the reason behind that ...
Regards,
Meeran
Meeran wrote:
The hash value 2065003705 (cursor_sharing=exact) is shared as executions column is changed from 1 to 2.
So after setting parameter cursor_sharing = similar why the hash value of 3727168047(cursor_sharing=similar)
is not shared?I guess something is cached at session level but i want to know the exact reason..Because there is a query in the shared_pool with same literal value so it doesn't have to use the hash 3727168047 and substitute the bind where it already has a plan for the same statement which is 2065003705.
I think with setting CURSOR_SHARING=similar again, If you try the query with JOB='ANALYST' then it will use the plan 3727168047 and substitute the bind with 'ANALYST'.
Again i flushed the shared pool
test >alter system flush shared_pool;
System altered.
Elapsed: 00:00:03.09
17:39:40 test >select sql_text,invalidations,hash_value,executions,loads from v$sqlarea
17:39:44 2 where sql_text like '%select empno,job from%';
SQL_TEXT
INVALIDATIONS HASH_VALUE EXECUTIONS LOADS
select empno,job from emp where job='SALESMAN' and empno=:b1
0 2065003705 0 2The hash value of 3727168047(cursor_sharing=similar) is removed ..not hash value 2065003705
What is the reason behind that ...If you have noticed, the executions for the hash plan 2065003705 are 0 after the shared_pool flushing. It seems that with flush shared_pool, oracle doesn't flush the queries with literals and just reset their stats. As literals are always the culprits.
You may also wanna read this, as good document on CURSOR_SHARING.
Similar Messages
-
To solve ORA-1008,set cursor_sharing parameter to EXACT
Per Bug 7154579 customer, to solve ORA-1008,set cursor_sharing parameter to EXACT but still see the error on the application.
One of the instance in our 4 node RAC USED to have cursor_sharing=similar, and the rest set to exact. Customer changed it to 'exact' longtime back. but still found some background process using cursor_sharing=similar ( and still see the error 1008) .
After the bounce of the above-mentioned node, but absent a clean restart of the whole RAC database, the customer still experienced the 1008 error. Session level is showing,INSTEAD OF "SIMILAR" for the background processes,the entries of "uninitialized". See query below:
SYS@ptmpnew4 >select inst_id,id,name,value from gV$SYS_OPTIMIZER_ENV where name like 'cursor%' ;
INST_ID ID NAME VALUE
4 48 cursor_sharing exact
3 48 cursor_sharing exact
2 48 cursor_sharing exact
1 48 cursor_sharing exact
SYS@ptmpnew4 >
SYS@ptmpnew4 >select inst_id,name,value,count(1) from gV$ses_OPTIMIZER_ENV where name like 'cursor%'
group by inst_id,name,value; 2
INST_ID NAME VALUE COUNT(1)
1 cursor_sharing exact 599
1 cursor_sharing uninit 20
2 cursor_sharing exact 590
2 cursor_sharing uninit 18
3 cursor_sharing exact 583
3 cursor_sharing uninit 19
4 cursor_sharing exact 600
4 cursor_sharing uninit 18
what could be the possible reasoncursor_sharing parameter in the init. ora allows you to change the shared pool's default behaviour when parsing and caching SQL statements.
force - allows two SQL statements, which differ only by a literal value, to share parsed code cached in the shared pool. the difference in literal values must not change the meaning of the statement.
similar - allows two sql statements, which differ only by a literal value, to share parsed code cached in the shared pool. the difference in literal values must not change the meaning of the statement or its cached execution plan.
exact - two sql statements must match exactly in order to share the parse code cached in shared pool.
refer the link given below , you will get answer for all your questions.
http://www.oracle.com/technology/oramag/oracle/06-jan/o16asktom.html
to know Parsing in Oracle, refer.
http://www.databasejournal.com/features/oracle/article.php/3341851/Parsing-in-Oracle.htm
Edited by: rajeysh on Jun 19, 2010 12:40 PM -
Cursor_sharing改成force,会引起什么bug吗?
公司的数据库内有一套老的应用,跑了好多年了,但没有绑定变量,导致SQLAREA占用大量资源
我想将cursor_sharing改成force,会不会引起bug
我在此之前将此参数similar ,应用会报错
数据库版 10.2.0.4 64bit
SELECT substr(sql_text, 1, 40) "SQL", count(*), sum(executions) "TotExecs"
FROM v$sqlarea
WHERE executions < 5
GROUP BY substr(sql_text, 1, 40) HAVING count(*) > 30 ORDER BY 2 desc;
结果为
1 SELECT ………… 22625 23047
2 insert ………… 21437 21437
3 insert ………… 21429 21429
4 select ………… 19464 22630
5 delete ………… 18655 18655
6 INSERT ………… 18078 20520
7 SELECT ………… 13218 15798
8 INSERT ………… 9060 9060
9 INSERT ………… 9060 9060
10 select ………… 7870 8451
11 insert ………… 7837 8350
12 select ………… 7790 7790
13 select ………… 7789 7789
14 insert ………… 7768 7937
15 SELECT ………… 7716 9052
16 insert ………… 6636 6643
17 SELECT ………… 6392 6392
18 UPDATE ………… 6077 6439
19 SELECT ………… 6027 6389
20 update ………… 4414 4414
21 INSERT ………… 4018 40161. 不推荐在任何版本上继续使用 CURSOR_SHARING=SIMILAR
2. cursor_sharing=force 在某些特性条件下会触发bug, 主要是在低版本(9iR2,10gR2早期),具体是否触发bug取决于SQL的写法。
建议你直接参考以下 10.2.0.4上cursor_sharing的 bug list:
NB Bug Fixed Description
12862170 12.1.0.0 INSERT ALL fails with ORA-600[kkslhsh1] with CURSOR_SHARING enabled / High Version Count on HASH_MATCH_FAILED
12374212 11.2.0.3, 12.1.0.0 Assorted dump , internal errors, memory corruptions with cursor_sharing = force
12334286 11.2.0.3, 12.1.0.0 High version counts with CURSOR_SHARING=FORCE (BIND_MISMATCH and INCOMP_LTRL_MISMATCH)
11063191 11.2.0.2.7, 11.2.0.2.BP17, 11.2.0.3.2, 11.2.0.3.BP04, 12.1.0.0 ORA-4031 with hint /*+ CURSOR_SHARING_EXACT */ - excessive "KKSSP^nn" memory
10013170 11.2.0.3, 12.1.0.0 ORA-600 [736] from literal replacement with a "WAIT n" clause
9877964 11.2.0.3, 12.1.0.0 ORA-600 [19003] raised by LIKE :BIND in query
9680430 11.2.0.3, 12.1.0.0 High version count with CURSOR_SHARING = FORCE due to CBO transformation
9411496 11.2.0.2, 12.1.0.0 ORA-979 on GROUP BY query with CURSOR_SHARING set
9362218 11.2.0.2, 12.1.0.0 Literals replaced by binds when CURSOR_SHARING=EXACT
9348402 12.1.0.0 OERI [kks-hash-collision] can occur with CURSOR_SHARING=FORCE|SIMILAR
9223586 11.2.0.2, 12.1.0.0 Problems with variable length NCHAR literals with cursor sharing
9031183 11.2.0.2, 12.1.0.0 ORA-1722 with CURSOR_SHARING=SIMILAR and with NCHAR
8246445 11.2.0.2, 12.1.0.0 Query rewrite not working for multi-MV rewrite with literal replacement
5751866 11.2.0.2 Wrong Results with CASE and CURSOR_SHARING
9767674 10.2.0.5.5 Dump [kkslmtl] using CURSOR_SHARING - superceded
8794693 11.2.0.2 Dump [kkscsmtl] using literal replacement (CURSOR_SHARING)
8453245 11.2.0.1 Many child cursors with CURSOR_SHARING = FORCE
8264642 11.2.0.1 ORA-600 [kkexbindopn0] with CURSOR_SHARING = SIMILAR
7516867 10.2.0.5, 11.1.0.7.1, 11.2.0.1 Intermittent Wrong results from literal replacement with fix for bug 6163785
7272297 10.2.0.4.1, 10.2.0.5, 11.1.0.7, 11.2.0.1 Memory corruption / OERI[17114] / OERI[17125] with literal replacement
6337716 10.2.0.5, 11.1.0.7, 11.2.0.1 Wrong max column size for NULL strings with literal replacement
4071519 10.2.0.5, 11.1.0.7, 11.2.0.1 GROUP BY query with CURSOR_SHARING fails with ORA-1802
3461251 11.1.0.7, 11.2.0.1 V$SQL_SHARED_CURSOR shows all N with CURSOR_SHARING
7296258 10.2.0.5, 11.1.0.7.1 Intermittent Wrong results from literal replacement and remote objects
6163785 10.2.0.5, 11.1.0.7 Intermittent Wrong Results with dblink and cursor_sharing
8202234 Intermittent Wrong Results with dblink and cursor_sharing
4867724 10.2.0.5, 11.1.0.6 Literal replacement limits column names to 30 characters -
Cursor_sharing force partially parameter sql
Hi ,
We are running our application with weblogic ,jdbc thin client with Oracle 9.2.0.5 database.
We have set cursor_sharing=FORCE in init.ora.
Our problem.
Java prepared statement with partial variable substitution is not sharing cursors, All other type of executions like update using sqlplus or without prepared statement they are sharing the cursors.
For example.
1)
UPDATE t1 SET col1=? WHERE id = 123
This gets translated into
UPDATE t1 SET col1= :1 WHERE nid = 123
where as
2)
UPDATE t1 SET col1=? WHERE id = ?
It gets translated into
UPDATE t1 SET col1= :1 WHERE nid = :2
We haved 1000 of update statements run in our application as example 1)
which is not sharing cursor.
Is there any parameter we can set in database?
This is happening in 9.2.0.6 also.<quote>Is there any parameter we can set in database?</quote>
No.
And the behavior you describe actually makes sense. If you used bind variables where you considered it to be appropriate [and conversely, didnt use them where it wasnt appropriate], why would Oracle come in and override your decision by blindingly replacing all remaining literals with binds?
<quote>We haved 1000 of update statements run in our application as example 1) which is not sharing cursor.</quote>
Then those statements have to be re-written. CURSOR_SHARING=FORCE at the instance level is supposed to be a temporary band-aid anyway the fix is to address the underlying coding problem and revert to CURSOR_SHARING=EXACT. Maybe, just maybe have CURSOR_SHARING other than EXACT at session level surrounding some particular piece of code deemed too risky to re-code (3rd party, undocumented, too obscure) but some regular UPDATEs? just fix. -
CURSOR_SHARING universe parameter
Does anyone know if the CURSOR_SHARING parameter is supported in a universe (BOXI R2 SP3, FP3.3)? BOXI R2 is running on AIX, and the reporting and CMS databases are on Oracle 10g. On the database side, CURSOR_SHARING is set to FORCE. On the universe side, we want to set the CURSOR_SHARING value to EXACT. Is this possible?
The solution to this is to add the following value to the ConnectInit parameter in the Universe Connection, "alter session set cursor_sharing=exact". Don't use the double quotes in your value.
-
SQVI - Join tables using similar fields (but not same)
Hi folks!
I would like to know if there is a way to do a join between two tables thru fields that are similar but not exactly the same. For example, I need to join tables EKKO and CDHDR, where the PO numbers do exist in both the tables (EKKO-EBELN and CDHDR-OBJECTID), but the fields are different. Is it possible to achieve such kind of a join?
Appreciate your help.
Regards,
Anwar.>
Mohammad Anwar wrote:
though their data type is the same (CHAR).
unfortunately it is not enough... You have to select separately from the two tables and merge the data somehow in the program. -
ORA-00060: Deadlock detected
I getting error as "ORA-00060: Deadlock detected. More info in file /d01/oracle/VIS/db/tech_st/10.2.0/.................". Following are my observations on the occurence of this error.
The deadlock is encountered first time when trying to login to applications. I have R12 vision instance on linux.
Following the content of the alert_VIS.log file
Mon Jun 15 04:41:41 2009
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Picked latch-free SCN scheme 3
Using LOG_ARCHIVE_DEST_1 parameter default value as /d01/oracle/VIS/db/tech_st/10.2.0/dbs/arch
Autotune of undo retention is turned on.
IMODE=BR
ILAT =44
LICENSE_MAX_USERS = 0
SYS auditing is disabled
ksdpec: called for event 13740 prior to event group initialization
Starting up ORACLE RDBMS Version: 10.2.0.3.0.
System parameters with non-default values:
tracefiles_public = TRUE
processes = 200
sessions = 400
timed_statistics = TRUE
shared_pool_size = 419430400
shared_pool_reserved_size= 41943040
nls_language = american
nls_territory = america
nls_sort = binary
nls_date_format = DD-MON-RR
nls_numeric_characters = .,
nls_comp = binary
nls_length_semantics = BYTE
sga_target = 1073741824
control_files = /d01/oracle/VIS/db/apps_st/data/cntrl01.dbf, /d01/oracle/VIS/db/apps_st/data/cntrl02.dbf, /d01/oracle/VIS/db/apps_st/data/cntrl03.dbf
db_block_checksum = TRUE
db_block_size = 8192
compatible = 10.2.0
log_buffer = 14251008
log_checkpoint_interval = 100000
log_checkpoint_timeout = 1200
db_files = 512
log_checkpoints_to_alert = TRUE
dml_locks = 10000
undo_management = AUTO
undo_tablespace = APPS_UNDOTS1
db_block_checking = FALSE
O7_DICTIONARY_ACCESSIBILITY= FALSE
session_cached_cursors = 500
utl_file_dir = /usr/tmp, /usr/tmp, /d01/oracle/VIS/db/tech_st/10.2.0/appsutil/outbound/VIS_oracleebsr12, /usr/tmp
plsql_native_library_dir = /d01/oracle/VIS/db/tech_st/10.2.0/plsql/nativelib
plsql_native_library_subdir_count= 149
plsql_code_type = native
plsql_optimize_level = 2
job_queue_processes = 2
systemtrig_enabled = TRUE
cursor_sharing = EXACT
parallel_min_servers = 0
parallel_max_servers = 8
background_dump_dest = /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/bdump
user_dump_dest = /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/udump
max_dump_file_size = 20480
core_dump_dest = /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/cdump
db_name = VIS
open_cursors = 600
ifile = /d01/oracle/VIS/db/tech_st/10.2.0/dbs/VIS_oracleebsr12_ifile.ora
sortelimination_cost_ratio= 5
btree_bitmap_plans = FALSE
fastfull_scan_enabled = FALSE
sqlexecprogression_cost= 2147483647
likewith_bind_as_equality= TRUE
pga_aggregate_target = 1073741824
workarea_size_policy = AUTO
optimizer_secure_view_merging= FALSE
aq_tm_processes = 1
olap_page_pool_size = 4194304
Mon Jun 15 04:42:05 2009
WARNING:Oracle instance running on a system with low open file descriptor
limit. Tune your system to increase this limit to avoid
severe performance degradation.
PSP0 started with pid=3, OS id=6824
PMON started with pid=2, OS id=6822
MMAN started with pid=4, OS id=6826
DBW0 started with pid=5, OS id=6828
CKPT started with pid=7, OS id=6832
SMON started with pid=8, OS id=6834
RECO started with pid=9, OS id=6836
CJQ0 started with pid=10, OS id=6838
LGWR started with pid=6, OS id=6830
MMON started with pid=11, OS id=6840
MMNL started with pid=12, OS id=6842
Mon Jun 15 04:42:19 2009
ALTER DATABASE MOUNT
Mon Jun 15 04:42:25 2009
Setting recovery target incarnation to 2
Mon Jun 15 04:42:27 2009
Successful mount of redo thread 1, with mount id 243370348
Mon Jun 15 04:42:27 2009
Database mounted in Exclusive Mode
Completed: ALTER DATABASE MOUNT
Mon Jun 15 04:42:28 2009
ALTER DATABASE OPEN
Mon Jun 15 04:42:48 2009
Thread 1 opened at log sequence 16
Current log# 3 seq# 16 mem# 0: /d01/oracle/VIS/db/apps_st/data/log3.dbf
Successful open of redo thread 1
Mon Jun 15 04:42:48 2009
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
Mon Jun 15 04:42:48 2009
SMON: enabling cache recovery
Mon Jun 15 04:42:48 2009
Incremental checkpoint up to RBA [0x10.a779.0], current log tail at RBA [0x10.a779.0]
Mon Jun 15 04:43:01 2009
Successfully onlined Undo Tablespace 18.
Mon Jun 15 04:43:01 2009
SMON: enabling tx recovery
Mon Jun 15 04:43:04 2009
Database Characterset is UTF8
Mon Jun 15 04:43:18 2009
replication_dependency_tracking turned off (no async multimaster replication found)
Mon Jun 15 04:43:44 2009
Starting background process QMNC
QMNC started with pid=14, OS id=6884
Mon Jun 15 04:46:48 2009
Completed: ALTER DATABASE OPEN
Mon Jun 15 05:03:23 2009
Incremental checkpoint up to RBA [0x10.b1bd.0], current log tail at RBA [0x10.b1f3.0]
Mon Jun 15 05:23:33 2009
Incremental checkpoint up to RBA [0x10.b5b3.0], current log tail at RBA [0x10.b5c2.0]
Mon Jun 15 05:45:12 2009
Incremental checkpoint up to RBA [0x10.b7b0.0], current log tail at RBA [0x10.fbce.0]
This is upto the point where all DB and application services has been started.
Once trying to login to applications following content got appended to the log file
Mon Jun 15 05:53:39 2009
ORA-00060: Deadlock detected. More info in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/udump/vis_ora_8149.trc.
Mon Jun 15 05:53:51 2009
ORA-00060: Deadlock detected. More info in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/udump/vis_ora_8149.trc.
Mon Jun 15 05:54:02 2009
ORA-00060: Deadlock detected. More info in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/udump/vis_ora_8149.trc.
Mon Jun 15 05:54:12 2009
ORA-00060: Deadlock detected. More info in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/udump/vis_ora_8149.trc.
Mon Jun 15 05:54:22 2009
ORA-00060: Deadlock detected. More info in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/udump/vis_ora_8149.trc.
Mon Jun 15 05:54:28 2009
ORA-00060: Deadlock detected. More info in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/udump/vis_ora_8149.trc.
Mon Jun 15 05:54:35 2009
ORA-00060: Deadlock detected. More info in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/udump/vis_ora_8149.trc.
Mon Jun 15 05:54:42 2009
ORA-00060: Deadlock detected. More info in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/udump/vis_ora_8149.trc.
Mon Jun 15 05:59:06 2009
Process J000 died, see its trace file
Mon Jun 15 05:59:11 2009
kkjcre1p: unable to spawn jobq slave process
Mon Jun 15 05:59:11 2009
Errors in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/bdump/vis_cjq0_6838.trc:
Mon Jun 15 05:59:23 2009
Process J000 died, see its trace file
Mon Jun 15 05:59:24 2009
kkjcre1p: unable to spawn jobq slave process
Mon Jun 15 05:59:24 2009
Errors in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/bdump/vis_cjq0_6838.trc:
Mon Jun 15 05:59:50 2009
Process J000 died, see its trace file
Mon Jun 15 05:59:50 2009
kkjcre1p: unable to spawn jobq slave process
Mon Jun 15 05:59:50 2009
Errors in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/bdump/vis_cjq0_6838.trc:
I did the TKPROF on .trc files but the tkprof file does not show any details as such except similar to :- (don't know if I am missing anything while issuing TKPROF as $ tkprof filename.trc
filename.txt explain=apps/apps)
TKPROF: Release 10.2.0.3.0 - Production on Mon Jun 15 06:07:14 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Trace file: /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/bdump/vis_cjq0_6838.trc
Sort options: default
count = number of times OCI procedure was executed
cpu = cpu time in seconds executing
elapsed = elapsed time in seconds executing
disk = number of physical reads of buffers from disk
query = number of buffers gotten for consistent read
current = number of buffers gotten in current mode (usually for update)
rows = number of rows processed by the fetch or execute call
0 statements EXPLAINed in this session.
Trace file: /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/bdump/vis_cjq0_6838.trc
Trace file compatibility: 10.01.00
Sort options: default
1 session in tracefile.
0 user SQL statements in trace file.
0 internal SQL statements in trace file.
0 SQL statements in trace file.
0 unique SQL statements in trace file.
22 lines in trace file.
0 elapsed seconds in trace file.
Yesterday, I did login to applications after multiple attempts and tried submitting a concurrent request of a standard report (after resolving the data block corrupt issue) and got the same ORA-00060 Error.
I have a fresh VISION R12 (12.0.4) installed without any customizations. My installation looks to be quite unstable, takes 2-3 attempts for successful login to apps.
Can you please give any clues on this and how to overcome the problem?
Thanks,
AmitI have run cmclean.sql as per :- Re: R12 Vision install - Unable to submit concurrent request
This is the only change made. No new patches etc. Before running cmclean.sql I believe the instance was working fine.
Now everytime I start the application services, its causing ORA=00060: Deadlock error. There are no issues with just DB services up and running.
And after apps services up, when trying to Login to apps it just hangs, get error as follows:
Tue Jun 23 02:04:55 2009
Process J001 died, see its trace file
Tue Jun 23 02:04:55 2009
kkjcre1p: unable to spawn jobq slave process
Tue Jun 23 02:04:55 2009
Errors in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/bdump/vis_cjq0_6747.trc:
Tue Jun 23 02:05:04 2009
Process q002 died, see its trace file
Tue Jun 23 02:05:04 2009
ksvcreate: Process(q002) creation failed
Tue Jun 23 02:05:55 2009
Process J000 died, see its trace file
Tue Jun 23 02:05:55 2009
kkjcre1p: unable to spawn jobq slave process
Tue Jun 23 02:05:55 2009
Errors in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/bdump/vis_cjq0_6747.trc:
Tue Jun 23 02:06:11 2009
Process J000 died, see its trace file
Tue Jun 23 02:06:11 2009
kkjcre1p: unable to spawn jobq slave process
Tue Jun 23 02:06:11 2009
Errors in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/bdump/vis_cjq0_6747.trc:
Tue Jun 23 02:08:51 2009
Process J000 died, see its trace file
Tue Jun 23 02:08:52 2009
kkjcre1p: unable to spawn jobq slave process
Tue Jun 23 02:08:52 2009
Errors in file /d01/oracle/VIS/db/tech_st/10.2.0/admin/VIS_oracleebsr12/bdump/vis_cjq0_6747.trc:
The OS also hangs (Linux) and I have to exit abnormally everytime which is frustrating.
I am not sure the reason for the same. I have gone through the metalink notes pointed which says to install the health check engine.
Do you have any clues based on above information as to what might be causing this problem.
I have 4 GB RAM installed on my Windows and 2 GB has been allocated to Linux on VMware.
Please let me know if I need to upgrade the memory.
Any pointers would be really helpful.
Thanks,
Amit -
Dbua error wile upgrade from 9.5.0.5 to 10.2.0.4
I am upgrading from 9.2.0.5 to 10.2.0.4
i earlier tried to upgrade from 9.2.0.5 to 10.2.0.3, however it failed because of not applying patch-
i then cloned the instance and installed 10g software,companion products,10.2.0.4. patchset. however when u run dbua it gives a weird error->
ora 1507---database not mounted
dbua thinks this is rerun and is trying to connect to the database with orcle home"/u08/fadevdb/10g". If you beleive this is not a rerun, remove below file and rerun DBUA again
/u08/fadevdb/10g/cfgtoollogs/dbua/logs/Welcome_FADEV.tct"
However /u08/fadevdb/10g/cfgtoollogs/dbua/logs/Welcome_FADEV.txt" files does not exist
I checked the alert log
Additional information: 4087
Fri Dec 19 23:00:24 2008
ORA-205 signalled during: ALTER DATABASE MOUNT...
Fri Dec 19 23:43:40 2008
Beginning log switch checkpoint up to RBA http://0x2e.2.10, SCN: 0x0000.88b18ab0
Thread 1 advanced to log sequence 46
Current log# 1 seq# 46 mem# 0: /u04/fadevdata/log01a.dbf
Current log# 1 seq# 46 mem# 1: /u06/fadevdata/log1b.dbf
Sat Dec 20 00:04:22 2008
Completed checkpoint up to RBA http://0x2e.2.10, SCN: 0x0000.88b18ab0
^C$ tail -100 alert_FADEV.log
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Shared memory segment for instance monitoring created
Picked latch-free SCN scheme 3
Using LOG_ARCHIVE_DEST_1 parameter default value as /u08/fadevdb/10g/dbs/arch
Autotune of undo retention is turned on.
LICENSE_MAX_USERS = 0
SYS auditing is disabled
ksdpec: called for event 13740 prior to event group initialization
Starting up ORACLE RDBMS Version: 10.2.0.4.0.
System parameters with non-default values:
tracefiles_public = TRUE
processes = 200
sessions = 400
timed_statistics = TRUE
shared_pool_size = 301989888
large_pool_size = 8388608
java_pool_size = 54525952
streams_pool_size = 50331648
shared_pool_reserved_size= 30000000
sharedpool_reserved_min_alloc= 4100
nls_language = american
nls_territory = america
nls_sort = binary
nls_date_format = DD-MON-RR
nls_numeric_characters = .,
nls_comp = binary
nls_length_semantics = BYTE
control_files = /u04/fadevdata/cntrl01.dbf, /u06/fadevdata/cntrl02.dbf, /u03/fadevdata/cntrl03.dbf
db_block_checksum = TRUE
db_block_size = 8192
db_cache_size = 163577856
compatible = 9.2.0
log_buffer = 14282752
log_checkpoint_interval = 100000
log_checkpoint_timeout = 1200
db_files = 512
db_file_multiblock_read_count= 8
log_checkpoints_to_alert = TRUE
dml_locks = 10000
undo_management = AUTO
undo_tablespace = APPS_UNDOTS1
undo_retention = 1800
db_block_checking = FALSE
O7_DICTIONARY_ACCESSIBILITY= FALSE
session_cached_cursors = 200
utl_file_dir = /usr/tmp, /usr/tmp, /u02/fadevdb/9.2.0/appsutil/outbound/FADEV_fadevdb, /usr/tmp
job_queue_processes = 2
systemtrig_enabled = TRUE
cursor_sharing = EXACT
parallel_min_servers = 0
parallel_max_servers = 8
background_dump_dest = /u02/fadevdb/9.2.0/admin/FADEV_fadevdb/bdump
user_dump_dest = /u02/fadevdb/9.2.0/admin/FADEV_fadevdb/udump
max_dump_file_size = 20480
core_dump_dest = /u02/fadevdb/9.2.0/admin/FADEV_fadevdb/cdump
session_max_open_files = 20
optimizer_features_enable= 9.2.0
db_name = FADEV
open_cursors = 600
ifile = /u02/fadevdb/9.2.0/dbs/FADEV_fadevdb_ifile.ora
sortelimination_cost_ratio= 5
btree_bitmap_plans = FALSE
fastfull_scan_enabled = FALSE
query_rewrite_enabled = true
indexjoin_enabled = FALSE
sqlexecprogression_cost= 2147483647
likewith_bind_as_equality= TRUE
pga_aggregate_target = 1073741824
workarea_size_policy = AUTO
aq_tm_processes = 1
olap_page_pool_size = 4194304
PSP0 started with pid=3, OS id=28588
MMAN started with pid=4, OS id=28590
PMON started with pid=2, OS id=28586
DBW0 started with pid=5, OS id=28592
LGWR started with pid=6, OS id=28594
CKPT started with pid=7, OS id=28596
SMON started with pid=8, OS id=28598
RECO started with pid=9, OS id=28600
CJQ0 started with pid=10, OS id=28602
MMON started with pid=11, OS id=28604
MMNL started with pid=12, OS id=28606
Fri Dec 19 23:00:21 2008
ALTER DATABASE MOUNT
Fri Dec 19 23:00:21 2008
ORA-00202: control file: '/u04/fadevdata/cntrl01.dbf'
ORA-27086: unable to lock file - already in use
SVR4 Error: 11: Resource temporarily unavailable
Additional information: 8
Additional information: 4087
Fri Dec 19 23:00:24 2008
ORA-205 signalled during: ALTER DATABASE MOUNT...
Fri Dec 19 23:43:40 2008
Beginning log switch checkpoint up to RBA http://0x2e.2.10, SCN: 0x0000.88b18ab0
Thread 1 advanced to log sequence 46
Current log# 1 seq# 46 mem# 0: /u04/fadevdata/log01a.dbf
Current log# 1 seq# 46 mem# 1: /u06/fadevdata/log1b.dbf
Sat Dec 20 00:04:22 2008
Completed checkpoint up to RBA http://0x2e.2.10, SCN: 0x0000.88b18ab0
I then found that ctr101.dbf had permissions of "rw-r-r". I gave 777 permission.aborted dbua and again started dbua. However it still gives the same problem.
If you note the alert log...then 10g is trying to start while 9i is already running.i then shutdown and started 9i again and then started dbua...however it again gives the same error.
How do i resolve it?Hi,
I would quickly identify some of the errors that I'm seeing in the log:
ORA-01034: ORACLE not available
This is probably occuring due to invalid entries in /etc/oratab and /var/opt/oracle/oratab, where ORACLE_HOME and ORACLE_SID are not properly defined. This could also be due to invalid entries within the listener file. Further to this, you may try to read through the following Metalink Note to resolve this issue:
https://metalink.oracle.com/metalink/plsql/f?p=130:14:2840960078839325001::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,302510.1,1,1,1,helvetica
A similar issue is being discussed here ORA-27086: unable to lock file over NFS -- but it's NOT Netapp!
SVR4 Error: 11: Resource temporarily unavailable
This is probably over-writing some already existing/production control files. Try pointing CONTROL_FILES parameter within init.ora to point to a new location. Once this is done you must now change the location of your datafiles, and finally change the location of your redo log files.
ORA-205 signalled during: ALTER DATABASE MOUNT
This again is falling in succession to the errors being popped up against the control files. Try to start the database without mounting it and check for the control files in v$parameter2.
Lastly, you may also want to check if the database is starting from the spfile instead of the pfile. If it is, alter it to start from the pfile.
I hope this helps.
Regards,
Naveed. -
Hi,
To tune the database i generated statspack report please share me the tips regarding tuning. part of the statspack is given below
STATSPACK report for
DB Name DB Id Instance Inst Num Release OPS Host
PINDB 3730403337 pindb 1 8.1.7.0.0 NO suportal01
Snap Id Snap Time Sessions
Begin Snap: 21 21-Jul-08 13:08:31 210
End Snap: 22 21-Jul-08 13:22:24 210
Elapsed: 13.88 (mins)
Cache Sizes
~~~~~~~~~~~
db_block_buffers: 409600 log_buffer: 163840
db_block_size: 4096 shared_pool_size: 1310720000
Load Profile
~~~~~~~~~~~~ Per Second Per Transaction
Redo size: 42,186.94 5,846.24
Logical reads: 38,625.42 5,352.68
Block changes: 174.36 24.16
Physical reads: 17,187.35 2,381.81
Physical writes: 173.19 24.00
User calls: 163.64 22.68
Parses: 26.36 3.65
Hard parses: 1.23 0.17
Sorts: 13.91 1.93
Logons: 0.27 0.04
Executes: 708.32 98.16
Transactions: 7.22
% Blocks changed per Read: 0.45 Recursive Call %: 80.91
Rollback per transaction %: 0.67 Rows per Sort: #######
Instance Efficiency Percentages (Target 100%)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Buffer Nowait %: 98.10 Redo NoWait %: 99.97
Buffer Hit %: 55.50 In-memory Sort %: 99.69
Library Hit %: 99.62 Soft Parse %: 95.35
Execute to Parse %: 96.28 Latch Hit %: 99.73
Parse CPU to Parse Elapsd %: 30.23 % Non-Parse CPU: 99.99
Shared Pool Statistics Begin End
Memory Usage %: 83.58 83.11
% SQL with executions>1: 62.74 63.24
% Memory for SQL w/exec>1: 37.31 38.34
STATSPACK report for
DB Name DB Id Instance Inst Num Release OPS Host
PINDB 3730403337 pindb 1 8.1.7.0.0 NO suportal01
Snap Id Snap Time Sessions
Begin Snap: 21 21-Jul-08 13:08:31 210
End Snap: 22 21-Jul-08 13:22:24 210
Elapsed: 13.88 (mins)
Cache Sizes
~~~~~~~~~~~
db_block_buffers: 409600 log_buffer: 163840
db_block_size: 4096 shared_pool_size: 1310720000
Load Profile
~~~~~~~~~~~~ Per Second Per Transaction
Redo size: 42,186.94 5,846.24
Logical reads: 38,625.42 5,352.68
Block changes: 174.36 24.16
Physical reads: 17,187.35 2,381.81
Physical writes: 173.19 24.00
User calls: 163.64 22.68
Parses: 26.36 3.65
Hard parses: 1.23 0.17
Sorts: 13.91 1.93
Logons: 0.27 0.04
Executes: 708.32 98.16
Transactions: 7.22
% Blocks changed per Read: 0.45 Recursive Call %: 80.91
Rollback per transaction %: 0.67 Rows per Sort: #######
Instance Efficiency Percentages (Target 100%)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Buffer Nowait %: 98.10 Redo NoWait %: 99.97
Buffer Hit %: 55.50 In-memory Sort %: 99.69
Library Hit %: 99.62 Soft Parse %: 95.35
Execute to Parse %: 96.28 Latch Hit %: 99.73
Parse CPU to Parse Elapsd %: 30.23 % Non-Parse CPU: 99.99
Shared Pool Statistics Begin End
Memory Usage %: 83.58 83.11
% SQL with executions>1: 62.74 63.24
% Memory for SQL w/exec>1: 37.31 38.34
Buffer Pool Statistics for DB: PINDB Instance: pindb Snaps: 21 -22
-> Pools D: default pool, K: keep pool, R: recycle pool
Free Write Buffer
Buffer Consistent Physical Physical Buffer Complete Busy
P Gets Gets Reads Writes Waits Waits Waits
D 14,233,242 0 14,216,020 39,539 0 0 612,534
Buffer wait Statistics for DB: PINDB Instance: pindb Snaps: 21 -22
-> ordered by wait time desc, waits desc
Tot Wait Avg
Class Waits Time (cs) Time (cs)
data block 611,175 0 0
undo header 2 0 0
Enqueue activity for DB: PINDB Instance: pindb Snaps: 21 -22
-> ordered by waits desc, gets desc
Enqueue Gets Waits
TX 7,173 4Thanks
Prakash
Message was edited by:
user612485Hi,
Your Buffer it ratio at that time is 55.50%, close to 85% should be good.>>>can i increase db_block_buffers for this
Parse CPU to Parse Elapsd %: 30.23, only 30% of your sql statements are shared, you need to change the cursor_sharing to ( force or similar) and the application code as well to potentatially use less literal variables>>>>since it is oracle 8.1.7.0.0. cursor_sharing=force is not available and i discuss with the developers regarding that.suppose if i make cursor_sharing=exact(default) to similar is it impact on execution plan of the queries.
shared pool Memory Usage %: 83.58 >>>>>>>>>>>>>>shall i increase shared_pool_size
Regards
Prakash
Message was edited by:
user612485 -
Please reply:how to avoid extra trailing spaces while using cursor sharing
i am using cursor sharing with FORCE or SIMILAR.
what is the solution to avoid extra trailing spaces without any java code change.
do we have any option in oracle to avoid extra trailing spaces during the query processing ?
I am using Oracle 10g
CURSOR SHARING is a feature in which multiple sql statements
which are same will have a shared cursor (in the library cache) for an oracle session,
i.e, the first three steps of the sql processing (hard parse, soft parse, optimization)
will be done only the first time that kind of statement is executed.
There are two ways in which similar SQL statements with different condition values can be made to "SHARE" cursor during execution:
1. Writing SQLs with Bind Variables: SQLs having no hard coded literals in them
For e.g., the query below
SELECT node.emp_name AS configid
FROM emp node
WHERE emp_no = :1
AND dept_no =
DECODE (SUBSTR (:2, 1, 3),
:3, :4,
(SELECT MAX (dept_no)
FROM emp
WHERE emp_no = :5 AND dept_no <= :6)
AND node.dept_type = :7
ORDER BY node.emp_name
Here all the variables are dynamically bound during the execution. The ":X" represents BIND Variable and the actual values are bound to the SQL only at the 4th step of the execution of the SQL.
In applications: The queries written with "?" as bind variables will be converted into ":X" and are sqls with Bind Variables.
2. The CURSOR_SHARING parameter: Only Useful for SQL statements containing literals:
For eg., the query below:
SELECT node.emp_name AS configid
FROM emp node
WHERE emp_no = 'H200'
AND dept_no =
DECODE (SUBSTR (:1, 1, 3),
'PLN', :2,
(SELECT MAX (dept_no)
FROM emp
WHERE emp_no = :3 AND dept_no <= :4)
AND node.dept_type = :5
ORDER BY node.emp_name
In the query above, there are two hard coded literals H200 , PLN. In this case when the same SQL executed with different values like (H2003 , PLN), oracle will create a new cursor for this statement and all the first three steps ( hard & soft parse and optimization plan) needs to be done again.
This can be avoided by changing the CURSOR_SHARING parameter which can be set to any of three values:
1. EXACT: Causes the mechanism not be used, i.e. no cursor sharing for statements with different literals. This is the default value.
2. FORCE: Causes unconditional sharing of SQL statements that only differ in literals.
3. SIMILAR: Causes cursor sharing to take place when this is known not to have any impact on optimization.
So, FORCE and SIMILAR values of the parameter will be helping in cursor sharing and improve the performance of the SQLs having literals.
But here the problem arises if we use the FORCE and SIMILAR other than EXACT.
alter session set cursor_sharing ='EXACT'
select 1 from dual;
'1'
1
alter session set curson_sharing='FORCE'
select 2 from dual;
'2'
2
alter session set curson_sharing='SIMILAR'
select 3 from dual;
'3'
3
So, this will give extra trailing spaces in when we retrieve from java method and any
further java processing based on the hardcoded literal values will fail. this needs lot of
effort in remodifying the existing millions of lines of code.
My question is i have to use cursor sharing with FORCE or SIMILAR and can't we do the trimming
from the oracle query processing level ?
please help me on this ?
Message was edited by:
Leeladhar
Message was edited by:
LeeladharPlease reply to this thread
How to avoid extr trailing spaces using Cursor sharing opton FORCE, SIMILAR -
I am trying to figure out why the explain plan (and performance) for the same query is different between our staging environment and our production environment when using the RESULT_CACHE hint. It's significantly worse in production. Platform and database version is the same. There are differences in the init settings between the two environments, specifically the following:
In Stage:
optimizer_mode = first_rows_100
result_cache_mode=manual
result_cache_max_result=5
result_cache_max_size=7872K
cursor_sharing=similar
In Prod:
optimizer_mode =
result_cache_mode=
result_cache_max_result=
result_cache_max_size=
cursor_sharing=exact
When I run the query in Stage, the explain plan looks like this:
Execution Plan
Plan hash value: 3058471186
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 263 | 8 (13)| 00:00:01 |
|* 1 | FILTER | | | | | |
| 2 | HASH GROUP BY | | 1 | 263 | 8 (13)| 00:00:01 |
| 3 | NESTED LOOPS | | 1 | 263 | 7 (0)| 00:00:01 |
|* 4 | TABLE ACCESS BY INDEX ROWID| C11_HOLDINGS | 1 | 195 | 4 (0)| 00:00:01 |
|* 5 | INDEX RANGE SCAN | HOLDING_CALC2_IDX | 1 | | 3 (0)| 00:00:01 |
|* 6 | TABLE ACCESS BY INDEX ROWID| C11_HOLDINGS | 1 | 68 | 3 (0)| 00:00:01 |
|* 7 | INDEX RANGE SCAN | HOLDING_CALC_IDX | 1 | | 2 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - filter("STATEMENT_DATE"=MAX("STATEMENT_DATE"))
4 - filter(UPPER("SYMBOL")=UPPER(NVL(NULL,"SYMBOL")) AND "SECURITY_TYPE"<>'NO REVIEW
REQUIRED' AND ("STATEMENT_DATE">=INTERNAL_FUNCTION("STATEMENT_DATE")-.0000115740740740740740
7407407407407407407407 OR "STATEMENT_DATE"=NULL) AND "ACTIVE_FLAG"='Y' AND
"STATEMENT_DATE"<=SYSDATE@!-3)
5 - access("BROKERAGE_ACCOUNT_ID"=14873 AND "USER_ID"=39356 AND "CLIENT_ID"=609)
6 - filter("B"."ACTIVE_FLAG"='Y' AND "B"."STATEMENT_DATE"<=SYSDATE@!-3 AND
"A"."SYMBOL"="B"."SYMBOL")
7 - access("B"."BROKERAGE_ACCOUNT_ID"=14873 AND "B"."USER_ID"=39356 AND
"B"."CLIENT_ID"=609 AND "A"."SECURITY_TYPE"="B"."SECURITY_TYPE")
filter("B"."SECURITY_TYPE"<>'NO REVIEW REQUIRED')
Statistics
0 recursive calls
0 db block gets
1356 consistent gets
0 physical reads
0 redo size
1904 bytes sent via SQL*Net to client
360 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
3 rows processed
When I run it in Prod:
Execution Plan
Plan hash value: 1021161140
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 252 | 239 (1)| 00:00:03 |
| 1 | NESTED LOOPS | | | | | |
| 2 | NESTED LOOPS | | 1 | 252 | 239 (1)| 00:00:03 |
| 3 | VIEW | VW_SQ_1 | 1 | 88 | 236 (1)| 00:00:03 |
|* 4 | FILTER | | | | | |
| 5 | HASH GROUP BY | | 1 | 83 | 236 (1)| 00:00:03 |
|* 6 | TABLE ACCESS BY INDEX ROWID| C11_HOLDINGS | 256 | 21248 | 235 (0)| 00:00:03 |
|* 7 | INDEX RANGE SCAN | HOLDING_CALC2_IDX | 512 | | 5 (0)| 00:00:01 |
|* 8 | INDEX RANGE SCAN | HOLDINGS_SYMB_IDX | 1 | | 2 (0)| 00:00:01 |
|* 9 | TABLE ACCESS BY INDEX ROWID | C11_HOLDINGS | 1 | 164 | 3 (0)| 00:00:01 |
Predicate Information (identified by operation id):
4 - filter("B"."BROKERAGE_ACCOUNT_ID"=14873 AND "B"."USER_ID"=39356 AND
"B"."CLIENT_ID"=609 AND MAX("STATEMENT_DATE")<=SYSDATE@!-3)
6 - filter("B"."ACTIVE_FLAG"='Y' AND "B"."STATEMENT_DATE"<=SYSDATE@!-3 AND
"B"."SECURITY_TYPE"<>'NO REVIEW REQUIRED')
7 - access("B"."BROKERAGE_ACCOUNT_ID"=14873 AND "B"."USER_ID"=39356 AND
"B"."CLIENT_ID"=609)
8 - access("A"."SYMBOL"="ITEM_5")
filter(UPPER("SYMBOL")=UPPER(NVL(NULL,"SYMBOL")))
9 - filter("BROKERAGE_ACCOUNT_ID"=14873 AND "USER_ID"=39356 AND "CLIENT_ID"=609 AND
"ACTIVE_FLAG"='Y' AND "SECURITY_TYPE"<>'NO REVIEW REQUIRED' AND
("STATEMENT_DATE">=INTERNAL_FUNCTION("STATEMENT_DATE")-.00001157407407407407407407407407407407
407407 OR "STATEMENT_DATE"=NULL) AND "STATEMENT_DATE"<=SYSDATE@!-3 AND
"STATEMENT_DATE"="MAX(STATEMENT_DATE)" AND "A"."SECURITY_TYPE"="ITEM_4")
Statistics
0 recursive calls
0 db block gets
18051 consistent gets
0 physical reads
0 redo size
1872 bytes sent via SQL*Net to client
360 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
3 rows processed
The queries and the data in both environments are identical. Any ideas, suggestions would be appreciated.
ThanksInterestingly, the explain plans are identical to what they were with the result_cache hint.
-
How to avoid:Query returns extra trailing spaces in oracle 10g
I want to use cursor sharing FORCE, SIMILAR for performance tuning. but i am having some problems like query process will give extra trailing spaces this will throw errors from the java application while reading literals.
do we have any option in oracle 10g to avoid extra trailing spaces during query processing ?
alter session set cursor_sharing ='EXACT'
select 1 from dual;
'1'
1
alter session set curson_sharing='FORCE'
select 2 from dual;
'2'
2
alter session set curson_sharing='SIMILAR'
select 3 from dual;
'3'
3You are right, But we already wrote millions of queries during that time we used cursor sharing is EXACT. so i don't want to take risk in modifying all the existing queries by adding TRIM.
do we have any option in oracle to trim after/ during processing the query.
Now we are facing performance issues and suggested us to use SIMILAR as cursor_sharing. but all the selected rows are giving extra tralining spaces.
I think i am clear now. -
PreparedStatement 와 cursor sharing 파라메터에 관해 질문입니다.
PreparedStatement 와 cursor sharing 파라메터에 관해 질문입니다.
cursor_sharing 파라메터를 EXACT 가 아닌 similar, force를 이용하면
리터럴이나 바인드 변수를 제외한 나머지 문장이 동일하면 같은 문장으로 취급하여
동일한 실행 계획을 이용한것으로 알고 있습니다.
그런데 만약 EXACT인경우 는 SQL-PLUS 상에서
select * from dept where deptno = &dept 이렇게 바인드 변수를 사용해도
다른 문장으로 처리하더군요.... 그렇다면
PreparedStatement의 경우는 EXACT일때 어떻게 되는건인가요?
어떤 jdbc 책도 ps 를 사용하라고 나와있고 오라클 튜닝책에는 cursor_sharing을
적절하게 사용하라고 되어있습니다.
두가지에 대해 같이 언급하는것은 없는데....
EXACT일때도 ps가 가능한것인지 좀 가르쳐 주세요...아래는 성능테스트를 한 상황입니다.
CURSOR_SHARING의 사용
===========================================
Explanation
1. 용례
1) initSID.ora에 기술 : CURSOR_SHARING = { FORCE | EXACT }
2) Scope : Dynamic ( ALTER SESSION, ALTER SYSTEM )
3) Default Value : EXACT
2. 설명
다음과 같은 두 개의 SQL 문장은 sql area의 cursor를 공유하지
못한다.
SELECT ename, empno FROM emp where deptno = 10;
SELECT ename, empno FROM emp where deptno = 20;
-> 위 sql 문장에서 다른 부분은 모두 동일하나 binding variable을
사용하지 않고 각각 상수인 10, 20을 사용한다.
만약 두 가지 sql 문장이 cursor를 공유하도록 하기 위해서는
sql 문장을 다음과 같이 바꿀 수 있다.
SELECT ename, empno FROM emp where deptno = :department_no;
하지만 이와 같이 바꾸는 것이 여의치 않을 경우 init 파라미터 파일이나
ALTER SYSTEM, ALTER SESSION 등의 명령으로 CURSOR_SHARING 값을
FORCE로 지정하면 된다.
3. 고려사항
CURSOR_SHARING 값을 FORCE로 지정하기 위해서는 다음과 같은 2가지 사항을
고려하여야만 한다.
1) SQL area에서 값을 제외한 다른 부분이 모두 동일한 문장이 많이 있는지
2) library cache miss가 높아 response time이 늦는지
* DSS 시스템에서는 CURSOR_SHARING 값을 FORCE로 지정할 경우 결과를 예측
하기 어려우므로 권장하지 않는다. 또한 복잡한 query나 query rewrite,
stored outline을 사용할 경우에도 CURSOR_SHARING 값을 FORCE로 지정하는
것을 권장하지 않는다.
4. 성능 분석
환경 : Windows NT 4.0 ( Pentium 233MHz 1 CPU, 128M )
Oracle 8.1.6
시나리오 : 특정 table에 만 개의 row insert
1) Binding Variable을 사용하지 않고 CURSOR_SHARING 값이 EXACT인 경우
-> Total time elapsed : 80,496 msec.
2) Binding Variable을 사용하지 않고 CURSOR_SHARING 값이 FORCE인 경우
-> Total time elapsed : 61,699 msec.
3) Binding Variable을 사용할 경우
-> Total time elapsed : 21,561 msec.
위 결과에 따르면 동일한 sql 문장을 반복적으로 처리할 경우 binding
variable을 사용하는 것이 가장 속도가 빠른 것으로 나타났으며, binding
variable을 사용하지 않을 경우에도 CURSOR_SHARING 값이 FORCE일 경우
그렇지 않을 경우 약 23% 정도의 속도 개선 효과가 있음을 알 수 있다.
글 수정:
minyh0124 -
Do stored outlines work in Oracle 10.2.0.3?
I am using 10.2.0.3 on HP UNIX 11i. I set cursor_sharing=force.
I created a stored outline using:
alter session set create_stored_outlines='CUSTOM';
my sql_statement;
When I run the sql statement and verify in v$sql whether outline was used by looking at outline_category and yes outline is used.
But then I run dbms_stat on an underlying table and run my sql again, my plan has changed which means outline was not used. This is really baffling, if outline was used,
Plan should be same as what was produced when creating outline. Something is
Definitely wrong.After spending whole day, I narrowed down the proble. Stored outlines in 10.2.0.3
do not work anymore whith cursor_sharing=force. They, however, they work with
cusror_sharing=similar and cirsor_sahring=exact. -
Delete a parse statement from shared pool
Can anybody help me to delete a parse statement from shared pool without affecting other objects ( without using ALTER SYSTEM FLUSH SHARED POOL;). This i am trying in my personal training db and I am using 10g. Thanks in advance for all of your replies.
Thank you for all your replies.
I am a newbie to oracle. Just i am playing with usage of bind variables and parameter CURSOR_SHARING .Need to verify when the data is heavly skewed ,sql parsing will occur for the sql statement having bind variables with parameter CURSOR_SHARING=EXACT but not with CURSOR_SHARING=FORCE / SIMILAR .
But infact i didn't see any sql parsing with parameter value EXACT . thinking of deleting my old parse statement from shared pool and try it again.
thanks again
Maybe you are looking for
-
Update was terminated error while scheduling maintenance plan
HI Friends, I created a maintenance plan.I scheduled the order and i saved. Now when i tried to see the schedule i am getting a message "Update was terminated" the detailed error is Update was terminated System ID.... DEV Client....... XXX User..
-
Hi, I downloaded iOS 7 recently. Everything was fine until I checked my apps and saw that there was something to update. I tried to update it and it won't work. Also whenever I try to put in my Apple ID and password for anything (ex. iMessage, etc.)
-
I am making a pdf form using acrobat XI on a mac (OS 10.6) and want to have a button to press that will input GPS co-ords into form fields, derived from the device (tablet, android, idevice) Someone else asked the same question in a forum, got the fo
-
What's everyone gonna do for 5.1 as well as video monitoring in Studio 2?
Anyone using a Decklink or a KONA card and then monitoring audio through a seperate device? Are you having sync issues? What's the best way to do this? Thanks for any input! Bob
-
I would like to cancel the photoshop program. Order n° AD005353543IT. Thank you
I would like to cancel the photoshop program. Order n° AD005353543IT. Thank you