Mục lục

Bài viết hướng dẫn bạn cách uninstall Oracle Database Software và Grid Infrastructure 1 cách đơn giản và triệt để nhất

1. Các bước thực hiện

1. Uninstall Oracle Database Software

Đầu tiên bạn cần phải gỡ bỏ Oracle Database Software trước

				
					su - oracle 
cd $ORACLE_HOME/deinstall
./deinstall
				
			
				
					Checking for required files and bootstrapping ... 
Please wait ... 
Location of logs /u01/app/oraInventory/logs/ 
############ ORACLE DECONFIG TOOL START ############
######################### DECONFIG CHECK OPERATION START ######################### ## [START] Install check configuration ## Checking for existence of the Oracle home location /u01/app/oracle/product/12.1.0/dbhome_1 Oracle Home type selected for deinstall is: Oracle Single Instance Database Oracle Base selected for deinstall is: /u01/app/oracle Checking for existence of central inventory location /u01/app/oraInventory ## [END] Install check configuration ## Network Configuration check config START Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_check2022-10-07_01-37-23-PM.log Network Configuration check config END Database Check Configuration START Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_check2022-10-07_01-37-24-PM.log Use comma as separator when specifying list of values as input Specify the list of database names that are configured in this Oracle home [orcl]: ###### For Database 'orcl' ###### Specify the type of this database (1.Single Instance Database|2.Oracle Restart Enabled Database) [1]: 2 Specify the list of nodes on which this database has instances [oracle-lab]: Specify the diagnostic destination location of the database [/u01/app/oracle/diag/rdbms/orcl]: Specify the storage type used by the Database ASM|FS []: ASM Database Check Configuration END Oracle Configuration Manager check START OCM check log file location : /u01/app/oraInventory/logs//ocm_check9847.log Oracle Configuration Manager check END ######################### DECONFIG CHECK OPERATION END ######################### ####################### DECONFIG CHECK OPERATION SUMMARY ####################### Oracle Home selected for deinstall is: /u01/app/oracle/product/12.1.0/dbhome_1 Inventory Location where the Oracle home registered is: /u01/app/oraInventory The following databases were selected for de-configuration : orcl Database unique name : orcl Storage used : ASM Checking the config status for CCR Oracle Home exists with CCR directory, but CCR is not configured CCR check is finished Do you want to continue (y - yes, n - no)? [n]: y A log of this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2022-10-07_01-37-22-PM.out' Any error messages from this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2022-10-07_01-37-22-PM.err' ######################## DECONFIG CLEAN OPERATION START ######################## Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_clean2022-10-07_01-38-28-PM.log Database Clean Configuration START orcl This operation may take few minutes. Database Clean Configuration END orcl Network Configuration clean config START Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_clean2022-10-07_01-38-45-PM.log De-configuring Local Net Service Names configuration file... Local Net Service Names configuration file de-configured successfully. De-configuring backup files... Backup files de-configured successfully. The network configuration has been cleaned up successfully. Network Configuration clean config END Oracle Configuration Manager clean START OCM clean log file location : /u01/app/oraInventory/logs//ocm_clean9847.log Oracle Configuration Manager clean END ######################### DECONFIG CLEAN OPERATION END ######################### ####################### DECONFIG CLEAN OPERATION SUMMARY ####################### Successfully de-configured the following database instances : orcl Cleaning the config for CCR As CCR is not configured, so skipping the cleaning of CCR configuration CCR clean is finished ####################################################################### ############# ORACLE DECONFIG TOOL END ############# Using properties file /tmp/deinstall2022-10-07_01-37-16PM/response/deinstall_2022-10-07_01-37-22-PM.rsp Location of logs /u01/app/oraInventory/logs/ ############ ORACLE DEINSTALL TOOL START ############ ####################### DEINSTALL CHECK OPERATION SUMMARY ####################### A log of this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2022-10-07_01-37-22-PM.out' Any error messages from this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2022-10-07_01-37-22-PM.err' ######################## DEINSTALL CLEAN OPERATION START ######################## ## [START] Preparing for Deinstall ## Setting LOCAL_NODE to oracle-lab Setting CRS_HOME to false Setting oracle.installer.invPtrLoc to /tmp/deinstall2022-10-07_01-37-16PM/oraInst.loc Setting oracle.installer.local to false ## [END] Preparing for Deinstall ## Setting the force flag to false Setting the force flag to cleanup the Oracle Base Oracle Universal Installer clean START Detach Oracle home '/u01/app/oracle/product/12.1.0/dbhome_1' from the central inventory on the local node : Done Delete directory '/u01/app/oracle/product/12.1.0/dbhome_1' on the local node : Done Delete directory '/u01/app/oracle' on the local node : Done Oracle Universal Installer cleanup was successful. Oracle Universal Installer clean END ## [START] Oracle install clean ## Clean install operation removing temporary directory '/tmp/deinstall2022-10-07_01-37-16PM' on node 'oracle-lab' ## [END] Oracle install clean ## ######################### DEINSTALL CLEAN OPERATION END ######################### ####################### DEINSTALL CLEAN OPERATION SUMMARY ####################### Successfully detached Oracle home '/u01/app/oracle/product/12.1.0/dbhome_1' from the central inventory on the local node. Successfully deleted directory '/u01/app/oracle/product/12.1.0/dbhome_1' on the local node. Successfully deleted directory '/u01/app/oracle' on the local node. Oracle Universal Installer cleanup was successful. Oracle deinstall tool successfully cleaned up temporary directories. ####################################################################### ############# ORACLE DEINSTALL TOOL END #############
				
			
 

