Size, Yes Its Different
Posted by Aman Sharma in internals on April 14, 2010
Some times, there is an assumption about things. And as with assumption always, its mostly not true. Still, we do believe on those assumptions and spread them as well , not caring that it may happen that the things are not the way you know them or have read them anywhere! I had a similar sort of discussion few days back with some guys and one of the discussions did end up as a matter of small confusion. This small note is about that confusion’s answer!
I have met many oracle dba’s arguing that the standard block size set at the time of the database creation is the size which is applicable to all the types of the files. So if you have a block size of 8kb, this would be size of your datafiles, control files and also of the log files. This sounds reasonable as well since besides setting the value for the Oracle block size, you don’t have option to mention any other kind of block size as well. So if you are setting a value of it, this should be applicable to all the database files. And this was the topic of discussion as well between me and few delegates! The answer of this doubt is a No actually! Oracle’s standard block size is applicable to only the datafiles. The redo log files and the control files use a different block size. Yes, the block size used by them is not shown in any of the views( things have changed a little from 11.1 onwards) so even if there would be any other value for the blocks, that is not visible. So let’s first check the size used in the datafiles. We shall check the values in 10.2 and 11.1 databases (10201, 11106) running on Windows XP Professional. First data files on 10g,
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options SQL> select file#,block_size from V$datafile; FILE# BLOCK_SIZE ---------- ---------- 1 8192 2 8192 3 8192 4 8192 5 8192 6 8192 7 8192 SQL> sho parameter block_size NAME TYPE VALUE ------------------------------------ ----------- ----------- db_block_size integer 8192 SQL>
And now the same for 11.1,
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> select file#, block_size from V$datafile; FILE# BLOCK_SIZE ---------- ---------- 1 8192 2 8192 3 8192 4 8192 5 8192 6 8192 7 8192 7 rows selected. SQL> sho parameter block_size NAME TYPE VALUE ------------------------------------ ----------- ------- db_block_size integer 8192
And this surely matches with what we have set in the parameter DB_BLOCK_SIZE!
Now, the issue is how do we check the block size used by the redo log files? In 10g, there is no provision given by oracle in the external view(s) to see this!
BANNER ---------------------------------------------------------------- Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod PL/SQL Release 10.2.0.1.0 - Production CORE 10.2.0.1.0 Production TNS for 32-bit Windows: Version 10.2.0.1.0 - Production NLSRTL Version 10.2.0.1.0 - Production SQL> desc V$log; Name Null? Type ----------------------------------------- -------- -------------------- GROUP# NUMBER THREAD# NUMBER SEQUENCE# NUMBER BYTES NUMBER MEMBERS NUMBER ARCHIVED VARCHAR2(3) STATUS VARCHAR2(16) FIRST_CHANGE# NUMBER FIRST_TIME DATE SQL> desc V$logfile Name Null? Type ----------------------------------------- -------- -------------------- GROUP# NUMBER STATUS VARCHAR2(7) TYPE VARCHAR2(7) MEMBER VARCHAR2(513) IS_RECOVERY_DEST_FILE VARCHAR2(3)
SQL>
But the size is indeed shown in an internal table, X$KCCRT( Kernel Cache Current Redo Thread). I am not going to show all the columns of this table but only that one which would be having the “log block size” .
SQL> select lebsz from X$kccle; LEBSZ ---------- 512 512 512
Yes, this is the size of the redo log block in which the LGWR writes into the log files. So this is indeed not true that the standard block size is applicable to the redo log files. This size basically is picked by Oracle based on the physical block size given by the media. We have the 512byte of the physical block size available and that’s the same is used by the redo log files. Still, you should check this on your own box! Surely enough, there is no need to change this size or play around with it! In 11g(11.1), this is the same output that you would be getting from oracle as there is no change that’s there in 11.1 for this nomenclature. Here is an output from 11.1 system,
BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production PL/SQL Release 11.1.0.6.0 - Production CORE 11.1.0.6.0 Production TNS for 32-bit Windows: Version 11.1.0.6.0 - Production NLSRTL Version 11.1.0.6.0 - Production SQL> select lebsz from x$kccle; LEBSZ ---------- 512 512 512 SQL> desc V$log Name Null? Type ----------------------------------------- -------- ---------------------------- GROUP# NUMBER THREAD# NUMBER SEQUENCE# NUMBER BYTES NUMBER MEMBERS NUMBER ARCHIVED VARCHAR2(3) STATUS VARCHAR2(16) FIRST_CHANGE# NUMBER FIRST_TIME DATE SQL> desc V$logfile Name Null? Type ----------------------------------------- -------- ---------------------------- GROUP# NUMBER STATUS VARCHAR2(7) TYPE VARCHAR2(7) MEMBER VARCHAR2(513) IS_RECOVERY_DEST_FILE VARCHAR2(3)
The output varies a little from 11.2 onwards where to check the redo log block, you won’t need to check any internal table but the same would be shown in the standard V$log. Since I don’t have 11.2 running with me on this machine so here is an excerpt from docs for the same,
http://download.oracle.com/docs/cd/E11882_01/server.112/e10820/dynviews_2030.htm#REFRN30127
You can see a new column sized called BLOCKSIZE which can have two values, 512 or 4096! Hang on a sec, two values? How that’s possible? The answer of that lies in a change that has started to come in the way our hard disks.
The standard physical sector size supported by the hard drives was always 512byte. This was( and still is) the same size of the block that was picked by redo log files as explained above. Since there are more bigger and faster media solutions available now, the hardware vendors have started moving from 512 byte physical block sized disks to 4kb physical block sized disks! Surely enough, this would increase the capability of underlying systems to do a more larger chunk of IOs in both reading and writing. But for this, there remains one hurdle that if the oracle files are still going to be using the 512byte sector sized block, this optimization from the hard disk vendors won’t bear any fruit since the IO would be still limited to the underlying block size of the redo log file which would be still 512byte. To overcome this, from 11.2 onwards, Oracle supports the 4kb sector disk drives and offers two modes of the working, Emulation mode and Native mode for the block size support of the redo log files. You can read about it here,
http://download.oracle.com/docs/cd/E11882_01/server.112/e10881/chapter1.htm#FEATURENO08747
Oracle is capable to detect what’s the size of the physical block offered by the disk and accordingly, the redo log block size is picked up. And this was the right thing to do in the past as well since there was no requirement to do any kind of tuning to this behavior as well as there was no other option available from the physical disk as well. But since now the vendors have started shipping disks with 4kb disks as well, so the support for the same must come both from Oracle and from the operating systems as well. Here is a support note from Microsoft about the same,
http://support.microsoft.com/kb/923332
The same support is offered by Oracle from 11.2 onwards where two new clauses are introduced for the same, sector_size and blocksize. The SECTOR_SIZE clause is added while you are working with the ASM(without ACFS) i.e. when you are creating a diskgroup, you can mention that what would be the size of the block used by that disk group. Oracle docs explain this in a good manner here,
http://download.oracle.com/docs/cd/E11882_01/server.112/e10500/asmdiskgrps.htm#OSTMG10203
The BLOCKSIZE support is offered from 11.2 while creating the log files. Now, you can mention that what should be the size of the redo log block on the underlying disk which supports either 4kb or 512 byte sized sector. If you are going to use 512 byte sized sector on a 4kb sector disk, this would be a non-good approach actually. So if you do know that you have a disk supporting 4kb sized sector, its advisable to use the same while creating the redo log files as well. For the same, 11.2 docs have this section added,
http://download.oracle.com/docs/cd/E11882_01/server.112/e10595/onlineredo002.htm#ADMIN12891
Emulation mode is the mode where the physical block size offered by the vendor is 4kb but the sized used by the redo log files is still 512byte only. This would be considered as a logical size where 8 logical sectors of 512 byte would map to one physical sector of 4096 bytes. As I said above, this would be a non-good approach. The better option would be to use the same size at both disk and within the file. There is another type of the mode offered called Native mode where the logical and physical size of the sector would be the same.
Oracle recommends that the block size used by the redo logs should match with the physical sector and the size of the data block should be either equivalent of multiple of the physical sector size. This optimization does “not” get applied to the control files which won’t experience any chance in their working since they don’t use either the standard block size or the redo log block size. Didn’t I say so already
?
Unlike the redo log and data files, control files use a standard block size of 16kb irrespective of what is offered from the media. Again, this is not shown from the standard control file views so we need to go a step ahead and check the table, X$KCCCF( Kernel Cache Current Control File). Let’s check this table on both 10.2 and 11.1 versions,
SQL> select * from V$version; BANNER ---------------------------------------------------------------- Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod PL/SQL Release 10.2.0.1.0 - Production CORE 10.2.0.1.0 Production TNS for 32-bit Windows: Version 10.2.0.1.0 - Production NLSRTL Version 10.2.0.1.0 - Production SQL> select cfbsz from X$kcccf; CFBSZ ---------- 16384 16384 16384 SQL> sho parameter control NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ control_file_record_keep_time integer 7 control_files string E:\ORACLE\PRODUCT\10.2.0\ORADA TA\ORCL\CONTROL01.CTL, E:\ORAC LE\PRODUCT\10.2.0\ORADATA\ORCL \CONTROL02.CTL, E:\ORACLE\PROD UCT\10.2.0\ORADATA\ORCL\CONTRO L03.CTL
What we are seeing is that there are three control files in my db and all are using 16kb as the block size. Let’s check on 11.1 now,
SQL> select * from V$version; BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production PL/SQL Release 11.1.0.6.0 - Production CORE 11.1.0.6.0 Production TNS for 32-bit Windows: Version 11.1.0.6.0 - Production NLSRTL Version 11.1.0.6.0 - Production SQL> select cfbsz from x$kcccf; CFBSZ ---------- 16384 16384 16384 SQL> sho parameter control NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ control_file_record_keep_time integer 7 control_files string E:\APP\ARISTADBA\ORADATA\ORCL1 11G\CONTROL01.CTL, E:\APP\ARIS TADBA\ORADATA\ORCL111G\CONTROL 02.CTL, E:\APP\ARISTADBA\ORADA TA\ORCL111G\CONTROL03.CTL control_management_pack_access string DIAGNOSTIC+TUNING
Which shows the same output with 3 files and a 16kb block size! This is sort of hardcoded only and won’t change even if you are going to use a disk which supports variable sector sizes.
To conclude, its good to believe on rumors but its more better to check their authentication since 9/10 times, rumors are just what they are, rumors! Sounds like a great punch line right
!
Special thanks to Jared for pointing and correcting a typo in the post
Object_ID & Data_Object_ID….
Posted by Aman Sharma in genernal on April 4, 2010
Its just so true that there is so much that is out there which I don’t know about this oracle db software and that holds true even for some very minor things. Almost every day, there is something new that comes in front of me and makes me realize that how less knowledge I have? The same happened today and yesterday as well when I came to know about two new things which I didn’t know before. I am sharing one of them today, the second one would come may be sometime later.
I was asked few days back a question that whether there is anything called data_object_id and if it is, what does it mean? Coincidently, the very same question was asked on OTN forums as well in this thread. I didn’t know what’s the meaning of the data_object_id but it came out that its indeed true that such things exists and is there in the ALL_OBJECTS view as well. Hmm interesting so what it can be? The first search like always was at AskTom which resulted in this thread. According to Tom, the object_id is a unique identifier of the object in the database. Each object is assigned a unique number to recognize it in the database. In the same manner, each object is linked to a segment. The data object id is assigned to that segment and any kind of change done on the physical segment would lead to give a change in that number. Both the numbers are same initially but when the modifications happen on the segment, the data_object_id changes. Both the object_id and data_object_id are the numbers used by oracle to denote the metadata for the object that is used within the data dictionary.
We can see it in action,
SQL> select * from V$version; BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production PL/SQL Release 11.1.0.6.0 - Production CORE 11.1.0.6.0 Production TNS for 32-bit Windows: Version 11.1.0.6.0 - Production NLSRTL Version 11.1.0.6.0 - Production SQL> select obj#, dataobj#, tab# from tab$ where obj# in ( select object_id from dba_objects where owner='SCOTT' and object_n EMP_C'); OBJ# DATAOBJ# TAB# ---------- ---------- ---------- 71135 71135 SQL> truncate table scott.emp_c; Table truncated. SQL> select obj#, dataobj#, tab# from tab$ where obj# in ( select object_id from dba_objects where owner='SCOTT' and object_n EMP_C'); OBJ# DATAOBJ# TAB# ---------- ---------- ---------- 71135 71136 SQL> . SQL> alter table scott.emp_c move; Table altered. SQL> select obj#, dataobj#, tab# from tab$ where obj# in ( select object_id from dba_objects where owner='SCOTT' and object_name=' EMP_C'); OBJ# DATAOBJ# TAB# ---------- ---------- ---------- 71135 71140
So, that was yet another learning for me. I am sure except me, almost all must be knowing about it already but I didn’t know and to be honest, it feels a little irritating that something so simple and tiny was not clear to me but that’s what makes me believe yet again that the best is to “stay hungry, stay foolish” all the time (courtesy Steve Jobs)
. And much thanks to Tom Kyte for being there for oracle community and making us understand the complexities of this beast called Oracle db!
Let’s Give Encouragement….
Posted by Aman Sharma in genernal on March 27, 2010
I always encourage the delegates who attend my sessions to start participating in Oracle’s socialsphere as much as possible! Also I try to sort of “push” them for reading the blogs related to Oracle (database since I do only database) related technologies. Its always something new happening some where and someone always would note it and share it with the rest of the community via his/her blog. So blog is a great way to share knowledge, new ideas. So one of the delegates of my current session, Swati who works as a senior DBA has finally taken the first step and has set up her own blog. I shall be bookmarking it and following it because the most important thing for a writer is to get feedback and encouragement. So let’s give the same to Swati for her Oracle related blog and hopefully, we would be able to hear much more regarding her experiences and experiments with Oracle db.
Here is the blog address,
http://dbaexperiments.wordpress.com/
Testing Syntax Highlighter….
Posted by Aman Sharma in Fun on March 6, 2010
I am not happy with the technical code part that I post over here. Though I know that I have to use some syntax highlighter but I just behaved lazy and didn’t try even to search for one. As like always, Sidhu came as a rescue and asked me install Syntax Highlighter which is a wordpress plugin. I am going to give it a try and see how it shows my code. So this is just a test post for checking the code and the plugin
.
SQL> set long 10000000 SQL> set longchunksize 10000000 SQL> set linesize 200 SQL> select dbms_sqltune.report_sql_monitor from dual; SQL>select count(*) from test; COUNT(*) ———- 1101904
Hope the highlighting is not over-done
!
Real Time SQL Monitoring, A Goodie Of 11g….
Posted by Aman Sharma in genernal on March 5, 2010
Oracle’s newest database release 11g is having lots of goodies stored in it. Since now even the release 2 of it, (11.2.0.1) is also out, the number of goodies has just gone more higher! There are some things which are really very nice and are worth checking at least for once. This post is just about one of those goodies. The idea of this post is not about a new invention but about the introduction a worth-to-know kind of feature introduced with the Oracle 11g. Interested, okay keep on reading then
.
Its always asked by the people who are involved in the query tuning that there should be something which should tell them the current statistics of the query, right at that time when the query is actually running! This kind of monitoring, if available, can help a lot in finding out that out of all the access paths, which one is taking more time in addition to the time spent in the execution of various steps of the query. Also, there is one question which I am asked all the time that from where the query execution starts in the execution plan? The answer of that can be given looking at the execution plan though but if there can be something which can show us the same when the query is still “alive”, I guess that information can help in both understanding the execution pathway of the query and also can come handy in the troubleshooting part. I am not sure that is there is some tool which can do this kind of task ( if you know, please do post the name of it in the comments) but I believe, there is nothing which I should be worried about now since from 11g release 1, Oracle has given a solution for this with the Real Time SQL Monitoring!
Real-time sql monitoring does exactly what it says, it monitors a query when its actually running. The monitoring information gives a wide information about the query state that whether its over and some more general information about the query. It also brings out the information of the execution plan of the query and the statistics like that how much time is spent by each access path in the plan, also including the cost incurred at that step. This also shows with a nice arrow (->) marker that which step is executing at the moment when the query is still actually running!
Real time monitoring is enabled through the parameter CONTROL_MANAGEMENT_PACK_ACCESS which should be set to the value DIAGNOSTIC+TUNING( default) . In addition to it, the parameter STATISTICS_LEVEL is set to either ALL or TYPICAL(default) . If oracle finds out that the there is delay of more than 5 seconds happening for the query, it can monitor that query. The monitoring information is stored in two new views V$SQL_MONITOR and V$SQL_PLAN_MONITOR. V$SQL_MONITOR view would get populated when the monitoring of the query would start.
The monitoring is recorded through the package DBMS_SQLTUNE’s function, REPORT_SQL_MONITOR which does offer couple of switches that can help in getting the desired output needed to troubleshoot the query’s performance issues. The description of the entire number of options offered by the function is in the link given already. Let’s try to use this function to monitor a simple query. For this purpose, we would be using two sessions where one would be running the query which we want to monitor and the other would be executing the function which would capture the query’s information. First, we prepare the session that is supposed to monitor the running query,
Session-1>>
SQL> set long 10000000
SQL> set longchunksize 10000000
SQL> set linesize 200
SQL> select dbms_sqltune.report_sql_monitor from dual;
Now, we shall write a very simple query in the session 2 of ours which we would execute and than monitor it from the first session.
Session-2>>
SQL@AMAN>select count(*) from test;
COUNT(*)
———-
1101904
Since the query result set is not that much large, the query gets complete in a very less time but still it did take long enough so that Oracle could monitor it. After the query’s execution got over, this is what was reported for it through the monitoring.
Session-1>>
SQL@SYS>select dbms_sqltune.report_sql_monitor from dual;
REPORT_SQL_MONITOR
———————————————————————————————————————————-
———————————————————————-
SQL Monitoring Report
SQL Text
———————————————————————————————————————————-
————————————————-
select count(*) from test
———————————————————————————————————————————-
————————————————-
Global Information
Status : DONE (ALL ROWS)
Instance ID : 1
Session ID : 131
SQL ID : 7b2twsn8vgfsc
SQL Execution ID : 16777216
Plan Hash Value : 1950795681
Execution Started : 03/04/2010 23:03:28
First Refresh Time : 03/04/2010 23:03:31
Last Refresh Time : 03/04/2010 23:03:35
——————————————————————–
| Elapsed | Cpu | IO | Other | Fetch | Buffer | Reads |
| Time(s) | Time(s) | Waits(s) | Waits(s) | Calls | Gets | |
——————————————————————–
| 6.56 | 0.13 | 6.38 | 0.06 | 1 | 23976 | 16112 |
——————————————————————–
SQL Plan Monitoring Details
| Id | Operation | Name | Rows | Cost | Time | Start | Starts | Rows | Activity | Activity Detail |
| | | | (Estim) | | Active(s) | Active | | (Actual) | (percent) | (sample #) |
================================================================| 0 | SELECT STATEMENT | | | 4655 | 1 | +7 | 1 | 1 | | |
| 1 | SORT AGGREGATE | | 1 | | 1 | +7 | 1 | 1 | | |
| 2 | TABLE ACCESS FULL | TEST | 1097K | 4655 | 6 | +2 | 1 | 1102K | 100.00 | direct path read (6) |
==================================================================
We can see that a lot of information is captured through the monitoring for us! The sections which presents the interesting outputs are Activity(percent) and Activity Detail(sample#) . The Acitivity percent shows that in terms of DB time, how much time was spent by each access path of the query and the Activity Details shows the detailed information about that activity. For our case, the biggest (and the only active) activity was table access full and this did happen through the Direct Path Read! Furthermore, you can even control the monitoring through two hints as well, MONITOR and NO_MONITOR! And last but certainly not the least, the real time monitoring is also a part of EM which means all of this can be done through nice and shiny colorful EM screens as well. Now that’s cool!
I believe that its a really useful feature! Once again, the idea of this post was not post something “internal” but just to bring this feature in front of you. If you already knew about it, cool, feel free to add more information about this feature over here via the comments. If you didn’t know about it before, well, now you know so enjoy it to the fullest
. Oh and BTW, you can read about this feature in detail from here.
Segment Checking Using DBV….
Posted by Aman Sharma in genernal on March 4, 2010
I have seen many people talking about the Database Verify(DBV) utility that it can be only used for the physical database check for any sort of corruptions( which is true too). That’s correct to say that the use of the DBV is to check (mandatorily) the data blocks so it can be used only to check the data files.
I have just got a question which did raise a doubt that somewhere its mentioned that the DBV can be “only” used to do the “logical corruption” check as well, how? Well, first of all , the statement itself is not correct. The DBV can be certainly used to check the physical corruption of a block and that’s what I believe most of us know about DBV as well too. So what about this logical corruption? Ain’t we suppose to use Flashback technology for it? Well, to answer these questions, we first of all have to understand what does it mean by “logical corruption” ?
First , what’s a physical corruption? It means that the underlying place where the block was sitting, itself is corrupted. The error normally would arise because of a faulty media or a bad sector over the media which essentially would physically corrupt the block, making it impossible for oracle to access it.And if you do find a block physically corrupted, the very first step before you attempt to recover the block would be that you replace the underlying media first. Once the media is replaced, the underlying block can be recovered using the Block Recover command (10g) or Recover command(11g) !
The perception that I have seen most of the times in my sessions is that when someone mentions “logical corruption”, he only means a DML corrupting data “logically” , for example all salaries getting updated to 0 by someone in one single Update command! Right? Wrong! This is not “logical corruption” but its “logical data corruption” and certainly for this, the Flashback technology is well verse to be used! So what the heck is the “logical corruption” of a block is ? Well, simply put and in the first place, the block is physically fine which means that the physical location where the block is located is perfectly fine and there are absolutely no issues for Oracle to read the block! But despite that, there is some inconsistency in the block which is making it marked as corrupted and that’s not related to the physical allocation of the block!
For example, if there is an index entry that should point to a data block, is found to be null i.e it stores an entry pointing to nowhere is an example of logical corruption of the block! The block would be fine in terms of physical aspects but still, its termed as corrupted “logically” by oracle! If there is a row entry mismatch found in the block, oracle reports internal error, ora-600 with the argument, [KDSGRP1], which means that there was a mismatch found in the row entries of the block. This kind of corruption would normally happen on its own and there are not set rules which would make it come! When you hit logical corruption, the block from Oracle’s side is completely fine and is fully accessible, yet the block is corrupted internally! This kind of corruption can be checked with the DBV command supplying it the information about the object whose blocks you want to verify. Obviously, this detection would be done below the high water mark of the segment, covering only those block which were formatted either now or in the past some time! The new or unformatted won’t have anything to do with the lgocial corruption!
To call DBV for the segment check, you need to pass minimally the user information (login credentials) of the user with the segment information which would comprise of the Tablespace Number, Relative file Number of the tablespace containing the block and the header block of the object! All this information can be picked up using the V$tablespace and dba_segments views. Other than that, in the Sys schema, you can find the view with the name Sys_user_segs which would also show the same to you! Shown below is a small snippet which is about creating an object and thus checking its information from both the views and finally using that info in the DBV command! Please note that the segment identification information passed in the command is comprising of the tablespace id, relative file number of the object and the header block of the object!
SQL> select * from v$version; BANNER -------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production PL/SQL Release 11.1.0.6.0 - Production CORE 11.1.0.6.0 Production TNS for 32-bit Windows: Version 11.1.0.6.0 - Production NLSRTL Version 11.1.0.6.0 - Production SQL> drop table e purge 2 ; Table dropped. SQL> create table e as select * from scott.emp; Table created. SQL> exec dbms_stats.gather_table_stats(user,'E'); PL/SQL procedure successfully completed. SQL> select segment_name, tablespace_name, header_file, header_block 2 from dba_segments 3 where segment_name='E'; SEGMENT_NAME ------------------------------------------------------------------------- TABLESPACE_NAME HEADER_FILE HEADER_BLOCK ------------------------------ ----------- ------------ E USERS 4 395 SQL> select ts#,name from v$tablespace where name='USERS'; TS# NAME ---------- ------------------------------ 4 USERS SQL> exit C:\>dbv userid=aman/aman segment_id=4.4.395 DBVERIFY: Release 11.1.0.6.0 - Production on Thu Mar 4 00:34:59 2010 Copyright (c) 1982, 2007, Oracle. All rights reserved. DBVERIFY - Verification starting : SEGMENT_ID = 4.4.395 DBVERIFY - Verification complete Total Pages Examined : 8 Total Pages Processed (Data) : 1 Total Pages Failing (Data) : 0 Total Pages Processed (Index): 0 Total Pages Failing (Index): 0 Total Pages Processed (Other): 6 Total Pages Processed (Seg) : 1 Total Pages Failing (Seg) : 0 Total Pages Empty : 0 Total Pages Marked Corrupt : 0 Total Pages Influx : 0 Total Pages Encrypted : 0 Highest block SCN : 1094559 (0.1094559) C:\>
As you can see that there won’t be anything mentioned by the DBV that the corruption is due to a physical corruption or a logical corruption! That’s why, to be ensured, its better to use Rman’s validate command which can check the blocks for physical and logical corruption!
So what’s the conclusion? Well, the conclusion is that “logical data corruption” is not the same as “logical block corruption” and DBV is not meant for only checking the physical corruption of the blocks within the data file and can be used the blocks of a segment as well!
And all of this is documented( okay may be not all ) in the official documentation,
http://download.oracle.com/docs/cd/E11882_01/server.112/e10701/dbverify.htm#i1006970
Hope this helps
!
Want To Become Oracle Certified? Do It ASAP Because….
Posted by Aman Sharma in Certification on February 25, 2010
Oracle University has announced that they are going to increase the prices of their exams from March 1,2010! You can read the complete information from this post.
Well, this was about the announcement, now a little rant! I am not sure that whether this price hike is actually correct or not? If one looks at the prices of the courses, combines it with the logistic charges, add to it the prices of the exams, the sum total becomes sky high! And this is when the exam fee is still the same. So when the exam fee would be increased, I am not sure how many would be really interested to take up the exams since I hear all the time at the moment even that the prices are very high! Agreed that the price hike would vary from country to country(which I don’t understand why but that’s another rant to talk about I guess) still, it would effect in an overall manner a lot! Not sure what’s good is going to come out from this but I believe its going to demoralize those new aspirants who want to get certified! I just hope that it won’t happen because doesn’t matter what anyone would say, Oracle Certification program is still is the best way to learn and demonstrate one’s passion about learning Oracle! Okay rant over!!
If you want to get certified and are delaying it, probably the time has come that you speed up your preparation process and write the exams as soon as possible! And this makes me recall that I need to do the same as well
!
Blog Upgrade, WordPress 2.9.2….
Posted by Aman Sharma in genernal on February 16, 2010
I just saw that the update is available for the WordPress for the latest 2.9.2 version. Just finished the upgrade of the blog. If you can see this post, it means all went well
.
Confused About DataGuard, Issues With It, Share/Discuss/Get Clarifications At….
Posted by Aman Sharma in genernal on February 16, 2010
Data Guard forum at OTN forums! It just has come up and based on the discussion happened here, I believe its the fruit of the efforts done by the product manager of Data Guard Larry Carpenter who is also the lead author of Data Guard Handbook from Oracle Press! I am quite active over OTN forums and based on my experience over there, I can say with complete trust that alike other forums like Database General and many more, this would also help Oracle community immensely! Another bookmark added to my daily-visit sites
!
Redo & Undo, Partners In Crime Talked About Yet Again….
Posted by Aman Sharma in internals on February 13, 2010
Anyone who does know about Oracle db and its working even the slightest bit would have heard about these two words for sure, Redo and Undo! Both make Oracle db what it is, a very robust data engine and also come out as one of the most complex algorithms to understand within the same. Almost all the time, there is some confusion that’s there about these two and I am sure, both will be a very hot topic of discussion for many many years yet to come!
I am quite active on OTN Forums ( and no that’s not an excuse of being less active here) and at times, there are some very interesting questions which do pop up there. One such question about Redo, which obviously would include Undo as well did come out few days back over this thread, why not use Redo log for consistent read. Now, it shouldn’t come out as a surprise that why Redo can’t be used if one understands the way it works but it was still a very interesting topic to jump into since the way Oracle db works is one of my favorite areas. So I did try to explain it somewhat. If you think that you don’t know the answer or even if you know you do, I would welcome you to read the thread! As like always, any corrections wherever needed and possible are most welcome!
Though the thread went to great lengths, still I fee that the underlying answer was not really what it should had been. I am sure the reason is my not-so-deep understanding about Oracle db only since I was the one who did give maximum replies there. But I guess, the topic was actually good because of which, Jonathan Lewis, probably the best and the most knowledgeable person over this planet about Oracle, did pick the question and gave the actual (and an awesome one) and very detailed answer over here. I would recommend you to read the complete blog post which clears the concept completely that why Redo should NOT be used for read consistency and Undo should be! Thanks so much Jonathan for such a brilliant explanation!
I am pretty busy at the moment( and no, this is also not the reason for being less active here) because there is a very important writing assignment I am working over but I shall try to write soon about some of these basic concepts over here! Hope that “soon” happens soon
!

Recent Comments