Delete a Domain

Use Resource Manager to destroy and delete the stack when you no longer need an Oracle WebLogic Server for Oracle Cloud Infrastructure domain.

You perform two separate actions:
  • Destroy the stack – A destroy job terminates the compute instance or instances for the domain but the stack's state and job history remain.
  • Delete the stack – A delete job permanently removes the stack and all related resources that were created for the domain, such as compute instances, networking components, and load balancer components.

If your domain includes the Java Required Files (JRF) components, then you must also delete the JRF schema before you destroy the stack.

If your domain uses Oracle Identity Cloud Service, then you must also delete the security resources before you destroy the stack.

Delete a JRF Database Schema

If the Oracle WebLogic Server for Oracle Cloud Infrastructure domain you want to delete was created with the Java Required Files (JRF) components, you must remove the JRF schema before you destroy the stack.

You'll need the following to delete the JRF schema:
  • The secure shell (SSH) private key that corresponds to the public key that was specified when you created the domain
  • The public IP address to the Administration Server node. If the WebLogic domain is in a private subnet, look up the bastion's public IP address and the private IP address of the administration server node.
  • The WebLogic Server administrator password
  • The database administrator password to the database associated with the domain

To delete the schema associated with a JRF-enabled domain:

  1. From your computer, run the ssh command to connect to the domain's Administration Server node as the opc user.
    ssh -i path_to_private_key opc@node_IP_address

    Or,

    ssh -i path_to_private_key -o ProxyCommand="ssh -W %h:%p -i path_to_private_key opc@bastion_public_IP" opc@node_private_IP

    For example:

    ssh -i /home/myuser/mykey.openssh opc@203.0.113.13
    ssh -i ~/.ssh/mykey.openssh -o ProxyCommand="ssh -W %h:%p -i ~/.ssh/mykey.openssh opc@198.51.100.1" opc@192.0.2.254
  2. If prompted, enter the passphrase for the private key.
  3. Change to the oracle user.
    sudo su - oracle
  4. Run the following command to delete the JRF schemas, providing the passwords for the WebLogic Server administrator and database administrator.
    /opt/scripts/delete_rcu.sh domain_password database_password

    For example:

    /opt/scripts/delete_rcu.sh wlsadminpassword dbadminpassword
  5. Wait for the script to run. The operation is completed when you see output similar to the following:
    Component schemas dropped:
    Component                                     Status       Logfile
    Common Infrastructure Services                Success      /tmp/RCU2019-06-10_numstring/logs/stb.log
    Oracle Platform Security Services             Success      /tmp/RCU2019-06-10_numstring/logs/opss.log
    User Messaging Service                        Success      /tmp/RCU2019-06-10_numstring/logs/ucsums.log
    Audit Services                                Success      /tmp/RCU2019-06-10_numstring/logs/iau.log
    Audit Services Append                         Success      /tmp/RCU2019-06-10_numstring/logs/iau_append.log
    Audit Services Viewer                         Success      /tmp/RCU2019-06-10_numstring/logs/iau_viewer.log
    Metadata Services                             Success      /tmp/RCU2019-06-10_numstring/logs/mds.log
    WebLogic Services                             Success      /tmp/RCU2019-06-10_numstring/logs/wls.log
    Repository Creation Utility - Drop : Operation Completed
    >
    <Jun 11, 2019 05:15:12 PM GMT> <INFO> <cleanup.py> <(host:resourcename-wls-0.mysubnet.ocidbvcnterrafo.oraclevcn.com) - Successfully deleted rcu schemas for prefix = SP1560222222>
  6. If necessary, review the entire output for exceptions or failures that caused a failed or incomplete deletion. For example, a failure to connect to the domain could be caused by an invalid WebLogic Server administrator password. Re-execute the script after fixing the issues.

Delete the Identity Cloud Service Resources

If the Oracle WebLogic Server for Oracle Cloud Infrastructure domain you want to delete was configured to use Oracle Identity Cloud Service for authentication, then you must delete the security resources for the domain before you destroy the stack.

You'll need the client ID and secret of an existing confidential application in Oracle Identity Cloud Service. See Create a Confidential Application.

  1. From your computer, run the ssh command to connect to the domain's Administration Server node as the opc user.
    ssh -i path_to_private_key opc@node_IP_address

    For example:

    ssh -i /home/myuser/mykey opc@203.0.113.13
  2. If prompted, enter the passphrase for the private key.
  3. Run the following command to delete the security resources for this domain.

    Provide the client ID and secret of the confidential application in Oracle Identity Cloud Service.

    sudo su oracle -c '/opt/scripts/idcs/delete_idcs_applications.sh idcs_app_client_id idcs_app_client_secret'

    Sample output:

    Deactivating App Gateway gateway_name...
    Deleting App Gateway gateway_name...
    Deactivating application enterprise_app_name...
    Deleting application enterprise_app_name...
    Deactivating application confidential_app_name...
    Deleting application confidential_app_name...

