Friday, June 3, 2011

How to get description of all tables in database

set feedback off
set verify off
set echo off
prompt This script is to get description of all tables excluding some schemas.
set termout off
set pages 500
set heading off
set linesize 150
spool table_definition.sql
select 'spool table_def_output.log;' from dual;
select 'DESC ' || A.OWNER ||'.'||A.TABLE_NAME DESC_SCRIPT from dba_tables a where
OWNER NOT IN ('SYS','SYSTEM','SYSMAN','MGMT_VIEW','TSMSYS','WMSYS','EXP_DBA','OUTLN','ORACLE_OCM','DBSNMP', 'MDSYS','EXFSYS', 'CTXSYS', 'OLAPSYS');
select 'exit;' from dual;
set termout on
prompt Running Script now to get description
set termout off
@table_definition.sql;
exit

Save it in a file and run that file.
Following is the sample output of above script in my test database.

C:\Documents and Settings\User>sqlplus arju/a

SQL*Plus: Release 10.2.0.3.0 - Production on Fri Jun 3 21:53:55 2011

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


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

SQL> set feedback off
SQL> set verify off
SQL> set echo off
SQL> prompt This script is to get description of all tables excluding some schemas.
This script is to get description of all tables excluding some schemas.
SQL> set termout off
SQL> set pages 500
SQL> set heading off
SQL> set linesize 150
SQL> spool table_definition.sql
SQL> select 'spool table_def_output.log;' from dual;

