linux下删除oracle数据库实例

1、停止服务

首先用命令 lsnrctl stop 

然后运行

 sqlplus /nolog 

      sql   conn / as sysdba

      sql   shutdown


2、查看实例进程并删除

find $ORACLE_BASE/ -name $ORACLE_SID

/mnt/installer/oracle/flash_recovery_area/orcl
/mnt/installer/oracle/oradata/orcl
/mnt/installer/oracle/diag/rdbms/orcl
/mnt/installer/oracle/diag/rdbms/orcl/orcl
/mnt/installer/oracle/admin/orcl
/mnt/installer/oracle/cfgtoollogs/dbca/orcl

[oracle@rt1d20 /]$ rm -rf /mnt/installer/oracle/flash_recovery_area/orcl/
[oracle@rt1d20 /]$ rm -rf /mnt/installer/oracle/oradata/orcl/
[oracle@rt1d20 /]$ rm -rf /mnt/installer/oracle/diag/rdbms/orcl/
[oracle@rt1d20 /]$ rm -rf /mnt/installer/oracle/admin/orcl/
[oracle@rt1d20 /]$ rm -rf /mnt/installer/oracle/cfgtoollogs/dbca/orcl/


find $ORACLE_BASE/* -name '*[Bb][Tt][Ss][Dd][Bb]2*' | grep -v admin| grep -v  oradata

如果没有则跳过

$ cd mnt/installer/oracle/

$ ll

drwxr-x--- 2 oracle oinstall 4096 Jan  8 16:50 admin
drwxr-xr-x 4 oracle oinstall 4096 Jan  7 23:12 cfgtoollogs
drwxr-xr-x 2 oracle oinstall 4096 Jan  7 23:15 checkpoints
drwxrwxr-x 4 oracle oinstall 4096 Jan  7 23:12 diag
drwxr-x--- 3 oracle oinstall 4096 Jan  8 16:49 flash_recovery_area
drwxr-x--- 2 oracle oinstall 4096 Jan  8 16:49 oradata
drwxrwx--- 5 oracle oinstall 4096 Jan  7 21:06 oraInventory
drwxr-xr-x 3 oracle oinstall 4096 Jan  7 21:03 product


[oracle@rt1d20 oracle]$ rm -rf admin/
[oracle@rt1d20 oracle]$ rm -rf flash_recovery_area/
[oracle@rt1d20 oracle]$ rm -rf oradata/

3、删除旧的实例配置项

vi etc/oratab 

删除最后一行:orcl:/mnt/installer/oracle/product/11.2.0/db_1:N


最后再重新静默安装数据库实例

最新回复(0)
/jishu1vjlEFYXFCVCcKS39FU_2B7LZE9ALHa1V_2BIQC_2FqEsQWJk_3D4652217
8 简首页