-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WMS ID: 11640 - Initial pull request to test ADG 23ai for OCW2024 (#45)
* [WMSID: 625] Rename workshop directories for Oracle Cloud World 2023 * WMSID 625: lint check for OCW2023 completed * WMSID 625: OCW2023 - Updated SSH keys and amended Get Help in the manifest * [WMSID: 4741] - Added the Need Help? section before the support section in the manifest. * Staging the first files of ADG23 HOL * fixed tns.sh and prepare.sh for host preparation * lab completed: prepare-host * Finished Lab 2: Prepare the databases * first draft of configuring DG * progressing with the configuration verification * ADG23c Livelabs: finished configure-dg, switchover * Added TAC lab * Active Data Guard 23c - Added: * Real-Time Query and DML redirect * Snapshot Standby * Transparent Application Continuity * WMSID-11640: Initial testing for OCW24 * WMSID 11640: renamed 23c to 23ai
- Loading branch information
1 parent
9725bbc
commit d12f2b8
Showing
97 changed files
with
2,455 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions
44
data-guard/active-data-guard-23ai/awr-snapshots/awr-snapshots.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Create AWR reports on the standby database | ||
|
||
## Introduction | ||
|
||
|
||
Estimated Lab Time: 2 Minutes | ||
|
||
### Requirements | ||
To try this lab, you must have successfully completed the following labs: | ||
* [Prepare the database hosts](../prepare-host/prepare-host.md) | ||
* [Prepare the databases](../prepare-db/prepare-db.md) | ||
* [Configure and Verify Data Guard](../configure-dg/configure-dg.md) | ||
* [Create role-based services](../create-services/create-services.md) | ||
|
||
### Objectives | ||
* Create two AWR snapshots | ||
* Create an AWR report | ||
|
||
## Task 1: Create two AWR snapshost | ||
|
||
In a window, connect with **dgmgrl** and convert the standby database to a snapshot standby. Don't forget to replace ADGHOL1_UNIQUE_NAME with the actual db_unique_name of the standby database. | ||
|
||
``` | ||
<copy> | ||
</copy> | ||
``` | ||
|
||
## Task 2: Create an AWR report | ||
|
||
1. Connect to the snapshot standby service: | ||
``` | ||
<copy> | ||
sql tacuser/WElcome123##@mypdb_snap | ||
</copy> | ||
``` | ||
|
||
![The DDL and DML statements work on the standby database](images/modify-snapshot-standby.png) | ||
|
||
|
||
You have successfully created AWR reports for the standby database. This concludes the Data Guard overview workshop. | ||
|
||
- **Author** - Ludovico Caldara, Product Manager Data Guard, Active Data Guard and Flashback Technologies | ||
- **Contributors** - Robert Pastijn | ||
- **Last Updated By/Date** - Ludovico Caldara, December 2023 |
113 changes: 113 additions & 0 deletions
113
data-guard/active-data-guard-23ai/configure-dg/configure-dg.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
|
||
# Create the Data Guard configuration | ||
|
||
## Introduction | ||
In this lab, we configure Oracle Data Guard using the broker. | ||
|
||
The broker automates all the aspects of a Data Guard topology, including setting up the redo transport, coordinating switchovers and failovers, monitoring the lags, etc. | ||
|
||
For more information about the Data Guard broker, refer to the [broker documentation](https://docs.oracle.com/en/database/oracle/oracle-database/23/dgbkr/oracle-data-guard-broker-concepts.html#GUID-723E5B73-A350-4B2E-AF3C-5EA4EFC83966). | ||
|
||
After configuring the broker, we will check the configuration and have a basic knowledge of how to control and monitor Data Guard. | ||
|
||
Estimated Lab Time: 10 Minutes | ||
|
||
### Requirements | ||
To try this lab, you must have successfully completed: | ||
* Lab 1: Prepare the database hosts | ||
* Lab 2: Prepare the databases | ||
|
||
### Objectives | ||
- Configure Data Guard | ||
|
||
## Task 1: Configure Data Guard | ||
|
||
You should have two Cloud Shell tabs connected to the primary and secondary hosts, adghol0 and adghol1. If you don't, follow the first steps of Lab 1 until you have both SSH connections established. | ||
|
||
1. From a terminal (which one of the two is irrelevant for this task), connect to the primary database using the broker client command line (DGMGRL). We use the DGConnectIdentifier for that (the service named after the db_unique_name). Replace `ADGHOL0_DGCI` with the one noted down during Lab 2. | ||
|
||
``` | ||
<copy> | ||
dgmgrl sys/WElcome123##@ADGHOL0_DGCI | ||
</copy> | ||
``` | ||
For example: | ||
``` | ||
dgmgrl sys/WElcome123##@adghol0-1234.ll1234pubsubnt.ll1234vcn.oraclevcn.com:1521/adghol_53k_lhr.ll1234pubsubnt.ll1234vcn.oraclevcn.com | ||
``` | ||
|
||
1. Create the configuration using the `CREATE CONFIGURATION` command. Again, replace `ADGHOL0_DGCI` with the actual connect string and `ADGHOL0_UNIQUE_NAME` with the actual db_unique_name: | ||
|
||
``` | ||
<copy> | ||
create configuration adghol primary database is ADGHOL0_UNIQUE_NAME connect identifier is 'ADGHOL0_DGCI'; | ||
</copy> | ||
``` | ||
For example: | ||
``` | ||
create configuration adghol primary database is adghol_53k_lhr connect identifier is 'adghol0-1234.ll1234pubsubnt.ll1234vcn.oraclevcn.com:1521/adghol_53k_lhr.ll1234pubsubnt.ll1234vcn.oraclevcn.com'; | ||
``` | ||
|
||
1. Add the standby database to the configuration using the `ADD DATABASE` command. Replace `ADGHOL1_DGCI` and `ADGHOL1_UNIQUE_NAME` with the actual connect string and db_unique_name of the standby database: | ||
|
||
``` | ||
<copy> | ||
add database ADGHOL1_UNIQUE_NAME as connect identifier is 'ADGHOL1_DGCI'; | ||
</copy> | ||
``` | ||
For example: | ||
``` | ||
add database adghol_p4n_lhr as connect identifier is 'adghol1-1234.ll1234pubsubnt.ll1234vcn.oraclevcn.com:1521/adghol_p4n_lhr.ll1234pubsubnt.ll1234vcn.oraclevcn.com'; | ||
``` | ||
|
||
Notice that we don't specify the static service (suffixed with _DGMGRL), because, under normal operation, the broker expects the standby to be mounted, therefore the default service is available. | ||
|
||
1. (Optional): set the `StaticConnectIdentifier` for both databases. | ||
Although the broker builds the default static connect identifier if it's not explicitly configured, it is still a good practice to set it to ease troubleshooting. | ||
|
||
Replace `ADGHOL0_UNIQUE_NAME`, `ADGHOL0_SCI`, `ADGHOL1_UNIQUE_NAME`, and `ADGHOL1_SCI` with the actual values: | ||
``` | ||
<copy> | ||
edit database ADGHOL0_UNIQUE_NAME set property StaticConnectIdentifier='ADGHOL0_SCI'; | ||
edit database ADGHOL1_UNIQUE_NAME set property StaticConnectIdentifier='ADGHOL1_SCI'; | ||
</copy> | ||
``` | ||
For example: | ||
``` | ||
<copy> | ||
edit database adghol_53k_lhr set property StaticConnectIdentifier='adghol0-1234.ll1234pubsubnt.ll1234vcn.oraclevcn.com:1521/adghol_53k_lhr_DGMGRL.ll1234pubsubnt.ll1234vcn.oraclevcn.com'; | ||
edit database adghol_p4n_lhr set property StaticConnectIdentifier='adghol1-1234.ll1234pubsubnt.ll1234vcn.oraclevcn.com:1521/adghol_p4n_lhr_DGMGRL.ll1234pubsubnt.ll1234vcn.oraclevcn.com'; | ||
</copy> | ||
``` | ||
|
||
1. Enable the configuration. This final command will set the required parameters and execute the required commands to start the redo shipping from the primary to the standby database and start the standby recovery: | ||
|
||
``` | ||
<copy> | ||
enable configuration; | ||
</copy> | ||
``` | ||
|
||
![Steps executed to create and enable the Data Guard configuration](images/create-configuration.png) | ||
|
||
The command `show configuration` should report success. | ||
|
||
``` | ||
<copy> | ||
show configuration; | ||
</copy> | ||
``` | ||
|
||
![Show configuration shows a healthy status](images/show-configuration.png) | ||
|
||
That means that the primary can contact the standby database with the `DGConnectIdentifier`, send the redo stream with no lag, and the standby database can apply it successfully without lag. | ||
|
||
You have successfully created the Oracle Data Guard configuration. In the next lab, we will see how to monitor and alter the configuration. | ||
|
||
## Acknowledgements | ||
|
||
- **Author** - Ludovico Caldara, Product Manager Data Guard, Active Data Guard and Flashback Technologies | ||
- **Contributors** - Robert Pastijn | ||
- **Last Updated By/Date** - Ludovico Caldara, December 2023 |
Binary file added
BIN
+75.9 KB
data-guard/active-data-guard-23ai/configure-dg/images/create-configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.3 KB
data-guard/active-data-guard-23ai/configure-dg/images/show-configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
136 changes: 136 additions & 0 deletions
136
data-guard/active-data-guard-23ai/create-services/create-services.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
# Create role-based services | ||
|
||
## Introduction | ||
|
||
Once the Data Guard configuration is in place, it is important to connect to the databases using highly-available connection strings. The connection strings, besides having multiple addresses, require connections to specific application services (for example, the OLTP read-write service for the HR application). The read-write services should only be available on the primary database. If this is not the case, the application will run into problems when connecting to a database that is not available for write operations. Also, when having a highly-available connection string, it's possible to keep the same connection string across role changes (e.g. after a failover or a switchover), without reconfiguring the application connectivity. | ||
|
||
The services that run only on databases with specific roles are called role-based services. | ||
|
||
**Never configure your applications to connect to the default services!** Always use a role-based application service with high availability properties. | ||
|
||
**Don't use any PDB saved states!** Saving a PDB's state will automatically open the PDB and the primary role services on the standby database when the PDB is opened there, which can lead to unwanted situations (e.g., the read/write application pointing to the standby database). Always discard the PDB states when configuring Data Guard. | ||
|
||
Oracle recommends that you use Oracle Clusterware for Real Application Clusters databases, or Oracle Restart for single instance databases when you need to configure role-based services. The Oracle Data Guard broker is aware of Oracle Clusterware, and delegates the stop and start of the instances to it. Also, Oracle Clusterware optimally manages the role-based services. | ||
|
||
However, when Oracle Clusterware is not available (like on single-instance deployments on OCI Base Database Services), one has to manage role-based services differently. Typically, we use the `DBMS_SERVICES` package along with startup triggers to stop and start the correct services depending on the database role. | ||
|
||
In this lab, we will create the services for the primary, physical standby, and snapshot standby roles, along with the trigger that stops and starts them. We will then test the connection to the primary service. | ||
|
||
|
||
Estimated Lab Time: 5 Minutes | ||
|
||
### Requirements | ||
To try this lab, you must have successfully completed: | ||
* Lab 1: Prepare the database hosts | ||
* Lab 2: Prepare the databases | ||
* Lab 3: Configure and Verify Data Guard | ||
|
||
### Objectives | ||
* Discard all PDB saved states | ||
* Create and start the role-based services | ||
* Review the connection strings and connect to the primary service | ||
|
||
## Task 1: Discard all PDB saved states | ||
|
||
1. Connect to the primary database as SYSDBA and discard any existing saved states. Replace ADGHOL0_CI with the actual connection identifier. | ||
|
||
``` | ||
<copy> | ||
sqlplus sys/WElcome123##@ADGHOL0_CI | ||
alter pluggable database all discard state; | ||
</copy> | ||
``` | ||
|
||
|
||
## Task 2: Create and start the role-based services | ||
|
||
1. Review the scripts that we'll use to create the services. We downloaded the scripts in the first lab. They are in the directory: | ||
|
||
``` | ||
<copy> | ||
cd ~/livelabs-database-maa/data-guard/active-data-guard-23c/prepare-host/scripts/tac | ||
</copy> | ||
``` | ||
|
||
2. Connect to the primary database and verify the existing services: | ||
|
||
``` | ||
<copy> | ||
sql / as sysdba | ||
</copy> | ||
``` | ||
|
||
``` | ||
<copy> | ||
alter session set container=MYPDB; | ||
select name from v$active_services where con_id>=2; | ||
</copy> | ||
``` | ||
|
||
![List of existing services in v$active_services](images/services-before.png) | ||
|
||
3. Create and start the services using the scripts in the following order: | ||
|
||
``` | ||
<copy> | ||
set echo on | ||
@create_pdb_services.sql | ||
@create_pdb_service_trigger.sql | ||
@execute_pdb_service_trigger.sql | ||
</copy> | ||
``` | ||
|
||
![Execution of the scripts that create the services](images/script-execution.png) | ||
|
||
The first script creates the service definition with high availability properties. Three services are created: | ||
* MYPDB_RW for the primary role | ||
* MYPDB_RO for the physical standby role | ||
* MYPDB_SNAP for the snapshot standby role | ||
|
||
The second script creates the startup trigger to start or stop the services depending on the database role. | ||
|
||
The last script executes the same code as the startup trigger, so the services are started without restarting the PDB. | ||
|
||
4. After the execution, the read-write service is running with high availability properties: | ||
|
||
``` | ||
<copy> | ||
select name from v$active_services where con_id>=2; | ||
select name, aq_ha_notification, commit_outcome, session_state_consistency, failover_restore from v$active_services where con_id >=2; | ||
exit | ||
</copy> | ||
``` | ||
|
||
![List of new services in v$active_services](images/services-after.png) | ||
|
||
## Task 3: Review the connection strings and connect to the primary service | ||
|
||
1. Review the connection strings in `tnsnames.ora` | ||
|
||
``` | ||
<copy> | ||
cat $ORACLE_HOME/network/admin/tnsnames.ora | ||
</copy> | ||
``` | ||
|
||
![List of new services in v$active_services](images/tns-entries.png) | ||
|
||
2. Connect to the read-write service and verify where you are connected | ||
|
||
``` | ||
<copy> | ||
sql sys/WElcome123##@mypdb_rw as sysdba | ||
select sys_context('USERENV','DB_UNIQUE_NAME') db_unique_name , sys_context('USERENV','SERVER_HOST') server_host from dual; | ||
</copy> | ||
``` | ||
|
||
![Connection to the read-write service](images/connect.png) | ||
|
||
You have successfully created, started, and connected to the application role-based service. | ||
|
||
## Acknowledgements | ||
|
||
- **Author** - Ludovico Caldara, Product Manager Data Guard, Active Data Guard and Flashback Technologies | ||
- **Contributors** - Robert Pastijn | ||
- **Last Updated By/Date** - Ludovico Caldara, December 2023 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+49.1 KB
data-guard/active-data-guard-23ai/create-services/images/script-execution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+41.4 KB
data-guard/active-data-guard-23ai/create-services/images/services-after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+40.8 KB
data-guard/active-data-guard-23ai/create-services/images/services-before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+71.9 KB
data-guard/active-data-guard-23ai/create-services/images/tns-entries.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+129 KB
data-guard/active-data-guard-23ai/introduction/images/architecture-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.53 KB
data-guard/active-data-guard-23ai/introduction/images/copy-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions
48
data-guard/active-data-guard-23ai/introduction/introduction.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Oracle Database 23ai Active Data Guard | ||
|
||
## Introduction | ||
|
||
Oracle Data Guard provides a comprehensive set of services that create, maintain, manage, and monitor one or more standby databases to enable production Oracle databases to survive disasters and data corruptions. | ||
|
||
Oracle Data Guard maintains these standby databases as copies of the production database. Then, if the production database becomes unavailable because of a planned or an unplanned outage, Oracle Data Guard can switch any standby database to the production role, minimizing the downtime associated with the outage. Oracle Data Guard can be used with traditional backup, restoration, and cluster techniques to provide a high level of data protection and data availability. | ||
|
||
Oracle (Active) Data Guard capabilities in Oracle Database 23ai further enhance its strategic objective of preventing data loss, providing high availability, eliminating risk, and increasing return on investment by enabling highly functional active disaster recovery systems that are simple to deploy and manage. | ||
|
||
It accomplishes this by providing the management, monitoring, and automation software infrastructure to create and maintain one or more synchronized standby databases that protect Oracle data from failures, data corruption, human error, and disasters | ||
|
||
This workshop focuses on **Creating Active Data Guard 23ai in Oracle Cloud Infrastructure using Base Database Services (BaseDB)**. | ||
|
||
Instead of leveraging the Control Plane automation to create the Data Guard association, this workshop will guide you through the manual creation of the standby database and the Data Guard configuration, to provide a similar experience to on-premises and hybrid environments. Similarly, complex topologies that cannot be achieved with the Control Plane automation, require manual Data Guard setup in the Oracle Cloud Infrastructure. | ||
|
||
![Architecture of Active Data Guard showing one primary database and one standby database.](./images/architecture-overview.png) | ||
|
||
Estimated workshop time: 2 Hours for the fundamental labs (labs 1 to 10) | ||
|
||
### Workshop Objectives | ||
#### Fundamental labs | ||
- Prepare the database hosts | ||
- Prepare the databases | ||
- Configure Data Guard | ||
- Perform a Switchover | ||
- Create role-based services | ||
- Transparent Application Continuity | ||
- Test your deployments with Snapshot Standby | ||
- Activate Real-Time Query | ||
- Use Real-Time Query and DML Redirection | ||
- Create AWR reports on the standby database | ||
- Automatic Block Repair | ||
|
||
### Prerequisites | ||
- An Oracle Cloud Account - Please view this workshop's LiveLabs landing page to see which environments are supported | ||
|
||
<i>Note: If you have a **Free Trial** account, when your Free Trial expires your account will be converted to an **Always Free** account. You will not be able to conduct Free Tier workshops unless the Always Free environment is available. **[Click here for the Free Tier FAQ page.](https://www.oracle.com/cloud/free/faq.html)**</i> | ||
|
||
## Disclaimer | ||
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. | ||
|
||
|
||
## Acknowledgements | ||
|
||
- **Author** - Ludovico Caldara, Product Manager Data Guard, Active Data Guard and Flashback Technologies | ||
- **Contributors** - Robert Pastijn, Kamryn Vinson | ||
- **Last Updated By/Date** - Ludovico Caldara, May 2024 |
Binary file added
BIN
+53.3 KB
data-guard/active-data-guard-23ai/prepare-db/images/cleanup-standby.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+36 KB
data-guard/active-data-guard-23ai/prepare-db/images/clear-standby-logs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+45.7 KB
data-guard/active-data-guard-23ai/prepare-db/images/connect-identifiers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+97.6 KB
data-guard/active-data-guard-23ai/prepare-db/images/prepare-primary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+178 KB
...-guard/active-data-guard-23ai/prepare-db/images/redo-transport-architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+44.9 KB
data-guard/active-data-guard-23ai/prepare-db/images/standby-nomount.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.