Error when using 11g export client on a 10g database

The only reason to read this post is if you have googled for the error “ORA-00904: “POLTYP”: invalid identifier”. This error occurs if you try the old export command from an 11g client against a database on version 10g or lower. The export command runs a query against a table called EXU9RLS in the SYS schema. On 11g this table was expanded with the column POLTYP and the export command (exp) expects to find this column. This should not be much of a problem since Data Pump export can be used.

June 29, 2010 · 1 min · Øyvind Isene

Someone trying to outperform Oracle's cache

The following code is from a migration project I’m working on. It is part of a package named PERFORMANCE and is run every 15 minutes: Declare test number; Cursor c_worklist Is select * from v_worklist where id = v_id; Begin FOR rec IN c_worklist LOOP test := 0; -- does nothing END LOOP; end; A nice little wtf-snippet. The purpose? According to “the vendor” the cursor that loops through every row in a view is supposed to keep the data in Oracle’s cache, and if not in place some web service will time out. I believe we have better tools to keep stuff in cache.

May 8, 2010 · 1 min · Øyvind Isene

Collatz conjecture in PL/SQL

A simple implementation of Collatz conjecture in PL/SQL: create or replace type int_tab_typ is table of integer; / create or replace function collatz(p_n in integer) RETURN int_tab_typ PIPELINED as n integer; BEGIN if p_n < 1 or mod(p_n,1)>0 then RETURN ; end if; n:=p_n; while n > 1 loop pipe row (n); if mod(n,2)=1 then n:=3*n+1; else n:=n / 2; end if; end loop; pipe row(n); end; / select * from table(collatz(101)); More on Collatz Conjecture (Wikipedia). ...

March 27, 2010 · 1 min · Øyvind Isene

Using trace to find wallet location

Not talking about a lost wallet with money, but the wallet used for encryption in the Oracle database and with encrypted backup. A wallet is used for storing keys used to encrypt/decrypt data to/from the database, as with Transparent Data Encryption. The documentation on Advanced Security says that Oracle searches the parameter ENCRYPTION_WALLET_LOCATION in sqlnet.ora, or if not found it searches for WALLET_LOCATION in the same file. If none of them are given it searches in the default location of the wallet for the database. I found different references to where this default location is, depending on underlying OS and version. After a few rounds of trial and error (always receiving ORA-28368) I gave up and resorted to tracing my process: ...

March 6, 2010 · 2 min · Øyvind Isene

Database triggers are evil

If you have a lousy database model, you can get around it with triggers. If you need to hide some business logic from everybody else, you can do it with triggers. If you need a mechanism that bypass the consistency in the database, you can do it with triggers. They live a life on their own, seemingly autonomous from everything else and one easily forgets they exist. That is why I hate them. What matters if you do an database export in consistent mode if some active triggers make the data inconsistent during import? Triggers are like secret police, they are threat to the democracy if they take over. ...

January 29, 2010 · 1 min · Øyvind Isene

Changing character set in database

If your database is using anything else than UTF8 as database character set you may consider to migrate from it. Oracle states in the Globalization Guide (10gR2): At the top of the list of character sets Oracle recommends for all new system deployment is the Unicode character set AL32UTF8. Depending on what characters you actually have in your database you have three options on how to do this: Changing the character set with the package CSALTER. Only data dictionary is migrated. ...

January 25, 2010 · 3 min · Øyvind Isene

RMAN Convert database and ORA-7445

Using the CONVERT command in RMAN can be an efficient way to migrate a database from one OS to another, if they have the same endian. We migrated 9 databases on 10.2.0.4 from HP-UX (on Itanium) to AIX. The databases where distributed on three servers with not exactly the same hardware configuration. On one of the servers we encountered an error described in bug 888530 on Metalink or My Oracle Support. The process terminated prematurely with ORA-7445 when converting an undo tablespace. The other tablespaces were migrated fine, but the undo tablespace ended up with a missing datafile. After the error occurred the RMAN session was left hanging and after killing it the migrated datafile belonging to undo was removed; may be that had something to do with the file system being NFS mounted. Anyway, our solution was to create another undo tablespace and change the undo_tablespace parameter, and then dropping the corrupted one. In one of the tests we did, we managed to do recovery on the migrated undo tablespace, but some funny error messages showed up in the alert log, probably because it was not finally migrated to the new platform. Meaning, if you get this error, create a new tablespace for undo and drop the old one.

November 9, 2009 · 1 min · Øyvind Isene

Manually add a host target to Grid Control

Case: I wanted to reinstall the Enterprise Manager agent on a host. I went on to delete the host in the list of targets in EM. Then after a new installation and synchronization I somehow managed to push the list of targets from GC to the agent and thereby removing the host as a target in the local targets.xml file. Result: The monitored host did never show up in the target list of hosts even after a successful installation of the agent. ...

October 11, 2009 · 1 min · Øyvind Isene

AIX and large pages

I’ll probably need this in the not-so-distant future. Here is the link to Noon’s write-up when I need it. His blog is recommended, by the way.

June 2, 2009 · 1 min · Øyvind Isene

Passed the OCP exam

Friday I passed the OCP exam (1Z0-043). In two months I have studied for, and taken three tests in order to achieve OCP certification. Before I started on this in January I had noe previous experience with Prometric testing or certification at all. But I knew I had read a post about it earlier and started looking up an old post by Chen Shapira about how she prepared for the OCA exam . I ordered the same book as well as another book for the test that was added as an extra requirement for the OCA level December last year. I more or less made the same experience that she did, in my words: ...

March 8, 2009 · 4 min · Øyvind Isene