How to delete the Oracle database on Linux manually and cleanly

Source: Internet
Author: User

Recent database experiments with VMware virtual machines for Oracle. As we all know on Windows, I was able to go to the delete program to take the initiative to delete all of the installed applications. However, there is no such service on Linux that can be deleted on its own initiative. The attempt was made to delete the Oracle database.

Detailed procedures such as the following:

1, first check the oracle_sid,oracle_home. Oracle_base's information:

[Email protected] dbs]$ echo $ORACLE _sid
PROD
[Email protected] dbs]$ echo $ORACLE _home
/u01/app/oracle/product/10.2.0/db_1
[Email protected] dbs]$ echo $ORACLE _base
/u01/app/oracle

2. Go to the Oracle_base folder to delete the associated folder where Oracle database information is installed:

The following Admin,flash_recovery_area,fra,oradata folder is the corresponding folder after the Oracle database is installed, we can all delete it. The product folder is the setup file for the Oracle database and cannot be deleted. We need this installation file to install the database, which is equivalent to the executable file that installs Oracle's EXE under the Windows system.

[Email protected] ~]$ CD $ORACLE _base
[email protected] oracle]$ LL
Total 20
Drwxr-x---3 oracle oinstall 4096 Jul 18:12 admin
Drwxr-xr-x 3 Oracle Oinstall 4096 Nov 19:34 Flash_recovery_area
Drwxr-xr-x 2 Oracle Oinstall 4096 Nov 18:11 FRA
Drwxr-xr-x 3 Oracle Oinstall 4096 Nov 18:51 oradata
DRWXRWX---3 oracle oinstall 4096 Mar product


[[email protected] oracle]$ RM-RF admin

[Email protected] oracle]$ RM-RF Flash_recovery_area FRA

[Email protected] oracle]$ RM-RF oradata

3, because I have this server deployed a grid control agent10g, so I also need to remove the agent10g folder.

[Email protected] oracle]$ CD product/
[email protected] product]$ LL
Total 4
DRWXRWX---4 oracle oinstall 4096 Nov 17 23:35 10.2.0
[Email protected] product]$ CD 10.2.0/
[email protected] 10.2.0]$ LL
Total 8
Drwxr-xr-x Oracle Oinstall 4096 Nov 19:41 agent10g
Drwxr-x---oracle oinstall 4096 Nov 18:13 db_1
[Email protected] 10.2.0]$ pwd
/u01/app/oracle/product/10.2.0
[Email protected] 10.2.0]$ RM-RF agent10g/

4. Until now, the data files associated with Oracle have been deleted.
[email protected] 10.2.0]$ LL
Total 4
Drwxr-x---oracle oinstall 4096 Nov 18:13 db_1

5, we delete the parameter files of the Oracle database, password files and snapshot files

[Email protected] db_1]$ CD $ORACLE _home/dbs
[email protected] dbs]$ LL
Total 6956
-RW-RW----1 Oracle oinstall 1544 Nov 18:58 Hc_prod.dat
-RW-R-----1 Oracle Oinstall 12920 May 3 2001 Initdw.ora
-RW-R-----1 Oracle Oinstall 8385 SEP one 1998 Init.ora
-rw-r--r--1 Oracle Oinstall 318 Nov 18:57 Initprod.ora
-RW-RW----1 Oracle oinstall 18:59 Lkprod
-RW-R-----1 Oracle Oinstall 1536 Nov 23:59 Orapwprod
-RW-R-----1 Oracle oinstall 7061504 Nov 22:30 SNAPCF_PROD.F
-RW-R-----1 Oracle oinstall 2560 Nov 19:35 Spfileprod.ora
[Email protected] dbs]$


[Email protected] ~]$ CD $ORACLE _home/dbs
[email protected] dbs]$ LL
Total 6956
-RW-RW----1 Oracle oinstall 1544 Nov 18:58 Hc_prod.dat
-RW-R-----1 Oracle Oinstall 12920 May 3 2001 Initdw.ora
-RW-R-----1 Oracle Oinstall 8385 SEP one 1998 Init.ora
-rw-r--r--1 Oracle Oinstall 318 Nov 18:57 Initprod.ora
-RW-RW----1 Oracle oinstall 18:59 Lkprod
-RW-R-----1 Oracle Oinstall 1536 Nov 23:59 Orapwprod
-RW-R-----1 Oracle oinstall 7061504 Nov 22:30 SNAPCF_PROD.F
-RW-R-----1 Oracle oinstall 2560 Nov 19:35 Spfileprod.ora
[Email protected] dbs]$ rm-rf hc_prod.dat initprod.ora lkprod orapwprod SNAPCF_PROD.F Spfileprod.ora
[email protected] dbs]$ LL
Total 28
-RW-R-----1 Oracle Oinstall 12920 May 3 2001 Initdw.ora
-RW-R-----1 Oracle Oinstall 8385 SEP one 1998 Init.ora

6. Delete listener files and tnsnames files

[Email protected] admin]$ CD $ORACLE _home/network/admin
[email protected] admin]$ LL
Total 12
-rw-r--r--1 Oracle Oinstall 419 Nov 19:59 Listener.ora
Drwxr-x---2 oracle oinstall 4096 Mar samples
-rw-r--r--1 Oracle Oinstall 541 Nov 19:39 Tnsnames.ora
[Email protected] admin]$ RM-RF Listener.ora Tnsnames.ora
[email protected] admin]$ LL
Total 4
Drwxr-x---2 oracle oinstall 4096 Mar samples

7, you can also check the/etc/oratab/etc/inittab/u01/app/orainventory/contentxml/inventory.xml file to see if there are any superfluous entries (entries) Information to delete or change it.

With the 7 steps above, you can basically remove an Oracle database from Linux.

How to delete the Oracle database on Linux manually and cleanly

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.