The active Data Guard feature is not something new. It has been on since Oracle Database version 11g, but it is the first time I am writing about it on my blog (I think so!), and I think it is always nice not to miss anything on our career path. So here we go!
Before Oracle Database version 11g, it was already possible to open Oracle Data Guard in open mode. Still, there were some complications, e.g., when it was needed to recover the standby database. Thinking on that, Oracle launched Active Data Guard feature on its version 11g, but, of course, some licensing requirements must be analyzed and checked to be able to use this feature.
The greatest thing about this feature is that if the primary production database goes unavailable, and you can not recover it to bring it up and available to all users, you can activate the standby database as the new primary database. So while it is not necessary, you can let your current standby database open read-only, which means that the standby database will be up to date among the primary database. It will still be available to run queries, another great advantage when you need to perform SQL tests but you want to run in some database with a similar configuration of the production.
In its version 19c, Oracle brought many interesting features, and there are two of them that I particularly liked the most: “New commands to set database initialization parameters” and “Show lag information for all configuration members.”. The architecture overview is taken from Oracle it is below:
But yes, now that I have written a little bit about it, how can I turn my standby database that is already configured into an Active Data Guard database? And the answer for that is pretty simple: You need to restart your database, open it in mount state following by open in read-only mode, and starting recover again or in a coding way can be seen as below:
##Current status Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 SQL> select process,status,sequence# from v$managed_standby; PROCESS STATUS SEQUENCE# --------- ------------ ---------- ARCH CLOSING 191 DGRD ALLOCATED 0 DGRD ALLOCATED 0 ARCH CLOSING 196 ARCH CLOSING 185 ARCH CLOSING 192 ARCH CLOSING 194 ARCH CLOSING 197 ARCH CLOSING 198 ARCH CLOSING 180 RFS IDLE 0 PROCESS STATUS SEQUENCE# --------- ------------ ---------- RFS IDLE 199 MRP0 WAIT_FOR_LOG 80 13 rows selected. SQL> select name, database_role, open_mode from v$database; NAME DATABASE_ROLE OPEN_MODE --------- ---------------- -------------------- TECHSTD PHYSICAL STANDBY MOUNTED [oracle@ ~]$srvctl stop database -d techstd [oracle@ ~]$srvctl start database -d techstd -startoption mount ##Execute open command below in both nodes Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 SQL> alter database open read only; Database altered. SQL> alter database recover managed standby database disconnect from session; Database altered. SQL> select name, database_role, open_mode from gv$database; NAME DATABASE_ROLE OPEN_MODE --------- ---------------- -------------------- TECHSTD PHYSICAL STANDBY READ ONLY WITH APPLY TECHSTD PHYSICAL STANDBY READ ONLY WITH APPLY SQL> column group# format a10 SELECT process, status, group#, thread#, sequence# FROM v$managed_standby order by process, group#, tSQL> hread#, sequence#; PROCESS STATUS GROUP# THREAD# SEQUENCE# --------- ------------ ---------- ---------- ---------- ARCH CLOSING 21 1 214 ARCH CONNECTED N/A 0 0 ARCH CONNECTED N/A 0 0 ARCH CONNECTED N/A 0 0 ARCH CONNECTED N/A 0 0 ARCH CONNECTED N/A 0 0 ARCH CONNECTED N/A 0 0 ARCH CONNECTED N/A 0 0 DGRD ALLOCATED N/A 0 0 DGRD ALLOCATED N/A 0 0 MRP0 APPLYING_LOG N/A 2 109
I hope this post was useful to you!
Hi! I am Bruno, a Brazilian born and bred, and I am also a naturalized Swedish citizen. I am a former Oracle ACE and, to keep up with academic research, I am a Computer Scientist with an MSc in Data Science and another MSc in Software Engineering. I have over ten years of experience working with companies such as IBM, Epico Tech, and Playtech across three different countries (Brazil, Hungary, and Sweden), and I have joined projects remotely in many others. I am super excited to share my interests in Databases, Cybersecurity, Cloud, Data Science, Data Engineering, Big Data, AI, Programming, Software Engineering, and data in general.
(Continue reading)