spool table_def_output.log;
SQL> select 'DESC ' || A.OWNER ||'.'||A.TABLE_NAME DESC_SCRIPT from dba_tables a where
  2  OWNER NOT IN ('SYS','SYSTEM','SYSMAN','MGMT_VIEW','TSMSYS','WMSYS','EXP_DBA','OUTLN','ORACLE_OCM','DBSNMP', 'MD

DESC DMSYS.DM$P_MODEL
DESC DMSYS.DM$P_MODEL_TABLES
DESC XDB.XDB$ROOT_INFO
DESC XDB.XDB$H_INDEX
DESC XDB.XDB$COLUMN_INFO
DESC XDB.XDB$PATH_INDEX_PARAMS
DESC XDB.XDB$NMSPC_ID
DESC XDB.XDB$QNAME_ID
DESC XDB.XDB$PATH_ID
DESC XDB.XDB$CHECKOUTS
DESC XDB.XDB$DXPTAB
DESC XDB.XDB$DXPATH
DESC XDB.MIGR9202STATUS
DESC ORDSYS.SI_IMAGE_FORMATS_TAB
DESC ORDSYS.SI_FEATURES_TAB
DESC ORDSYS.SI_VALUES_TAB
DESC ORDSYS.ORD_CARTRIDGE_COMPONENTS
DESC JULIA.BONUS
DESC JULIA.SALGRADE
DESC JULIA.DUMMY
DESC JULIA.INSTRUCTOR
DESC JULIA.GRADE
DESC JULIA.GRADE_TYPE
DESC JULIA.GRADE_CONVERSION
DESC JULIA.GRADE_TYPE_WEIGHT
DESC JULIA.SECTION
DESC JULIA.COURSE
DESC JULIA.ENROLLMENT
DESC JULIA.STUDENT
DESC JULIA.ZIPCODE
DESC ARJU.T
DESC ARJU.PRODUCT
DESC ARJU.COMPOSER_DETAILS
DESC ARJU.MUSIC
DESC A.MM_MOVIE_TYPE
DESC A.MM_PAY_TYPE
DESC A.MM_MEMBER
DESC A.MM_MOVIE
DESC A.MM_RENTAL
DESC ARJU.MM_MOVIE_TYPE
DESC ARJU.MM_PAY_TYPE
DESC ARJU.MM_MEMBER
DESC ARJU.MM_MOVIE
DESC ARJU.MM_RENTAL
DESC SCOTT.DEPT
DESC SCOTT.EMP
DESC SCOTT.BONUS
DESC SCOTT.SALGRADE
DESC ARJU.REL_MODULE
DESC ARJU.REL_COMPLEXASSEMBLY
DESC ARJU.REL_BASEASSEMBLY
DESC ARJU.REL_COMPOSITEPART
DESC HR.EMPLOYEES
DESC HR.JOB_HISTORY
DESC OE.CUSTOMERS
DESC OE.INVENTORIES
DESC OE.PRODUCT_INFORMATION
DESC OE.PRODUCT_DESCRIPTIONS
DESC ARJU.SOLOIST_DETAILS
DESC OE.SYS_IOT_OVER_52539
DESC OE.SYS_IOT_OVER_52544
DESC OE.PRODUCT_REF_LIST_NESTEDTAB
DESC OE.SUBCATEGORY_REF_LIST_NESTEDTAB
DESC OO7SUBDB.REL_COMPLEXASSEMBLY
DESC B.REL_MODULE
DESC B.REL_MODULE_COMPOSITEPARTS
DESC OO7SUBDB.REL_MODULE
DESC ARJU.PAYMENT_INFO
DESC OO7SUBDB.REL_BASEASSEMBLY
DESC OO7SUBDB.REL_COMPOSITEPART
DESC OO7SUBDB.REL_COMPONENTSSHAR
DESC B.REL_COMPLEXASSEMBLY
DESC B.REL_COMPLEXASSEMBLY_CPARTS
DESC B.REL_BASEASSEMBLY
DESC B.REL_BASEASSEMBLY_CPARTS
DESC JULIA.EMP
DESC JULIA.DEPT
DESC JULIA.TEST1
DESC JULIA.TEST2
DESC AR.STUDENT
DESC TE.STUDENT
DESC A.EMPLOYEE
DESC A.SALE
DESC JULIA.EMPLOYEE
DESC JULIA.TEST
DESC JULIA.TESTZIP
DESC ARJU.S_DEPT
DESC ARJU.S_EMP
DESC ARJU.S_ITEM
DESC ARJU.PRECIOUS_METAL_PRICE
DESC ARJU.METALS
DESC MUDDY.MV_DBA_CLIENTS
DESC MUDDY.T
DESC MUDDY.DBA_CLIENTS
DESC E.MM_MOVIE_TYPE
DESC E.MM_PAY_TYPE
DESC E.MM_MEMBER
DESC E.MM_MOVIE
DESC E.MM_RENTAL
DESC ARJU.PAYMENT_INFORMATION
DESC B.STAR
DESC B.STAR_MOVIE
DESC C.REL_MODULE
DESC C.REL_MODULE_COMPOSITEPARTS
DESC C.REL_COMPLEXASSEMBLY
DESC C.REL_COMPLEXASSEMBLY_CPARTS
DESC C.REL_BASEASSEMBLY
DESC C.REL_BASEASSEMBLY_CPARTS
DESC C.REL_COMPOSITEPART
DESC C.REL_COMPOSITEPARTS
DESC ARJU.DAS_EXCEPTIONS
DESC ARJU.DAS_LOGON_TRAIL
DESC MUDDY.CLIENT
DESC MUDDY.COURSE
DESC MUDDY.COURSE_ACTIVITY
DESC MUDDY.CORP_EXTRACT1
DESC MUDDY.CORP_EXTRACT2
DESC ARJU.CLIENT
DESC ARJU.CONTRACT_MANAGER
DESC ARJU.STAFF_MEMBER
DESC JULIA.LOB_TAB
DESC ARJU.CUSTORDTOT_TEMP
DESC ARJU.CUSTORD_TEMP
DESC ARJU.G_DEPT
DESC SH.SALES_TRANSACTIONS_EXT
DESC SH.DR$SUP_TEXT_IDX$N
DESC SH.DR$SUP_TEXT_IDX$K
DESC SH.COSTS
DESC SH.SALES
DESC IX.AQ$_STREAMS_QUEUE_TABLE_C
DESC IX.AQ$_STREAMS_QUEUE_TABLE_I
DESC IX.AQ$_STREAMS_QUEUE_TABLE_G
DESC IX.AQ$_STREAMS_QUEUE_TABLE_H
DESC IX.AQ$_STREAMS_QUEUE_TABLE_T
DESC IX.AQ$_ORDERS_QUEUETABLE_I
DESC IX.AQ$_ORDERS_QUEUETABLE_G
DESC IX.AQ$_ORDERS_QUEUETABLE_H
DESC IX.AQ$_ORDERS_QUEUETABLE_T
DESC HR.COUNTRIES
DESC SH.MVIEW$_EXCEPTIONS
DESC IX.AQ$_STREAMS_QUEUE_TABLE_S
DESC PM.ONLINE_MEDIA
DESC SH.TIMES
DESC SH.PRODUCTS
DESC SH.FWEEK_PSCAT_SALES_MV
DESC SH.CHANNELS
DESC PM.PRINT_MEDIA
DESC SH.SUPPLEMENTARY_DEMOGRAPHICS
DESC IX.AQ$_ORDERS_QUEUETABLE_S
DESC SH.COUNTRIES
DESC OE.PROMOTIONS
DESC IX.ORDERS_QUEUETABLE
DESC OE.WAREHOUSES
DESC SH.DR$SUP_TEXT_IDX$R
DESC HR.LOCATIONS
DESC SH.CAL_MONTH_SALES_MV
DESC HR.REGIONS
DESC OE.ORDERS
DESC HR.JOBS
DESC IX.SYS_IOT_OVER_52134
DESC SH.CUSTOMERS
DESC IX.STREAMS_QUEUE_TABLE
DESC SH.PROMOTIONS
DESC HR.DEPARTMENTS
DESC IX.SYS_IOT_OVER_52117
DESC OE.ORDER_ITEMS
DESC SH.DR$SUP_TEXT_IDX$I
SQL> select 'exit;' from dual;

exit;
SQL> set termout on
SQL> prompt Running Script now to get description
Running Script now to get description
SQL> set termout off
SQL> @table_definition.sql;
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options

Failed to create a peer profile for Oracle Cluster GPnP. gpnptool rc=256

Problem Description
During the installation of Oracle Grid Infrastructure on Linux, while running root.sh it fails with error. From the logfile we see the following error./u01/app/11.2.0/grid/cfgtoollogs/crsconfig/rootcrs_vis.log:
[root@rac1 grid]# ./root.sh 
Running Oracle 11g root.sh script... 

The following environment variables are set as: 
ORACLE_OWNER= oracle 
ORACLE_HOME= /u01/app/11.2.0/grid 

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
Copying dbhome to /usr/local/bin ... 
Copying oraenv to /usr/local/bin ... 
Copying coraenv to /usr/local/bin ... 


Creating /etc/oratab file... 
Entries will be added to the /etc/oratab file as needed by 
Database Configuration Assistant when a database is created 
Finished running generic part of root.sh script. 
Now product-specific root actions will be performed. 
2009-11-17 09:38:12: Parsing the host name 
2009-11-17 09:38:12: Checking for super user privileges 
2009-11-17 09:38:12: User has super user privileges 
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params 
Creating trace directory 
LOCAL ADD MODE 
Creating OCR keys for user 'root', privgrp 'root'.. 
Operation successful. 
root wallet 
root wallet cert 
root cert export 
peer wallet 
profile reader wallet 
pa wallet 
peer wallet keys 
pa wallet keys 
peer cert request 
pa cert request 
peer cert 
pa cert 
peer root cert TP 
profile reader root cert TP 
pa root cert TP 
peer pa cert TP 
pa peer cert TP 
profile reader pa cert TP 
profile reader peer cert TP 
peer user cert 
pa user cert 
Failed to create a peer profile for Oracle Cluster GPnP. gpnptool rc=256 
Creation of Oracle GPnP peer profile failed for linux1 at /u01/app/11.2.0/grid/crs/install/crsconfig_lib.pm line 4138. 

Cause of the Problem
This problem happened if on the host machine Firewall is enabled or Security Enhanced linux(SELinux) is enabled.

Solution of the Problem
Step 01: Login as root user on the node which you have ran root.sh. Check whether SELinux is enabled or not.
You can check by,
# /usr/sbin/sestatus
command.

Step 02: If enabled you need to disable it permanently as well as temporarily unless you want to restart your server. Temporarily disable is very good workaround because you no longer need to restart your OS and also no need to reinstall everything.

Step 03: You can permanently disable SELinux by editing file /etc/selinux/config and set SELINUX =disabled.
# vi /etc/selinux/config
SELINUX=disabled

Temporarily disabled SELinux by setting setenforce to 0.
# /usr/sbin/setenforce 0 (to disable which is permissive, meaning SELinux is running and logging events but not controlling permissions)

If you want to know detail about the procedure have a look at How to disable SELinux.

Step 04: Deconfig crs on the nodes which it is failed.
# $GRID_HOME/crs/install/roothas.pl -delete -force -verbose
In order to know detail information about what to do after failure of Oracle 11gR2 Grid Infrastructure (CRS) Installation have a look at http://arjudba.blogspot.com/2010/03/what-to-do-after-failure-of-oracle.html.

Step 05: Run root.sh again.
[root@rac1 grid]# ./root.sh

Wednesday, June 1, 2011

How to disable SELinux

Before going to directly disabling SELinux let's have an idea about what SELinux is. SELinux indicates Security Enhanced Linux which is a security patch applied to Linux kernel. When it is enabled in the kernel it follows some principle of least privilege. It is an implementation of mandatory access control using Linux Security Modules.

In fact, SELinux is a set of patches to the Linux kernel and some utilities to incorporate a strong, flexible mandatory access control (MAC) architecture into the major subsystems of the kernel. It provides a mechanism to enforce the separation of information based on confidentiality and integrity requirements, which allows threats of tampering and bypassing of application security mechanisms to be addressed and enables the confinement of damage that can be caused by malicious or flawed applications. It includes a set of sample security policy configuration files designed to meet common, general-purpose security goals.

Though it is incorporated for strong security control still we need to disable it for some application specially to install Oracle software.

How to know whether SELinux is enabled or disabled
You can easily determine whether SELinux is enabled or disabled by using "sestatus" command which resides under /usr/bin

For example:

$ /usr/sbin/sestatus
SELinux status: disabled

How to disable SELinux Temporarily or Permanently
There is two kinds of disabling offered by SELinux.

1) Permissive - switch the SELinux kernel into a mode where every operation is allowed. Operations that would be denied are allowed and a message is logged identifying that it would be denied. The mechanism that defines labels for files which are being created/changed is still active.