Uninstall Oracle Grid Infrastructure

Bạn cũng làm tương tự để uninstall Oracle Grid Infrastructure

su - grid
cd $ORACLE_HOME/deinstall
./deinstall

Kết quả:

Checking for required files and bootstrapping ...
Please wait ...
Location of logs /tmp/deinstall2022-10-07_01-46-47PM/logs/

############ ORACLE DECONFIG TOOL START ############


######################### DECONFIG CHECK OPERATION START #########################
## [START] Install check configuration ##


Checking for existence of the Oracle home location /u01/app/12.2.0/grid
Oracle Home type selected for deinstall is: Oracle Grid Infrastructure for a Standalone Server
Oracle Base selected for deinstall is: /u01/app/grid
Checking for existence of central inventory location /u01/app/oraInventory
Checking for existence of the Oracle Grid Infrastructure home /u01/app/12.2.0/grid

## [END] Install check configuration ##

Traces log file: /tmp/deinstall2022-10-07_01-46-47PM/logs//crsdc_2022-10-07_01-47-00PM.log

Network Configuration check config START

Network de-configuration trace file location: /tmp/deinstall2022-10-07_01-46-47PM/logs/netdc_check2022-10-07_01-47-00-PM.log

Specify all Oracle Restart enabled listeners that are to be de-configured. Enter .(dot) to deselect all. [LISTENER]:

Network Configuration check config END

Asm Check Configuration START

ASM de-configuration trace file location: /tmp/deinstall2022-10-07_01-46-47PM/logs/asmcadc_check2022-10-07_01-47-10-PM.log

Automatic Storage Management (ASM) instance is detected in this Oracle home /u01/app/12.2.0/grid.
ASM Diagnostic Destination : /u01/app/grid
ASM Diskgroups :
ASM diskstring : <Default>
Diskgroups will not be dropped
 If you want to retain the existing diskgroups or if any of the information detected is incorrect, you can modify by entering 'y'. Do you  want to modify above information (y|n) [n]:
Database Check Configuration START

Database de-configuration trace file location: /tmp/deinstall2022-10-07_01-46-47PM/logs/databasedc_check2022-10-07_01-47-42-PM.log

Database Check Configuration END

######################### DECONFIG CHECK OPERATION END #########################


####################### DECONFIG CHECK OPERATION SUMMARY #######################
Oracle Grid Infrastructure Home is: /u01/app/12.2.0/grid
The following nodes are part of this cluster: null
The cluster node(s) on which the Oracle home deinstallation will be performed are:null
Oracle Home selected for deinstall is: /u01/app/12.2.0/grid
Inventory Location where the Oracle home registered is: /u01/app/oraInventory
Following Oracle Restart enabled listener(s) will be de-configured: LISTENER
ASM instance will be de-configured from this Oracle home
Do you want to continue (y - yes, n - no)? [n]: y
A log of this session will be written to: '/tmp/deinstall2022-10-07_01-46-47PM/logs/deinstall_deconfig2022-10-07_01-46-59-PM.out'
Any error messages from this session will be written to: '/tmp/deinstall2022-10-07_01-46-47PM/logs/deinstall_deconfig2022-10-07_01-46-59-PM.err'

######################## DECONFIG CLEAN OPERATION START ########################
Database de-configuration trace file location: /tmp/deinstall2022-10-07_01-46-47PM/logs/databasedc_clean2022-10-07_01-47-46-PM.log
ASM de-configuration trace file location: /tmp/deinstall2022-10-07_01-46-47PM/logs/asmcadc_clean2022-10-07_01-47-46-PM.log
ASM Clean Configuration START
ASM Clean Configuration END

Network Configuration clean config START

Network de-configuration trace file location: /tmp/deinstall2022-10-07_01-46-47PM/logs/netdc_clean2022-10-07_01-47-49-PM.log

De-configuring Oracle Restart enabled listener(s): LISTENER

De-configuring listener: LISTENER
    Stopping listener: LISTENER
    Warning: Failed to stop listener. Listener may not be running.
    Deleting listener: LISTENER
    Listener deleted successfully.
Listener de-configured successfully.

De-configuring Listener configuration file...
Listener configuration file de-configured successfully.

De-configuring Naming Methods configuration file...
Naming Methods configuration file de-configured successfully.

De-configuring backup files...
Backup files de-configured successfully.

The network configuration has been cleaned up successfully.

Network Configuration clean config END


---------------------------------------->

Run the following command as the root user or the administrator on node "oracle-lab".

/tmp/deinstall2022-10-07_01-46-47PM/perl/bin/perl -I/tmp/deinstall2022-10-07_01-46-47PM/perl/lib -I/tmp/deinstall2022-10-07_01-46-47PM/crs/install /tmp/deinstall2022-10-07_01-46-47PM/crs/install/roothas.pl -force  -deconfig -paramfile "/tmp/deinstall2022-10-07_01-46-47PM/response/deinstall_OraGI12Home1.rsp"

Press Enter after you finish running the above commands

<----------------------------------------

Đến đoạn này, deinstaller sẽ yêu cầu bạn chạy 1 câu lệnh bằng user root. Bạn hãy mở 1 session khác kết nối với user root và chạy câu lệnh đó

Đọc thêm  Lộ trình trở thành PostgreSQL DBA

uninstall oracle

Sau đó bạn quay lại session  grid trước và ấn Enter.

Tiến trình deinstall sẽ lại tiếp tục

######################### DECONFIG CLEAN OPERATION END #########################


####################### DECONFIG CLEAN OPERATION SUMMARY #######################
ASM instance was de-configured successfully from the Oracle home
Following Oracle Restart enabled listener(s) were de-configured successfully: LISTENER
Oracle Restart was already stopped and de-configured on node "oracle-lab"
Oracle Restart is stopped and de-configured successfully.
#######################################################################


############# ORACLE DECONFIG TOOL END #############

Using properties file /tmp/deinstall2022-10-07_01-46-47PM/response/deinstall_2022-10-07_01-46-59-PM.rsp
Location of logs /tmp/deinstall2022-10-07_01-46-47PM/logs/

############ ORACLE DEINSTALL TOOL START ############





####################### DEINSTALL CHECK OPERATION SUMMARY #######################
A log of this session will be written to: '/tmp/deinstall2022-10-07_01-46-47PM/logs/deinstall_deconfig2022-10-07_01-46-59-PM.out'
Any error messages from this session will be written to: '/tmp/deinstall2022-10-07_01-46-47PM/logs/deinstall_deconfig2022-10-07_01-46-59-PM.err'

######################## DEINSTALL CLEAN OPERATION START ########################
## [START] Preparing for Deinstall ##
Setting LOCAL_NODE to oracle-lab
Setting CRS_HOME to true
Setting oracle.installer.invPtrLoc to /tmp/deinstall2022-10-07_01-46-47PM/oraInst.loc
Setting oracle.installer.local to false

## [END] Preparing for Deinstall ##

Setting the force flag to false
Setting the force flag to cleanup the Oracle Base
Oracle Universal Installer clean START

Detach Oracle home '/u01/app/12.2.0/grid' from the central inventory on the local node : Done

Delete directory '/u01/app/12.2.0/grid' on the local node : Done

Delete directory '/u01/app/oraInventory' on the local node : Done

Delete directory '/u01/app/grid' on the local node : Done

Oracle Universal Installer cleanup was successful.

Oracle Universal Installer clean END


## [START] Oracle install clean ##

Clean install operation removing temporary directory '/tmp/deinstall2022-10-07_01-46-47PM' on node 'oracle-lab'

## [END] Oracle install clean ##


######################### DEINSTALL CLEAN OPERATION END #########################


####################### DEINSTALL CLEAN OPERATION SUMMARY #######################
Successfully detached Oracle home '/u01/app/12.2.0/grid' from the central inventory on the local node.
Successfully deleted directory '/u01/app/12.2.0/grid' on the local node.
Successfully deleted directory '/u01/app/oraInventory' on the local node.
Successfully deleted directory '/u01/app/grid' on the local node.
Oracle Universal Installer cleanup was successful.


Run 'rm -r /etc/oraInst.loc' as root on node(s) 'oracle-lab' at the end of the session.

Run 'rm -r /opt/ORCLfmap' as root on node(s) 'oracle-lab' at the end of the session.
Run 'rm -r /etc/oratab' as root on node(s) 'oracle-lab' at the end of the session.
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################


############# ORACLE DEINSTALL TOOL END #############

Nguồn: https://dangxuanduy.com/

Đọc thêm  Chế độ archive log mode Oracle là gì?

Hiện tại, tôi có tổ chức đều đặn các khóa học về quản trị Oracle Database, tôi sẽ để thông tin ở đây, để bạn nào quan tâm về lịch học cũng như chương trình học có thể theo dõi nhé.

Hãy tham gia group “Kho tài liệu kiến thức database” để cùng học hỏi và chia sẻ nhé.

0 0 đánh giá
Article Rating
Theo dõi
Thông báo của
guest
0 Comments
Cũ nhất
Mới nhất Được bỏ phiếu nhiều nhất
Phản hồi nội tuyến
Xem tất cả bình luận
0
Rất thích suy nghĩ của bạn, hãy bình luận.x