oow2k6 sessions

the sessions I registered with for oracle open world 2006 are the following :

Monday 10:45 : Bryn LLewellyn, PLSQL Manager, will talk about PLSQL future in the next release (11g) : session S281172

Monday 12:30 : Andrew Clarke, Oracle ACE, will talk about unit testing in PL/SQL : session 282112

Monday 15:15 : Thomas Kyte, Oracle ACE and asktom owner, will talk about sql worst practice : session 281206

Monday 16:15 : Steven Feuerstein, Oracle ACE and PL/SQL author, will talk about 10 Things You Should NEVER Do in PL/SQL : session 281918

Tuesday 13:15 : Sue Harper, SQL Developer Product Manager, and Kris Rice, Director of Database Tools Research, will talk about Advanced Database Development with Oracle SQL Developer : session 281142

Tuesday 16:30 : Wim Coekaerts, Oracle ACE and Linux Principal, will talk about Securing Linux for Oracle : session 281224

Thursday 09:30 : Werner Puschitz, Oracle ACE, will talk about Automated Oracle Real Application Clusters Deployment : Session 283479

I have booked a few more sessions, about Virtual Directory, Application Server and Grid Control.

I will be at the OTN lounge to play chess or othello at any time 🙂

cu@oow2k6@sf

tablespace maintenance tasks

I just had to guide one of our DBA this morning.