2) Disabled - SELinux is completely switched off in the kernel. This allows all operations to be permitted, and also disables the process which decides what to label files & processes with.

If it is enabled then it is in enforcing mode which means security is enforced by SELinux.

Way 01:
You can temporarily switch off the SELinux by following command.
# echo 0 >/selinux/enforce
In order to switch back into enforcing mode:
# echo 1 >/selinux/enforce

If you have SELinux enabled then you can issue,
# cat /selinux/enforce
in order to check in which mode your system is in.

Way 02:
You can also enable or disable SELinux by passing kernel boot parameters. You need to open your booting configuration file for example grub.conf (menu.lst) or lilo.conf and append parameter selinux=0:

Following is an example from my sample grub.conf file.
title Debian GNU/Linux, kernel 2.6.13-web100 Default
root (hd0,0)
kernel /boot/vmlinuz-2.6.13-web100 root=/dev/hdb1 ro selinux=0
initrd /boot/initrd.img-2.6.13-web100
savedefault
boot
Once you edit, save the file and reboot Linux system.

Way 03:
If you are using Fedora Core or RedHat Enterprise Linux then edit /etc/selinux/config and change the SELINUX line to SELINUX=disabled
# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted

In order to change SELinux option permanently into permissive mode then change SELINUX to permissive. Note that, changing to this file will only affect once you reboot the machine and this changing is persistence.

