1. Home
  2. Knowledge Base
  3. ZDLRA
  4. Zero Data Loss Recovery Appliance (ZDLRA) Hands-On Lab 1

Zero Data Loss Recovery Appliance (ZDLRA) Hands-On Lab 1

Tutorial Objectives

  • Create the VPC user
  • Create a Protection Policy
  • Enroll a Protected Database
  • Configure Wallet to enable connections to Primary and Secondary ZDLRA catalog databases

ENVIRONMENT

ZDLRA Servers
  • Primary: przdlra01 (10.152.1.10)
  • Secondary: sezdlra01 (10.152.1.110)

ZDLRA Catalog Databases
  • Primary: PRZDRDB
  • Secondary: SEZDRDB
Protected Database

CDB (19c)

  • Primary Database Server:prdb01 (10.152.1.129)
  • Standby Database Server:sbdb01 (10.152.1.131)
Passwords
  • ZDLRA servers: root/welcome1
  • ZDLRA Catalog database: rasys/change^Me2
  • Primary/Standby database server: oracle/DBpwd123_#
  • CDB sys/system: Oracle_4U

CREATE VPC USER

On both ZDLRA servers connect as root

PRIMARY ZDLRA

[root@przdlra01 ~]# racli add vpc_user --user_name=vpc_cdb
[vpc_cdb] New Password:
Sun Sep 19 20:08:16 2021: Start: Add vpc user vpc_cdb.
Sun Sep 19 20:08:16 2021: Add vpc user vpc_cdb successfully.
Sun Sep 19 20:08:16 2021: End: Add vpc user vpc_cdb.


SECONDARY ZDLRA

[root@sezdlra01 ~]# racli add vpc_user --user_name=vpc_cdb
[vpc_cdb] New Password:
Sun Sep 19 20:07:28 2021: Start: Add vpc user vpc_cdb.
Sun Sep 19 20:07:28 2021: Add vpc user vpc_cdb successfully.
Sun Sep 19 20:07:28 2021: End: Add vpc user vpc_cdb.

CREATE THE PROTECTION POLICY

Connect to both ZDLRA catalog databases as the RASYS user


PRIMARY ZDLRA CATALOG DATABASE


[root@przdlra01 ~]# su - oracle
Last login: Sun Sep 19 17:09:27 AEST 2021

[oracle@przdlra01 ~]$ sqlplus rasys/change^Me2
SQL*Plus: Release 19.0.0.0.0 - Production on Sun Sep 19 20:10:24 2021
Version 19.9.0.0.0

Copyright (c) 1982, 2020, Oracle. All rights reserved.

Last Successful login time: Sun Sep 19 2021 20:03:48 +10:00

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.9.0.0.0

SQL> BEGIN
DBMS_RA.CREATE_PROTECTION_POLICY(
protection_policy_name => 'CDB_PROTECTION_POLICY'
, description => 'Test Policy for ZDLRA HOL'
, storage_location_name => 'DELTA'
, recovery_window_goal => INTERVAL '30' DAY
, max_retention_window => INTERVAL '90' DAY
, guaranteed_copy => 'NO'
, allow_backup_deletion => 'YES'
);
END;
/


PL/SQL procedure successfully completed.

SQL>

SET LINES 300
SET PAGES 100
COL POLICY_NAME FORMAT a50
COL DESCRIPTION FORMAT a50
SELECT POLICY_NAME, DESCRIPTION,
TO_CHAR(EXTRACT(DAY FROM RECOVERY_WINDOW_GOAL),'fm00') ||':'||
TO_CHAR(EXTRACT(HOUR FROM RECOVERY_WINDOW_GOAL),'fm00') ||':'||
TO_CHAR(EXTRACT(MINUTE FROM RECOVERY_WINDOW_GOAL),'fm00') ||':'||
TO_CHAR(EXTRACT(SECOND FROM RECOVERY_WINDOW_GOAL),'fm00')
AS "DD:HH:MM:SS"
FROM RA_PROTECTION_POLICY
WHERE POLICY_NAME='CDB_PROTECTION_POLICY';




POLICY_NAME DESCRIPTION DD:HH:MM:SS
-------------------------------------------------- -------------------------------------------------- ---------------
CDB_PROTECTION_POLICY Test Policy for ZDLRA HOL 30:00:00:00


SECONDARY ZDLRA CATALOG DATABASE

[root@sezdlra01 ~]# su - oracle
Last login: Sun Sep 19 19:31:09 AEST 2021

[oracle@sezdlra01 ~]$ sqlplus rasys/change^Me2
SQL*Plus: Release 19.0.0.0.0 - Production on Sun Sep 19 20:09:29 2021
Version 19.9.0.0.0

Copyright (c) 1982, 2020, Oracle. All rights reserved.

Last Successful login time: Sun Sep 19 2021 19:56:33 +10:00

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.9.0.0.0

SQL>
BEGIN
DBMS_RA.CREATE_PROTECTION_POLICY(
protection_policy_name => 'CDB_PROTECTION_POLICY'
, description => 'Test Policy for ZDLRA HOL'
, storage_location_name => 'DELTA'
, recovery_window_goal => INTERVAL '30' DAY
, max_retention_window => INTERVAL '90' DAY
, guaranteed_copy => 'NO'
, allow_backup_deletion => 'YES'
);
END;
/


PL/SQL procedure successfully completed.

ENROLL THE PROTECTED DATABASE

Connect to BOTH ZDLRA catalog databases as the RASYS user

SQL> conn rasys/change^Me2
Connected.

SQL> BEGIN
DBMS_RA.ADD_DB(
db_unique_name => 'cdb'
, protection_policy_name => 'CDB_PROTECTION_POLICY'
, reserved_space => '10G'
);
END;
/