How to get free of segments in SYSTEM tablespace :

  1. tables

    SQL> select owner, table_name from dba_tables where tablespace_name=’SYSTEM’ and owner not in (‘SYS’,’SYSTEM’,’OUTLN’);
    OWNER TABLE_NAME
    —– ———-
    SCOTT T

    SQL> alter table scott.t move tablespace users;

    Table altered.

    SQL> select owner, table_name from dba_tables where tablespace_name=’SYSTEM’ and owner not in (‘SYS’,’SYSTEM’,’OUTLN’);

    no rows selected

    If the table has a LONG datatype, than I need to exp/drop/create/imp the table


    SQL> select owner, table_name from dba_tables where tablespace_name=’SYSTEM’ and owner not in (‘SYS’,’SYSTEM’,’OUTLN’);
    OWNER TABLE_NAME
    —– ———-
    SCOTT T

    SQL> alter table scott.t move tablespace users;
    alter table scott.t move tablespace users
    *
    ERROR at line 1:
    ORA-00997: illegal use of LONG datatype

    SQL> ! exp file=t.dmp tables=t userid=scott/tiger

    Export: Release 10.2.0.2.0 – Production on Mon Aug 14 14:24:29 2006

    Copyright (c) 1982, 2005, Oracle. All rights reserved.

    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 – Production
    With the Partitioning, OLAP and Data Mining options
    Export done in WE8ISO8859P1 character set and AL16UTF16 NCHAR character set

    About to export specified tables via Conventional Path …
    . . exporting table T 3 rows exported
    Export terminated successfully without warnings.

    SQL> select dbms_metadata.get_ddl(‘TABLE’,’T’,’SCOTT’) from dual;
    DBMS_METADATA.GET_DDL(‘TABLE’,’T’,’SCOTT’)
    —————————————————————————————————————————————
    CREATE TABLE “SCOTT”.”T”
    ( “L” LONG
    ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE “SYSTEM”

    SQL> drop table scott.t;

    Table dropped.

    SQL> CREATE TABLE “SCOTT”.”T”
    2 ( “L” LONG
    3 ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    4 STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    5 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    6 TABLESPACE “USERS”;

    Table created.

    SQL> ! imp file=t.dmp tables=t userid=scott/tiger ignore=y

    Import: Release 10.2.0.2.0 – Production on Mon Aug 14 14:27:05 2006

    Copyright (c) 1982, 2005, Oracle. All rights reserved.

    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 – Production
    With the Partitioning, OLAP and Data Mining options

    Export file created by EXPORT:V10.02.01 via conventional path
    import done in WE8ISO8859P1 character set and AL16UTF16 NCHAR character set
    . importing SCOTT’s objects into SCOTT
    . importing SCOTT’s objects into SCOTT
    . . importing table “T” 3 rows imported
    Import terminated successfully without warnings.

  2. Indexes

    SQL> select owner, index_name from dba_indexes where tablespace_name=’SYSTEM’ and owner not in (‘SYS’,’SYSTEM’,’OUTLN’);
    OWNER INDEX_NAME
    —– ———-
    SCOTT I

    SQL> alter index scott.i rebuild tablespace users;

    Index altered.

    SQL> select owner, index_name from dba_indexes where tablespace_name=’SYSTEM’ and owner not in (‘SYS’,’SYSTEM’,’OUTLN’);

    no rows selected

  3. lob
    warning: in 9i you must join with dba_tables to get tablespace_name

    SQL> select owner, table_name, column_name from dba_lobs where tablespace_name=’SYSTEM’ and owner not in (‘SYS’,’SYSTEM’,’OUTLN’);
    OWNER TABLE_NAME COLUMN_NAME
    —– ———- ———–
    SCOTT T          C

    SQL> alter table scott.t move lob(c) store as (tablespace users);

    Table altered.

    SQL> select owner, table_name, column_name from dba_lobs where tablespace_name=’SYSTEM’ and owner not in (‘SYS’,’SYSTEM’,’OUTLN’);

    no rows selected

  4. table partition

    SQL> select table_owner, table_name, partition_name from dba_tab_partitions where tablespace_name=’SYSTEM’ and table_owner not in (‘SYS’,’SYSTEM’,’OUTLN’);
    TABLE_OWNER TABLE_NAME PARTITION_NAME
    ———– ———- ————–
    SCOTT       T          P1

    SQL> alter table scott.t move partition p1 tablespace users;

    Table altered.

    SQL> select table_owner, table_name, partition_name from dba_tab_partitions where tablespace_name=’SYSTEM’ and table_owner not in (‘SYS’,’SYSTEM’,’OUTLN’);

    no rows selected

  5. index partition

    SQL> select index_owner, index_name, partition_name from dba_ind_partitions where tablespace_name=’SYSTEM’ and index_owner not in (‘SYS’,’SYSTEM’,’OUTLN’);
    INDEX_OWNER INDEX_NAME PARTITION_NAME
    ———– ———- ————–
    SCOTT       I          SYS_P32

    SQL> alter index scott.i rebuild partition SYS_P32 tablespace users;

    Index altered.

    SQL> select index_owner, index_name, partition_name from dba_ind_partitions where tablespace_name=’SYSTEM’ and index_owner not in (‘SYS’,’SYSTEM’,’OUTLN’);

    no rows selected

  6. table subpartition

    SQL> select table_owner, table_name, subpartition_name from dba_tab_subpartitions where tablespace_name=’SYSTEM’ and table_owner not in (‘SYS’,’SYSTEM’,’OUTLN’);
    TABLE_OWNER TABLE_NAME SUBPARTITION_NAME
    ———– ———- ——————————
    SCOTT       T          SYS_SUBP30

    SQL> alter table scott.t move subpartition SYS_SUBP30 tablespace users;

    Table altered.

    SQL> select table_owner, table_name, subpartition_name from dba_tab_subpartitions where tablespace_name=’SYSTEM’ and table_owner not in (‘SYS’,’SYSTEM’,’OUTLN’);

    no rows selected

  7. index subpartition

    SQL> select index_owner, index_name, subpartition_name from dba_ind_subpartitions where tablespace_name=’SYSTEM’ and index_owner not in (‘SYS’,’SYSTEM’,’OUTLN’);
    INDEX_OWNER INDEX_NAME SUBPARTITION_NAME
    ———– ———- ——————————
    SCOTT       I          SYS_SUBP31

    SQL> alter index scott.i rebuild subpartition SYS_SUBP31 tablespace users;

    Index altered.

    SQL> select index_owner, index_name, subpartition_name from dba_ind_subpartitions where tablespace_name=’SYSTEM’ and index_owner not in (‘SYS’,’SYSTEM’,’OUTLN’);

    no rows selected

  8. IOT

    SQL> select owner, table_name, index_name, index_type from dba_indexes where tablespace_name=’SYSTEM’ and owner not in (‘SYS’,’SYSTEM’,’OUTLN’);
    OWNER TABLE_NAME INDEX_NAME INDEX_TYPE
    —– ———- —————– ———-
    SCOTT T          SYS_IOT_TOP_10406 IOT – TOP

    SQL> alter table scott.t move tablespace users;

    Table altered.

    SQL> select owner, table_name, index_name, index_type from dba_indexes where tablespace_name=’SYSTEM’ and owner not in (‘SYS’,’SYSTEM’,’OUTLN’);

    no rows selected

  9. IOT Overflow

    SCOTTSQL> select owner, table_name, iot_name, iot_type from dba_tables where tablespace_name=’SYSTEM’ and owner not in (‘SYS’,’SYSTEM’,’OUTLN’);
    OWNER TABLE_NAME IOT_NAME IOT_TYPE
    —– —————— ——– ————
    SCOTT SYS_IOT_OVER_10406 T        IOT_OVERFLOW

    SQL> alter table scott.t move overflow tablespace users;

    Table altered.

    SQL> select owner, table_name, iot_name, iot_type from dba_tables where tablespace_name=’SYSTEM’ and owner not in (‘SYS’,’SYSTEM’,’OUTLN’);

    no rows selected

  10. cluster
    I did not find out yet 🙁 Probably not possible, so use exp+drop+create+imp as for long

  11. nested tables
    warning: according to the sql reference manual (not tested), in 9i, the nested table was moved with the parent table automatically

    SQL> select owner, table_name from dba_tables where nested=’YES’ and tablespace_name=’SYSTEM’ and owner not in (‘SYS’,’SYSTEM’,’OUTLN’);
    OWNER TABLE_NAME
    —– ———-
    SCOTT CTT

    SQL> alter table scott.ctt move tablespace users;

    Table altered.

    SQL> select owner, table_name from dba_tables where nested=’YES’ and tablespace_name=’SYSTEM’ and owner not in (‘SYS’,’SYSTEM’,’OUTLN’);

    no rows selected

  12. Lob partitions and subpartitions
    This is getting tricky… I did not achieve to change the default tablespace specification for lob, nor to change a HASH partition. Again, when all failed, use exp/drop/create/imp

    SQL> select owner, table_name, column_name from dba_lobs where tablespace_name=’SYSTEM’ and owner not in (‘SYS’,’SYSTEM’,’OUTLN’);
    OWNER TABLE_NAME COLUMN_NAME
    —– ———- —————–
    SCOTT T         C

    SQL> alter table scott.t move lob(c) store as (tablespace users);
    alter table scott.t move lob(c) store as (tablespace users)
    *
    ERROR at line 1:
    ORA-14511: cannot perform operation on a partitioned object

    SQL> select table_owner,table_name,column_name,partition_name from dba_lob_partitions where tablespace_name=’SYSTEM’ and table_owner not in (‘SYS’,’SYSTEM’,’OUTLN’);
    TABLE_OWNER TABLE_NAME COLUMN_NAME PARTITION_NAME
    ———– ———- ———– ————–
    SCOTT       T         C           P1

    SQL> alter table scott.t move partition p1 lob(c) store as (tablespace users);

    Table altered.

    SQL> select table_owner,table_name,column_name,partition_name from dba_lob_partitions where tablespace_name=’SYSTEM’ and table_owner not in (‘SYS’,’SYSTEM’,’OUTLN’);

    no rows selected

    SQL> select owner, table_name, column_name from dba_lobs where tablespace_name=’SYSTEM’ and owner not in (‘SYS’,’SYSTEM’,’OUTLN’);
    OWNER TABLE_NAME COLUMN_NAME
    —– ———- —————–
    SCOTT T          C

    the table was ranged partitioned. With a hash partition, i would get an ORA-22877

    SQL> alter table scott.t move partition sys_p47 lob(c) store as (tablespace users);
    alter table scott.t move partition sys_p47 lob(c) store as (tablespace users)
    *
    ERROR at line 1:
    ORA-22877: invalid option specified for a HASH partition or subpartition of a LOB column

The DBA also wanted to separate indexes and tables for tuning IOs. I had to redirect him to the doc :
Performance Tuning Guide
One popular approach to manual I/O distribution suggests separating a frequently used table from its index. This is not correct.
well, he shows me his Oracle 9i Tuning Course, Chapter 3, Slice 6, put table and indexes on different tablespaces… Ok, this is not a new thema, just google to find explanations !

latest patchset

Huge downtime on forums.oracle.com today. After landing on an Error-500 page, I discovered a quick and neat overview of oracle patchsets, accessible without metalink account :

http://www.oracle.com/technology/support/patches.htm

Still waiting for 9.2.0.8 Solaris by the way, announced for 2006Q3, whatever this mean

sqlnet.wallet_override=true

I recently posted about Oracle Password Repository (OPR).

I did get a comment from Andreas Piesk about something similar in Oracle, the wallet.

Let’s do a quick test.

First, I create a .sqlnet.ora in my home directory (I do not want to mess up the system-wide sqlnet.ora).


$ cat /home/lsc/.sqlnet.ora
SQLNET.WALLET_OVERRIDE=TRUE
WALLET_LOCATION=(SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=/home/lsc)))

