I have been awfully quiet on my blog lately. I think that is because I have been busy with other things, like my garden and stuff like that. There are some ‘techie’ thing I have done in the meantime, though,
I have submitted a couple of abstracts for Tech14. Hope at least one of them gets selected. I really like presenting and if it is in a different country, that is just a plus. That (more...)
There are already a lot of blogposts and presentations done about Hybrid Columnar Compression and i am adding one more blogpost to that list. Recently i was doing some small tests one HCC and noticed that that inserts on a HCC row didn’t got compressed and yes i was using direct path loads:
DBA@TEST1> create table hcc_me (text1 varchar2(4000)) compress for archive high; Table created. KJJ@TEST1> insert /*+ append */ into hcc_me select dbms_random.string('x',100) (more...)
Being a huge fan of Logger, the PL/SQL logging utility, I really wanted this be to included in the project that I'm currently working on. So I downloaded it (link at the bottom of this blog) and included it in our deployment scripts. Done.... at least I thought so, but of course this wasn't the case.
The regular install script for Logger looks something like the following (parts removed and table names are changed):
There is a ‘rule’, I think it was created by Tom Kyte, stating: If you can do it in SQL, do it in SQL. I came across some code the other day that makes perfect sense to do then you are running an Oracle 10g (or earlier) instance. I rewrote the code to use only the EMP and DEPT tables to protect the suspects and maybe innocent.
The function defined is something like this:
email@example.com > select banner from v$version; BANNER -------------------------------------------------------------------------------- Oracle Database 12c Enterprise Edition Release 22.214.171.124.0 - 64bit Production PL/SQL Release 126.96.36.199.0 - Production CORE 188.8.131.52.0 Production TNS for Linux: Version 184.108.40.206.0 - Production NLSRTL Version 220.127.116.11.0 - Production firstname.lastname@example.org > select value from nls_database_parameters where parameter='NLS_CHARACTERSET'; VALUE -------------------------------------------------------------------------------- AL32UTF8 email@example.com > ! (more...)
Chris Saxon posted a nice quiz regarding a pitfall when creating tables with VARCHAR2-columns: when you are not explicit in specifying the length-semantics ( CHAR or BYTE ), a session parameter, which may vary, is used.
This is a short follow-up of his story, which shows more pitfalls when creating views and selecting from those.
We end up in a structure which can – by definition – contain only 1 byte, but actually shows containing (more...)
This year, from June 22 - June 26, the best convention in the world, ODTUG’s KScope14 will be held in Seattle, Washington. I am already looking forward to meeting some ‘old’ friends again, creating new friends and seeing some of the best content by presenters from all over the world.
Some of the presentations I am looking forward to:
In the Developer’s Toolkit track:
Here is a restriction of the cardinality hint in conjunction with the materialize-hint ( note: both are undocumented but sometimes of great use ):
we cannot tell the optimizer in the outer query ( the one that uses the materialized subquery ) about the cardinality of the materialization, this can only – and then not always – be done within the materializing query.
The example to show that is stolen from Tom Kyte’s Presentation S13961_Best_Practices_for_Managing_Optimizer_Statistics_Short. (more...)
It’s sometimes amazing, how many bugs there are still with elementary SQL.
Here is one concerning updatable views:
firstname.lastname@example.org > create table t ( v varchar2(30) ); Table created. email@example.com > create view v as 2 select v as dontdothatman, v as canbelostwheninserted 3 from t; View created. firstname.lastname@example.org > insert /* this is fine */ into v 2 values('fine', 'fine'); 1 row created. email@example.com > select * from v; DONTDOTHATMAN (more...)
Just a quick code snippit. I do a lot of data pumps to move schemas between different databases; for example taking a copy of a schema to an internal database to try to reproduce a problem. Some of these schemas have some very large tables. The large tables aren’t always (more...)
When he (more...)
Recursive subquery factoring (AKA Recursive Common Table Expressions) has been available in Oracle since version 11g R2 was launched sometime around 2009. I always thought of it as a replacement for the connect by clause and just another way to write hierarchical queries, so I never really took the time (more...)
He wanted the data in the columns to be "shifted to the left". To explain a little more, take a look at the following data:
ID V1 V2 (more...)
It seems that sometimes you need a non-unique index to enforce a unique constraint even if this constraint is declared as not deferrable.
firstname.lastname@example.org > create table strange(i int not null, j int not null); Table created. email@example.com > alter table strange add constraint unique_i unique(i) not deferrable (more...)
Please see the details of the sessions below along with the (more...)