Installing Oracle 9i, SQLPlus Configuration, Deleting a Database

Oracle 9i Installation

Create the oracle user and account.
Create a .bashrc for the oracle user
If an error message about java threads and occurs and the libstdc++-libc6.1-1.so.2 is mentioned then do this.
# cd /usr/lib
# ln -s libstdc++-libc6.2-2.so.3 libstdc++-libc6.1-1.so.2

Also make sure the fstab file allows users to execute binaries on the filesystem with the exec option. Otherwise you will get permission denied messages when executing runInstaller.

During the installation an error will appear saying "Error invoking target insall of makefile /usr/.../product/ora92/ctx/lib/ins_ctx.mk". Ignore the message.
When installation is complete patch the system with 3095277_9204_LINUX.zip. Extract to tmp.
cd Disk1
./runInstaller
Accept the default values. When you get to the installable products select "Oracle Universial Installer 2.2.0.18.0 !". Then exit once installation is complete.
Patch 9iR2
$ cd $ORACLE_HOME/bin
$ ./runInstaller
When you get to installable products select "Oracle9iR2 Patch Set 3 9.2.0.4.0 !". Then exit installer once complete.
etc.

SQLPlus

Changing the width on a column in sqlplus:
sql>column <column_name> format a<int>
Creating a new database
ORACLE_BASE=/opt/ora92
ORACLE_HOME=/opt/ora92
ORACLE_OWNER=oracle
ORACLE_SID=V902
ORACLE_TERM=xterm

Starting worksheet - $oemapp worksheet
Starting OEM - $oemapp console
If you get an error message from oracle enterprise manager (OEM) with error 01031 and you can't start or shutdown oracle, but you connect to the OEM with your username and you can also start and shutdown an instance using sqlplus.
This means the password the password file is invalid to recreate the password file do the following.
$orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=oracle entries=5. The tnsnames.ora file was correct and the tnsping worked. In my case the oracle sid was a different case.

If you're using sqlplus on linux and you are having problems with control characters download gqlplus from sourceforge and compile. gqlplus.sourceforge.net it works a treat.

Alert Log

/opt/ora92/admin/fun1/bdump/alert_fun1.log

Deleting a Database

1. Delete Database Files
select 'rm -f ' || name from v$controlfile
union
select 'rm -f ' || name from v$datafile
union
select 'rm -f ' || member from v$logfile;

2. Clean Up Output
Clean up above output then make it executable.

3. Remove Directory
If installation follows OFA standard remove the directory $ORACLE_BASE/admin/$ORACLE_SID

4. Delete Archive Direcory
Delete archive log directory (if archive mode)

Directory Size
To get the size of a directory or multiple directories use the following command
$du -csh /home/*
s does a summary for each item

Oracle 9i GUI Console

To get the oracle console oem console working on linux it is necessary to do a couple of things.
1. Configure and the tnsnames.ora file
2. Make sure the listener is running.