I now create the wallet


$ mkstore -create -wrl /home/lsc
Enter password:
Enter password again:

and the credentials


$ mkstore -wrl /home/lsc -createCredential LSC01 scott tiger
Enter password:
Create credential oracle.security.client.connect_string1

now I try to login


$ sqlplus /@LSC01

SQL*Plus: Release 10.2.0.2.0 - Production on Thu Aug 10 11:23:35 2006

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> sho user
USER is "SCOTT"

This sounds to work very nicely. Let’s see if this is more secure than OPR :


$ mkstore -wrl /home/lsc -list
Enter password:

Oracle Secret Store entries:
oracle.security.client.connect_string1
oracle.security.client.password1
oracle.security.client.username1
$ mkstore -wrl /home/lsc -viewEntry oracle.security.client.connect_string1
Enter password:
oracle.security.client.connect_string1 = LSC01
$ mkstore -wrl /home/lsc -viewEntry oracle.security.client.username1
Enter password:
oracle.security.client.username1 = scott
$ mkstore -wrl /home/lsc -viewEntry oracle.security.client.password1
Enter password:
oracle.security.client.password1 = tiger

Definitely! The password is not reveal, unless you know the password of the wallet. Remember in OPR, the application had direct access to the password. Here it is not the case, if you do not know the password of the wallet, you may login, but you cannot find out what the password is. I like this very much.