Way 04:
In order to toggle between enable and disable of SELinux option in runtime issue:

# /usr/sbin/setenforce 0 (to disable which is permissive, meaning SELinux is running and logging events but not controlling permissions)
# /usr/sbin/setenforce 1 (to enable which is enforcing, meaning SELinux is running and enforcing policy.)

Note that, this options only allow you to disable selinux from running system but after reboot it will activate again.

Way 05:
Another way to permanently disable SELinux is to disable it from config file /etc/sysconfig/selinux

Open the file with any editor and change SELINUX to disabled.
SELINUX=disabled

How to recover your deleted facebook page

If you come through this page then I guess you have created your facebook fan page. Collected a lots of fans for your page and designed your fanpage. Design may be from simple to some complex one. I designed one in scubanation. But unfortunately your page disabled now and you want to get it back. Also, it might be due to an accidental deletion, hacker attack, or any other reasons. This problem is happening day by day to many peoples. Following are the step by step instructions about what to do when your facebook account is deleted or disabled.

1. If your facebook page is disabled due to possible facebook terms then you can use this disable form to appeal. Most of the time if facebook bots disable or delete a page due to false positive then applying might reinstate your page.

2. If you have accidentally deleted your facebook page then you should often bug page form in order to reinstate your page. For the link you can supply necessary information like Subject, Page Name, Web address (URL) of Page, Description of the issue you are encountering and
Screen shot of Issue. So, you should always remember your page url as well as page name so that you can proceed further.

