When need to update statistics for a table
In Sybase we use "delete statistics ", "update all statistics " and "sp_recompile ", does Oracle need to do such things in any case? Thank you!
Modern versions have a default job to do this, which may or may not be appropriate in its settings. Volumes have been written about it. Version and app dependent. Highly recommend studying Jonathan Lewis' books.
Stored procedures automatically recompile on use, although there can be issues dependent on bad design or configuration.
Similar Messages
-
AUTOMATIC UPDATE STATISTICS for VB* tables ON automatically
Hello All,
We had reviewed our ECC system with SAP and they recommended us to OFF the AUTOMATIC UPDATE STATISTICS for VBDATA, VBHDR and VBMOD.
We executed the script EXEC sp_autostats <tablename>, 'OFF' but the status goes ON after a while.
Checked the SAP note 771352 but did not get proper idea from it.
MS SQL database used is 2008.
Can someone suggest and share his/her experience.
Regards,
MohitHi Mohit,
Did you ran the sap_z* script ?
What is your SP level - did you check 1702325 - Alerts appear for VB tables
Also, I asked to to use NORECOMPUTE - have you tried that ?
Regards -
Unable to generate statistics for the table
I have got a staging table of more than 600 columns which has got range portioning. Size of the table is 4GB. The average size of the row is around 3 MB. I have created a Functional index on one of the column ABC VARCHAR2(50) and it has only number values. Now when I try generating statistics for this table through ANALYZE or DBMS_STAT, it gives Invalid Number error but when I drop this index and try analyzing, it works.
Executed TO_NUMBER(ABC) query on the table and it works fine.
I have got Functional Indexes on other tables also but I don't get such problem with those tables. I tried dropping the index and re-creating it but it didn't work out.
I was suspecting DATA BLOCK CORRUPTION so checked ALERT LOG and TRACE FILES but found nothing.
So what is this magic called?I am using TO_NUMBER on the column.
I have checked the MetaLink for the same problem but could not find anything on that. I still suspect datafile error which I am unable to get in ALERT LOG or TRACE FILES. So I am going to try it this way:
1) Create new Tablespace with New Datafile
2) Transfer the table from existing Tablespace to new Tablespace
3) Create the functional index in the same new Tablespace
4) Try generating the statistics.
5) If it works then create seprate Tablespace for data and Index.
Hope it works !!
Thanks for the reply guys. -
When do I really need to create indexes for a table?
Once I was talking to a dba in a conference.
He told me that not always I have to create indexes for a single table, it depends of its size.
He said that Oracle read registers in blocks, and for a small table Oracle can read it fully, in a single operation, so in those cases I don't need indexes and statistcs.
So I would like to know how to calculate it.
When do I really need to create indexes for a table?
If someone know any documment that explain that, or have some tips, I'd aprecciate.
Thanks.
P.S.: The version that I'm using is Oracle 9.2.0.4.0.Hi Vin
You mentioned so many mistakes here, I don't know where to begin ...
vprabhu_2000 wrote:
There are different kinds of Index. B-tree Index is by default. Bit map index, function based index,index organized table.
B-tree index if the table is large This is incorrect. Small tables, even those consisting of rows within just one block, can benefit from an index. There is no table size too small in which an index might not be benefical. William Robertson in his post references links to my blog where I discuss this.
and if you want to retrieve 10 % or less of data then B-tree index is good. This is all wrong as well. A FTS on a (say) million row table could very well be more efficient when retrieving (say) just 1% of data. An index could very well be more efficient when retrieving 100% of data. There's nothing special about 10% and there is no such magic number ...
>
Bit Map Index - On low cardinality columns like Sex for eg which could have values Male,Female create a bit map index. Completely and utterly wrong. A bitmap index might be the perfect type of index, better than a B-Tree, even if there are (say) 100,000 distinct values in the table. That a bitmap index is only suitable for low cardinality columns is just not true. And what if it's an OLTP application, with lot's of concurrent DML on the underlining table, do you really think a bitmap index would be a good idea ?
>
You can also create an Index organized table if there are less rows to be stored so data is stored only once in index and not in table. Not sure what you mean here but an IOT can potentially be useful if you have very large numbers of rows in the table. The number of rows has nothing to do with whether an IOT is suitable or not.
>
Hope this info helps. Considering most of it is wrong, I'm not sure it really helps at all :(
Cheers
Richard Foote
http://richardfoote.wordpress.com/ -
Hi Experts,
IF Auto Update Statistics ENABLED in Database Design, Why we need to Update Statistics as a maintenance plan for Daily/weekly??
Vinai Kumar GandlaHi Vikki,
Many systems rely solely on SQL Server to update statistics automatically(AUTO UPDATE STATISTICS enabled), however, based on my research, large tables, tables with uneven data distributions, tables with ever-increasing keys and tables that have significant
changes in distribution often require manual statistics updates as the following explanation.
1.If a table is very big, then waiting for 20% of rows to change before SQL Server automatically updates the statistics could mean that millions of rows are modified, added or removed before it happens. Depending on the workload patterns and the data,
this could mean the optimizer is choosing a substandard execution plans long before SQL Server reaches the threshold where it invalidates statistics for a table and starts to update them automatically. In such cases, you might consider updating statistics
manually for those tables on a defined schedule (while leaving AUTO UPDATE STATISTICS enabled so that SQL Server continues to maintain statistics for other tables).
2.In cases where you know data distribution in a column is "skewed", it may be necessary to update statistics manually with a full sample, or create a set of filtered statistics in order to generate query plans of good quality. Remember,
however, that sampling with FULLSCAN can be costly for larger tables, and must be done so as not to affect production performance.
3.It is quite common to see an ascending key, such as an IDENTITY or date/time data types, used as the leading column in an index. In such cases, the statistic for the key rarely matches the actual data, unless we update the Statistic manually after
every insert.
So in the case above, we could perform manual statistics updates by
creating a maintenance plan that will run the UPDATE STATISTICS command, and update statistics on a regular schedule. For more information about the process, please refer to the article:
https://www.simple-talk.com/sql/performance/managing-sql-server-statistics/
Regards,
Michelle Li -
Updating model for pivot table in af:iterator
Using Master Detail relationship, i am trying to create multiple forms at runtime. I want to show all the forms at once. Each form has some header fields and a pivot table. Header field is coming from master table and pivot table should be made from child.
I am using af:iterator to iterate over master table rows and show header:
<af:iterator id="i1"
value="#{bindings.MasterTableVO.collectionModel}" var="row"
varStatus="index"> For pivot table, i dragged Child View Object from Data Controls to make pivot table.
<dvt:pivotTable id="pivotTable1"
value="#{bindings.ChildTableVO.pivotTableModel}"
summary="pivot table" sizing="auto"
pivotEnabled="false" drillingEnabled="false"/> Now while iterating, i am not able to get updated model for pivot table. Values from Master table are being updated, but pivot table from child table showing details corresponding to the first row of master table everywhere.
So can you please help me, how to get the updated pivot table model corresponding to the current row in parent iterator ?
I am using JDeveloper 11.1.1.6.0
Thank You.
VSHi Aswini ,
I didnot worked for me. I need to change the usecase a bit..
however you can eaisly display the af:table inside iterator in readonly mode, but when you perform crud operations inline then it gives problems..
Can you explain your usecase.
Regards,
Santosh. -
Update statistics for database
I'm needing to update stats on all tables in the database, and an unsure how to do so, and haven't been able to find any documentation for it. Could someone help me in this, show me the code on how to make this happen.
ThanksHi,
There are multiple sites and articles that explain the issue in depth (just google oracle statistics, [http://www.oracle.com/technology/pub/articles/lewis_cbo.html] is a very good example).
Basically statistics help generate execution plans for your queries and DMLs.
It is recommended to gather statistics with the DBMS_STATS package ([http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_stats.htm]).
Regards,
Yuri
[http://it.toolbox.com/blogs/living-happy-oracle] -
Disable Statistics for specific Tables
Is it possible to disable statistics for specific tables???
If you want to stop gathering statistics for certain tables, you would simply not call DBMS_STATS.GATHER_TABLE_STATS on those particular tables (I'm assuming that is how you are gathering statistics at the moment). The old statistics will remain around for the CBO, but they won't be updated. Is that really what you want?
If you are currently using GATHER_SCHEMA_STATS to gather statistics, you would have to convert to calling GATHER_TABLE_STATS on each table. You'll probably want to have a table set up that lists what tables to exclude and use that in the procedure that calls GATHER_TABLE_STATS.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
Create new CBO statistics for the tables
Dear All,
I am facing bad performance in server.In SM50 I see that the read and delete process at table D010LINC takes
a longer time.how to create new CBO statistics for the tables D010TAB and D010INC. Please suggest.
Regards,
KumarHi,
I am facing problem in when save/activating any problem ,so sap has told me to create new CBO statistics for the tables D010TAB and D010INC
Now as you have suggest when tx db20
Table D010LINC
there error comes Table D010LINC does not exist in the ABAP Dictionary
Table D010TAB
Statistics are current (|Changes| < 50 %)
New Method C
New Sample Size
Old Method C Date 10.03.2010
Old Sample Size Time 07:39:37
Old Number 51,104,357 Deviation Old -> New 0 %
New Number 51,168,679 Deviation New -> Old 0 %
Inserted Rows 160,770 Percentage Too Old 0 %
Changed Rows 0 Percentage Too Old 0 %
Deleted Rows 96,448 Percentage Too New 0 %
Use O
Active Flag P
Analysis Method C
Sample Size
Please suggest
Regards,
Kumar -
How to build statistics for a table, its urgent, points will be rewarded
Hi friends,
I want to create a statistics for MSEG table in production server, because its not up to date.
Total no. of entries available in table is 2,30,000.
My O/S windows2003 (cluster)/oracle9.2/ ECC 5.
I need a step by step procedure to build or create statistics using DB20.
Regards,
s.senthil kumarHi stefan,
Thanks 4 ur reply.
I need some more clarification on db20.
Wt are the values I have to give on following fields.
New method and new sample size.
anyfields or chek box I need to fill before create new statistics?
My current screen values on following fields.
new method = 'C'. new sample size = ' '.
old method = 'C'. old sample size = ' '.
Old Number 5,965 Deviation Old -> New 3,669
New Number 24,834 Deviation New -> Old 97-
Inserted Rows 0 Percentage Too Old 0
Changed Rows 0 Percentage Too Old 0
Deleted Rows 0 Percentage Too New 0
Use A
Active Flag A
Analysis Method C
and history check box is marked.
Can I run DB20 while server is running or at peak time?
Regards,
s.senthil kumar -
i am trying to download some apps onto my iphone 3gs and it keeps saying i need to update it for this but ive trying and there is no update option on the phone or through itunes, it keeps saying its up to date, can anyone help please?
Would this matter then? can you not update the 3g to the lastest software?
-
I'm about to hulk out guys! Brand new iPhone 5 and need to update iTunes for recognition. Keep getting "the installer encountered an error that caused the installation to fail." Can anyone help? I may smash something very soon.
iTunes:
AppName: itunes.exe
AppVer: 10.5.0.142
ModName: unknown
ModVer: 0.0.0.0
Offset: 001be6f6
Quicktime:
EventType : BEX
P1 : QuickTimePlayer.exe
P2 : 7.71.80.42
P3 : 4ea5c6ef
P4 : QuickTimePlayer.dll
P5 : 7.71.80.42
P6 : 4ea5c6d5
P7 : 00005b6d
P8 : c0000409
P9 : 00000000
That's consistent with another application (other than QuickTime) having dropped old QuickTime componentry in non-standard locations on the PC.
So we'll go looking for the older QuickTime componentry in the most common locations for it to be stashed.
First we'll need to change some view options on the PC.
1. Open My Computer from the desktop or Start menu.
2. In the Tools menu, click Folder Options.
3. Click the View tab.
4. In the "Advanced settings" pane under "Hidden files and folders" make sure that the "Show hidden files and folders" option is selected, and the "Hide extensions for known file types" option is unchecked.
5. Click OK.
Now in My Computer, open your C drive.
Open the "Windows" folder.
Open the "system32" folder.
What files and/or folders can you see in there with QuickTime in the file/folder name? (In a standard installation of QuickTime, you should see precisely two files ... QuickTime.qts and QuickTimeVR.qtx ... and no QuickTime folders whatsoever.) -
When symbian belle updation come for nokia 500
.. plz.. i want to know when symbian belle updation come for nokia 500
Nokia Belle is specifically tailored to each phone model, including the Nokia 500. Due to technical specifications, Nokia Belle for Nokia 500 differs to other Nokia Belle phones in the following aspects:
Nokia 500 with Nokia Belle only supports 4 homescreens.
Nokia 500 does not support NFC.
FM transmitter and widget are not supported in Nokia 500.
Nokia 500 includes Nokia Maps 3.06 instead of 3.08.
Additionally, Nokia 500 will get Angry Birds with the Nokia Belle update. This update is expected to launch on Feb 15th.
(Hit the star if it helped you) -
When will new update (firmware) for E72 will come?
when will new update (firmware) for E72 will come?
Firmware update for E72 has already been released..
v22.007 has been around for many European models since around January
v23.002 has been around for Asian/Middle-East models since this February.
Some operator-branded phones may not have available updates yet though.
You can use the Device Software Update page (search for the links in Nokia website) and enter your product code to find out if your product code has been included in the firmware updates already. -
When is Anna update coming for Sri Lanka
When is Anna update coming for Sri Lanka.Please tell me the date.Phone model NOKIA N8 Product code 0599777
This type of question gets asked repeatedly here, and the same answer is always given - "We Don't Know".
Palm Inc. does not release time schedules for updates, nor future plans for product development. Employess of Palm Inc. are bound legally by NDA's, and the Volunteer Moderators (like me) are kept out of the loop...
WyreNut
I am a Volunteer here, not employed by HP.
You too can become an HP Expert! Details HERE!
If my post has helped you, click the Kudos Thumbs up!
If it solved your issue, Click the "Accept as Solution" button so others can benefit from the question you asked!
Maybe you are looking for
-
Self-assigned IP - No connection
I have a perfectly fine IP address when I'm hardwired, and a full signal, but no internet connection. Here's the steps I've taken. What am I missing? -Obtained a valid IP address and connection by connecting my Powerbook G4 to my cable modem via ethe
-
wondering if i never signed up for the locate my ipad app if it would show my stolen device as offline and pending lost mode or if that means that i did sign up for it and just dont remember?
-
Using too much data very quickly
This month my phone provider advised me that I'd nearly used up all my data in 5 days. I really don't know why. Could it be an app called pic college?
-
Landed Cost manager Program is scheduled to run everyday but it did not run
Hi All, Landed Cost manager Program is scheduled to run everyday but it did not run for 2 days and there was no error; it did not start even though it is a scheduled prog to run every 30 mins. Please let me know if anyone has experienced similar case
-
How to select random and unique number
hi all suppose i have millions of rows in emp table i want to select group of empno group of records would be 10 all records uniquely selected make sure all records are selected in any Group thanks