<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4897450294835765476</id><updated>2011-10-08T04:12:46.225+02:00</updated><category term='Oracle 11g standby sgkfifi'/><category term='Oracle OCM'/><category term='OCP'/><category term='OOW Oracle'/><category term='RAC'/><category term='Oracle Database'/><category term='CBO'/><category term='Linux'/><category term='bug'/><category term='11g'/><category term='OCP OCM 11g'/><category term='dbms_alert'/><category term='list partitioning'/><category term='index'/><category term='x86_64'/><category term='RHEL5'/><title type='text'>Vit Spinka technical blog</title><subtitle type='html'>I use this blog to publish the small bits I come accross when using the Oracle Database. It's the "every day I learn something new" style.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://vitspinka.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://vitspinka.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Vit Spinka</name><uri>http://www.blogger.com/profile/03048791839608729608</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4897450294835765476.post-378659334593481651</id><published>2011-04-27T22:00:00.000+02:00</published><updated>2011-04-27T22:00:06.702+02:00</updated><title type='text'>Manual archiving of redo logs gone with 9i – or is it not?</title><content type='html'>Originally published on Dbvisit blog at &lt;a href="http://blog.dbvisit.com/manual-archiving-of-redo-logs-gone-with-9i-or-is-it-not/"&gt;http://blog.dbvisit.com/manual-archiving-of-redo-logs-gone-with-9i-or-is-it-not/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;If you memory dates back to the pre-10g times, you will maybe recall the steps to enable archivelog mode on the database at that time. Perhaps the greatest catch was that the online logs did not get archived automatically by default – you had to do it manually.&lt;br /&gt;&lt;br /&gt;Or, let Oracle come to rescue, and let the ARCH process(es) do it for you by starting them with &lt;tt&gt;log_archive_start = true&lt;/tt&gt; (or even dynamically with &lt;tt&gt;alter system archive log start/stop&lt;/tt&gt;). You could even start ARCH in noarchivelog mode, so they did completely nothing, just writing error messages to alert.log.&lt;br /&gt;&lt;br /&gt;One of the new features of 10g was getting rid of all of this – ARCH starting is governed solely by (no)archivelog mode and the DBA does not need to fiddle with anything else to get it right. Great applause, many thanks, scene over.&lt;br /&gt;&lt;br /&gt;Well, all above is just a short transcript of my memory of those great times, and I lived with it happily and well till this week.&lt;br /&gt;&lt;br /&gt;As it turns out, the story with 10g is not so straightforward – although it is true that if you just set no/archivelog mode that ARCH works as expected, the manual way of archiving was in fact not removed. But the way to enable it new:&lt;br /&gt;&lt;br /&gt;To enable manual archiving mode, use &lt;tt&gt;alter database archivelog manual&lt;/tt&gt;. The rest is the same as with 9i – use &lt;tt&gt;alter system archive log&lt;/tt&gt; commands.&lt;br /&gt;&lt;br /&gt;One consequence of this change – the &lt;tt&gt;log_mode&lt;/tt&gt; in &lt;tt&gt;v$database&lt;/tt&gt; can be archivelog, noarchivelog (as in 9i and before) or manual (from 10g on). This also means that if you want to detect whether a database runs in archivelog mode, you have to check for manual log_mode as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4897450294835765476-378659334593481651?l=vitspinka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vitspinka.blogspot.com/feeds/378659334593481651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4897450294835765476&amp;postID=378659334593481651' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/378659334593481651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/378659334593481651'/><link rel='alternate' type='text/html' href='http://vitspinka.blogspot.com/2011/04/manual-archiving-of-redo-logs-gone-with.html' title='Manual archiving of redo logs gone with 9i – or is it not?'/><author><name>Vit Spinka</name><uri>http://www.blogger.com/profile/03048791839608729608</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4897450294835765476.post-1413307917670608322</id><published>2011-04-24T14:47:00.001+02:00</published><updated>2011-05-04T21:50:06.896+02:00</updated><title type='text'>Installing RAC on Oracle VM</title><content type='html'>Originally published on Dbvisit blog at  &lt;a href="http://blog.dbvisit.com/installing-rac-on-oracle-vm/"&gt;http://blog.dbvisit.com/installing-rac-on-oracle-vm/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;One of the nice features of Oracle VM (and perhaps the most compelling one when you are evaluating different virtualization products for testing and development) is the comprehensive list of prepackaged templates available at Oracle e-delivery.&lt;br /&gt;&lt;br /&gt;The list is not complete and probably cannot ever be, as Oracle is expanding it’s product offerings very fast. Of the missing basic configurations, there is for example no Oracle Database on Solaris template (although plain Solaris is available).&lt;br /&gt;&lt;br /&gt;However, let’s look at the RAC templates. The list is comprehensive and you can choose between 11.1 and 11.2 on Oracle Enterprise Linux, both 32- and 64-bit.&lt;br /&gt;&lt;br /&gt;The first-time setup is quite easy and easy if you follow supplied pdf documentation. The usual setup is 2-node RAC, but you can semi-manually add further nodes as well.&lt;br /&gt;&lt;br /&gt;Still, there is a catch: the pdf declares that one of the prerequisities is to have &lt;i&gt;two physical network cards&lt;/i&gt;. Strange, isn’t it? After all, a RAC node needs just one network card for the outside world, the second one connects just to the other nodes and should be virtual only, right? Well, not according to the docs. You have to set the second network interface of the RAC node to use xenbr1 (second network bridge) to connect to other nodes, but this bridge is simply not present in Oracle VM if you have just one physical network interface.&lt;br /&gt;&lt;br /&gt;If you ignore the requirement and go on with the VM creation, you will face problems very soon: after you specify primary/secondary node (the first question after startup), the nodes don’t see each other. Or, they see each other, but after that, connectivity tests fail on eth1. (This differs on your choice of template used.)&lt;br /&gt;&lt;br /&gt;The solution is in fact simple: if RACs need a separate xenbr1 bridge interface, just give it to them:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;create the bridge: &lt;i&gt;brctl addbr xenbr1&lt;/i&gt;&lt;br /&gt;&lt;li&gt;bring the bridge up: &lt;i&gt;ifconfig xenbr1 up&lt;/i&gt;&lt;/ul&gt;And then, according to the docs, set the VIF1 interfaces to use xenbr1.  If you do it by trial and error as I did, you may up end with VM assigning the VIFs incorrectly to the bridges (both to the same one, etc.). In that case edit vm.cfg for you virtual machine (in &lt;i&gt;/OVS/running_pool/&lt;/i&gt;) and check that VIF0 is really set to xenbr0 and VIF1 to xenbr1. But if you first setup the xenbr1 and after that start creating your RAC, you should be fine.&lt;br /&gt;&lt;br /&gt;As usual, to make the configuration permanent, you must make sure it persists reboots. Just adding the two aforementioned commands to /etc/rc.local should do the trick.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4897450294835765476-1413307917670608322?l=vitspinka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vitspinka.blogspot.com/feeds/1413307917670608322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4897450294835765476&amp;postID=1413307917670608322' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/1413307917670608322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/1413307917670608322'/><link rel='alternate' type='text/html' href='http://vitspinka.blogspot.com/2011/04/installing-rac-on-oracle-vm.html' title='Installing RAC on Oracle VM'/><author><name>Vit Spinka</name><uri>http://www.blogger.com/profile/03048791839608729608</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4897450294835765476.post-838409061763591438</id><published>2010-07-20T11:12:00.001+02:00</published><updated>2010-07-20T11:15:10.149+02:00</updated><title type='text'>How to move flashback data archive to a different tablespace?</title><content type='html'>The documentation says to ALTER FLASHBACK ARCHIVE REMOVE TABLESPACE following:&lt;br /&gt;&lt;blockquote&gt;If the tablespace to be removed contains any data within the retention period of the flashback archive, then that data will be dropped as well. Therefore, you should move your data to another tablespace before removing the tablespace with this clause.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;However, the question is: how do you move the data?&lt;br /&gt;&lt;br /&gt;Attempt to move the internal tables stored in flashback archive raises&lt;br /&gt;ORA-55622: DML, ALTER and CREATE UNIQUE INDEX operations are not allowed on table "SCOTT"."SYS_FBA_DDL_COLMAP_69926"&lt;br /&gt;&lt;br /&gt;And the response of Oracle support is simple:&lt;br /&gt;&lt;blockquote&gt;What you are trying to do is not currently possible. You cannot move the FDA history tables from one tablespace to another, nor can you move the FDA to another tablespace using ALTER FLASHBACK ARCHIVE.&lt;br /&gt;&lt;br /&gt;Development however acknowledges that this is a desired feature that they will look into adding for a future release.&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4897450294835765476-838409061763591438?l=vitspinka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vitspinka.blogspot.com/feeds/838409061763591438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4897450294835765476&amp;postID=838409061763591438' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/838409061763591438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/838409061763591438'/><link rel='alternate' type='text/html' href='http://vitspinka.blogspot.com/2010/07/how-to-move-flashback-data-archive-to.html' title='How to move flashback data archive to a different tablespace?'/><author><name>Vit Spinka</name><uri>http://www.blogger.com/profile/03048791839608729608</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4897450294835765476.post-304644883419005846</id><published>2009-12-02T07:29:00.004+01:00</published><updated>2009-12-02T10:57:20.769+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle 11g standby sgkfifi'/><title type='text'>ORA-27048: skgfifi: file header information is invalid</title><content type='html'>I was asked to analyze a situation, when an attempt to recover a 11g (standby) database resulted in bunch of "ORA-27048: skgfifi: file header information is invalid" errors.&lt;br /&gt;&lt;br /&gt;I tried to reproduce the error on my test system, using different versions (EE, SE, 11.1.0.6, 11.1.0.7), but to no avail. Fortunately, I finally got to the failing system:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;SQL&gt; recover standby database;&lt;br /&gt;ORA-00279: change 9614132 generated at 11/27/2009 17:59:06 needed for thread 1&lt;br /&gt;ORA-00289: suggestion :&lt;br /&gt;/u01/flash_recovery_area/T1/archivelog/2009_11_27/o1_mf_1_208_%u_.arc&lt;br /&gt;ORA-27048: skgfifi: file header information is invalid&lt;br /&gt;ORA-27048: skgfifi: file header information is invalid&lt;br /&gt;ORA-27048: skgfifi: file header information is invalid&lt;br /&gt;ORA-27048: skgfifi: file header information is invalid&lt;br /&gt;ORA-27048: skgfifi: file header information is invalid&lt;br /&gt;ORA-27048: skgfifi: file header information is invalid&lt;br /&gt;ORA-00280: change 9614132 for thread 1 is in sequence #208&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Interestingly, nothing interesting is written to alert.log nor the trace file - just the ORA-27048, with no detail, so you cannot see which file is affected from there.&lt;br /&gt;&lt;br /&gt;However, don't lose hope, there is always one thing to try: strace the process (fortunately this was a Linux box, not a Windows one).&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;sqlplus / as sysdba&lt;br /&gt;SQL&gt; !ps -ef&lt;br /&gt;SQL&gt; !strace -o ~/strace.trc -p &amp;lt;PID&amp;gt; &amp;&lt;br /&gt;SQL&gt; recover standby database;&lt;br /&gt;SQL&gt; exit&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;That is, run you sqlplus, get the PID of your server process and strace it. (With the usual caveat that you are running the sqlplus locally, that you have a dedicated server process... well you have to, you're doing a recovery.)&lt;br /&gt;&lt;br /&gt;And voilà, it's there! The server process does a lot of gettimeofday() calls (Oracle wait interface measuring time of code pieces, perhaps), opens datafiles, opens alert.log/xml and trace, writes to them... and traverses the FRA! (the listing below is just a very short sample)&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;access("/u01/flash_recovery_area/T1/archivelog/", R_OK) = 0&lt;br /&gt;stat64("/u01/flash_recovery_area/T1/archivelog/", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0&lt;br /&gt;readlink("/u01/flash_recovery_area/T1/archivelog/", 0xbfe0c5c0, 512) = -1 EINVAL (Invalid argument)&lt;br /&gt;open("/u01/flash_recovery_area/T1/archivelog/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 21&lt;br /&gt;fstat64(21, {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0&lt;br /&gt;fcntl64(21, F_SETFD, FD_CLOEXEC)        = 0&lt;br /&gt;getdents(21, /* 20 entries */, 4096)    = 476&lt;br /&gt;access("/u01/flash_recovery_area/T1/archivelog/2007_08_15", R_OK) = 0&lt;br /&gt;access("/u01/flash_recovery_area/T1/archivelog/2007_08_15", R_OK) = 0&lt;br /&gt;stat64("/u01/flash_recovery_area/T1/archivelog/2007_08_15", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0&lt;br /&gt;readlink("/u01/flash_recovery_area/T1/archivelog/2007_08_15", 0xbfe0c100, 512) = -1 EINVAL (Invalid argument)&lt;br /&gt;open("/u01/flash_recovery_area/T1/archivelog/2007_08_15", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 22&lt;br /&gt;fstat64(22, {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0&lt;br /&gt;fcntl64(22, F_SETFD, FD_CLOEXEC)        = 0&lt;br /&gt;getdents(22, /* 2 entries */, 4096)     = 32&lt;br /&gt;getdents(22, /* 0 entries */, 4096)     = 0&lt;br /&gt;close(22)                               = 0 &lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;This was the top-level directory and one of its children - an empty one (2 entries in directory, i.e. "." and "..").&lt;br /&gt;&lt;br /&gt;When we get to a non-empty dir, the server process analyzes the actual files there:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;access("/u01/flash_recovery_area/T1/archivelog/2007_08_17/o1_mf_1_19_3d9wj20f_.arc", R_OK) = 0&lt;br /&gt;access("/u01/flash_recovery_area/T1/archivelog/2007_08_17/o1_mf_1_19_3d9wj20f_.arc", R_OK) = 0&lt;br /&gt;stat64("/u01/flash_recovery_area/T1/archivelog/2007_08_17/o1_mf_1_19_3d9wj20f_.arc", {st_mode=S_IFREG|0775, st_size=47616, ...}) = 0 &lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Well, interesting, but nothing groundbreaking. However, for some of the files, the server process does something different:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;stat64("/u01/flash_recovery_area/T1/archivelog/2007_08_17/o1_mf_1_21_3d9wspto_.arc.gz", {st_mode=S_IFREG|0775, st_size=24228, ...}) = 0&lt;br /&gt;statfs("/u01/flash_recovery_area/T1/archivelog/2007_08_17/o1_mf_1_21_3d9wspto_.arc.gz", {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=10119516, f_bfree=4882707, f_bavail=4368756, f_files=5144576, f_ffree=4885233, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0&lt;br /&gt;open("/u01/flash_recovery_area/T1/archivelog/2007_08_17/o1_mf_1_21_3d9wspto_.arc.gz", O_RDONLY|O_LARGEFILE) = 21&lt;br /&gt;fstatfs(21, {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=10119516, f_bfree=4882707, f_bavail=4368756, f_files=5144576, f_ffree=4885233, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0&lt;br /&gt;lseek(21, 0, SEEK_SET)                  = 0&lt;br /&gt;read(21, "\37\213\10\0106\363\304F\0\3o1_mf_1_21_3d9wspto_.a"..., 512) = 512&lt;br /&gt;close(21)                               = 0 &lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Yes, it opens them and reads first 512 bytes of them - the file header! And if the file header is invalid (as is for the file above, as it is a gzipped file, so no longer an Oracle file), the skgfifi function signals an error (as can be confirmed by removing all .gz files and trying the recovery again).&lt;br /&gt;&lt;br /&gt;Just a final note - the server process skipped some of the .gz files, read the rest of them - I could not find a simple rule how it decided.&lt;br /&gt;&lt;br /&gt;Just a few conclusing note:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;The reaction of Oracle Support for this was: Oracle does not recommend compressing files within FRA.&lt;br /&gt;&lt;li&gt;If you use "set logsource" in SQL*plus, the scanning does not happen, as there is simply just one directory to look into (set logsource will not work with FRA, due to the YYYY_MM_DD dirs in FRA).&lt;br /&gt;&lt;li&gt;For the background info (who came up with the problem, how do they solve it), visit &lt;a href="http://blog.dbvisit.com/ora-27048_11g/"&gt;Dbvisit blog&lt;/a&gt; - they stumbled upon it while supporting their "standby on Standard Edition" solution.&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4897450294835765476-304644883419005846?l=vitspinka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vitspinka.blogspot.com/feeds/304644883419005846/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4897450294835765476&amp;postID=304644883419005846' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/304644883419005846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/304644883419005846'/><link rel='alternate' type='text/html' href='http://vitspinka.blogspot.com/2009/12/ora-27048-skgfifi-file-header.html' title='ORA-27048: skgfifi: file header information is invalid'/><author><name>Vit Spinka</name><uri>http://www.blogger.com/profile/03048791839608729608</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4897450294835765476.post-760990123059042852</id><published>2009-11-09T17:40:00.001+01:00</published><updated>2009-11-09T17:42:05.559+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle OCM'/><title type='text'>11g OCM update</title><content type='html'>Just a quick note: Oracle set the 11g OCM upgrade release date to November 30, 2009. However, schedule is still "comming soon"...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4897450294835765476-760990123059042852?l=vitspinka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vitspinka.blogspot.com/feeds/760990123059042852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4897450294835765476&amp;postID=760990123059042852' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/760990123059042852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/760990123059042852'/><link rel='alternate' type='text/html' href='http://vitspinka.blogspot.com/2009/11/11g-ocm-update.html' title='11g OCM update'/><author><name>Vit Spinka</name><uri>http://www.blogger.com/profile/03048791839608729608</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4897450294835765476.post-3315684795928928157</id><published>2009-10-23T22:59:00.004+02:00</published><updated>2009-10-23T23:10:39.980+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OCP OCM 11g'/><title type='text'>OCM 11g</title><content type='html'>After all, I learned one new thing I did not expect to find out at OOW: at the OCP Lounge (where, contrary to promises, no networking took place), I was told new info regarding the 11g OCM exam.&lt;br /&gt;While from supposedly trustworthy source, don't take the following as 100%-sure; still, it's worth to know, that:&lt;br /&gt;- the &lt;a href="http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getpage?page_id=41&amp;p_org_id=&amp;lang=&amp;p_exam_id=11gOCMU"&gt;11g OCM Upgrade exam&lt;/a&gt; is scheduled to start late November this year, and will be delivered on 11gR1.&lt;br /&gt;- the full 2-day 11g OCM has no schedule yet, and will be delivered on 11gR2 from it's start.&lt;br /&gt;&lt;br /&gt;The only trouble I see is the attendance - with 10g OCM, every local Oracle was cancelling it if only one person signed for it - two persons was minimum. With the upgrade, how many people will sign up?&lt;br /&gt;&lt;br /&gt;I plan to take it quite soon after it's available, somewhere in Europe (UK has usually densest exam schedule, while countries like Czech Republic/Slovakia/Italy etc. have lower prices for the exam).&lt;br /&gt;Drop me a line if you would be interested in taking the exam, so we can force some Oracle local office to actually DO the exam instead of cancelling it again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4897450294835765476-3315684795928928157?l=vitspinka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vitspinka.blogspot.com/feeds/3315684795928928157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4897450294835765476&amp;postID=3315684795928928157' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/3315684795928928157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/3315684795928928157'/><link rel='alternate' type='text/html' href='http://vitspinka.blogspot.com/2009/10/ocm-11g.html' title='OCM 11g'/><author><name>Vit Spinka</name><uri>http://www.blogger.com/profile/03048791839608729608</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4897450294835765476.post-6646189199193602948</id><published>2009-10-23T22:51:00.003+02:00</published><updated>2009-10-23T23:19:10.455+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OOW Oracle'/><title type='text'>OOW 2009 experience</title><content type='html'>As I was at the Open World last week, you would expect me to post a bunch of blog entries, right? Well, no... first of all, it was already covered by many others, closer to the real time of the events. You can read about the perhaps most interesting event I attended at &lt;a href="http://www.pythian.com/news/4523/pythian-oow09-diaries-bloggers-meetup"&gt;Pythian OOW09 Diaries&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Still, let me empahsize one thing - as a first-timer to OOW I realized, that after all, the sessions held there are not so important, after all. Ok, select some of them, but reserve enought time for the Unconference, for the OTN Lounge, and to meet other fellows. You will catch up with the sessions using OOW On-demand (and as I remember, the PDFs are published later for general public) later - you will have to do it anyway, you can't attend everything you would like.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4897450294835765476-6646189199193602948?l=vitspinka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vitspinka.blogspot.com/feeds/6646189199193602948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4897450294835765476&amp;postID=6646189199193602948' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/6646189199193602948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/6646189199193602948'/><link rel='alternate' type='text/html' href='http://vitspinka.blogspot.com/2009/10/oow-2009-experience.html' title='OOW 2009 experience'/><author><name>Vit Spinka</name><uri>http://www.blogger.com/profile/03048791839608729608</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4897450294835765476.post-3996402634942438984</id><published>2009-07-16T14:09:00.003+02:00</published><updated>2009-07-17T22:47:32.113+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><title type='text'>More than one way to save blocks</title><content type='html'>In these days, disk capacity is often not a big issue today. If you have at least a decent load on the database, you will hit the IOPS limit much sooner than you run out of disk space.&lt;br /&gt;&lt;br /&gt;Well, almost. First, you will still have a lot of inactive data that consumes the space but does not require any IOPS. And second, in some applications (like ETL in DWH) you are bound by throughput. Let me talk about this case.&lt;br /&gt;&lt;br /&gt;Don't expect any exceptional thoughts, this post just inspired by a real production case and tries to pinpoint that there is always one more way to consider.&lt;br /&gt;&lt;br /&gt;The optimal plan for many ETL queries is a lot of fullscans with hash joins. And often, you read one table more times, to join it in different ways. Such queries benefit if you make your tables smaller - you save on I/O.&lt;br /&gt;&lt;br /&gt;(1) In ETL, your source tables are often imported from a different system, and you actually don't need all columns from the tables. So, first of all - don't load the data you don't need. However, usually you just can't drop the columns - this would change the data model, you would have to update it in the ETL tool, and you would have to do a lot of work when the list of used columns change.&lt;br /&gt;How to tackle this? Use views, and select NULL for the columns you don't need. Use FGA (Fine-grained auditing) (at least on test) to verify you don't access any of those non-loaded columns. (Just beware, that things like dbms_stats access all columns.)&lt;br /&gt;(Bonus: depending on the source system, transferring less data may take less time due to limits of the transfer channel - ODBC, network, etc.)&lt;br /&gt;&lt;br /&gt;(2) As the source data is usually loaded only once and truncated before each load, PCTFREE should be 0, so no space is lost for allocations that will never come.&lt;br /&gt;&lt;br /&gt;(3) Now, with the (1) implemented, the tables contain (a lot of) NULL columns. It's just one byte for each such column, but interestingly, it still makes a difference. Just recreate the tables while putting the NULL columns at the end. (No proper application depend on column order, right?). On a 1.2GB table, we got a 35% saving just by using (2) and (3) - it's really worth trying.&lt;br /&gt;&lt;br /&gt;(4) And of course, use APPEND hint and use the 10g table direct-load data compression (COMPRESS in table definition). Another 50% for us...&lt;br /&gt;&lt;br /&gt;Please note that the only problem you usually face here is to get a list of used columns - fortunately, most ETL tools (like ODI) can provide it, even it means accessing directly their repository (snp_txt_crossr in ODI). The rest is easy to automate.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4897450294835765476-3996402634942438984?l=vitspinka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vitspinka.blogspot.com/feeds/3996402634942438984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4897450294835765476&amp;postID=3996402634942438984' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/3996402634942438984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/3996402634942438984'/><link rel='alternate' type='text/html' href='http://vitspinka.blogspot.com/2009/07/more-than-one-way-to-save-blocks.html' title='More than one way to save blocks'/><author><name>Vit Spinka</name><uri>http://www.blogger.com/profile/03048791839608729608</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4897450294835765476.post-735487385845836592</id><published>2009-07-08T09:40:00.010+02:00</published><updated>2009-07-14T18:11:28.544+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CBO'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><title type='text'>A latteral view quirk</title><content type='html'>This quest started with the usual question: why is this query so slow? To put it in the picture, it was a query loading one DWH table by reading one source table from a legacy system (already loaded to Oracle, so no heterogenous services were involved at this step), joining it several times to several tables.&lt;br /&gt;(It's the usual badly-designed legacy system: if flag1 is I, join table T1 by C1, if flag1 is N, join table T1 by C2... 20 times.)&lt;br /&gt;&lt;br /&gt;If I simplify the query, we are talking about something like:&lt;br /&gt;&lt;pre&gt;SELECT T1.m, &lt;br /&gt;case &lt;br /&gt;  when T1.h = 'I' then T2_I.n &lt;br /&gt;  when T1.h = 'G' then T2_G.n &lt;br /&gt;  else null &lt;br /&gt;end&lt;br /&gt;FROM T1 &lt;br /&gt;LEFT OUTER JOIN T2 T2_I&lt;br /&gt;ON (T1.h = 'I' and T1.y = T2_I.c1)&lt;br /&gt;LEFT OUTER JOIN T2 T2_G&lt;br /&gt;ON (T1.h = 'G' and T1.z = T2_G.c2)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;We even know, that the query always return number of rows identical to number of rows in T2. However, ommiting the T1.h = 'I'/'G' conditions in join clause &lt;span style="font-weight:bold;"&gt;would&lt;/span&gt; duplicate the rows, so the conditions &lt;span style="font-weight:bold;"&gt;are&lt;/span&gt; necessary there. Ofcourse it's not possible to move the conditions to WHERE clause, as this would elimitate all rows from result query.&lt;br /&gt;&lt;br /&gt;To make the test case query even shorter, we can use for the demonstration just:&lt;br /&gt;&lt;pre&gt;SELECT count(*)&lt;br /&gt;FROM T1 &lt;br /&gt;LEFT OUTER JOIN T2&lt;br /&gt;ON (T1.h = 'I' and T1.y = T2.c1)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;(This query makes almost no business sense now, but the the lateral view issue I want to demonstrate is still there.)&lt;br /&gt;&lt;br /&gt;The query plan looks like:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;|Id|Operation             |Name|Rows  |Bytes| Cost | Time     | &lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;|0 |SELECT STATEMENT      |    |    1 |  43 | 1804M|999:59:59 | &lt;br /&gt;|1 | SORT AGGREGATE       |    |    1 |  43 |      |          | &lt;br /&gt;|2 |  NESTED LOOPS OUTER  |    | 9805M| 392G| 1804M|999:59:59 | &lt;br /&gt;|3 |   TABLE ACCESS FULL  | T1 |  188K|7899K|  718 | 00:00:09 | &lt;br /&gt;|4 |   VIEW               |    |52124 |     | 9593 | 00:01:56 | &lt;br /&gt;|*5|    FILTER            |    |      |     |      |          | &lt;br /&gt;|*6|     TABLE ACCESS FULL| T2 |52124 | 356K| 9593 | 00:01:56 | &lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;Predicate Information (identified by operation id): &lt;br /&gt;--------------------------------------------------- &lt;br /&gt;&lt;br /&gt;   5 - filter("T1"."H"='I') &lt;br /&gt;   6 - filter("T1"."Y"="T2"."C1") &lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This is awful! Cost of 1804M just for joining two tables (T1: 188K rows, T2: 5M rows). And yes, the execution proves the plan is not good (I did not have the patience to wait many hours (days?) for the query to finish).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;However, a colleague suggested modifying the query as follows:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;SELECT count(*)&lt;br /&gt;FROM T1 &lt;br /&gt;LEFT OUTER JOIN T2&lt;br /&gt;ON (T1.h = nvl('I',T2.c1) and T1.y = T2.c1)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This does not change the result set - the 'I' is always not null and thus the nvl is superfluos. However, we get a different execution plan!&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;-------------------------------------------------------------&lt;br /&gt;|Id|Operation           |Name|Rows  |Bytes| Cost | Time     | &lt;br /&gt;-------------------------------------------------------------&lt;br /&gt;|0 |SELECT STATEMENT    |    |    1 |  54 | 5409K| 18:01:45 | &lt;br /&gt;|1 | SORT AGGREGATE     |    |    1 |  54 |      |          | &lt;br /&gt;|*2|  HASH JOIN OUTER   |    | 9805M| 493G| 5409K| 18:01:45 | &lt;br /&gt;|3 |   TABLE ACCESS FULL| T1 |  188K|7899K|  718 | 00:00:09 | &lt;br /&gt;|4 |   TABLE ACCESS FULL| T2 | 5212K|  54M| 9585 | 00:01:55 | &lt;br /&gt;-------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Predicate Information (identified by operation id): &lt;br /&gt;--------------------------------------------------- &lt;br /&gt;&lt;br /&gt;   2 - access("T1"."Y"="T2"."C1"(+) AND &lt;br /&gt;              "T1"."H"=NVL('I',"T2"."C1"(+))) &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The cost is now 5409K, the operation is a nice hash join, and the query really finishes in few minutes.&lt;br /&gt;&lt;br /&gt;The question now is: &lt;span style="font-weight:bold;"&gt;WHY&lt;/span&gt;?&lt;br /&gt;&lt;br /&gt;Well, this is a matter of query optimization and plan generation, so the first person to ask is directly the CBO. So, I enabled the 10053 event for the two queries and dived into the two trace files, mainly to see the differences.&lt;br /&gt;&lt;br /&gt;Both queries had the main query block initially rewritten as:&lt;br /&gt;&lt;pre&gt;SQL:******* UNPARSED QUERY IS *******&lt;br /&gt;SELECT "T1"."Y" "Y","T1"."H" "H",&lt;br /&gt;  "from$_subquery$_004"."C1_0" "C1" &lt;br /&gt;FROM "SCOTT"."T1" "T1", &lt;br /&gt;LATERAL( (SELECT "T2"."C1" "C1_0" FROM "SCOTT"."T2" "T2" WHERE "T1"."H"='G' AND "T1"."Y"="T2"."C1"))(+) "from$_subquery$_004"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;(The second query with the added NVL in "T1"."H"=NVL('G',"T2"."C1")  ).&lt;br /&gt;&lt;br /&gt;So, for Oracle, it is a lateral (correlated) view. That's not nice, but at this stage of CBO processing, normal. CBO will try to get rid of it.&lt;br /&gt;&lt;br /&gt;However only for the NVL case the CBO trace shows:&lt;br /&gt;&lt;pre&gt;CVM:   Merging SPJ view SEL$1 (#0) into SEL$2 (#0)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Followed by:&lt;br /&gt;&lt;pre&gt;SQL:******* UNPARSED QUERY IS *******&lt;br /&gt;SELECT COUNT(*) "COUNT(*)" &lt;br /&gt;FROM "SCOTT"."T1" "T1","SCOTT"."T2" "T2" &lt;br /&gt;WHERE "T1"."Y"="T2"."C1"(+) &lt;br /&gt;  AND "T1"."H"=NVL('G',"T2"."C1"(+))&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Thus, CBO was able to rewrite is as the old-fashioned (+) outer join; however, it was not able to do it for the non-NVL query. And these result are passed to the next stage, and as no constraints or predicate move-around changes the query, they are verbatim passed for actual plan generation. And understandably, a lateral (correlated) view is not considered for hash join.&lt;br /&gt;&lt;br /&gt;Anyway, should you read the &lt;a href="http://optimizermagic.blogspot.com/2007/12/outerjoins-in-oracle.html"&gt;Inside the Oracle Optimizer blog&lt;/a&gt;, you would already know that this is the classical example of the lateral non-mergeable view. Still, why the second one worked as we wanted?&lt;br /&gt;&lt;br /&gt;Well, the quirk is in the fact that there is no way how to write the non-NVL query using (+) syntax - there is just no place to put the (+) sign to the t1.y='I' predicate to change it from filter to join predicate. However, adding artifically a column from T2 makes it possible, and the CBO did it. The CBO internally uses the old Oracle syntax, and thus if you can't rewrite your query using that syntax, neither CBO can.&lt;br /&gt;&lt;br /&gt;Just a note - the same applies for example for predicate length(t1.q)=10, you can save the day by using length(nvl(t1.q,t2.c1))=10.&lt;br /&gt;&lt;br /&gt;Tested on: Windows 64-bit (EM64T), Oracle 10.2.0.4.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4897450294835765476-735487385845836592?l=vitspinka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vitspinka.blogspot.com/feeds/735487385845836592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4897450294835765476&amp;postID=735487385845836592' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/735487385845836592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/735487385845836592'/><link rel='alternate' type='text/html' href='http://vitspinka.blogspot.com/2009/07/latteral-view-quirk.html' title='A latteral view quirk'/><author><name>Vit Spinka</name><uri>http://www.blogger.com/profile/03048791839608729608</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4897450294835765476.post-6181920892903146592</id><published>2009-07-05T19:19:00.003+02:00</published><updated>2009-07-05T19:23:57.839+02:00</updated><title type='text'>Gentle introduction to opimization</title><content type='html'>I was just asked to prepare a short, one-hour workshop/presentation about optimization on Oracle. As this topis is so huge, and everyone had already read something, I decided to concept this workshop as an overview of the concepts (starting with db design) and the tools available.&lt;br /&gt;The .pdf version is thus a kind of checklist - have you read about all of these issues? Have you thought them out when designing your system?&lt;br /&gt;I hope you will find at least one new thing there:-)&lt;br /&gt;The PDF is available for download on my &lt;a href="http://vitspinka.cz/download.html"&gt;website download area&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4897450294835765476-6181920892903146592?l=vitspinka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vitspinka.blogspot.com/feeds/6181920892903146592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4897450294835765476&amp;postID=6181920892903146592' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/6181920892903146592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/6181920892903146592'/><link rel='alternate' type='text/html' href='http://vitspinka.blogspot.com/2009/07/gentle-introduction-to-opimization.html' title='Gentle introduction to opimization'/><author><name>Vit Spinka</name><uri>http://www.blogger.com/profile/03048791839608729608</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4897450294835765476.post-6549279052460865363</id><published>2008-09-23T23:22:00.013+02:00</published><updated>2008-09-24T07:44:18.154+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='index'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><title type='text'>Unique and non-unique indexes</title><content type='html'>An interesting questions is: what is in fact the difference between unique and non-unique indexes? For a long discussion, see &lt;a href="http://richardfoote.wordpress.com/"&gt;Richard Foote's blog&lt;/a&gt;. Here, we look at the on-disk differences.&lt;br /&gt;&lt;br /&gt;Let's start with environment setup and block dump creation:&lt;br /&gt;&lt;blockquote&gt;connect system&lt;br /&gt;&lt;br /&gt;create user itest identified by itest;&lt;br /&gt;&lt;br /&gt;grant dba to itest;&lt;br /&gt;&lt;br /&gt;create tablespace ITEST;&lt;br /&gt;&lt;br /&gt;alter user itest default tablespace itest;&lt;br /&gt;&lt;br /&gt;connect itest/itest&lt;br /&gt;&lt;br /&gt;create table TDATA (pk varchar2(20));&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;for i in 1..10000 loop&lt;br /&gt; insert into TDATA values ('VAL'||i);&lt;br /&gt;end loop;&lt;br /&gt;commit;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;create index TIDX1 on TDATA(pk);&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;(I chose varchar2 type so that the actual characters are clearly seen in the dump. Also, I created a fresh new tablespace so the block numbers are small and probably consecutive.)&lt;br /&gt;Now, find the extents involved:&lt;br /&gt;&lt;blockquote&gt;select * from dba_extents where owner=user;&lt;/blockquote&gt;And dump the blocks (take numbers from the query above - relative_fno, block_id):&lt;br /&gt;&lt;blockquote&gt;alter system dump datafile 14 block min 33 block max 62;&lt;/blockquote&gt;Save the trace, create a unique index, dump it:&lt;br /&gt;&lt;blockquote&gt;drop index TIDX1;&lt;br /&gt;create unique index TIDX2 on TDATA(pk);&lt;br /&gt;select * from dba_extents where owner=user;&lt;br /&gt;alter system dump datafile 14 block min 33 block max 62;&lt;br /&gt;&lt;/blockquote&gt;Now, take look at the dumped blocks. For the sake of the explanation flow, let's start with the leaf blocks:&lt;br /&gt;&lt;br /&gt;Non-unique:&lt;br /&gt;&lt;blockquote&gt;Leaf block dump&lt;br /&gt;===============&lt;br /&gt;header address 146678372=0x8be2264&lt;br /&gt;kdxcolev 0&lt;br /&gt;KDXCOLEV Flags = - - -&lt;br /&gt;kdxcolok 0&lt;br /&gt;kdxcoopc 0x80: opcode=0: iot flags=--- is converted=Y&lt;br /&gt;kdxconco 2&lt;br /&gt;kdxcosdc 0&lt;br /&gt;kdxconro 380&lt;br /&gt;kdxcofbo 796=0x31c&lt;br /&gt;kdxcofeo 1617=0x651&lt;br /&gt;kdxcoavs 821&lt;br /&gt;kdxlespl 0&lt;br /&gt;kdxlende 0&lt;br /&gt;kdxlenxt 58720295=0x3800027&lt;br /&gt;kdxleprv 58720293=0x3800025&lt;br /&gt;kdxledsz 0&lt;br /&gt;kdxlebksz 8036&lt;br /&gt;row#0[8020] flag: ------, lock: 0, len=16&lt;br /&gt;col 0; len 6; (6):  56 41 4c 31 33 34&lt;br /&gt;col 1; len 6; (6):  03 80 00 0d 00 85&lt;br /&gt;row#1[8003] flag: ------, lock: 0, len=17&lt;br /&gt;col 0; len 7; (7):  56 41 4c 31 33 34 30&lt;br /&gt;col 1; len 6; (6):  03 80 00 0f 00 8a&lt;br /&gt;...&lt;br /&gt;&lt;/blockquote&gt;What is interesting: the index has 2 colums! This is indicated by kdxconco, and is of course clearly seen in the entries themselves. The second column is the rowid of the table row. So after all, the entries are unique, by considering rowid as an additional column.&lt;br /&gt;&lt;br /&gt;Interestingly, the unique index looks a bit differently:&lt;br /&gt;&lt;blockquote&gt;Leaf block dump&lt;br /&gt;===============&lt;br /&gt;header address 152117860=0x9112264&lt;br /&gt;kdxcolev 0&lt;br /&gt;KDXCOLEV Flags = - - -&lt;br /&gt;kdxcolok 0&lt;br /&gt;kdxcoopc 0x80: opcode=0: iot flags=--- is converted=Y&lt;br /&gt;kdxconco 1&lt;br /&gt;kdxcosdc 0&lt;br /&gt;kdxconro 401&lt;br /&gt;kdxcofbo 838=0x346&lt;br /&gt;kdxcofeo 1664=0x680&lt;br /&gt;kdxcoavs 826&lt;br /&gt;kdxlespl 0&lt;br /&gt;kdxlende 0&lt;br /&gt;kdxlenxt 58720295=0x3800027&lt;br /&gt;kdxleprv 58720293=0x3800025&lt;br /&gt;kdxledsz 6&lt;br /&gt;kdxlebksz 8036&lt;br /&gt;row#0[8020] flag: ------, lock: 0, len=16, data:(6):  03 80 00 0f 00 9d&lt;br /&gt;col 0; len 7; (7):  56 41 4c 31 33 35 39&lt;br /&gt;row#1[8005] flag: ------, lock: 0, len=15, data:(6):  03 80 00 0d 00 87&lt;br /&gt;col 0; len 6; (6):  56 41 4c 31 33 36&lt;br /&gt;&lt;/blockquote&gt;Oracle now does not need to artifically add rowid to column list, as the 1 column suffices to uniquely identify the entry. However, it still needs it to find the row. The difference: 1 byte saved (in fact, the length byte for the rowid).&lt;br /&gt;&lt;br /&gt;Now, let's have a look at the branch block (the root, for this small table). First, the non-unique:&lt;br /&gt;&lt;blockquote&gt;Branch block dump&lt;br /&gt;=================&lt;br /&gt;header address 146678348=0x8be224c&lt;br /&gt;kdxcolev 1&lt;br /&gt;KDXCOLEV Flags = - - -&lt;br /&gt;kdxcolok 0&lt;br /&gt;kdxcoopc 0x80: opcode=0: iot flags=--- is converted=Y&lt;br /&gt;kdxconco 2&lt;br /&gt;kdxcosdc 0&lt;br /&gt;kdxconro 26&lt;br /&gt;kdxcofbo 80=0x50&lt;br /&gt;kdxcofeo 7724=0x1e2c&lt;br /&gt;kdxcoavs 7644&lt;br /&gt;kdxbrlmc 58720293=0x3800025&lt;br /&gt;kdxbrsno 0&lt;br /&gt;kdxbrbksz 8060&lt;br /&gt;kdxbr2urrc 0&lt;br /&gt;row#0[8048] dba: 58720294=0x3800026&lt;br /&gt;col 0; len 6; (6):  56 41 4c 31 33 34&lt;br /&gt;col 1; TERM&lt;br /&gt;row#1[8035] dba: 58720295=0x3800027&lt;br /&gt;col 0; len 7; (7):  56 41 4c 31 36 38 32&lt;br /&gt;col 1; TERM&lt;br /&gt;&lt;/blockquote&gt;In the branch blocks, only the information needed to find the correct leaf block is storred. Thus, the column contents is truncated as much as possible (see more below). However, we have two columns in the index - and we have to indicate that the 2nd column (rowid) is not needed - and that's the "col 1; TERM" entry.&lt;br /&gt;&lt;br /&gt;Now, for the unique case:&lt;br /&gt;&lt;blockquote&gt;Branch block dump&lt;br /&gt;=================&lt;br /&gt;header address 152117836=0x911224c&lt;br /&gt;kdxcolev 1&lt;br /&gt;KDXCOLEV Flags = - - -&lt;br /&gt;kdxcolok 0&lt;br /&gt;kdxcoopc 0x80: opcode=0: iot flags=--- is converted=Y&lt;br /&gt;kdxconco 1&lt;br /&gt;kdxcosdc 0&lt;br /&gt;kdxconro 24&lt;br /&gt;kdxcofbo 76=0x4c&lt;br /&gt;kdxcofeo 7775=0x1e5f&lt;br /&gt;kdxcoavs 7699&lt;br /&gt;kdxbrlmc 58720293=0x3800025&lt;br /&gt;kdxbrsno 0&lt;br /&gt;kdxbrbksz 8060&lt;br /&gt;kdxbr2urrc 4&lt;br /&gt;row#0[8048] dba: 58720294=0x3800026&lt;br /&gt;col 0; len 7; (7):  56 41 4c 31 33 35 39&lt;br /&gt;row#1[8037] dba: 58720295=0x3800027&lt;br /&gt;col 0; len 6; (6):  56 41 4c 31 37 32&lt;br /&gt;&lt;/blockquote&gt;Here, we have only one column, so no need to write that no other column data is needed. The net difference: 1 bytes per index entry.&lt;br /&gt;&lt;br /&gt;Please note, that Oracle fills the blocks end-to-start (so the header can grow), and thus the dump usually starts with high addresses. However, this is only physical location, and does not represent the index ordering. For example, after index block split, it can (and will) change. Just reverse the example order: first create index, then insert data. Then compare first and last leaf block.&lt;br /&gt;&lt;br /&gt;One final note regarding the branch blocks and inclusion only of the prefix needed to identify the correct leaf block.&lt;br /&gt;Let's change the example slightly: insert the values 'VAL'||i||'0000000'. Now, the leaf blocks has to contain these values:&lt;br /&gt;&lt;blockquote&gt;row#1[4367] flag: ----S-, lock: 2, len=24&lt;br /&gt;col 0; len 14; (14):  56 41 4c 33 37 35 30 30 30 30 30 30 30 30&lt;br /&gt;col 1; len 6; (6):  03 80 00 0f 00 4f&lt;br /&gt;&lt;/blockquote&gt;However, the branch block does not have to:&lt;br /&gt;&lt;blockquote&gt;row#0[7989] dba: 58720300=0x380002c&lt;br /&gt;col 0; len 6; (6):  56 41 4c 31 31 34&lt;br /&gt;col 1; TERM&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4897450294835765476-6549279052460865363?l=vitspinka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vitspinka.blogspot.com/feeds/6549279052460865363/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4897450294835765476&amp;postID=6549279052460865363' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/6549279052460865363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/6549279052460865363'/><link rel='alternate' type='text/html' href='http://vitspinka.blogspot.com/2008/09/unique-and-non-unique-indexes.html' title='Unique and non-unique indexes'/><author><name>Vit Spinka</name><uri>http://www.blogger.com/profile/03048791839608729608</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4897450294835765476.post-1633067422969419453</id><published>2008-05-08T18:59:00.004+02:00</published><updated>2008-05-08T19:24:37.009+02:00</updated><title type='text'>Who am I?</title><content type='html'>Quite often, a procedure needs to know some information about the session it is running in - at least for logging some information.&lt;br /&gt;&lt;br /&gt;It seems to be easy to find this information - just look at SYS_CONTEXT documentation, and find the impressive list of attributes of USERENV context. And if something is missing, just grab the SESSIONID, SID or  AUDSID and query v$session or other view.&lt;br /&gt;&lt;br /&gt;Well, this works nicely, as long as you don't do it in a job. Unfortunately, in a job you always get 0.&lt;br /&gt;You can try to battle with FG_JOB_ID and BG_JOB_ID, but I think this deserves a more elegant solution - and that's why I always query v$mystat to get the SID of my process. Just fetch the first line:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;select * from v$session where sid = (select sid from v$mystat where rownum=1)&lt;/blockquote&gt;You need a select grant on v_$mystat by SYS, but as this view does not expose anything important, it's not a security issue.&lt;br /&gt;&lt;br /&gt;The next question that comes is: if I am run by a job (let's talk about dbms_job now), what's my job id?&lt;br /&gt;&lt;br /&gt;The universal solution is to query v$lock and check for the JQ lock you are holding - and id2 is jor id:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;select id2 from v$lock where type = 'JQ' and sid = (select sid from v$mystat where rownum=1)&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;However, there is one more elegant solution - the dbms_job engine does not run just the "what" code specified by you - it wraps it in a short anonymous block. In this block, a variable called "job" is defined and binded to contain just the id you need. So, in your "what" code, just use this variable:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;dbms_job.submit(j, 'my_proc(job, my_param1, my_param2);'&lt;/blockquote&gt;If you are curious, this block will be run:&lt;pre&gt;&lt;blockquote&gt;DECLARE job BINARY_INTEGER := :job; next_date DATE := :mydate;&lt;br /&gt;  broken BOOLEAN := FALSE; BEGIN my_proc(job, my_param1, my_param2);&lt;br /&gt;  :mydate := next_date; IF broken THEN :b := 1; ELSE :b := 0;&lt;br /&gt;  END IF; END; &lt;/blockquote&gt;&lt;/pre&gt;&lt;br /&gt;For dbms_scheduler, see for example discussion at http://forums.oracle.com/forums/thread.jspa?messageID=2335238. I still personally don't like it, it's too cumbersone for the things I do (a workflow engine, for example).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4897450294835765476-1633067422969419453?l=vitspinka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vitspinka.blogspot.com/feeds/1633067422969419453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4897450294835765476&amp;postID=1633067422969419453' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/1633067422969419453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/1633067422969419453'/><link rel='alternate' type='text/html' href='http://vitspinka.blogspot.com/2008/05/who-am-i.html' title='Who am I?'/><author><name>Vit Spinka</name><uri>http://www.blogger.com/profile/03048791839608729608</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4897450294835765476.post-6957293335053339985</id><published>2008-04-15T14:16:00.006+02:00</published><updated>2008-04-15T14:41:34.556+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><category scheme='http://www.blogger.com/atom/ns#' term='bug'/><category scheme='http://www.blogger.com/atom/ns#' term='list partitioning'/><title type='text'>A list partitiong bug</title><content type='html'>Last week, I found a not-so-nice bug in 10gR2. Just try this short test case, creating a table with two list partitions, default and null:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;&lt;span style="font-size:85%;"&gt;alter session set nls_territory=America;&lt;br /&gt;alter session set nls_language=American;&lt;br /&gt;&lt;br /&gt;select version from product_component_version;&lt;br /&gt;&lt;br /&gt;drop table th3;&lt;br /&gt;&lt;br /&gt;prompt Creating TH3...&lt;br /&gt;create table TH3&lt;br /&gt;(&lt;br /&gt; DF DATE,&lt;br /&gt; DT DATE,&lt;br /&gt; N  NUMBER&lt;br /&gt;)&lt;br /&gt;partition by list (DT)&lt;br /&gt;(&lt;br /&gt; partition THTBL_CURRENT values (NULL)&lt;br /&gt;   tablespace USERS,&lt;br /&gt; partition THTBL_OLD values (default)&lt;br /&gt;   tablespace USERS&lt;br /&gt;)&lt;br /&gt;;&lt;br /&gt;&lt;br /&gt;prompt Loading TH3...&lt;br /&gt;insert into TH3 (DF, DT, N)&lt;br /&gt;values (to_date('01-01-2000', 'dd-mm-yyyy'), to_date('10-04-2008', 'dd-mm-yyyy'), 1);&lt;br /&gt;insert into TH3 (DF, DT, N)&lt;br /&gt;values (to_date('01-01-1000', 'dd-mm-yyyy'), to_date('01-03-3000', 'dd-mm-yyyy'), 2);&lt;br /&gt;insert into TH3 (DF, DT, N)&lt;br /&gt;values (to_date('10-04-2008', 'dd-mm-yyyy'), to_date('10-04-2008', 'dd-mm-yyyy'), 10);&lt;br /&gt;insert into TH3 (DF, DT, N)&lt;br /&gt;values (to_date('11-04-2008', 'dd-mm-yyyy'), to_date('11-04-2008', 'dd-mm-yyyy'), 11);&lt;br /&gt;insert into TH3 (DF, DT, N)&lt;br /&gt;values (to_date('10-04-2008', 'dd-mm-yyyy'), to_date('11-04-2008', 'dd-mm-yyyy'), 1011);&lt;br /&gt;commit;&lt;br /&gt;prompt 5 records loaded&lt;br /&gt;prompt Done.&lt;br /&gt;&lt;br /&gt;SELECT to_date('10.04.2008', 'dd.mm.yyyy'), N, df, dt, rowid&lt;br /&gt;FROM th3&lt;br /&gt;WHERE to_date('10.04.2008', 'dd.mm.yyyy')&lt;br /&gt; BETWEEN DF AND dt;&lt;br /&gt;&lt;br /&gt;SELECT to_date('10.04.2008', 'dd.mm.yyyy'), N, df, dt, rowid&lt;br /&gt;FROM th3&lt;br /&gt;WHERE to_date('10.04.2008', 'dd.mm.yyyy')&lt;br /&gt; BETWEEN DF AND&lt;br /&gt; nvl(dt,to_date('10.04.9999', 'dd.mm.yyyy'));&lt;br /&gt;&lt;br /&gt;exit;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;Although the selects should not differ in the results (there is no NULL value in dt column), they do:&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;&lt;span style="font-size:85%;"&gt;SQL*Plus: Release 10.2.0.1.0 - Production on Sat Apr 12 14:59:05 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected To:&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production&lt;br /&gt;With the Partitioning, OLAP and Data Mining options&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;VERSION&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;10.2.0.1.0&lt;br /&gt;10.2.0.1.0&lt;br /&gt;10.2.0.1.0&lt;br /&gt;10.2.0.1.0&lt;br /&gt;&lt;br /&gt;drop table th3&lt;br /&gt;          *&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-00942: table or view does not exist&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Creating TH3...&lt;br /&gt;&lt;br /&gt;Table created.&lt;br /&gt;&lt;br /&gt;Loading TH3...&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Commit complete.&lt;br /&gt;&lt;br /&gt;5 records loaded&lt;br /&gt;Done.&lt;br /&gt;&lt;br /&gt;no rows selected&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;TO_DATE('       N DF        DT     ROWID&lt;br /&gt;--------- ---------- --------- --------- ------------------&lt;br /&gt;10-APR-08       1 01-JAN-00 10-APR-08 AAAM1CAAEAAAAGtAAA&lt;br /&gt;10-APR-08       2 01-JAN-00 01-MAR-00 AAAM1CAAEAAAAGtAAB&lt;br /&gt;10-APR-08      10 10-APR-08 10-APR-08 AAAM1CAAEAAAAGtAAC&lt;br /&gt;10-APR-08    1011 10-APR-08 11-APR-08 AAAM1CAAEAAAAGtAAE&lt;br /&gt;&lt;br /&gt;Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production&lt;br /&gt;With the Partitioning, OLAP and Data Mining options&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;The same results were obtained for 10.2.0.3. However, in the 10.2.0.4 (and 11.1.0.6), it seems fixed:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-size:85%;" &gt;SQL*Plus: Release 10.2.0.4.0 - Production on Sat Apr 12 18:45:30 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;VERSION&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;10.2.0.4.0&lt;br /&gt;10.2.0.4.0&lt;br /&gt;10.2.0.4.0&lt;br /&gt;10.2.0.4.0&lt;br /&gt;&lt;br /&gt;drop table th3&lt;br /&gt;          *&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-00942: table or view does not exist&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Creating TH3...&lt;br /&gt;&lt;br /&gt;Table created.&lt;br /&gt;&lt;br /&gt;Loading TH3...&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Commit complete.&lt;br /&gt;&lt;br /&gt;5 records loaded&lt;br /&gt;Done.&lt;br /&gt;&lt;br /&gt;TO_DATE('       N DF        DT     ROWID&lt;br /&gt;--------- ---------- --------- --------- ------------------&lt;br /&gt;10-APR-08       1 01-JAN-00 10-APR-08 AAAM7pAAEAAAAGlAAA&lt;br /&gt;10-APR-08       2 01-JAN-00 01-MAR-00 AAAM7pAAEAAAAGlAAB&lt;br /&gt;10-APR-08      10 10-APR-08 10-APR-08 AAAM7pAAEAAAAGlAAC&lt;br /&gt;10-APR-08    1011 10-APR-08 11-APR-08 AAAM7pAAEAAAAGlAAE&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;TO_DATE('       N DF        DT     ROWID&lt;br /&gt;--------- ---------- --------- --------- ------------------&lt;br /&gt;10-APR-08       1 01-JAN-00 10-APR-08 AAAM7pAAEAAAAGlAAA&lt;br /&gt;10-APR-08       2 01-JAN-00 01-MAR-00 AAAM7pAAEAAAAGlAAB&lt;br /&gt;10-APR-08      10 10-APR-08 10-APR-08 AAAM7pAAEAAAAGlAAC&lt;br /&gt;10-APR-08    1011 10-APR-08 11-APR-08 AAAM7pAAEAAAAGlAAE&lt;br /&gt;&lt;br /&gt;Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-family: courier new;font-size:85%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;If you create the table as nonpartitioned, you get correct results irrespective of version.&lt;br /&gt;&lt;br /&gt;Tested on Windows 32-bit (on 10.2.0.1, 10.2.0.3 and 10.2.0.4) and RHEL 5.1 x86_64 (10.2.0.3).&lt;br /&gt;&lt;br /&gt;If you are curious, here's the explain plan (10.2.0.3) for the first select:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;&lt;span style="font-size:85%;"&gt;PLAN_TABLE_OUTPUT&lt;br /&gt;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;Plan hash value: 4063410327&lt;br /&gt;&lt;br /&gt;---------------------------------------------------------------------------------------------&lt;br /&gt;| Id  | Operation            | Name | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |&lt;br /&gt;---------------------------------------------------------------------------------------------&lt;br /&gt;|   0 | SELECT STATEMENT     |      |     1 |    43 |     2   (0)| 00:00:01 |       |       |&lt;br /&gt;|   1 |  PARTITION LIST EMPTY|      |     1 |    43 |     2   (0)| 00:00:01 |INVALID|INVALID|&lt;br /&gt;|*  2 |   TABLE ACCESS FULL  | TH3  |     1 |    43 |     2   (0)| 00:00:01 |INVALID|INVALID|&lt;br /&gt;---------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Predicate Information (identified by operation id):&lt;br /&gt;&lt;br /&gt;PLAN_TABLE_OUTPUT&lt;br /&gt;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  2 - filter("DF"&lt;=TO_DATE('2008-04-10 00:00:00', 'yyyy-mm-dd hh24:mi:ss') AND               "DT"&gt;=TO_DATE('2008-04-10 00:00:00', 'yyyy-mm-dd hh24:mi:ss'))&lt;br /&gt;&lt;br /&gt;Note&lt;br /&gt;-----&lt;br /&gt;  - dynamic sampling used for this statement&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;On 10.2.0.4, I get:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;&lt;span style="font-size:85%;"&gt;PLAN_TABLE_OUTPUT&lt;br /&gt;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;Plan hash value: 3503314195&lt;br /&gt;&lt;br /&gt;---------------------------------------------------------------------------------------------&lt;br /&gt;| Id  | Operation            | Name | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |&lt;br /&gt;---------------------------------------------------------------------------------------------&lt;br /&gt;|   0 | SELECT STATEMENT     |      |     1 |    43 |     3   (0)| 00:00:01 |       |       |&lt;br /&gt;|   1 |  PARTITION LIST SINGLE|      |     1 |    43 |     3   (0)| 00:00:01 |KEY     |KEY      |&lt;br /&gt;|*  2 |   TABLE ACCESS FULL  | TH3  |     1 |    43 |     2   (0)| 00:00:01 |     2 |       2|&lt;br /&gt;---------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Predicate Information (identified by operation id):&lt;br /&gt;&lt;br /&gt;PLAN_TABLE_OUTPUT&lt;br /&gt;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  2 - filter("DF"&lt;=TO_DATE('2008-04-10 00:00:00', 'yyyy-mm-dd hh24:mi:ss') AND               "DT"&gt;=TO_DATE('2008-04-10 00:00:00', 'yyyy-mm-dd hh24:mi:ss'))&lt;br /&gt;&lt;br /&gt;Note&lt;br /&gt;-----&lt;br /&gt;  - dynamic sampling used for this statement&lt;br /&gt;&lt;/span&gt;      &lt;/blockquote&gt;&lt;br /&gt;So it looks like a problem in partition elimination - on 10.2.0.3, Oracle didn't evaluate the involved partitions properly.&lt;br /&gt;&lt;br /&gt;No patch was provided by Oracle, as we have two luxurious options: a workaround and 10.2.0.4. And of course, the second select is after all the correct one for the initial problem...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4897450294835765476-6957293335053339985?l=vitspinka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vitspinka.blogspot.com/feeds/6957293335053339985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4897450294835765476&amp;postID=6957293335053339985' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/6957293335053339985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/6957293335053339985'/><link rel='alternate' type='text/html' href='http://vitspinka.blogspot.com/2008/04/list-partitiong-bug.html' title='A list partitiong bug'/><author><name>Vit Spinka</name><uri>http://www.blogger.com/profile/03048791839608729608</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4897450294835765476.post-707181831510723107</id><published>2008-04-15T12:46:00.008+02:00</published><updated>2008-04-15T14:10:35.343+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RHEL5'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><category scheme='http://www.blogger.com/atom/ns#' term='RAC'/><category scheme='http://www.blogger.com/atom/ns#' term='x86_64'/><title type='text'>10gR2 RAC on RHEL5.1 (x86_64)</title><content type='html'>Just a few issues you should be aware of when trying to install 10gR2 RAC on RHEL 5.1:&lt;br /&gt;&lt;br /&gt;See Metalink 465001.1 for raw device configuration for RHEL 5. It's not explicitly said, but all disks used must be partitioned! Otherwise, if you don't partition the OCR disk, the root.sh from clusterware installation will fail (fail with “Failed to upgrade Oracle Cluster Registry configuration” error, with “Failed to call clsssinit” in log.)&lt;br /&gt;The ASMLib will also refuse to stamp whole disk, a partition is required.&lt;br /&gt;&lt;br /&gt;For OS configuration, see Metalink 421308.1. However, the sysctl parameters listed there do not exist on RHEL 5.1, you will have to use:&lt;br /&gt; &lt;p class="MsoNormal"&gt;&lt;span style="" lang="DE"&gt;&lt;/span&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p class="MsoNormal"&gt;&lt;span style="" lang="DE"&gt;kernel.shmmni = 4096&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="" lang="DE"&gt;kernel.sem = 250 32000 100 128&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="" lang="DE"&gt;fs.file-max = 65536&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;net.ipv4.ip_local_port_range = 1024 65000&lt;/p&gt;  &lt;p class="MsoNormal"&gt;net.core.rmem_default = 262144&lt;/p&gt;  &lt;p class="MsoNormal"&gt;net.core.rmem_max = 262144&lt;/p&gt;  &lt;p class="MsoNormal"&gt;net.core.wmem_default = 262144&lt;/p&gt;  &lt;p class="MsoNormal"&gt;net.core.wmem_max = 262144&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-weight: bold;"&gt;net.ipv4.tcp_rmem = 4194304 4194304 4194304&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; net.ipv4.tcp_wmem = 262144 262144 262144&lt;/span&gt;&lt;b style=""&gt;&lt;span style="color: rgb(153, 51, 102);"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;/blockquote&gt;&lt;br /&gt;You will also need to install one more rpm package (kernel-headers from CD1), but this will indicate the rpm command anyway.&lt;br /&gt;&lt;br /&gt;As for network, remember that the localhost entries must be at the end of hosts file, so OUI will resolve current server with its name, instead of "localhost". (You would see this in the "Specify cluster configuration" screen.) If the node is listed as "localHost" (note the capital H), check your /etc/hosts for errors and that you can ping all the nodes listed (check also for typing errors).&lt;br /&gt;&lt;br /&gt;Before running the root.sh script, read Metalink 414163.1. You will have to edit vipca and srvctl scripts (remove LD_ASSUME_KERNEL setting) and manually configure public/interconnect interfaces, finally running vipca interactively from root X session.&lt;br /&gt;If you ran root.sh without these changes, remove the /etc/oracle/ocr.loc, remove the entries from /etc/inittab and run telinit so the root.sh can configure the OCR from scratch again.&lt;br /&gt;&lt;br /&gt;Hope this helps:-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4897450294835765476-707181831510723107?l=vitspinka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vitspinka.blogspot.com/feeds/707181831510723107/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4897450294835765476&amp;postID=707181831510723107' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/707181831510723107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/707181831510723107'/><link rel='alternate' type='text/html' href='http://vitspinka.blogspot.com/2008/04/10gr2-rac-on-rhel51-x8664.html' title='10gR2 RAC on RHEL5.1 (x86_64)'/><author><name>Vit Spinka</name><uri>http://www.blogger.com/profile/03048791839608729608</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4897450294835765476.post-4992603506574903145</id><published>2008-04-15T12:31:00.005+02:00</published><updated>2008-04-15T12:45:31.745+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dbms_alert'/><category scheme='http://www.blogger.com/atom/ns#' term='RAC'/><title type='text'>dbms_alert on RAC</title><content type='html'>Not long time ago, I came across a usage of dbms_alert to manage running jobs. As the solution implemented must work also for RAC, I wanted to know whether dbms_alert works on RAC across instances.&lt;br /&gt;&lt;br /&gt;The documentation nor Metalink does not say anything (contrary to dbms_pipe, which does NOT work on RAC). So, if they don't warn, it should work... However, Julian Dyke says, that dbms_alert does not work and is the same as dbms_pipe (sources: &lt;a href="http://juliandyke.com/Presentations/Presentations.html#ARoughGuideToRAC"&gt;http://juliandyke.com/Presentations/Presentations.html#ARoughGuideToRAC&lt;/a&gt;, page 17, or Pro Oracle Database 10g RAC on Linux, page 426).&lt;br /&gt;&lt;br /&gt;You know, never trust anybody, so I conducted a test case (10.2.0.3 on Linux x86_64, VMware ESX server, 2-node RAC):&lt;br /&gt;&lt;br /&gt;You will need two simultaneous sessions, I mark them with DWH1&gt; and DWH2&gt; here.&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;DWH1&gt; select instance_name from v$instance;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;INSTANCE_NAME&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;----------------&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DWH1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DWH2&gt; select instance_name from v$instance;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;INSTANCE_NAME&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;----------------&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DWH2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DWH2&gt; exec dbms_alert.register('TST');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DWH2&gt; set serveroutput on&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DWH2&gt; declare&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   message varchar2(2000);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   status integer;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   name varchar2(2000);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;begin&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  DBMS_ALERT.WAITANY (&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   name ,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   message,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   status);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  dbms_output.put_line(name);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  dbms_output.put_line(message);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;end;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DWH1&gt; exec dbms_alert.signal('TST','msg1');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DWH2&gt; TST&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;msg1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;PL/SQL procedure successfully completed.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DWH2&gt; declare&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   message varchar2(2000);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   status integer;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;begin&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DBMS_ALERT.WAITONE (&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   'TST',&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   message,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   status );&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  dbms_output.put_line(message);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;end; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DWH1&gt; exec dbms_alert.signal('TST','msg1');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;msg1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;PL/SQL procedure successfully completed.&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;So, as you see, it works even on RAC. Just test it yourself, and never trust anybody anything without proper testing. Everyone does mistakes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4897450294835765476-4992603506574903145?l=vitspinka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vitspinka.blogspot.com/feeds/4992603506574903145/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4897450294835765476&amp;postID=4992603506574903145' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/4992603506574903145'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/4992603506574903145'/><link rel='alternate' type='text/html' href='http://vitspinka.blogspot.com/2008/04/dbmsalert-on-rac.html' title='dbms_alert on RAC'/><author><name>Vit Spinka</name><uri>http://www.blogger.com/profile/03048791839608729608</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4897450294835765476.post-8618422937334987899</id><published>2007-10-02T14:45:00.000+02:00</published><updated>2007-10-02T14:51:39.103+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='11g'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><category scheme='http://www.blogger.com/atom/ns#' term='OCP'/><title type='text'>Oracle 11g New Features for Administrators</title><content type='html'>&lt;p&gt;The new Oracle 11g New Features exam is available in beta: &lt;a href="http://www.oracle.com/global/cz/education/certification/11g_nfbeta.html"&gt;http://www.oracle.com/global/cz/education/certification/11g_nfbeta.html&lt;/a&gt;, open till December, 15th. The first opportunity to earn the 11g OCP credential...&lt;/p&gt;&lt;p&gt;By the way, the full 11g OCP track is announced too, and it looks similiar to the 10g track - 1 exam for OCA, 1 exam and hans-on course for OCP. OCM is promised too, but no date is given.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4897450294835765476-8618422937334987899?l=vitspinka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vitspinka.blogspot.com/feeds/8618422937334987899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4897450294835765476&amp;postID=8618422937334987899' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/8618422937334987899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/8618422937334987899'/><link rel='alternate' type='text/html' href='http://vitspinka.blogspot.com/2007/10/oracle-11g-new-features-for.html' title='Oracle 11g New Features for Administrators'/><author><name>Vit Spinka</name><uri>http://www.blogger.com/profile/03048791839608729608</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4897450294835765476.post-8151239292019735923</id><published>2007-08-19T19:43:00.000+02:00</published><updated>2007-08-19T19:52:30.417+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='11g'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database'/><title type='text'>11g New Features</title><content type='html'>I've prepared a presentation about 11g new features - it's ment for an internal workshop at my company, but perhaps you will find it interesting, too.&lt;br /&gt;&lt;br /&gt;So, the direct link is here: &lt;a href="http://www.vitspinka.cz/files/11gnewf.pdf"&gt;11g New Features presentation&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4897450294835765476-8151239292019735923?l=vitspinka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vitspinka.blogspot.com/feeds/8151239292019735923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4897450294835765476&amp;postID=8151239292019735923' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/8151239292019735923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/8151239292019735923'/><link rel='alternate' type='text/html' href='http://vitspinka.blogspot.com/2007/08/11g-new-features.html' title='11g New Features'/><author><name>Vit Spinka</name><uri>http://www.blogger.com/profile/03048791839608729608</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4897450294835765476.post-3222833340273909125</id><published>2007-08-01T14:53:00.000+02:00</published><updated>2007-08-01T15:03:09.627+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>64-bit Linux and SGA size</title><content type='html'>Everyday, I learn something new. Or maybe I just learn again something I forgot in the meantime...&lt;br /&gt;&lt;br /&gt;A year ago or so, I was reading throught the problems you must face when crossing the 4GB memory size. One of the question asked was: 32-bit or 64-bit? After reading the things needed to make it work on 32-bit (you must use indirect buffers, for example, thus you loose automatic SGA tuning), the answer was simple - 64-bit.&lt;br /&gt;&lt;br /&gt;Not long before, I was asked what has to be done to use 16GB SGA on 64-bit (EM64T) Linux. Well, it's much simpler then on the 32-bit, and simple sga_target=16g will &lt;span style="font-style: italic;"&gt;basically&lt;/span&gt; work.&lt;br /&gt;&lt;br /&gt;The catch is in the word &lt;span style="font-style: italic;"&gt;basically&lt;/span&gt; - the database will work, but the Linux kernel (kswapd) will have a hard time managing all the memory. Thus, you need to use huge pages (same was for 32-bit, by the way) to get optimal performance.&lt;br /&gt;&lt;br /&gt;I'm just getting an impression, that the DBA has to know more and more about things outside the database - in this case, of OS. With ASM, about the NAS/SAN. With ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4897450294835765476-3222833340273909125?l=vitspinka.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vitspinka.blogspot.com/feeds/3222833340273909125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4897450294835765476&amp;postID=3222833340273909125' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/3222833340273909125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4897450294835765476/posts/default/3222833340273909125'/><link rel='alternate' type='text/html' href='http://vitspinka.blogspot.com/2007/08/64-bit-linux-and-sga-size.html' title='64-bit Linux and SGA size'/><author><name>Vit Spinka</name><uri>http://www.blogger.com/profile/03048791839608729608</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
