Question: What are the steps that need to be performed to delete or remove a WebLogic Server (WLS) domain?

Step 1

To delete a WLS domain, the only requirement is to remove the domain directory DOMAIN_HOME. DOMAIN_HOME by default would be at ORACLE_HOME/user_projects/domains/DOMAIN_NAME (where ORACLE_HOME is the WLS installation directory and DOMAIN_NAME is the name of the domain).

NOTE: There is no special tool or script required to delete a domain. A domain is nothing but a configuration in WebLogic Server, not an installation. So to delete a domain, uninstall packages are not needed. All the information related to the domain will be maintained within the domain itself. So when the domain root folder is removed, all the details of the domain are completely cleaned up.

If Node Manager, the admin server, or one or more managed servers is running as a Windows service, remove the Windows service before removing the domain. The scripts to do this are at WL_HOMEserverbinuninstallNodeMgrSvc.cmd and WL_HOMEserverbinuninstallSvc.cmd (where WL_HOME is the wlserver_xx directory under ORACLE_HOME). To remove the per-domain Node Manager service in 12c, run the script at DOMAIN_HOMEbinuninstallNodeMgrSvc.cmd instead.

Step 2

In an Oracle Fusion Middleware (FMw) installation, remove the entry for the domain from the domain-registry.xml file at ORACLE_HOME. It is not required to change the Metadata Service (MDS).

NOTE: Always back up files like domain-registry.xml before manually changing them.

Step 3

If a per-installation Node Manager is used, then edit the “nodemanager.domains” file under WL_HOME/common/nodemanager to remove domain information from that file.

NOTE:
– This does not apply to a per-domain Node Manager (the default in 12c and higher).
– The nodemanager.domains file specifies the domains that a Node Manager instance controls, and should contain an entry specifying the domain directory for each domain the Node Manager instance controls, in this form: domain-name=domain-directory.
– Take a backup of the “nodemanager.domains” file before editing it.
– When creating a domain through the Configuration Wizard, the domain name should be automatically added to the nodemanager.domains file. If in any scenario the domain name needs to be added manually, add the line “domain-name=domain-directory” to the same (nodemanager.domains) file.