Destroy a Stack

To delete an Oracle WebLogic Server for Oracle Cloud Infrastructure domain, use Resource Manager to destroy the stack associated with the domain before you execute the Delete Stack action.

Note:

If your domain includes the Java Required Files (JRF) components, be sure to delete the JRF schema before you destroy the stack.

A destroy action terminates the compute instance or instances for the domain but the stack's state and job history remain until you execute the Delete Stack action.

To destroy a stack:

  1. Sign in to the Oracle Cloud Infrastructure Console.
  2. From the Compartment dropdown, select the compartment where your stack is located.
  3. Click the name of your stack.
  4. Click Terraform Actions, then click Destroy.
  5. When prompted for confirmation, click Destroy.
    A job with type Destroy and state Accepted is added to the top of the table under Jobs. After a few minutes, the state changes to In Progress.
  6. Wait for the destroy job state to change to Succeeded before you delete the stack.
To verify the stack has been destroyed, navigate to the Compute Instances page. Instances associated with a destroyed stack are labeled Terminated.

If there are networking resources created by the stack and those resources are still in use by other compute instances (not created by the stack):

  • The destroy action on the stack fails because related networking resources are still in use. Those networking resources will not be deleted.
  • The compute instances created by the stack are terminated. You can proceed to delete the stack.

Delete a Stack

To delete an Oracle WebLogic Server for Oracle Cloud Infrastructure domain, use Resource Manager to delete the stack associated with the domain, but only after you've executed the Destroy action.

Note:

To verify a stack has been destroyed, navigate to the Compute Instances page. Instances associated with a destroyed stack are labeled Terminated.

A delete action permanently removes the stack and all related resources that were created for the domain, such as compute instances, network components, and load balancer components. If any of the network resources are being used by other stacks, the delete action:

  • Does not remove those network components
  • Does remove the compute instances created by the stack for the domain

To delete a stack:

  1. Sign in to the Oracle Cloud Infrastructure Console.
  2. From the Compartment dropdown, select the compartment where your stack is located.
  3. Click the name of your stack.
  4. Click Delete Stack.
  5. When prompted for confirmation, click Delete.
The Stacks page redisplays immediately. You'll no longer see your stack listed on the page.

Delete the Database Security List

If your Oracle WebLogic Server for Oracle Cloud Infrastructure domain is JRF-enabled and is connected to an Oracle Cloud Infrastructure Database (DB System), then you can delete the security list that grants the domain access to the database.

WARNING:

Do not the delete this security list if other domains are in the same VCN and are using the same database.

This security list is not a component of the stack for your domain, and is not automatically deleted when you destroy the stack.

  1. Sign in to the Oracle Cloud Infrastructure Console.
  2. From the navigation menu, click Networking, and then select Virtual Cloud Networks.
  3. Select the Compartment where your database's virtual cloud network (VCN) is located.
  4. Click the name of the database's VCN.
  5. Click Security Lists.
  6. Click the security list for your domain, servicename-wls-to-db-seclist.
    servicename is the resource name prefix you provided during stack creation.
  7. Click Terminate.
  8. When prompted for confirmation, click Delete.

Delete the Identity Cloud Service Resources Manually

If the Oracle WebLogic Server for Oracle Cloud Infrastructure domain you deleted was configured to use Oracle Identity Cloud Service for authentication, you can manually delete the security resources for the domain.

If the domain's compute instances still exist, you can delete the security resources using a script. See Delete the Identity Cloud Service Resources.

  1. Delete the App Gateway that's associated with your domain.

    From Identity Cloud Service console, expand the navigation drawer, click Security, and then click App Gateways.

    The name of the gateway is servicename_app_gateway_timestamp. For example, mywls_app_gateway_2019-08-01T01:02:01.123456.

  2. Delete the enterprise application that's associated with your domain.

    From Identity Cloud Service console, expand the navigation drawer, and then click Applications.

    The name of the application is servicename_enterprise_idcs_app_timestamp. For example, mywls_enterprise_idcs_app_2019-08-01T01:02:01.123456.

  3. Delete the confidential application that's associated with your domain.

    The name of the application is servicename_confidential_idcs_app_timestamp. For example, mywls_confidential_idcs_app_2019-08-01T01:02:01.123456.