Manually uninstall Oracle Database 11gR2 using the command line
There are two ways to uninstall Oracle: one is to automatically uninstall Oracle using DBCA, and the other is to manually uninstall Oracle using commands. The following describes the operation steps of the second method:
1. log on to the database as sysdba
$ Sqlplus/as sysdba
2. Make the database in the mount state
SQL> select open_mode from v $ database;
Check the open_mode status. If it is not "mount", run the following command:
SQL> shutdown immediate;
SQL> startup mount;
3. Enable restricted session Mode
SQL> alter system enable restricted session;
4. delete a database
SQL> drop database;
Note:
1. The database must be closed.
2. The restricted session mode must be enabled for the database.
3. the command line drop database will delete Oracle database files (control, redo, datafile, SPFILE)
4. the backup files of archivelog and rman can be deleted using the rman command.
5. the command line drop database does not delete any data files on raw disk. You need to delete them manually.
6. manually delete instance registration (/etc/oratab)