Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle RAC cluster uninstall steps

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Complete deletion procedure for oracle user

1. Log in to oracle users and stop Oracle database snooping and database instances

Oracle@Linux:~ > lsnrctl stoporacle@Linux:~ > sqlplus / as sysdba SQL > shutdown immediate; SQL > exit

Note: you can use ps-ef | grep 'oracle' | grep-v grep to confirm whether there are any processes. If so, you can kill directly by hand.

2. Obtain the ORACLE_HOME and ORACLE_BASE paths under the oracle user and delete them. The reason is that the oracle installation directory is not always completed in the standard installation mode, and the / opt/oracle and / opt/oraInventory directories can be deleted directly if it is in the standard mode.

Linux:~#-~ $~ $

Switch to the root user and delete the ORACLE_BASE and ORACLE_HOME directories of the oracle user obtained above.

Linux:~#-rf / home/-rf / home/oracle/product

3. Delete the dbhome, oraenv and coraenv files in the / usr/local/bin directory

Linux:~# rm / usr/local/bin/dbhomeLinux:~# rm / usr/local/bin/oraenvLinux:~# rm / usr/local/bin/coraenv

4. Delete the oratab, oraInst.loc files and / etc/oracle directory under the / etc directory

Linux:~#-rf / etc/-rf / etc/oraInst.loc

5. Delete the relevant files generated by installing oracle in the / tmp directory

Linux:~# rm-rf / tmp/*oracle*Linux:~# rm-rf / tmp/Oracle*Linux:~# rm-rf / tmp/.oracleLinux:~# rm-rf / tmp/CUV*Linux:~# rm-rf / tmp/OraInst*

6. Delete oracle users

Linux:~# userdel-

7. Delete dba and oinstall user groups

Linux:~# groupdel dbaLinux:~# groupdel oinstall

8. Check whether there are related files or directories with user oracle in the / dev/shm directory, and delete them if so.

9. End of uninstalling oracle user.

Complete deletion procedure for grid user

1. Switch to the grid user and stop the ASM instance listening and HAS service under grid.

Grid@Linux:~ > lsnrctl stopgrid@Linux:~ > crsctl stop resource-all

Note: you can use ps-ef | grep 'grid' | grep-v grep to confirm whether there are any processes. If so, you can kill directly by hand.

2. Get the ORACLE_HOME and ORACLE_BASE paths of grid users and delete them. The reason is that the installation directories of grid users may not always be completed in the standard installation mode. If they are calibrated, the / opt/oracrs, / opt/oraadm, / opt/oraInventory directories can be deleted directly.

Linux:~# su-gridgrid:~$ echo $ORACLE_BASE-- > / home/grid/basegrid:~$ echo $ORACLE_HOME-- > / home/grid/product

Switch to the root user and delete the ORACLE_BASE and ORACLE_GRID directories of the grid user obtained above.

Linux:~# rm-rf / home/grid/base

Linux:~# rm-rf / home/grid/product

3. Delete grid users

Linux:~# userdel-rf grid

4. Clean up DG information related to ASM

Linux:~# cd / dev/diskgroupLinux:~# dd if=/dev/zero of=./dg_ora bs=8k count=10240Linux:~# dd if=/dev/zero of=./dg_data bs=8k count=10240Linux:~# dd if=/dev/zero of=./dg_backup bs=8k count=10240

5. End the uninstallation of grid users.

Method 2 (use find to delete in batch, do not recommend operation if you do not understand the following operation command)

# delete oracle relation file and directoryps-fu oracle | grep-Ev 'PID | grep' | awk' {print $2}'| xargs kill-9find /-maxdepth 3-path / proc-prune-o-user oracle-print0 | xargs-0 rm-rffind /-maxdepth 3-path / proc-prune-o-group dba-print0 | xargs-0 rm-rffind /-maxdepth 3-path / proc-prune-o-group oinstall-print0 | xargs-0 rm-rf#delete grid relation file and directoryps | rf#delete grid relation file and directoryps-rf#delete grid relation file and directoryps' PID | grep' | awk'{print $2}'| xargs kill-9find /-maxdepth 3-path / proc-prune-o-user grid-type f-print0 | xargs-0 rm-rffind /-maxdepth 3-path / proc-prune-o-user grid-type d-print0 | xargs-0 rm-rf

Note: (1) if the data file is managed by ASM, you also need to execute the dd command to delete the disk group information.

(2) the impact of the use of the above command must be clear (files or directories that are not oracle/grid users but whose user group is dba/oinstall will be deleted.)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report