1 使用SQL*PLUS停止資料庫
1.1 停止執行個體
[oracle@standby1 ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 6月 11 17:53:02 2008
Copyright (c) 1982, 2005, oracle. All rights reserved.
SQL> conn /as sysdba
Connected.
SQL> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
1.2 停止Listener
[oracle@standby1 ~]$ lsnrctl stop
2 刪除檔案(root身份執行)
/app/oracle/product/10.2.1/db_1/bin/localconfig delete
[root@standby1 ~]# /app/oracle/product/10.2.0/db/bin/localconfig delete
/etc/oracle does not exist. Creating it now.
/app/oracle/product/10.2.0/db/bin/localconfig: line 715: /etc/init.d/init.cssd: No such file or directory
(路徑/app/oracle/ 是我的$ORACLE_HOME)
[root@standby1 ~]# rm -rf /app/oracle/*
[root@standby1 ~]# rm -rf /oradata/*
[root@standby1 ~]# rm -f /etc/oraInst.loc /etc/oratab
[root@standby1 ~]# rm -rf /etc/oracle
[root@standby1 ~]# rm -f /etc/inittab.cssd
[root@standby1 ~]# rm -f /usr/local/bin/coraenv /usr/local/bin/dbhome /usr/local/bin/oraenv
(其中/app/oracle是我的$ORACLE_BASE,/oradata/存放了oracle資料。)
3 刪除使用者與使用者組
3.1 刪除oracle使用者(若要重新安裝,可以不刪除)
[root@standby1 ~]# userdel -r oracle
3.2 刪除使用者組 (若要重新安裝,可以不刪除)
[root@standby1 ~]# groupdel oinstall
[root@standby1 ~]# groupdel dba
4 刪除對應的服務
[root@ora920 /root]# chkconfig --del oracle
select userenv('language') from dual;