Performance Tuning :: Cursor Sharing Setting In OLTP Environment?

Feb 22, 2011

In an OLTP environment what cursor_sharing setting is preferred?Though typically we retain the original setting for most of the parameters except memory settings etc. I have queries in the following context

No. I am not facing any issue as of now (I am not supporting any Live environment) But I want to know the desgn considerations

First of all in OLTP environment (say one I am referring) we use pl/sql variables which are obviously bind variables Only in case where plan is expected to change we use hard coded values like 'CREDIT' or 'DEBIT' etc. for acc_type column

Again there can be 2 scenario
1) we use the same query for both acc_type values
2) we use 2 different queries
IF v_parameter = 'CR'
select * from accounts where acc_type='CREDIT'...
else
select * from accounts where acc_type='DEBIT'...
end if;

Again suppose the values are skewed and we gather stats with histograms hereIs't it the setting 'cursor_sharing=similar' which will be useful in above case?as with this setting optimizer will 'think' which plan to pick depending upon the values and bind variable peeking is taken care in option 2 above with IF ELSE clause?

BTW
I have carried several tests but not getting conclusive results For example I created following table with skewed data, created index and gather stats with histogram

SQL> select object_id,count(*) from skewed_data_tab group by object_id;

OBJECT_ID COUNT(*)
---------- ----------
5 30
6 2970
7 10797
8 150000
9 300000

SQL> create index i_skewed_tab_data on skewed_data_tab(object_id);

SQL> exec dbms_stats.gather_table_stats(user,'SKEWED_DATA_TAB',cascade=>true,
method_opt=>'for all columns size 254');

Then traced with following options
1) alter session set events '10046 trace name context forever, level 12';

SQL> begin
for i_outer in(select n from ids order by tstamp)
loop
for i_inner in (select /* for exact */ object_id,object_name,object_type
from skewed_data_tab where object_id=i_outer.n)

[code]...

2) set termout off
alter session set events '10046 trace name context forever, level 12';
@/u04/scripts/exact.sql 5
cat /u04/scripts/exact.sql
select /* for exact */ object_id,object_name,object_type from skewed_data_tab where object_id=&1;

But not getting consistent results

View 11 Replies


ADVERTISEMENT

Performance Tuning :: Adaptive Cursor Sharing VS SPM?

Nov 5, 2013

we are using Release 11.2.0.3.0 of oracle. And have cursor_sharing default setup as 'exact'.

In case of 'sql queries' using bind variable, which suffers performnace issue(unstabilized plan) due to different bind values at runtime addition with skewed columns. In these cases 'adaptive cursor sharing', will monitor major variation in selectivity/cost of multiple available plan(path of execution) and automatically switch to optimum plan during run time query execution.

my question is , considering 'up to date stats for all our database objects' what is the requirement of sql plan baseline(spm)? At which situation ,ACS(adaptive cursor sharing) won't able to stabilize the query plan, so that we have to go for baseline or SPM?

View 2 Replies View Related

Performance Tuning :: Adaptive Cursor Sharing?

Dec 18, 2012

I have a table "t", with a highly skewed ID column
Cursor_sharing=force
select count(*) from t;
--79003
select count(*) from t where id=1;
--79002
select count(*) from t where id=99;
--1

I have a index on id column and since highly skewed data is there in id column therefore histogram is there

SQL> select table_name,column_name,histogram,num_buckets from user_tab_cols where table_name='T';

TABLE_NAME COLUMN_NAME HISTOGRAM NUM_BUCKETS
------------------------------ ------------------------------ --------------- ------------
T ID FREQUENCY 2

When i use literals , explain plan comes up with optimal execution plan
select * from t where id=1;
Full table scan

Select * from t where id=99;
Index range scan

But when i use bind variables,sub optimal execution plan

For id=1, it should use Full table scan but it goes for Index range scan , WHY? why ACS is not getting kicked?

alter system flush shared_pool;
set autotrace traceonly
variable n number;
exec :n=1;
select * from t where id=:n;

[code]...

Why is_bind_sensitive not "Y"?

View 10 Replies View Related

Performance Tuning :: Capacity Planning For 250 User OLTP Shop

Mar 19, 2013

installing Oracle for a new Data-Center(still in planning).It will be an OLTP shop working 24/7, with 250 concurrent users.