of course do not forget to protect your wallet

Ok, what I did not achieve until yet is logging in externally when using wallet_override :


$ mv /home/lsc/.sqlnet.ora /home/lsc/.sqlnet.ora.disable
$ sqlplus /

SQL*Plus: Release 10.2.0.2.0 - Production on Thu Aug 10 11:35:56 2006

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> sho user
USER is "OPS$LSC"
$ mv /home/lsc/.sqlnet.ora.disable /home/lsc/.sqlnet.ora
$ sqlplus /

SQL*Plus: Release 10.2.0.2.0 - Production on Thu Aug 10 11:37:13 2006

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

ERROR:
ORA-01017: invalid username/password; logon denied

I will update this if I find out how to login externally too.

select last rows

I just read about a query to retrieve last modification row of a date


SQL> SELECT ora_rowscn FROM tab_test;

ORA_ROWSCN
----------
351744
351744
351744
351744
351744
351744
6 rows selected.

SQL> UPDATE tab_test SET valeur=valeur*1.1 WHERE col_id=1;

3 rows updated.

SQL> commit;

Commit complete

SQL>  SELECT ora_rowscn FROM tab_test:

ORA_ROWSCN
----------

351744
351744
351744
371423
371423
371423

6 rows selected.

conclusion of the author : very neat to retrieve last modification date.

