SQL versions with cursor_sharing=similar
Hello,
We have a Peoplesoft DB and we have been obliged to use cursor_sharing=similar to solve some of our problems. We have just noticed that with Oracle *9.2.0.7*, when a table is partitioned, many versions of the same sql are created in the SGA. Here is the demo
CREATE TABLE T5
ID NUMBER(2),
NAME VARCHAR2(15 BYTE)
PARTITION BY RANGE (ID)
PARTITION P1 VALUES LESS THAN (10),
PARTITION P2 VALUES LESS THAN (20),
PARTITION P3 VALUES LESS THAN (30),
PARTITION P_MAXVALUE VALUES LESS THAN (MAXVALUE));
alter session set cursor_sharing=similar;
select count(*) from t5 where id = 1;
select count(*) from t5 where id = 10;
select count(*) from t5 where id = 30;
select count(*) from t5 where id = 5;
select count(*) from t5 where id = 15;Now we check the SGA:
SQL> select hash_value,CHILD_NUMBER,EXECUTIONS,sql_text from v$sql where SQL_TEXT like '%t5%';
HASH_VALUE CHILD_NUMBER EXECUTIONS SQL_TEXT
602987019 0 1 select count(*) from t5 where id = :"SYS_B_0"
602987019 1 1 select count(*) from t5 where id = :"SYS_B_0"
602987019 2 1 select count(*) from t5 where id = :"SYS_B_0"
602987019 3 1 select count(*) from t5 where id = :"SYS_B_0"
602987019 4 1 select count(*) from t5 where id = :"SYS_B_0"Is there a way to avoid all these child cursors?
Has anyone had this same problem before?
Well, I just tried it, but this time with a table NOT partitioned, no histograms and no range operation, with Oracle version 10.2.0.1 and I got the same results:
SQL> CREATE TABLE T6
ID NUMBER(2),
NAME VARCHAR2(15 BYTE)
SQL> alter session set cursor_sharing=similar;
Session altered.
SQL>
SQL> select count(*) from t6 where id = 1;
COUNT(*)
0
SQL> select count(*) from t6 where id = 10;
COUNT(*)
0
SQL> select count(*) from t6 where id = 30;
COUNT(*)
0
SQL> select count(*) from t6 where id = 5;
COUNT(*)
0
SQL> select count(*) from t6 where id = 15;
COUNT(*)
0
SQL> select hash_value,CHILD_NUMBER,EXECUTIONS,sql_text
from v$sql where SQL_TEXT like '%t6%';
HASH_VALUE CHILD_NUMBER EXECUTIONS SQL_TEXT
2780697141 0 1 select count(*) from t6 where
id = :"SYS_B_0"
2780697141 1 1 select count(*) from t6 where
id = :"SYS_B_0"
2780697141 2 1 select count(*) from t6 where
id = :"SYS_B_0"
2780697141 3 1 select count(*) from t6 where
id = :"SYS_B_0"
HASH_VALUE CHILD_NUMBER EXECUTIONS SQL_TEXT
2780697141 4 1 select count(*) from t6 where
id = :"SYS_B_0"
2776262046 0 2 select hash_value,CHILD_NUMBER
,EXECUTIONS,sql_text from v$sq
l where SQL_TEXT like '%t6%'
6 rows selected.So?
Similar Messages
-
Have Photoshop Elements from 2001. Got new computer with Windows 7 Professional 64 bit. It won't run on my new computer. What version is MOST SIMILAR to the old version I have, that will run on W7P-64? Thanks for any help. Popjer
You should probably just download the trial version of pse 12 and see if you can live with it.
Download a free trial or buy Adobe products | Adobe downloads
That being said, have you tried to install pse 1 on your computer?
How much free space is on your hard drive?
Do you have Internet Explorer 10 or 11?
Pse 1 can run on windows 7 x64, provided certain conditions are met. -
Trace file in bdump (SQL ID with large Version Count encountered.)
Hi, all.
I found tons of this trace file in one of my oracle servers. What does this mean? did anyone ever see this? How to solve it?
Thanks.
*** ACTION NAME:(Auto-Flush Slave Action) 2009-01-28 18:00:10.985
*** MODULE NAME:(MMON_SLAVE) 2009-01-28 18:00:10.985
*** SERVICE NAME:(SYS$BACKGROUND) 2009-01-28 18:00:10.985
*** SESSION ID:(84.5246) 2009-01-28 18:00:10.985
SQL ID with large Version Count encountered.
SQL Id: b221muwskhm6
Version Count: 299, Parse Calls: 12, Shareable Mem: 11907351
Elapsed Time: 0, CPU Time: 0, Executions: 0
Disk reads: 0, Buffer Gets: 0, I/O Wait Class: 0
Application WC: 0, Concurrency WC: 0, Cluster WC: 0Refer Oracle Support note 4632024.8
-
Hi
I can't open sql files with file type .pck. They are opened as a package. The icon is a package too. (Worked fine in 4.0)
My settings:
Thanks for any helpThanks, but that doesn't help
To specify it more precisly: I can open such a file, but it is not opened as a sql file. The icons you see above left are the icons of the files (not of the packages).
Greetings
Ovi -
_optim_peek_user_binds and cursor_sharing=SIMILAR
Hello evey DBA,
Please tell me If I am wrong :
I think that the setting of "_optim_peek_user_binds" has no sens, if "cursor_sharing=similar"
Because, when the cursor_sharing=similar, oracle ALWAYS peeking the bind variables to check of the repartition of the corresponding columns on the histograms, and decide if it can use the same plan or if it's better to generate a new plan ...
Assume that the columns in question have their histogram.
Am I wrong ?Hemant K Chitale wrote:
There are very many references to ""_optim_peek_user_binds" on MetaLink. So it isn't exactly "undocumented ... there is no official description of its purpose". The cat is out of the bag.How about - this is a deliberately hidden parameter. Hidden parameters are hidden for a reason.
According to Metalink note 315631.1 "NB:It is never recommended to modify these hidden parameters without the assistance of Oracle Support.Changing these parameters may lead to high performance degradation and other problems in the database." And Note 790268.1 shows a method of finding sessions that have set hidden parameters.
Based on information in Metalink and other sources, one could reasonably conclude that
- hidden parameters may change in impact or meaning at any upgrade or patch, so even version is not enough to properly discuss them in all cases;
- hidden parameters should not be published or discussed at length in a public forum, lest newbies misinterpret and use them to potentially disasterous effect;
- hidden parameters could be discussed in specialty and advanced forums (such as Oracle Scratchpad) because advanced readers tend to be careful;
- information about hidden parameters should be researched in Metalink, or with Support, first before use;
- impact of hidden parameters should be evaluated in a test environment, not in a debate.
That said, this one is well discussed in note 387394.1 ]:) -
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,
MeeranMeeran 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. -
SQL Version Count in AWR and Child Cursor
Hi,
In 11.1.0.7, what is SQL Version count in AWR report? What does it mean? and how oracle does this version count? How do we define child cursor?
ThanksHi,
when you issue a SQL statement, the database searches the library cache to find a cursor with matching SQL text. Then it can happen that even though the text matches, there are some other differences that prevent you from using existing cursor (e.g. different optimizer settings, different NLS settings, different permissions etc.). In such cases, a new child cursor is created. So basically child cursors are different versions of the same SQL statement.
If you have SQL statements with thousands of versions, this could mean a problem for your shared pool (child cursors taking up lots of space and causing fragmentation), as well as a potential for performance problems due to plan instability (if the same SQL text is parsed to a new plan every time, sooner or later it will be a bad plan). That's why AWR report has this list.
According to Oracle support, up to a couple of hundreds versions doesn't indicate a problem (cursor sharing mechanism isn't perfect), but when you have thousands or tens of thousands of versions, you should check your cursor sharing settings (first of all, CURSOR_SHARING parameter).
Best regards,
Nikolay -
Can't update a sql-table with a space
Hello,
In a transaktion I'm getting some Values from a SAP-ERP System via JCO.
I update a sql-table with this values with a sql-query command.
But sometimes the values I get from SAP-ERP are empty (space) and I'm not able to update the sql-table because of a null-value exception. (The column doesn't allow null-values). It seems that MII thinks null and space are the same.
I tried to something like this when passing the value to the sql-query parameter but it didn't work:
stringif( Repeater_Result.Output{/item/SCHGT} == "X", "X", " ")
stringif( Repeater_Result.Output{/item/SCHGT} == "X", "X", " ")
this works but I don't want to have a "_"
stringif( Repeater_Result.Output{/item/SCHGT} == "X", "X", "_")
Any suggestions?
thank you.
MatthiasThe problem is Oracle doesn't know the space function. But it knows a similar function: NVL --> replaces a null value with something else. So this statement works fine for me:
update marc set
LGort = '[Param.3]',
dispo = '[Param.4]',
schgt = NVL('[Param.5]', ' '),
dismm = '[Param.6]',
sobsl = NVL('[Param.7]',' '),
fevor = '[Param.8]'
where matnr = '[Param.1]' and werks = '[Param.2]'
If Param.5 or Param.7 is null Oracle replaces it with a space in every other case it is the parameter itself.
Christian, thank you for your hint with the space function. So I remembered the NVL-function.
Regards
Matthias -
Installing Oracle 8i in Solaris Intel Version With Pentium 4
Hi Guys,
I am trying to Install Oracle 8i under Solaris 8 Intel version with Pentium 4 processor fixed.But iam'nt able to continue after I click "Install" button,the runInstaller exited badly with no response.I was told that even Installing Oracle under Windows P4 is facing the same problem,but on searching I got solution by renaming a DDL file before starting installation.Is there any similar method to do for installing it under p4 processor on solaris intel 8 version.Dear Mr. Kumar, i am chandrasekaran from singapore, actualy i need your help regarding the intel sun os oracle. I have Intel Based SUN OS, but i try to get Oracle CD Any version either 8i or 9i for intel sun os.
One of my friend have the cd but it already damaged so that i need your help.
My address
S.Chandrasekaran, Blk 84 #07-93, Commonwealth close, Singapore 140084. If you have the cd you make one copy for me and send by post. Thank you
My email id: [email protected] or yahoo.com
by chandran.s -
Sql server with multiple instance
hi All,
i want to install sql server with two instance and i want to assign two separate is ips for both default instance and named instance and both should work like
two different server
note: If i logged with one ip(default instance) it should show its own databases not both or named instance databases
thanks
chintalaHi chintala,
According to your description, if you want to assign the two different IP to stand for default instance
and named instance, I recommend you set up aliases on a SQL Server with multiple instances. For example, a physical server is named WinServer and 2 instances of SQL Server named WinServer and WinServer\instance1.
We need to add 1 IP addresse to the WinServer, there is one IP address already assigned to WinServer, 192.168.1.1, by adding one new IP's, 192.168.1.2 .
We need to move into DNS to configure our host names and aliases. The physical machine must be steup as a static IP in DNS. SQLAlias1, which point to the default instance on WinServer, will be setup as a DNS with an address of 192.168.1.1.
SQLAlias2, which will point to WinServer\Instance1, will be setup as a new Host (A) record in DNS with an address of 192.168.1.2.
When everything has been completed on the DNS side, you need to open up SQL Server Configuration Manager on WinServer and configure the protocols for each instance one at a time, restart the 3 SQL services.
For more information about how to set up aliases on a SQL Server with multiple instances, you can review the similar article.
http://kevine323.blogspot.com/2013/08/setting-up-aliases-on-sql-server-with.html
Regards,
Sofiya Li
Sofiya Li
TechNet Community Support -
Which version of SQL Server with BIDS is recommended for a starter? I keep on running in various problems when installing and uninstalling.
SQL Server 2014 is the latest SQL version and from SQL 2012, BIDS is replaced with SSDT(sql server data tools). refer: https://msdn.microsoft.com/library/cc645993.aspx?f=255&MSPPError=-2147217396
Express edition does not have this. but SQL 2014 'Express with advanced services' edition has it. i do not think full functionality is available though.
if you only want BIDS, you can install SQL 2008R2 express with advanced services edition. google for the link
this link is for SQL 2008 http://www.microsoft.com/en-us/download/details.aspx?id=1842
if this is for learning purpose, i would recommend installing sql 2014 enterprise evaluation edition. that way you can get full exposure to SQL product suite
Hope it Helps!! -
Usage of java.sql.Timestamp with classes12.zip and ojdbc14.jar ?
Hi all,
If i'm using java.sql.Timestamp with classes12 it is functioning perfectly,
if i'm using ojdbc14 and java.sql.Timestamp it is functioning in different way and failing to do the action..
Example : update set xxx=yy where time = my Timestamp object set in Prepared statement
Hope to see the answerhttp://forum.java.sun.com/thread.jspa?threadID=460615&messageID=2116517
Timestamp insert problem
Using the "classes12.zip" file that comes with the distribution for Oracle versions 8.1.6.x and 8.1.7.x, Oracle's DATE datatype is mapped to the "java.sql.Timestamp" class. However, the "ojdbc14.jar" driver maps DATE to "java.sql.Date", and "java.sql.Date" only holds a date (without a time), whereas "java.sql.Timestamp" holds both a date and a time. -
SQL Developer with Mac Os X 1.3.9
Greetings,
I am running Oracle Database 10g Release 1 (10.1.0.3) on my Powerbook G4 1 GHz with 768 MB ram. After reading the requirements for SQL developer for OS X, I thought I would try to install it. Unfortunately there seems to be a conflict in the requirements for installing SQL developer.
"Operating System
Apple Mac OS X Version 10.3
CPU Type and Speed
Dual 1.25 GHz G4/G5 (1 GHz G4 minimum)
Memory
256 MB RAM
Display
"Thousands" of colors
Hard Drive Space
110 MB
Java SDK
Sun J2SE 1.5 release 1, available at ...
" from http://download-uk.oracle.com/docs/html/B28240_02/install.htm#CIHDJBJG
The J2SE 1.5 release is currently only available for OS X 10.4 and higher, so apparently you need this os version to run SQL developer. Is this correct? Is there a SQL Developer version that will run on OSX 10.3 that is running the J2SE 1.4.2 release?Sorry the subject heading should read:
SQL Developer with Mac Os X 10.3.9 -
SQL 2005 with ERP2005 (ECC 6.0) Unicode
Hi All,
I need a few questions to be answered.
Can anybody tell me as to what would be the initial size of the database after an installation of ECC 6.0 Unicode with database as SQL 2005.
Is there any minimum hardware requirements that would have to be taken into consideration before an installation is planned.
Can anyone help me in deciding whether MSCS services or Manual Log shipping would be preferred for Failovers.....
Regards
Anand<b>Sizing</b>
Hardware sizing should be completed by your SAP partner. Its based on many things. Users, modules, storage volumes, peek, BP, workloads etc etc.
You can do the 'noddy' version with the sapsize on OSS. The output from this is in 'SAPs' you could look up std systems bench marks and get something 'like' it. Else submit the results to the hardware vendor of your choice and they will do it for you.
<b>System Redundancy</b>
Depends what you are trying to do.
MSCS is a fail over HARDWARE only solution. ie if you want to patch or take a node out of service you can by 'failing over' the services on it to the other node. If you get a DB problem MSCS can not help you at all.
Log shipping gives you 'rapid' recovery options for SQL(and there in SAP). The way this normally works is via either manual or automatic log-shipping to a 'standby' system with SQL/SAP loaded on it that can be brought online if you get a problem with the main system.
A well planned system will have fail-over and recovery capabilities, ie it will use BOTH. -
What MS SQL version for SAP ECC 6.0?
Hi,
we are preparing ourselves to move away from SAP R/3 & MS SQL 2000 to SAP ECC 6.0 and a new SQL platform.
From what I found, it runs on SAP_BASIS 7.0 - so both SQL 2005 and SQL 2008 are supported.
I was wondering, however, what SQL version do I need - would SAP ECC 6.0 run on Standard or does it require Enterprise Edition of SQL server?
Many thanks
Gavin
Edited by: Gavin Clark on Sep 9, 2008 5:07 PMHi Gavin,
you should always use the SQL EE for SAP installations (because of additional features that only come with EE).
Concerning SQL 9 or SQL 10, I would definitely go for SQL 10. It has some nice features like Backup Compression, Page/Row Compression and so on. Have a look [here|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/60a236a2-8104-2b10-5ebe-8fef61cc82fd]. Just make sure that your installation meets the SR3 requirements.
We already have SQL 10 in production and did not encounter any problems.
Regards,
Sven
Maybe you are looking for
-
When trying to update my iPad on iTunes I keep getting a message that the download has stopped because the file is full. There is plenty of space on the iPad. Also, the message says to check the settings. What am I supposed to check in the setting
-
How to print text in English & chinese lang in the same window in smartform
Hi All, My requirement is in the Smartform for few windows i need the text in the English Language as well as corresponding Text in chinese Language. For Eg Buyer:
-
Transfer data between systems realtime
Dear All, I have the following issue: In System1 we create Purchase Order (PO) and in System2 a Sales Order (SO) reference to that PO. The line item in the PO in System1 have Profit Center PC1 assigned. In System2 the SO has PC2 assigned to line item
-
Hi, I would like to create the package of Adobe Acrobat 7.0.9 Standard. In English and in French. I have downloaded the Adobe tool : ISTuner7_AdobeAcrobat.exe to create the MST file The problem is : The computers have already Adobe Reader 7.0.9 insta
-
How do i copy my ipod to my laptop
I want to import my itunes from my ipod to my my new laptop. It was on my old laptop which now not working,please help!