1. Can it, in theory run with good performance on a quad processor(something like Intel Xeon Series 56XX) , with 32GB of memory?
2. What is the Oracle Database Edition required for this configuration?
3. What additional things should one take into account to plan the most cost-effective configuration?

View 2 Replies View Related

Server Administration :: OLTP Environment On 10g?

Apr 29, 2010

I have to create/configure the environment for the database having high volume of the transactions nearly 10000 transactions per day and at peak time nearly 1500 transactions per second.

RAC can be one of the solution but that comes up with high cost. I googled for this type of environment configuration, what could be possible settings need to be configured for this environment configuration in both RAC and Non-RAC.

View 6 Replies View Related

Performance Tuning :: Setting Flash Cache Initialization Parameters?

Aug 11, 2010

I have OEl 5.5 installed and patched. I have my SSD mounted..

but when i ran the command 'alter system set db_flash_cache_file ='/media/ssd/' scope=spfile;'

It wouldn't startup giving ORA-01078: failure in processing system parameters...

View 6 Replies View Related

Optim-peek-user-binds - Set To TRUE In Order To Utilize Adaptive Cursor Sharing?

Jul 5, 2012

I am on 11.2.0.2 (RHEL 5.4)

For one of my OLTP table, we have skewed distribution on STATUS column and hence we created frequency histograms. NDV=7 for this column.

My question is : Do we need to have "_optim_peek_user_binds" set to TRUE in order to utilize Adaptive Cursor Sharing ?I have gone through different OTN forum and blogs and it appears that in order to generate different plans, Oracle has to Peek the value of bind variables each time. Without Peeking, how would CBO knows whether to generate new plans or not ?

For xyz reasons, optimpeek_user_binds is set to FALSE in my database and i could not find any sql_id having V$SQL.IS_BIND_AWARE='Y'.

View 9 Replies View Related

Performance Tuning :: Cursor Embedded In Select

Jul 21, 2010

I've been examining som old queries in an existing db due to more and more problems regarding performance. The sql is used as backend for a java/jboss web application with the possibility for users to enter data. With more and more data, there starting to come complaints about the performance.

I stumbled upon a select query with an embedded cursor similar to this :

select id, name ...,
cursor(select id, sequence.... from table2),
cursor(select id, name.... from table3)
from table1
join table4 on (table1.id = table4.id)
where .....

The javacode is a prepared statement with the actual sql as a string and the content of the cursors saved in conjunction with each row.

when i use sqldeveloper to show the explain plan without the cursors, the cost is 2428
when i use sqldeveloper to show the explain plan with just 1 of the cursors, the cost is ~165000

Is there a better way to do this instead of cursors ?

View 2 Replies View Related

Performance Tuning :: Does Parallel Hint Works In Cursor Queries

Aug 28, 2013

Does parallel hint works in cursor queries? The cursor query is something like :

cursor c is
select /*+ parallel(s,8) */
from table ref_tab s ---- >>
<where condition>;

The table ref_tab hold data for a single day at any point of time and gets truncate before loading the next days data.On average the table holds around 7 million rows and doesn't contains any index (think that's fine as all together we are loading the whole set).And, we are using bulk logic with save exceptions to open the cursor and load the data into the target table.

View 13 Replies View Related

Backup & Recovery :: Process Of Setting Up DR Environment For SAP And Oracle Database

Feb 7, 2012

We are in the process of setting up a DR environment for our SAP and Oracle databases . The netapp and our architects came up with solution as follows .

1.Standby databases are built for all production databases.
2.The SAP file systems are replicated to the secondary site
3.The Oracle logfiles and controlfiles are replicated by netapp snap mirror every 10 mins interval
4.The database is recovered through recover standby database every 15 mins at standby site
5.Please note there is no data guard involved .
6.To test the failover , the mirror is broken .The standby controlfile is replaced with Production controlfile and Redo logs files.
7.The standby database issued a startup comnmand and it worked .

Would like to know whether the step 6 is a correct approach ? I tried to convince the architects that this will result in a very disastrous situation for us but none is listened to .

View 3 Replies View Related

Performance Tuning :: Tools For Database Tuning And Instance Tuning

Jul 12, 2010

Looking to understand the difference between instance tuning and database tuning.