Well, I am worried. I have answered so many times on the technical forums here for example, that the only way to retrieve the last rows is to use a date column, and to manually update it (or with a trigger or a default value for insert) with the last modification date.

What should I do?
test it!


14:52:07 SQL> create table t as 
select rownum x from all_objects;

Table created.

14:56:23 SQL> select scn_to_timestamp(ora_rowscn) timestamp, count(*) from t group by scn_to_timestamp(ora_rowscn);

TIMESTAMP                COUNT(*)
---------------------- ----------
04.08.2006 14:56:23.00       4238

let’s update one row


14:54:12 SQL> update t set x=-1 where rownum=1;

1 row updated.

14:55:04 SQL> commit;

Commit complete.

14:58:03 SQL> select scn_to_timestamp(ora_rowscn) timestamp, count(*) from t group by scn_to_timestamp(ora_rowscn) order by scn_to_timestamp(ora_rowscn);

TIMESTAMP                COUNT(*)
---------------------- ----------
04.08.2006 14:56:23.00       3580
04.08.2006 14:57:14.00        658

what? I updated one row, why did it updated so many rows? Let’s look at the block


14:58:16 SQL>  select dbms_rowid.rowid_block_number(rowid) block_number,scn_to_timestamp(ora_rowscn) timestamp,count(*) from t group by dbms_rowid.rowid_block_number(rowid),scn_to_timestamp(ora_rowscn) order by scn_to_timestamp(ora_rowscn);

BLOCK_NUMBER TIMESTAMP                COUNT(*)
------------ ---------------------- ----------
         651 04.08.2006 14:56:23.00        658
         652 04.08.2006 14:56:23.00        658
         653 04.08.2006 14:56:23.00        658
         654 04.08.2006 14:56:23.00        658
         655 04.08.2006 14:56:23.00        658
         656 04.08.2006 14:56:23.00        290
         650 04.08.2006 14:57:14.00        658 <=====================

ok, what has the doc to say about this :

For each row, ORA_ROWSCN returns the conservative upper bound system change number (SCN) of the most recent change to the row. This pseudocolumn is useful for determining approximately when a row was last updated. It is not absolutely precise, because Oracle tracks SCNs by transaction committed for the block in which the row resides. You can obtain a more fine-grained approximation of the SCN by creating your tables with row-level dependency tracking

Well, let’s try again with row dependencies.


15:04:53 SQL> drop table t;

Table dropped.

15:04:55 SQL> create table t rowdependencies as select rownum x from all_objects;

Table created.

15:05:28 SQL> select scn_to_timestamp(ora_rowscn) timestamp, count(*) from t group by scn_to_timestamp(ora_rowscn) order by scn_to_timestamp(ora_rowscn);

TIMESTAMP                COUNT(*)
---------------------- ----------
04.08.2006 15:05:26.00       4241

15:05:42 SQL> update t set x=-1 where rownum=1; 
1 row updated.

15:05:58 SQL> commit;

Commit complete.

15:06:09 SQL> select scn_to_timestamp(ora_rowscn) timestamp, count(*) from t group by scn_to_timestamp(ora_rowscn) order by scn_to_timestamp(ora_rowscn);

