Deleting a Protection Policy

This section explains how to delete protection policies using either Cloud Control (recommended) or the DBMS_RA PL/SQL package.

You must be logged in to metadata database of the Recovery Appliance as RASYS or as a named db_user with user_type=admin.

The protection policy must not be associated with any protected database. To delete a policy that is associated with one or more databases, you must associate those databases with different policies before you can delete the desired policy.

In the following example, assume that you want to delete the bronze_dev policy.

To delete a Protection Policy with Cloud Control:

  1. Access the Protection Policies page, as described in "Accessing the Create Protection Policy Page in Cloud Control".

  2. In the Protection Policies table, select the protection policy that you want to delete.

    For example, select the BRONZE_DEV row.

  3. Click Delete.

    A confirmation window appears.

  4. Click Yes.

    The Protection Policies page appears, with the deleted protection policy no longer listed.

To delete a Protection Policy with DBMS_RA:

In the following example, assume that you want to delete the bronze_dev policy.

  1. Start SQL*Plus or SQL Developer, and then log in to the metadata database as RASYS or as a named db_user with user_type=admin..

  2. Confirm that the protection policy that you intend to delete is not currently associated with any protected databases.

    For example, query all protection policies not associated with databases:

    SELECT POLICY_NAME AS "Currently unused policy"
    FROM   RA_PROTECTION_POLICY
    WHERE  POLICY_NAME NOT IN (SELECT POLICY_NAME FROM RA_DATABASE)
    ORDER BY POLICY_NAME;
    
    Currently unused policy
    -----------------------
    BRONZE_DEV
    
  3. Delete the policy.

    For example, execute the following PL/SQL anonymous block to delete the protection policy named bronze_dev:

    BEGIN
      DBMS_RA.DELETE_PROTECTION_POLICY(
        protection_policy_name => 'BRONZE_DEV');
    END;
    
  4. Optionally, confirm the deletion.

    For example, count the rows for policies named bronze_dev (sample output included):

    SELECT COUNT(*)
    FROM   RA_PROTECTION_POLICY
    WHERE  POLICY_NAME = 'BRONZE_DEV';
    
      COUNT(*)
    ----------
             0