What is the difference between these two tuning exercises? I understand that an instance is memory based structures (logical) where as database consists of physical structures.

However, how does one tune a database the physical structure? Does it have to do with file placements/block sizes etc. Would you agree that a lot of that is taken care by ASM now in 11g? What tools are required/available (third party as well as oracle supplied) for these types of tuning scenarios?

View 1 Replies View Related

Performance Tuning :: Merge Statement Tuning For 100M Records In Table?

Oct 31, 2011

I have two tables with 113M records in DWH_BILL_DET & 103M in prd_rerate_chg_que and Im running following merge query, which is running for 13 hrs to update records, which is quiet longer time.

SQL> explain plan for MERGE /*+ parallel (rq, 16) */
INTO DWH_BILL_DET rq
USING (SELECT rated_que_rowid,
detail_rerate_flag_code,
rerate_sel_key,

[code].....

View 39 Replies View Related

Performance Tuning :: How Length Of Column Width Effects Index Performance

Sep 30, 2010

How the length of column width effects index performance?

For example if i had IOT table emp_iot with columns:
(id number,
job varchar2(20),
time date,
plan number)

Table key consist of(id, job, time)

Column JOB has fixed list of distinct values ('ANALYST', 'NIGHT_WORKED', etc...).

What performance increase i could expect if in column "job" i would store not names but concrete numbers identifying job names.
For e.g. i would store "1" instead 'ANALYST' and "2" instead 'NIGHT_WORKED'.

View 24 Replies View Related

Performance Tuning :: Fragmentation Can Reduce Performance In Query Times

Jun 16, 2010

I have a question about database fragmentation.I know that fragmentation can reduce performance in query times. The blocks are distributed in many extents and scans process takes a long time. Oracle engine have to locate the address of the next extent..

I want to know if there is any system view in which you can check if your table or index has high fragmentation. If it's needed I will have to re-create, move or rebulid the table or index, but before I want to know if the degree of fragmentation is high.

Any useful script or query to do this, any interesting oracle system view?

View 2 Replies View Related

Performance Tuning :: Method Of Tuning Database - Row Reduction?

Oct 20, 2010

There is a simple way to increase the performance of a query by reducing the row-size of the table it hits. I used it in the past by dividing the table into smaller parts and querying respective smaller table in each query.

what is this method called ? just forgot the method and can't recall it. what this type of row-reduction optimization is called ?

View 6 Replies View Related

Performance Tuning :: Performance Standard Edition Without Partitioning?

Jun 16, 2011

How many records could I have in a single table without performance degradation with Standard Edition without partitioning with cutting-edge server (8 or 12 cores, 72 GB RAM, FC 4 Gbit, etc...) and good storage?

300 Millions in only one table with 500K transactions / day is too much?

Simple database with simple schema.

How many records begin to be too many?

View 2 Replies View Related

Performance Tuning :: Procedure Performance On New Database Import?

Nov 15, 2010

Testing our 9i to 11g upgrade, we've imported the entire DB into the new machine.We've found that certain procedures are really suffering performance problems. BUT, we've also found, that if we check out a production copy of the procedure from our source code control, and reinstall it, the performance issue goes away. Just alter the procedure and recompiling does NOT work.

The new machine where the 11g database exists is slightly different than the source, but it's not like we have this problem with every procedure. It's only a couple.

any possible reason that we'd have to re-install a procedure to correct a performance problem?

View 13 Replies View Related

Performance Tuning :: Checking Delete Performance In Package

Apr 12, 2013

I need to check the package performance and need to improve the package performance.

1. how to check the package performance(each and every statement in the package)?
2. In the package using the delete statement to delete all records and observed that delete is taking long time to delete all the records in the table(Table records 7000000). This table is like staging table.Daily need to clean the data before inserting the data into it. what can I use instead of Delete.

View 13 Replies View Related

Performance Tuning :: Query Performance Gain Using Statistics?

Aug 9, 2010

Somewhere I read that we should not use hints in Oracle production environments, but we can use hints in the development environment and on achieving the desired execution plan we can adjust the 'statistics' to follow that plan without hints.

Q1. If it is true what statistics do we adjust for influencing the execution plan and how?

For example, I have the following simple query:

select e.empid, e.ename, d.dname
from emp e, dept d
where e.deptno=d.deptno;

emp.empid, emp.deptno and dep.deptno columns have indexes and the tables have the standard structure as found in the basic oracle examples.

If I look at the execution plan of the above query then I see that the driving table is empand the driven table is dept.Also the type of join that is taking place is 'Nested Loop'.

Questions: With respect to the above query,
Q 2. If I want to make dept the driving table and emp the driven table then how can I adjust the statistics to achieve that?
Q 3. If I want to use hash join instead of a nested loop join then then how can I adjust the statistics to achieve that?

I can put the ordered and the use_hash hint to effect this but again I have heard that altering statistics is a more robust way to control an execution plan as compared to hints.

View 6 Replies View Related

Performance Tuning :: How To Improve The Performance Of Export Job (expdp)

Dec 6, 2011

I have an issue with export(expdp).

When i exporting an user using expdp utility, the load the on the server is going up-to 5. The size of the database is 180GB. Below is the command that i use for export.

expdp sys/xxxx directory=dbpdump dumpfile=expdp_trk_backup.dmp logfile=expdp_trk_backup.log exclude=statistics schemas=trk

Do i need any look into any memory parameters for this?

View 1 Replies View Related

Performance Tuning :: DECODE In WHERE CLAUSE Performance?

Oct 17, 2011

The following query gets input parameter from the Front End application, which User queries to get Reports.There are many drop down boxes like LOB, FAMILY, BRAND etc., The user may or may not select values from drop down boxes.

If the user select any one or more values ( against each drop down box) it has to fetch all matching values from DB. If the user does'nt select any values it has to fetch all the records, in this case application will send a value 'DEFAULT' (which is not a value in DB ) so that the DB will fetch all the records.

For getting this I wrote a query like below using DECODE, which colleague suggested that will hamper performance.From the below query all the variables V_ are defined in procedure which gets the values selected by user as a comma separated string here V_SELLOB and LOB_DESC is column in DB.

DECODE (V_SELLOB, 'DEFAULT', V_SELLOB, LOB_DESC) IN
OPEN v_refcursor FOR
SELECT /*+ FULL(a) PARALLEL(a, 5) */
*
FROM items a
WHERE a.sku_status = 'A'

[code]...

View 9 Replies View Related

Performance Tuning :: Same Data But Different Performance Results

Sep 3, 2010

what the principal things to look at when we have for the same query different performance results are?I have 2 different bases: the plan and data are the same but performance results are very differents.

View 10 Replies View Related

Backup & Recovery :: Moving From One Windows Environment To Another Linux Environment?

Jun 19, 2012

I'm trying to move my backup sets from windows database environment, to OEL 5.7 environment on another server.

I've found a manual [URL] by which I am trying to do it.I took backup sets from last night's backup using RMAN,and the current parameter(initSID.ora) file from the running live database.Now i need to configure control files in the pfile accordingly.

1. can i take current control files from the running system, to restore and recover backup sets from last night, to the state the database was at backup time?

2. how can i find out if control files are backed up and know by RMAN? "list backup completed after '2012-JUN-19';" >> gives me Archive redo logs, datafiles, but don't see the control files(or don't reconize them).