TIMESTAMP                COUNT(*)
---------------------- ----------
04.08.2006 15:05:26.00       4240
04.08.2006 15:06:08.00          1

sounds better! probably not 100% reliable but way better, it seems almost usable …

Oracle OpenWorld 2006

I just registered to Oracle OpenWorld in October in San Francisco… Well, I know it is a long long long way to the west, but I will survive again, but this time I will avoid Delta Airlines, they refused to serve me a glass of wine last year in the plane! I am going to take maybe Lufthansa.

As an ACE, I got the Oracle Develop for free this year too. I also took the gold pass, well, waiting hours for keynotes is just too much boring. Since it is the only thing I pay myself (ok wine in the plane too), I guess this 150$ investment is ok.

If available, I will try the Oracle Application Server OCP Beta exam 1Z1-312 in SF. Also, I will ask them why this OCM 10g upgrade is still not available.

OTN forums new release

I read forums.oracle.com frequently. I have read and answered thousands of questions there.

Those days, they launched a new release, I do not know what the improvements are, but it is fairly unstable. Well, it has been worst in the past, but I keep getting We’re sorry, the server encountered an unexpected condition and timetouts occasionaly.

Another nightmare for users was the blank-trimming effect, it was hardly possible to format the post, all multiple spaces were trimmed to one space, even by using [code] or [pre]. It is now fixed!

There has been also two new icons, Usefull answer and Correct answer, but it has been removed already. It makes me remembers the smilies they introduced in a previous release, where :p bind variable was translated to a smile…

Problem with the downtime is that the experts go away. I post and read hundreds of messages on metalink, especially in sqlplus and plsql forums. The problem on metalink, lot’s of users expect to have an immediate and advanced answer from Oracle, because they pay for support, and they do not invest time to write the question properly nor to say please or thank you.

I recently start writing on the linux and oracle forums of developpez.net, where they put a high value on proper formatting, code of conduct, correct spelling (in french).

oas-console


oas-console
Originally uploaded by laurentschneider.

I installed OAS 10.1.3 on my notebook. Why? well, just to test if it is installable… and to justify my need of 2Gb of memory to my boss 😉

Ok, SLES10 is not certified yet, Not even planned yet on metalink. But it will definitely be certified one day.

The first step is to install the necessary packages

1) db1 : Berkeley DB Database Library Version 1.85
this package is needed, in order to avoid :

httpd: error while loading shared libraries: libdb.so.2: 
cannot open shared object file: No such file or directory

2) openmotif21-libs, sysstat
as listed in the quick installation guide for SLES9

3) libgnome and libgnome-devel
replace the old gnome-libs and gnome-libs-devel

4) pdksh
ksh-93r seems to be suffisant

5) glibc 2.3 and gcc 3.3
no problem until yet by using glibc 2.4 and gcc 4.1

The second and last step is to launch the installer, with -ignoreSysPrereqs or with an updated install/oraparam.ini

That’s all. I did get some warning about memory and requirements, but it seems that it works.

Oracle Password Repository

I checked this tool today :
http://sourceforge.net/projects/opr

This tool provide a simple way of not hardcoding passwords in shell scripts. Hardcoding passwords in shell scripts is a bad practice. The source code may be shared by many developers, may resides on unsecure servers (CVS), may be printed, etc… The passwords may change often too.

This tool uses a simple file to stores the passwords encrypted. Well, I urge you to secure this file to make it non-accessible for others.

I am not going to decode nor rate the encryption algorythm, the fact is, you do not have clear text passwords. It could be also possible to have clear text password in a separate text file, which would not be that less secure, but it is ugly.

To make it clear (I hope), it is a 2-ways encryption, so if you have access to the file and the source code of the algorythm, you can crack the password. Sounds weak? Well, Oracle Proxy Users with Internet Directory, Application Server, Portal and all those products are not much different. The only 100% passwordless solution I am aware of is the external OS identification.

Well, that said, let’s look how it works.