3. There is a facebook discussion page through which you can get notice of your problem.

Last of all, remember to read the facebook terms and condition before dealing with page.

Tuesday, May 31, 2011

Today is Abasa's first birthday

Today Abasa has became 1 year old. Many one tell him little Arju. I feel sorry for him as I am not beside him. I just ringed him and listened his voice. He can speak "Abba, baba, abba, abba, haaa". Really life is busy here and I am not spending my time to take care of Abasa. He turned 1 year on this 1st June. Just 1 year ago I saw him and was beside him in a hospital. He was looking at him with his twinkle eyes. Now, he like to play with my laptop. Laptop is his most favorite toys specially close the laptop and open it again. Anyway, I don't have his 1 year photo but I am uploading here some of his 9, 10, 11 months old photo.













Monday, May 30, 2011

oracleasm createdisk fails with no additional error message

Problem Description
"oracleasm configure" works fine but whenever it is tried to create disk for ASM using createdisk command it fails like below.
# /etc/init.d/oracleasm createdisk VOL1 /dev/sdc1
Creating Oracle ASM disk "VOL1" [FAILED]
Running createdisk with strace show the device /dev/sdc1 is busy
# strace -f /etc/init.d/oracleasm createdisk VOL1 /dev/sdc1
...
19543 open("/dev/sdc1", O_RDWR|O_EXCL) = -1 EBUSY (Device or resource busy)
...
19543 write(2, "Unable to open device \"/dev/sdc1"..., 59 >unfinished ...<
...
19527 write(1, "FAILED", 6) = 6

Cause of the Problem
The device in question (/dev/sdc1) is already mounted on a directory.
# mount | grep sdc1
/dev/sdc1 on /mnt type ext3 (rw)

Solution of the Problem
1. Unmount the device /dev/sdc1 and make sure it is not mounted anymore.
# umount /dev/sdc1
# mount | grep sdc1
2. Retry createdisk:
# /etc/init.d/oracleasm createdisk VOL1 /dev/sdc1
Creating Oracle ASM disk "VOL1" [ OK ]

Sunday, May 29, 2011

Loading module "oracleasm": Unable to load module "oracleasm"[FAILED]

Problem Description
After installing necessary ASMLIB packages whenever it is tried to configure oracleasm it fails with error Loading module "oracleasm": Unable to load module "oracleasm"[FAILED].

First it is downloaded ASMLIB from http://www.oracle.com/technetwork/topics/linux/asmlib/index-101839.html

We check the kernel version by,
# uname -r
2.6.9-11.0.0.10.3.ELsmp
Check the oraclasm packages version by,
# ls -l oracleasm*
-rw-r--r-- 1 root root 78232 May 29 22:09 oracleasm-2.6.9-11.ELsmp-2.0.0-1.i686.rpm
-rw-r--r-- 1 root root 12785 May 29 22:08 oracleasmlib-2.0.0-1.i386.rpm
-rw-r--r-- 1 root root 21345 May 29 22:08 oracleasm-support-2.0.0-1.i386.rpm
Install the ASMLIB packages by,
# rpm -ivh oracleasm-2.6.9-11.ELsmp-2.0.0-1.i686.rpm \
oracleasmlib-2.0.0-1.i386.rpm \
oracleasm-support-2.0.0-1.i386.rpm

Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [ 33%]
2:oracleasm-2.6.9-11.ELsm########################################### [ 67%]
3:oracleasmlib ########################################### [100%]
Configure the ASMLIB with kernel by,
# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting  without typing an
answer will keep that current value. Ctrl-C will abort.

Default user to own the driver interface [oracle]: oracle
Default group to own the driver interface [dba]: dba
Start Oracle ASM library driver on boot (y/n) [y]: y
Fix permissions of Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: [ OK ]
Loading module "oracleasm": Unable to load module "oracleasm" [FAILED]
Configuration fails, similarly starts also fail.
# /etc/init.d/oracleasm start
Loading module "oracleasm": Unable to load module "oracleasm" [FAILED]

The /var/log/messages file shows the following:

May 29 23:01:24 rac1 oracleasm: succeeded
May 29 23:01:24 rac1 modprobe: FATAL: Module oracleasm not found.
May 29 23:01:24 rac1 oracleasm: Unable failed

Cause of the Problem
The problem happened as kernel version does not match with the oracleasm packages that is installed on the machine. If incorrect ASMLIB RPMs were installed this is common problem.
We see here kernel version is,

2.6.9-11.0.0.10.3.ELsmp

And the oracleasm packages installed is,
2.6.9-11.ELsmp
which does not match with kernel and hence the load fails.

The ASM package is compiled for a specific kernel version and does only install for this kernel version. The package name contains the kernel information and the numbers following "oracleasm" specify the kernel version.

Solution of the Problem
You need to install same version of oracleasm as of kernel. If you don't find equivalent version of oracleasm software as of kernel then you can either downgrade or upgrade kernel so that it match with ASMLIB packages.

If you have installed wrong version of RPMS then do the following:
1) Remove the current RPMS.