View 15 Replies View Related

SQL & PL/SQL :: Update Statement For OLTP Table

May 14, 2013

I have a table TEMP_TEST_1 to be loaded with multiple rows which contains the available items for a store with their sequence numbers. I also have another table TEMP_INV_1 which holds a column for inventory count of the items, and this column is to be updated after loading the first table TEMP_TEST_1.

The table TEMP_TEST_1 is updated through all possible channels in OLTP. So while updating the inventory, which is the best way. My update should either add the total number of inserts per item into the TEMP_TEST_1 table's INVENTORY_CNT column i.e. existing value + count of new rows OR a full update by taking the complete row count (Grouped by item id) and update the INVENTORY_CNT column

--------------------------------------------------------------------------------
-- Initial setup SQL's, TEMP_TEST_1 is updates on OLTP through multiple channels
--------------------------------------------------------------------------------
CREATE TABLE TEMP_TEST_1 ( ITEMID NUMBER ( 4 ),
INVENTORY_CNT NUMBER ( 2 ) );
CREATE TABLE TEMP_INV_1 ( ITEMID NUMBER ( 4 ),
ITEMSEQ NUMBER ( 5 ) );
INSERT INTO
[code].......

--------------------------------------------------------------------------------
-- Inserts for new items in the store
--------------------------------------------------------------------------------
INSERT INTO
TEMP_INV_1
VALUES
( 1,
11 );
INSERT INTO
TEMP_INV_1
[code].......