# ./configure
# make
# make install

let’s create the repository

 
$ export OPRREPOS=$ORACLE_HOME/dbs/oprrepos
$ opr -c

store the password for scott on LSC01

$ opr -a LSC01 SCOTT lsc
please enter the password :
please re-enter the password :
entry (LSC01, scott, lsc) added.

let’s test

$ sqlplus scott/$(opr -r LSC01 SCOTT)@LSC01

SQL*Plus: Release 10.2.0.2.0 - Production on Tue Jul 25 13:51:48 2006

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

This is quite convenient. I will use this to store the RMAN password to connect to the RMAN repository in my backup scripts

Installation Oracle on Suse Linux Enterprise 10

How neat is Suse!

I downloaded the DVD SLES10 on Novell.com. At the installation time, appart from Gnome, Development, X Window, there are a few new categories. One of them is called Oracle Database, and guess what, it installs all what I needed for Oracle. It creates an oracle account, with oinstall as primary group and dba as secondary group, it sets usefull things like ORACLE_HOME.

Ok, let’s unlock the account

chltlxlsc1:~ # usermod -s /bin/bash oracle
chltlxlsc1:~ # passwd oracle
Changing password for oracle.
New Password:
Reenter New Password:
Password changed.

Ok, let’s install. SLES10 is not recognized as a certified OS yet. The DISPLAY thing has to be manually set too.

oracle@chltlxlsc1:~&gt; ./runInstaller  -ignoreSysPrereqs
Starting Oracle Universal Installer...

Checking installer requirements...

Checking operating system version: must be redhat-3, SuSE-9, 
redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
                                      Failed &lt;&lt;&lt;&lt;

&gt;&gt;&gt; Ignoring required pre-requisite failures. Continuing...

this is one of the friendliest installation I have ever made…

indian readers

I am aware indian and pakistan ISP did block access to blogspot blogs. There are some workaround available on google, for example to access my site from Pakistan, you may be able to use pkblogs

http://www.pkblogs.com/laurentschneider

I am quite sad about this, I used to have a lot of access from India in the past (according to statcounter.com), and this is quite a limiting move for the indian Internet community.

Update: only relevant to my old blogger blog

oracle partner workshop : database 10g

Last month I had an application server seminar I blogged in SOA . Yesterday it was database 10g day.

First we had exactly the same talk about EMEA marketing, vision, partner and blabla for one hour. I did not expect to hear this comparison between Oracle Database and the C: prompt (origin) and fusion and mswin (ultimative achievement)… I almost told him than the C: prompt was not the first think to appear in MSDOS, but the A: prompt, well, if I will say it next time 😉

We heared about partitioning, parallel query, real application cluster, flashback database, undo management, in about 250 powerpoint slides and not a single line of sql in the whole presentation. Well, not willing to blame the teacher, I just felt losing my time listening to this superficial presentation of oracle database.

About the things I found interesting :
– Using the listener as http server. Especially interesting is to use lsnrctl star to start the listener (just joking).


listener.ora
HTTP= (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP)
  (HOST=chltlxlsc1) (PORT=8080)) (presentation=http)
  (session=raw))

$ lsnrctl star http
LSNRCTL for Linux: Version 10.2.0.2.0 - Production 

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Starting .../bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.2.0 - Production
System parameter file is .../network/admin/listener.ora
Log messages written to .../network/log/http.log
Listening on: (DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) 
(HOST=chltlxlsc1.lcsys.ch) (PORT=8080))  
(presentation=http) (session=raw))

than I should be able with the package DBMS_EPG to administer the website

– An Excel plugin : well, if your marketing department is hooked on excel, there is a plugin which enable you some connectivity within your spreadsheet. You can download it on otn for free on BI Spreadsheet Addin. I did not try it yet, but it did look sexy.

– As last month, the pause has been enjoyable. Fine starters, great cat fish, delicious dessert

exp/imp

