Uninstalling Oracle perfectly in Linux

Source: Internet
Author: User

First, what will happen if Oracle is not uninstalled and then installed in Linux? In a production environment installation, an error occurs during Oracle installation, which leads to oracle Installation failure, ignore the previous installation and reinstall oracle again. The normal installation is complete and the serverS is normal. When the application starts, the restart El will automatically restart in half an hour, it took me a whole week. It is too painful. I hope you will pay attention not to make such mistakes at work.

1. log on with an oracle user
If you want to install it again, you 'd better back up the data first.
The script includes the user's login script, the script for automatic database startup and shutdown, and the script for automatic Listener startup.
If it is possible to save the script for creating a database

2. Use SQL * PLUS to stop a database
[Oracle @ ora920 oracle] $ sqlplus/nolog
SQL> connect/as sysdba
SQL> shutdown [immediate]
SQL> exit

3. Stop Listener
[Oracle @ ora920 oracle] $ lsnrctl stop

4. Stop the HTTP service
[Oracle @ ora920 oracle] $ ORACLE_HOME/Apache/bin/apachectl stop

5. Use su or log on to the root again (if you want to reinstall it, You can retain the oracle user, saving you the need to enter environment variables)

6. Delete the installation directory
[Root @ ora920/root] # rm-rf/opt/oracle/

7. delete files under/usr/bin
[Root @ ora920/root] # rm/usr/bin/dbhome
[Root @ ora920/root] # rm/usr/bin/oraenv
[Root @ ora920/root] # rm/usr/bin/coraenv

10 Gb in the following directory:

1. rm-f/etc/oraInst. loc/etc/oratab
2. rm-rf/etc/oracle
3. rm-f/usr/local/bin/coraenv/usr/local/bin/dbhome/usr/local/bin/oraenv

8.

Delete/etc/oratab
[Root @ ora920/root] # rm/etc/oratab

9. delete/etc/oraInst. loc
[Root @ ora920/root] # rm/etc/oraInst. loc

10. Delete the oracle user (to reinstall, do not delete it)
[Root @ ora920/root] # userdel-r oracle

11. Delete the user group (to reinstall it, Do not delete it)
[Root @ ora920/root] # groupdel oinstall
[Root @ ora920/root] # groupdel dba

12. Delete the startup Service
[Root @ ora920/root] # chkconfig -- del dbora

How to delete Oracle 10g software after installation failure
./RunInstall --> deinstall --> All Oracle 10g software --> remove
Rm-rf/opt/oracle/app/*/opt/oracle/ocfs2/*/usr/local/bin/dbhome/usr/local/bin/oraenv
Rm-rf/etc/ora */opt/oracle/oraInventory // opt/oracle/admin/opt/oracle/crs/tmp/*/etc/init. d/init *
Delete ASM Disk
Run
/Etc/init. d/oracleasm deletedisk VOL1
/Etc/init. d/oracleasm deletedisk VOL2
/Etc/init. d/oracleasm deletedisk VOL3
Re-create an ASM Disk
Run
/Etc/init. d/oracleasm createdisk VOL1/dev/sda2
/Etc/init. d/oracleasm createdisk VOL2/dev/sda3
/Etc/init. d/oracleasm createdisk VOL3/dev/sda4
/Etc/init. d/oracleasm listdisks
Then execute
/Etc/init. d/oracleasm scandisks
/Etc/init. d/oracleasm listdisks
Reformat the OCFS2 Partition
Mkfs. ocfs2-B 4 k-C 32 k-N 2-L ocfs2/dev/sda1
Reboot

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.