View 4 Replies View Related

Exadata :: Enable OLTP Compression On Tables

Sep 2, 2012

I am trying to enable OLTP compression on tables and at tablespace level for the tables

Steps I am following are:

1. Move indexes to its own tablespace
2. enable OLTP compression at table level:
alter table table_name move compress for OLTP
3. Rebuild indexes
4. Issue I have is what to do with tables with LOB columns
ALTER TABLE lob_table MOVE LOB (LOB_COL) STORE AS (TABLESPACE index_tbsp); -- Is this correct?
5. alter tablespace data_tablespace default compress for OLTP;

I have a question, is the sequence of steps correct. For tables with LOB columns do we needto move lobindex to index tablespace. Beacuse lobsegment and lobindex are created in data tablespace?

View 2 Replies View Related

Performance Tuning :: DB Performance Keys?

Mar 17, 2012

are the most important performance keys we have to calculate or take in account to preserve or to increase the DB performance in terms of response times, and whatsoever according to performance ?

View 8 Replies View Related

Performance Tuning :: Options While Using RBO?

Mar 27, 2013

I am working on an assignement where client is using Oracle 10g but stuck to using RBO Now the application team, from the GUI available to them build dynamic queries and some of them run very slow.

Neither the code can not be changed to tune the queries nor do we get the exact step in the plan which is an issue (being RBO).For some long running queries the Tuning advisor is not producing any recommendations.

Another hurdle is that all the application users are using same application user id so we can not write a logon trigger to use CBO for some particular queries to see what is happening in the background!

View 11 Replies View Related

Performance Tuning :: Next SQL Sentence

Jul 4, 2012

I want to tuning the next sql sentence. In this sql I want to get the hash_value and sql_text of the sentences that it's causing TX blocks. Is it possible?. This sentence works fine but sometimes It's slow.

SELECT DISTINCT hash_value,
sql_text
FROM gv$sql sq
WHERE hash_value IN (SELECT DISTINCT prev_hash_value
FROM gv$session se
WHERE sid IN (SELECT sid
FROM gv$lock l
WHERE type = 'TX'
AND ctime >= 2000
AND l.inst_id = se.inst_id
AND l.sid = se.sid)
AND sq.inst_id = se.inst_id);
[code]....

View 7 Replies View Related

Performance Tuning :: Different SQL ID For Same HASH-VALUE?

Nov 2, 2012

I see one of my SQL's which is ran by the user on a 10.2.0.3 database changing its SQL_ID after some runs even if the query is not changed a bit! However the HASH VALUE for this query remains the same.

how a same query can have different SQL_ID's but same HASH_VALUE?

Note: Statistics are not modified on the base tables of this query.

View 10 Replies View Related

Performance Tuning :: SGA-MAX-SIZE To More Than 2G?

Aug 10, 2011

I am running Oracle 10.2.0.1.0 on MS Windows 2003 server 64-bit with 16G RAM.

Here is the findings for my Oracle database.

SQL> select * * from v$sgainfo;
NAME BYTES RES
-------------------------------- ---------- ---
Fixed SGA Size 1293560 No
Redo Buffers 7094272 No
Buffer Cache Size 830472192 Yes

[code]...

I find that the SGA component "Buffer Cache" is decreasing from the start "1.8G" and down to now 0.8G. On the other hand, the component "Shared Pool" is increasing from the start 0.3G to now 1.2G. I noticed that there are 100 operations of shrinking of "Buffer cache" and growth of "Shared Pool" in Oracle every day.Is it a indicator that I should raise up the SGA_MAX_SIZE?

I tried to increase the SGA_MAX_SIZE to 4G. But I cannot start the Oracle afterward.Is it a limitation of MS Windows(OS) or Oracle?I set the SGA_MAX_SIZE to 3G. This time, I can startup Oracle.What is the optimum/maximum I can set to SGA_MAX_SIZE?Is there any adverse effect/concern when setting the SGA_MAX_SIZE more than 2G?

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved