Wednesday, June 17, 2020

Uninstalling ORDS from Database

Hello Guys!!

Oracle REST Data Service (ords) is used as alternative to Oracle HTTP server (OHS) proxy web server that uses mod_plsql. In this post I would like ot share my experience on how to uninstall the ORDS from the Database.

Before uninstalling you should aware of the following:
  • Where is the ords.war exists
  • JDK installed path (JAVA_HOME
  • From which Database it need to uninstall

Syntax:
Navigate to the ORDS extracted directory which was previously used:
  java -jar ords.war uninstall
  
ORDS Uninstallation Issue
The challenge we faced during the ORDS uninstall
  $JAVA_HOME/bin/java -jar ords.war uninstall
Enter the name of the database server [localhost]:
Enter the database listen port [1521]:
Enter the database service name [ORCL]:
Please login with SYSDBA privileges to verify Oracle REST Data Services schema. Installation may be required.
Enter the username with SYSDBA privileges to verify the installation [SYS]:
Enter the database password for SYS:
Confirm password:
Jun 15, 2020 5:50:53 AM oracle.dbtools.installer.Installer uninstallORDS
INFO:
Uninstall Oracle REST Data Services
... Log file written to /opt/apex_listener/logs/ordsuninstall_2020-06-15_055053_00961.log
Jun 15, 2020 6:36:05 AM oracle.dbtools.rt.config.setup.Uninstall execute
WARNING: Error executing script: ords_uninstall.sql Error: ORA-04021: timeout occurred while waiting to lock object
ORA-06512: at line 6
ORA-06512: at line 6
 Refer to log file 
  
  
Cause : 
In the log file, we found that there is something blocking session that is not allowing to complete uninstall. 

   force_print
Rollback
Error starting at line : 85 in command -
begin
   for c1 in (
      select username from sys.dba_users where username in ('ORDS_METADATA','ORDS_PUBLIC_USER')
   ) loop
      dbms_output.put_line('drop user ' || c1.username);
      execute immediate 'drop user ' || c1.username || ' cascade';
   end loop;
end;
Error report -
ORA-04021: timeout occurred while waiting to lock object
ORA-06512: at line 6
  

Solution :
After taking DDL Backup and performing the drop schemas which are failed ORDS_METADATA and ORDS_PUBLIC_USER  then the ORDS uninstall command executed successfully

Official Reference:

Here the moral of this story, Understand the log files properly and what the system unable to do that activity do it manually. Some time digging into the automated scripts become more complicated but the real detective in you will come out to solve such problems! 

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.