# rpm -e oracleasm-2.6.9-11.ELsmp-2.0.0-1.i686.rpm
# rpm -e oracleasmlib-2.0.0-1.i386.rpm
# rpm -e oracleasm-support-2.0.0-1.i386.rpm

2) Download the correct ASMLIB RPMS from http://www.oracle.com/technetwork/topics/linux/asmlib/index-101839.html and install it in your host.

3) Configure oracleasm.

Backup controlfile to trace fails with ORA-600 [2662]

Problem Description
Backup controlfile to trace fails with ora-600[2662].
alter database backup controlfile to trace
Completed: alter database backup controlfile to trace
Thu Jan  12 03:14:21 2011
Errors in file /u01/oracle/admin/DBA/udump/dba_ora_3210.trc:
ORA-00600: [2662], [1502], [3257769387], [1502], [3304221570], [100663298], [], []
From the Oracle trace file we see the following information.
ORA-00600: internal error code, arguments: [2662], [1502], [3257769387], [1502], [3304221570], [100663298], [], []
Current SQL statement for this session:
alter database backup controlfile to trace
----- Call Stack Trace -----               
ksedmp kgeriv kgesiv ksesic5 kcsgbsn kcrfwr kcbchg1 kcbchg ktucmt ktcrcm 

The problem started whenever it is performed select queries or 'alter database backup controlfile to trace' command since restoring the backup. This happens when reuse of tempfile is performed after the recovery.

The following steps will reproduce the problem.

1. Create a TEMP tablespace.
2. Shutdown a database.
3. Copy control file, data files, and log files to another directory (but not tempfile).
4. Restart a database.
5. Create a temporary table and insert into it, thereby causing tempfile to be updated.
6. Shutdown a database.
7. Restore a database.
8. Restart a database.
9. Create a temporary table and insert into it.
10. Commit - causes 2662.

Cause of the Problem
This problem is identified as Oracle bug 2216823. Whenever recovery is performed without temp file backup, this bug fires.

Solution of the Problem
The workaround is not to use the pre-existing tempfile, instead either backup the tempfile with rest of the db or recreate a new tempfile.

This bug is fixed in Oracle 10g.