![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Oracle 10.2.0.4 enterprise windows 2003 I am interested in finding out how much of a table is made up of deleted rows / just to see if there is a potential benefit for backups / operations I have run following query SELECT blocks as BLOCKS_USED, empty_blocks FROM dba_tables WHERE table_name='TASK' It shows me I have no empty blocks Is there a query that shows me deleted rows */ non-deleted rows within the used blocks for this table My aim is to assess wether a table export / import would be beneficial for 1) rman backups 2) database operations regards Chris B |
#3
| |||
| |||
|
|
On Apr 18, 7:48*am, dba cjb <chris.br... (AT) providentinsurance (DOT) co.uk wrote: Oracle 10.2.0.4 enterprise windows 2003 I am interested in finding out how much of a table is made up of deleted rows / just to see if there is a potential benefit for backups / operations I have run following query SELECT blocks as BLOCKS_USED, empty_blocks FROM dba_tables WHERE table_name='TASK' It shows me I have no empty blocks Is there a query that shows me deleted rows */ non-deleted rows within the used blocks for this table My aim is to assess wether a table export / import would be beneficial for 1) rman backups 2) database operations regards Chris B I don't understand why knowing what rows were deleted affects whether or not *you perform an export; possibly you could explain that to us. Oracle provides a least two tools you could use to identify which rows have been deleted: the DBMS_LOGMNR package or Change Data Capture. There is (to my knowledge) no way to scan each data block associated with a table to find the rows currentlty marked as deleted, and using either of the above methods of deleted row identification could still not show an accurate 'image' of the table data as slots vacated by deleted rows could be filled by newly inserted data. *You could also query the table for rowids then pass those through the DBMS_ROWID package to extract the file, block and row address then visually scan that for 'holes' (a time-consuming task). *Again I don't understand why this is necessary information in the decision process on whether or not to perform an export. David Fitzjarrell |
#4
| |||
| |||
|
|
Oracle 10.2.0.4 enterprise windows 2003 I am interested in finding out how much of a table is made up of deleted rows / just to see if there is a potential benefit for backups / operations I have run following query SELECT blocks as BLOCKS_USED, empty_blocks FROM dba_tables WHERE table_name='TASK' It shows me I have no empty blocks Is there a query that shows me deleted rows / non-deleted rows within the used blocks for this table My aim is to assess wether a table export / import would be beneficial for 1) rman backups 2) database operations regards Chris B |
#5
| |||
| |||
|
|
"dba cjb" <chris.br... (AT) providentinsurance (DOT) co.uk> wrote in message news:56bbc456-e724-472c-b9f2-eecbd0b62f0a (AT) e8g2000vbz (DOT) googlegroups.com... Oracle 10.2.0.4 enterprise windows 2003 I am interested in finding out how much of a table is made up of deleted rows / just to see if there is a potential benefit for backups / operations I have run following query SELECT blocks as BLOCKS_USED, empty_blocks FROM dba_tables WHERE table_name='TASK' It shows me I have no empty blocks Is there a query that shows me deleted rows */ non-deleted rows within the used blocks for this table My aim is to assess wether a table export / import would be beneficial for 1) rman backups 2) database operations regards Chris B It depends how much work you want Oracle to do, what sort of precision you want in your answer, and what assumptions you are prepared to make about your data. *For example, if you're prepared to assume that every row ina table is about the same size then there's a query on my blog that could be helpful: *http://jonathanlewis.wordpress.com/2...ows-per-block/ Slice and dice it various ways, but if you have an expected number of rows per block this gives you some idea of how many blocks are not filled. -- Regards Jonathan Lewishttp://jonathanlewis.wordpress.com |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
Oracle 10.2.0.4 enterprise windows 2003 I am interested in finding out how much of a table is made up of deleted rows SELECT blocks as BLOCKS_USED, empty_blocks FROM dba_tables WHERE table_name='TASK' It shows me I have no empty blocks |
#8
| |||
| |||
|
|
On Apr 18, 4:48*pm, dba cjb <chris.br... (AT) providentinsurance (DOT) co.uk wrote: Oracle 10.2.0.4 enterprise windows 2003 I am interested in finding out how much of a table is made up of deleted rows SELECT blocks as BLOCKS_USED, empty_blocks FROM dba_tables WHERE table_name='TASK' It shows me I have no empty blocks EMPTY_BLOCKS is not maintained nowadays. It is populated by a ANALYZE ... ESTIMATE/COMPUTE STATISTICS call. However, even if you used ANALYZE ... ESTIMATE/COMPUTE STATISTICS which is usually not recommended for various reasons the meaning of the column would be misleading: It will only show you the number of blocks that *never* have been used, viz. are "unformatted" and therefore won't tell you what you are looking for. Running ANALYZE ... ESTIMATE/COMPUTE STATISTICS populates another column that is called "AVG_SPACE" that tells you the average space per block and might give you a rough estimate of how much space could be reclaimed by re-organizing the object. If you attempt to use ANALYZE you should not mix it with DBMS_STATS calls - there are some subtle side effects regarding the cost calculation where ANALYZE produces slightly different results than DBMS_STATS and furthermore the CBO uses some information only populated by ANALYZE (I think it is the CHAIN_CNT info in particular), so you should probably save your current statistics before running ANALYZE or delete and re-gather statistics using DBMS_STATS afterwards. Note that deleting the statistics explicitly is an important step in that procedure otherwise you end up with a mixture of statistics updated by DBMS_STATS and some left unchanged from the ANALYZE call. Due to these potential issues with ANALYZE it is probably much easier to follow Jonathan's post and use the query provided instead... If your objects reside in an ASSM tablespace you could also use the DBMS_SPACE.SPACE_USAGE procedure to get an overview of the "fill grade" maintained in the ASSM bitmap information which also might give a rough idea how much space could be reclaimed. Finally if you want to you could try the "Space/Segment Advisor" provided by Oracle, however I'm unsure about the license implications since it says that it will use AWR historic information for growth trend analysis, but the Segment Advisor itself is not mentioned in any license document:http://download.oracle.com/docs/cd/E.../e17120/schema... Regards, Randolf Oracle related stuff blog:http://oracle-randolf.blogspot.com/ Co-author of the "OakTable Expert Oracle Practices" book:http://www.apress.com/book/view/1430...Administration... |
#9
| |||
| |||
|
|
On Apr 18, 4:48*pm, dba cjb <chris.br... (AT) providentinsurance (DOT) co.uk wrote: Oracle 10.2.0.4 enterprise windows 2003 I am interested in finding out how much of a table is made up of deleted rows SELECT blocks as BLOCKS_USED, empty_blocks FROM dba_tables WHERE table_name='TASK' It shows me I have no empty blocks |
|
Finally if you want to you could try the "Space/Segment Advisor" provided by Oracle, however I'm unsure about the license implications since it says that it will use AWR historic information for growth trend analysis, but the Segment Advisor itself is not mentioned in any license document:http://download.oracle.com/docs/cd/E.../e17120/schema... |
#10
| |||
| |||
|
|
On Apr 19, 2:59*am, Randolf Geist <mah... (AT) web (DOT) de> wrote: On Apr 18, 4:48*pm, dba cjb <chris.br... (AT) providentinsurance (DOT) co.uk wrote: Oracle 10.2.0.4 enterprise windows 2003 I am interested in finding out how much of a table is made up of deleted rows SELECT blocks as BLOCKS_USED, empty_blocks FROM dba_tables WHERE table_name='TASK' It shows me I have no empty blocks Thanks to all for the various clarifications. Finally if you want to you could try the "Space/Segment Advisor" provided by Oracle, however I'm unsure about the license implications since it says that it will use AWR historic information for growth trend analysis, but the Segment Advisor itself is not mentioned in any license document:http://download.oracle.com/docs/cd/E.../e17120/schema... The 10g license doc says you need the tuning pack to reorganize objects, the diagnostics pack to use the tuning pack, and if you click the setup link on the EM home page, then the management packs link, you will see check boxes that will take away any links or tabs you can't use. *Doing this grays out the performance tab on the home page, so you can't get to any of the useful screens.http://download.oracle.com/docs/cd/B...2/b14199/optio... The 11g license doc is more clear about accessing the functionality "whether through Enterprise Manager Console, Desktop Widgets, command- line APIs, or direct access to the underlying data":http://download.oracle.com/docs/cd/E...2/e10594/optio... For my largest tables which periodically show up and I then set up a shrink job, it appears to be wildly overoptimistic about how much space it will get, much like those who waste time rebuilding indices every weekend. Looking at the dba_feature_usage_statistics is left as an exercise for the paranoid, or realists, as the case may be. jg -- @home.com is bogus.http://web.signonsandiego.com/news/2...ark-expands-in... |
![]() |
| Thread Tools | |
| Display Modes | |
| |