I recently used the vmwarevm to perform ORACLE Database experiments. We all know that on WINDOWS, I can add and delete programs to automatically delete all installed applications, however, this service is not available in LINUX for automatic deletion, so I tried to manually delete the ORACLE database. The procedure is as follows:
1. First, check the ORACLE_SID and ORACLE_HOME.ORACLE_BASE information:
[Oracle @ vmoel5u4 dbs] $ echo $ ORACLE_SID
PROD
[Oracle @ vmoel5u4 dbs] $ echo $ ORACLE_HOME
/U01/app/oracle/product/10.2.0/db_1
[Oracle @ vmoel5u4 dbs] $ echo $ ORACLE_BASE
/U01/app/oracle
2. Go to the ORACLE_BASE directory and delete the directories related to ORACLE database installation information:
The following admin, flash_recovery_area, FRA, and oradata directories are all corresponding directories after the ORACLE database is installed. we can delete them all. The product directory is the installation program file of the ORACLE database. This file cannot be deleted. We need this installation file to install the database, this file is equivalent to the executable file for ORACLE Installation in WINDOWS.
[Oracle @ vmoel5u4 ~] $ Cd $ ORACLE_BASE
[Oracle @ vmoel5u4 oracle] $ ll
Total 20
Drwxr-x --- 3 oracle oinstall 4096 Jul 22 admin
Drwxr-xr-x 3 oracle oinstall 4096 Nov 25 flash_recovery_area
Drwxr-xr-x 2 oracle oinstall 4096 Nov 17 FRA
Drwxr-xr-x 3 oracle oinstall 4096 Nov 17 oradata
Drwxrwx --- 3 oracle oinstall 4096 Mar 24 2012 product
[Oracle @ vmoel5u4 oracle] $ rm-rf admin
[Oracle @ vmoel5u4 oracle] $ rm-rf flash_recovery_area FRA
[Oracle @ vmoel5u4 oracle] $ rm-rf oradata
3. Because the agent10g of grid control is deployed on this server, I also need to delete the agent10g directory.
[Oracle @ vmoel5u4 oracle] $ cd product/
[Oracle @ vmoel5u4 product] $ ll
Total 4
Drwxrwx --- 4 oracle oinstall 4096 Nov 17 10.2.0
[Oracle @ vmoel5u4 product] $ cd 10.2.0/
[Oracle @ vmoel5u4 10.2.0] $ ll
Total 8
Drwxr-xr-x 38 oracle oinstall 4096 Nov 25 agent10g
Drwxr-x --- 54 oracle oinstall 4096 Nov 17 db_1
[Oracle @ vmoel5u4 10.2.0] $ pwd
/U01/app/oracle/product/10.2.0
[Oracle @ vmoel5u4 10.2.0] $ rm-rf agent10g/
4. data files related to ORACLE have been deleted so far.
[Oracle @ vmoel5u4 10.2.0] $ ll
Total 4
Drwxr-x --- 54 oracle oinstall 4096 Nov 17 db_1
5. Delete the parameter files, password files, and snapshot files of the ORACLE database.
[Oracle @ vmoel5u4 db_1] $ cd $ ORACLE_HOME/dbs
[Oracle @ vmoel5u4 dbs] $ ll
Total 6956
-Rw ---- 1 oracle oinstall 1544 Nov 17 hc_PROD.dat
-Rw-r ----- 1 oracle oinstall 12920 May 3 2001 initdw. ora
-Rw-r ----- 1 oracle oinstall 8385 Sep 11 1998 init. ora
-Rw-r -- 1 oracle oinstall 318 Nov 17 initPROD. ora
-Rw ---- 1 oracle oinstall 24 Nov 17 18:59 lkPROD
-Rw-r ----- 1 oracle oinstall 1536 Nov 17 orapwPROD
-Rw-r ----- 1 oracle oinstall 7061504 Nov 18 snapcf_PROD.f
-Rw-r ----- 1 oracle oinstall 2560 Nov 25 spfilePROD. ora
[Oracle @ vmoel5u4 dbs] $
[Oracle @ vmoel5u4 ~] $ Cd $ ORACLE_HOME/dbs
[Oracle @ vmoel5u4 dbs] $ ll
Total 6956
-Rw ---- 1 oracle oinstall 1544 Nov 17 hc_PROD.dat
-Rw-r ----- 1 oracle oinstall 12920 May 3 2001 initdw. ora
-Rw-r ----- 1 oracle oinstall 8385 Sep 11 1998 init. ora
-Rw-r -- 1 oracle oinstall 318 Nov 17 initPROD. ora
-Rw ---- 1 oracle oinstall 24 Nov 17 18:59 lkPROD
-Rw-r ----- 1 oracle oinstall 1536 Nov 17 orapwPROD
-Rw-r ----- 1 oracle oinstall 7061504 Nov 18 snapcf_PROD.f
-Rw-r ----- 1 oracle oinstall 2560 Nov 25 spfilePROD. ora
[Oracle @ vmoel5u4 dbs] $ rm-rf hc_PROD.dat initPROD. ora lkPROD orapwPROD snapcf_PROD.f spfilePROD. ora
[Oracle @ vmoel5u4 dbs] $ ll
Total 28
-Rw-r ----- 1 oracle oinstall 12920 May 3 2001 initdw. ora
-Rw-r ----- 1 oracle oinstall 8385 Sep 11 1998 init. ora
6. Delete the LISTENER and TNSNAMES files.
[Oracle @ vmoel5u4 admin] $ cd $ ORACLE_HOME/network/admin
[Oracle @ vmoel5u4 admin] $ ll
Total 12
-Rw-r -- 1 oracle oinstall 419 Nov 25 listener. ora
Drwxr-x --- 2 oracle oinstall 4096 Mar 24 2012 samples
-Rw-r -- 1 oracle oinstall 541 Nov 17 tnsnames. ora
[Oracle @ vmoel5u4 admin] $ rm-rf listener. ora tnsnames. ora
[Oracle @ vmoel5u4 admin] $ ll
Total 4
Drwxr-x --- 2 oracle oinstall 4096 Mar 24 2012 samples
7. Check/etc/oratab/etc/inittab/u01/app/oraInventory/ContentXML/inventory. xml file to see if there are any additional entries (entries) to delete or modify it.
In step 7 above, you can delete an ORACLE database from LINUX.