PL/SQL procedure successfully completed.

SQL> BEGIN
DBMS_RA.GRANT_DB_ACCESS (
db_unique_name => 'cdb'
, username => 'vpc_cdb'
);
END;
/


PL/SQL procedure successfully completed.



set lines 300
col policy_name format a30
col storage_location format a20
col recovery_window_goal format a30


SQL> SELECT db_key, dbid, policy_name, storage_location,recovery_window_goal, space_usage FROM ra_database where db_unique_name='CDB';


DB_KEY DBID POLICY_NAME STORAGE_LOCATION RECOVERY_WINDOW_GOAL SPACE_USAGE
---------- ---------- ------------------------------ -------------------- ------------------------------ -----------
CDB_PROTECTION_POLICY DELTA +000000030 00:00:00.000000 0


SQL> col username format a30
SQL> col db_unique_name format a30
SQL> select username, DB_UNIQUE_NAME from ra_db_access where username='VPC_CDB';

USERNAME DB_UNIQUE_NAME
------------------------------ ------------------------------
VPC_CDB CDB

VERIFY CONNECTIVITY TO CATALOG DATABASE AS VPC USER

Primary ZDLRA 

[oracle@przdlra01 ~]$ sqlplus vpc_cdb/Oracle_4U

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Sep 19 20:47:51 2021
Version 19.9.0.0.0

Copyright (c) 1982, 2020, Oracle. All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.9.0.0.0

SQL> sho user
USER is "VPC_CDB"
SQL>


Secondary ZDLRA


[oracle@sezdlra01 ~]$ sqlplus vpc_cdb/Oracle_4U

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Sep 19 20:48:02 2021
Version 19.9.0.0.0

Copyright (c) 1982, 2020, Oracle. All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.9.0.0.0

SQL> sho user
USER is "VPC_CDB"
SQL>

tnsnames.ora entries

DR_ZDLRA =
(DESCRIPTION_LIST =
(LOAD_BALANCE = off)
(FAILOVER = on)
(DESCRIPTION =
(CONNECT_TIMEOUT = 5)
(TRANSPORT_CONNECT_TIMEOUT = 3)
(RETRY_COUNT = 3)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = czdr8nse-scan.mycorp.gov.au)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = SEZDRDB1_2060)
)
)
(DESCRIPTION =
(CONNECT_TIMEOUT = 5)
(TRANSPORT_CONNECT_TIMEOUT = 3)
(RETRY_COUNT = 3)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = czdr8npr-scan.mycorp.gov.au)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = PRZDRDB1_2060)
)
)
)


DR_ZDLRA_SE =
(DESCRIPTION_LIST =
(DESCRIPTION =
(CONNECT_TIMEOUT = 5)
(TRANSPORT_CONNECT_TIMEOUT = 3)
(RETRY_COUNT = 3)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = czdr8nse-scan.mycorp.gov.au)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = SEZDRDB1_2060)
)
)
)


DR_ZDLRA_PR =
(DESCRIPTION_LIST =
(DESCRIPTION =
(CONNECT_TIMEOUT = 5)
(TRANSPORT_CONNECT_TIMEOUT = 3)
(RETRY_COUNT = 3)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = czdr8npr-scan.mycorp.gov.au)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = PRZDRDB1_2060)
)
)
)

TEST CONNECTIONS TO CATALOG DATABASE USING WALLET

View wallet entries for VPC_HOL user and test connection to both ZDLRA Catalog databases using wallet>


[oracle@prdb01 ~]$ cd /u01/app/oracle/product/19.0.0.0/dbhome_2/network/admin/server_wallet


[oracle@prdb01 server_wallet]$ mkstore -wrl . -listCredential
Oracle Secret Store Tool Release 19.0.0.0.0 - Production
Version 19.4.0.0.0
Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved.

Enter wallet password:
List credential (index: connect_string username)
5: dr_zdlra_pr vpc_cdb
4: dr_zdlra_se vpc_cdb
3: dr_zdlra vpc_cdb
2: czdr8npr-scan.mycorp.gov.au:1521/PRZDRDB1_2060:dedicated vpc_cdb
1: czdr8nse-scan.mycorp.gov.au:1521/SEZDRDB1_2060:dedicated vpc_cdb


Connection to Primary Catalog database

[oracle@prdb01 server_wallet]$ sqlplus /@czdr8npr-scan.mycorp.gov.au:1521/PRZDRDB1_2060:dedicated

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Sep 8 13:32:40 2021
Version 19.10.0.0.0

Copyright (c) 1982, 2020, Oracle. All rights reserved.

Last Successful login time: Wed Sep 08 2021 12:56:42 +10:00

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.9.0.0.0

SQL> sho user
USER is "VPC_CDB"
SQL>


Connection to Secondary Catalog database

[oracle@prdb01 server_wallet]$ sqlplus /@czdr8nse-scan.mycorp.gov.au:1521/SEZDRDB1_2060:dedicated

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Sep 8 13:25:12 2021
Version 19.10.0.0.0

Copyright (c) 1982, 2020, Oracle. All rights reserved.

Last Successful login time: Wed Sep 08 2021 12:56:51 +10:00

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.9.0.0.0

SQL> sho user
USER is "VPC_CDB"


[oracle@prdb01 server_wallet]$ sqlplus /@dr_zdlra

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Sep 8 13:32:40 2021
Version 19.10.0.0.0

Copyright (c) 1982, 2020, Oracle. All rights reserved.

Last Successful login time: Wed Sep 08 2021 12:56:42 +10:00

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.9.0.0.0

SQL> sho user
USER is "VPC_CDB"
SQL>

Next Hands-on Lab

Updated on May 18, 2024

Was this article helpful?

Related Articles

Leave a Comment