Skip to content

Commit 79764a4

Browse files
committed
Merge branch 'AbhiK_fix3' into 'master'
Readme changes, and standby SID validation See merge request rac-docker-dev/oracle-database-operator!241
2 parents 16148a9 + 89a15ff commit 79764a4

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

controllers/database/singleinstancedatabase_controller.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,12 @@ func (r *SingleInstanceDatabaseReconciler) validate(m *dbapi.SingleInstanceDatab
493493
return requeueY, err
494494
}
495495

496+
if m.Spec.Sid == rp.Spec.Sid {
497+
r.Log.Info("Standby database SID can not be same as the Primary database SID")
498+
r.Recorder.Eventf(m, corev1.EventTypeWarning, "Spec Error", "Standby and Primary database SID can not be same")
499+
return requeueY, err
500+
}
501+
496502
if m.Status.DatafilesCreated == "true" ||
497503
!dbcommons.IsSourceDatabaseOnCluster(m.Spec.PrimaryDatabaseRef) {
498504
return requeueN, nil

docs/sidb/README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -587,10 +587,20 @@ To create a standby database, edit and apply the sample yaml file [config/sample
587587
#### List Standby Databases
588588

589589
```sh
590+
kubectl get singleinstancedatabase
591+
590592
NAME EDITION STATUS ROLE VERSION CONNECT STR TCPS CONNECT STR OEM EXPRESS URL
591-
sidb-19 Enterprise Healthy PRIMARY 19.3.0.0.0 10.25.0.26:1521/ORCL1 Unavailable https://10.25.0.26:5500/em
592-
stdby-1 Enterprise Healthy PHYSICAL_STANDBY 19.3.0.0.0 10.25.0.27:32392/ORCLS1 Unavailable https://10.25.0.27:30329/em
593+
sidb-19 Enterprise Healthy PRIMARY 19.3.0.0.0 10.25.0.26:1521/ORCL1 Unavailable https://10.25.0.26:5500/em
594+
stdby-1 Enterprise Healthy PHYSICAL_STANDBY 19.3.0.0.0 10.25.0.27:32392/ORCLS1 Unavailable https://10.25.0.27:30329/em
595+
596+
```
593597

598+
### Query Primary Database Reference
599+
You can query the corresponding primary database for every standby database.
600+
601+
```sh
602+
kubectl get singleinstancedatabase stdby-1 -o "jsonpath={.status.primaryDatabase}"
603+
sidb-19
594604
```
595605

596606
#### Creation Status
@@ -611,8 +621,6 @@ After you have created standbys, now configure dataguard broker for standbys and
611621
For the use cases detailed below a sample .yaml file is available at
612622
[config/samples/sidb/dataguardbroker.yaml](./../../config/samples/sidb/dataguardbroker.yaml)
613623

614-
**Note:** The `adminPassword` field of the above `dataguardbroker.yaml` yaml contains a Admin Password secret of primary database ref for Dataguard configuration and observer creation. This secret gets deleted after the database pod becomes ready for security reasons.
615-
616624
#### Setup DataGuardBroker Resource
617625

618626
Provision a new DataguardBroker custom resource for a single instance database(`.spec.primaryDatabaseRef`) by specifying appropriate values for the attributes in the example `.yaml` file, and running the following command:

0 commit comments

Comments
 (0)