Author: Laurent Schneider

How to check if I have a pending transaction?

Pretty straightforward, check if dbms_transaction.step_id is null! SQL> select dbms_transaction.step_id from dual; STEP_ID ————— SQL> insert into t values (1); 1 row created. SQL> select dbms_transaction.step_id from dual; STEP_ID ————— 114352430549782 SQL> commit; Commit complete. SQL> select dbms_transaction.step_id from dual; STEP_ID ————— SQL> insert into t values (2); 1 row created. SQL> select dbms_transaction.step_id from […]

on my bookshelf

I just started a new job as a dba and placed some books on my desk. Applied Mathematics for Database Professionals by Lex de Haan and Toon Koppelaars SQL Design Patterns by Vadim Tropashko Beginning Oracle Database 11g Administration by Iggy Fernandez Expert Oracle Database Architecture by Tom Kyte Oracle 11g New Features by Brian […]

11.2.0.2

I have read on Surachart Opun’s blog that 11.2.0.2 is available, but also that the patchset is now a full installation. In the past, if you wanted to have 9.2.0.8 or 10.2.0.5, you needed to install both the base version, 9.2.0.1 or 10.2.0.1 and the patchset, 9.2.0.8 or 10.2.0.5. Very often the patchset itself was […]

last access time of a file

I was reading http://blogs.oracle.com/myoraclediary and there was a command about printing the modification details of a file. In Linux / Cygwin “stat” exists as a command $ stat /etc/hosts Access: 2010-08-25 15:20:49.782522200 +0200 Modify: 2010-08-18 14:04:25.868114200 +0200 Change: 2010-08-18 14:04:26.072413100 +0200 Or use the one-liner perl below ### st_atime; /* Time of last access */ […]

to cvs or to subversion

First surprise, after migration, the size of my subversion folder is double the size of my cvs folder. With a bunch of 2Gb disks shared amoung dozens of unix persons, and regular reminders the current usage reached 100%, you will feel the pain of having each developers doublesizing its home directory… The reason is a […]

connect by and recursive with (part 2)

According to the doc The subquery_factoring_clause now supports recursive subquery factoring (recursive WITH), which lets you query hierarchical data. This feature is more powerful than CONNECT BY in that it provides depth-first search and breadth-first search, and supports multiple recursive branches. A new search_clause and cycle_clause let you specify an ordering for the rows and […]

where is the TRIGGER ANY TABLE privilege?

You have your table data in one schema and your procedures in another one. But can you have triggers and tables in different schemas? SYS@lsc01> create user u1 identified by u1; User created. SYS@lsc01> create user u2 identified by u2; User created. SYS@lsc01> grant create table, unlimited tablespace to u1; Grant succeeded. SYS@lsc01> grant create […]

cd

Do you know cd ? I thought I did until this afternoon … OK, let’s start some basic. I create two directories $ echo $SHELL /bin/ksh $ mkdir /tmp/foo $ mkdir /tmp/bar create a symlink /tmp/bar/baz pointing to /tmp/foo $ ln -s /tmp/foo /tmp/bar/baz create a file foo1 in foo $ touch /tmp/foo/foo1 change to […]

Oracle – Sun, what has changed ?

Did you go to http://www.sun.com recently? You will land on oracle.com ! But more will come. The conference JavaOne will be in SanFrancisco with Oracle OpenWorld. The Sun Developer Network and Bigadmin will be integrated in OTN. Welcome Sun Developers Ensuring community continuity MySql and java.sun.com have the Oracle logo. That was fast! Well, Oracle […]

what is the type of NULL

I was a bit surprised to see a VARCHAR2(0) column in my schema select column_name, data_type, data_length from user_tab_columns where table_name=’V’; COLUMN_NAME DATA_TYPE DATA_LENGTH ————— ——————– ———– X VARCHAR2 0 What’s this datatype? It is the datatype of NULL !!! SQL> create or replace view v as select null x from dual View created. SQL> […]

.plz dump file

What are those .plz dump files in my user dump directory ? -rw-r–r– 1 oracle dba 15168 Oct 6 14:34 _anon__3ca8c5e38__AB.plz -rw-r—– 1 oracle dba 15883 Oct 6 14:45 db01_ora_10061.trc -rw-r–r– 1 oracle dba 15168 Oct 6 14:45 _anon__3c929b088__AB.plz -rw-r—– 1 oracle dba 15895 Oct 6 14:47 db01_ora_10666.trc -rw-r–r– 1 oracle dba 15168 Oct 6 […]

jdbc hello world

I am in a java mood today, let’s check how to print hello world with jdbc 🙂 import java.sql.*; public class HelloWorld { public static void main(String[] args) throws SQLException { DriverManager.registerDriver(new oracle.jdbc.OracleDriver()); ResultSet res = DriverManager. getConnection(“jdbc:oracle:thin:@srv1:1521:DB01”, “scott”, “tiger”). prepareCall(“select ‘Hello World’ txt from dual”). executeQuery(); res.next(); System.out.println(res.getString(“TXT”)); } } let’s compile javac -classpath […]