EXP / IMP has a quite a lot of bugs and limitations.

Today I had a trouble with a function based index first, generating ORA-942 table does not exist on import. I also had an error with AQ.

I have a few invalid objects too :

before exp, on source system (tru64/9.2.0.4)

SQL&gt; select count(*) from dba_objects where status='INVALID';
 
  COUNT(*)
----------
        54

after imp, on target system (rh4/10.2.0.2)

SQL&gt; select count(*) from dba_objects where status='INVALID';
 
  COUNT(*)
----------
    142240

let’s recompile

SQL&gt; @?/rdbms/admin/utlrp

SQL&gt; select count(*) from dba_objects where status='INVALID';
 
  COUNT(*)
----------
      2699

… better, but still too much !

I probably did hit bug 3169196 too. The workaround is delicious :

<b>manually clean the data dictionary</b>

Well, I am going to drop the destination database and try again…

Oracle 7 Apero

Today we definitely shutdown our last productive Oracle7 database. Quite good news actually, I can now use set newp none, sqlplus “/ as sysdba” in all my scripts, svrmgrl is no longer needed (well, sometimes in 8i to do abort, but this is rare), and we garbage a hudge bin of reference manuals and cds!

And it is a good atmosphere, we talk about the good old time and this long life with no support and no change.

We have about 20% Oracle8i, 70% Oracle9i and 10% Oracle10g right now.

mod_plsql

mod_plsql is an oracle module for Apache. Let’s do it from A to Z.

I install HTTP server. In 10g, it is located on the companion cd and requires a separate oracle home.

I copy my tnsnames.ora in COMPANIONHOME/network/admin

Then, I configure COMPANIONHOME/Apache/modplsql/conf/dads.conf


&lt;Location /helloworld&gt;
  SetHandler pls_handler
  PlsqlDatabaseUsername         scott
  PlsqlDatabasePassword         tiger
  PlsqlDatabaseConnectString    LSC01
&lt;/Location&gt;

I create my procedure
create or replace procedure helloworld is begin htp.bold('hello world'); end;

I start my Apache server
$ORACLE_HOME/opmn/bin/opmnctl startproc ias-component=HTTP_Server

I open my browser
firefox http://localhost:7780/helloworld/scott.helloworld

So easy!

SOA

The seminar yesterday focused on SOA, Service Oriented Architecture. Teacher Michel Hascoët gave us an impressive demo with his notebook and JDeveloper; the SOA Workshop is usually taking four days, and for us he did it in one day.

Ok, first ADF. With JDeveloper, he created with just a few clicks a connection to a database, dropped two screens, one for browsing customers, one for editing a customer, and just by clicking “run”, the application started in a browser.

Later, we saw the BPEL process manager in JDeveloper. I have been quite impressed. Well, I am a vi man after all, and I am typically quite sceptical about click-click-click and it works. What is really sexy in the BPEL approach is that the application is built in a natural way. You just define process, like you would do “if (y==2)”, or “x=1” in vi, but in a good-looking fashion. At the end, the application is self-documented, and this is a real bonus, because the next developer in task for your project will understand your work immediatly.

As Michel pointed out, the key point to success is the data format. If you can exchange Data from one application to another, than building a new process is just a matter of a few clicks.

In the afternoon, we had a look at BAM, the Oracle Business Activity Monitor. This Windows tool (needs a windows server and an internet explorer client) let you build graphs and send alerts according to rules and sensors you can define in JDeveloper. Michel believes this tool will be rewritten by Oracle in a near future to comply with the OS strategy of Oracle, understand Java.

At the end of the day, we have been watching a OWSM demo. Oracle Web Service Manager is a security product for your application. Instead of connecting to your OC4J component directly (with http), you actually access a Proxy server, where you can eventually add authentication with a directory server like OID and authorization, than access the OC4J url, which can be behind a firewall.

Learn more : http://otn.oracle.com/soa