Tags

, , , , , ,

Often we encounter problems installing the Oracle 10g or 11g Express Edition on Linux (usually Ubuntu), and we need to remove the entire installation to try to re-install again.

Below is a Script to clean Up the Oracle XE on your machine, simply copy and paste into your command prompt with SUDO user to have the necessary permissions to run the commands.

Below are some of the errors that commonly occur when installing Oracle:

Error 1:

ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist

Error 2:

Error uninstalling the Synaptic

Error 3:

Starting Oracle Database 10g Express Edition Instance.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 2: No such file or directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=cataserver)(PORT=1521)))
TNS-12545: Connect failed because target host or object does not exist
TNS-12560: TNS:protocol adapter error
TNS-00515: Connect failed because target host or object does not exist

Below is the script to solve all your problems:

sudo dpkg -r oracle-xe-universal
sudo dpkg -r oracle-xe
sudo dpkg -r oracle-xe:i386

sudo dpkg –purge oracle-xe-universal
sudo dpkg –purge oracle-xe
sudo dpkg –purge oracle-xe:i386

sudo rm -rf /usr/lib/oracle/xe
sudo rm -rf /etc/oratab
sudo rm -rf /etc/init.d/oracle-xe
sudo rm -rf /etc/sysconfig/oracle-xe

cd /
sudo rm -rf ./usr/lib/openoffice/program/openintro_ubuntu_oracle.bmp
sudo rm -rf ./usr/lib/openoffice/program/openabout_ubuntu_oracle.bmp
sudo rm -rf ./usr/lib/oracle
sudo rm -rf ./tmp/.oracle
sudo rm -rf ./etc/rc6.d/K20oracle-xe
sudo rm -rf ./etc/rc0.d/K20oracle-xe
sudo rm -rf ./etc/rc2.d/S20oracle-xe
sudo rm -rf ./etc/rc3.d/S20oracle-xe
sudo rm -rf ./etc/default/oracle-xe
sudo rm -rf ./etc/rc4.d/S20oracle-xe
sudo rm -rf ./etc/xdg/menus/oraclexe.menu
sudo rm -rf ./etc/rc1.d/K20oracle-xe
sudo rm -rf ./etc/rc5.d/S20oracle-xe
sudo rm -rf ./var/tmp/.oracle
sudo rm -rf ./var/lib/update-rc.d/oracle-xe
sudo rm -rf ./var/lib/dpkg/info/oracle-xe-universal.postrm
sudo rm -rf ./var/lib/dpkg/info/oracle-xe-universal.list

sudo rm -rf /usr/lib/oracle/xe
sudo rm -rf /etc/oratab
sudo rm -rf /etc/init.d/oracle-xe
sudo rm -rf /etc/sysconfig/oracle-xe

cd /
sudo rm -rf ./usr/lib/openoffice/program/openintro_ubuntu_oracle.bmp
sudo rm -rf ./usr/lib/openoffice/program/openabout_ubuntu_oracle.bmp
sudo rm -rf ./usr/lib/oracle
sudo rm -rf ./tmp/.oracle
sudo rm -rf ./etc/rc6.d/K20oracle-xe
sudo rm -rf ./etc/rc0.d/K20oracle-xe
sudo rm -rf ./etc/rc2.d/S20oracle-xe
sudo rm -rf ./etc/rc3.d/S20oracle-xe
sudo rm -rf ./etc/default/oracle-xe
sudo rm -rf ./etc/rc4.d/S20oracle-xe
sudo rm -rf ./etc/xdg/menus/oraclexe.menu
sudo rm -rf ./etc/rc1.d/K20oracle-xe
sudo rm -rf ./etc/rc5.d/S20oracle-xe
sudo rm -rf ./var/tmp/.oracle
sudo rm -rf ./var/lib/update-rc.d/oracle-xe
sudo rm -rf ./var/lib/dpkg/info/oracle-xe-universal.postrm
sudo rm -rf ./var/lib/dpkg/info/oracle-xe-universal.list

sudo rm -rf ./root/.sqldeveloper/system1.5.5.59.69/oracle.javatools.cache
sudo rm -rf ./usr/share/vim/vim72/syntax/sqloracle.vim
sudo rm -rf ./var/lib/dpkg/info/oracle-xe.list
sudo rm -rf ./var/lib/dpkg/info/oracle-xe.postrm

sudo rm -rf ./etc/rc3.d/S20oracle-xe
sudo rm -rf ./etc/rc4.d/S20oracle-xe
sudo rm -rf ./etc/rc0.d/K20oracle-xe
sudo rm -rf ./etc/rc5.d/S20oracle-xe
sudo rm -rf ./etc/rc6.d/K20oracle-xe
sudo rm -rf ./etc/rc1.d/K20oracle-xe
sudo rm -rf ./etc/init.d/oracle-xe
sudo rm -rf ./etc/rc2.d/S20oracle-xe
sudo rm -rf ./etc/default/oracle-xe
sudo rm -rf ./etc/xdg/menus/oraclexe.menu

sudo rm -rf ./usr/lib/oracle
sudo rm -rf ./usr/lib/oracle/xe/app/oracle
sudo rm -rf ./var/tmp/.oracle
sudo rm -rf ./var/lib/dpkg/info/oracle-xe.list
sudo rm -rf ./var/lib/dpkg/info/oracle-xe.postrm
sudo rm -rf ./var/lib/update-rc.d/oracle-xe

sudo -s
/etc/init.d/oracle-xe stop
ps -ef | grep oracle | grep -v grep | awk ‘{print $2}’ | xargs kill
dpkg –purge oracle-xe
rm -r /u01
rm /etc/default/oracle-xe
update-rc.d -f oracle-xe remove

 

Hugs and to the Next

/:-D