Date: Fri, 29 Mar 2024 14:49:47 +0000 (UTC) Message-ID: <861509682.3.1711723787815@7f2a1bc278bb> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_2_1964377680.1711723787815" ------=_Part_2_1964377680.1711723787815 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
One of the key features in Dbvisit Standby Version 10.0.x is the support= of refresh of a pluggable database to standby. Oracle has announced the su= pport of up to three pluggable databases in Standard Edition 2 from 19c. Wi= th Dbvisit Standby 10.0.x, any new pluggable databases added to primary is = automatically refreshed in the standby database when you send archivelogs f= rom primary and apply them in standby without having to re-create the stand= by database.
Adding a snapshot pluggable database to primary is not supported for thi= s process.
There are two new parameters which need to be set to appropriate values = before creating the pluggable database or before sending archivelogs from p= rimary to standby after adding the pluggable database. The parameters are= p>
BCKDIR
BCKDIR_DR
The above parameters by default have the value of $DBVISIT_BASE\= standby\backup\{DDC} directory.
BCKDIR parameters hold the backup of the pluggable database that was rec= ently added in the primary and its recommended to provide a proper location= unless the pluggable database is added from the seed database. The backups= taken are by default compressed RMAN backup, and we recommend providing a = location with enough free space if the pluggable database is refreshed from= an existing pluggable database or it is attached from a different server.<= /p>
BCKDIR_DR parameter is the location in the standby server where the back= up of the pluggable database is transferred from the primary. This location= too must have enough free space to accommodate the backup of the pluggable= database.
Primary Server: Kiwi701
Database: DEV
Database Instance in ASM
ASM Instance : +ASM
Standby Server: Kiwi702
Database: DEV
Database Instance in ASM
ASM Instance : +ASM
For this example, the default location of BCKDIR and BCKDIR_DR parameter= is used
[oracle= @kiwi701 /usr/dbvisit/standby]$ ./dbvctl -d DEV -f print_var -a name=3DBCKD= IR /usr/dbvisit/standby/backup [oracle@kiwi701 /usr/dbvisit/standby]$ ./dbvctl -d DEV -f print_var -a name= =3DBCKDIR_DR /usr/dbvisit/standby/backup
Now, let's add a pluggable database in the primary from seed database.= p>
SQL>= sho pdbs CON_ID CON_NAME=09=09=09 OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- =09 2 PDB$SEED=09=09=09 READ ONLY NO =09 3 DEVPDB=09=09=09 READ WRITE NO SQL> select host_name from v$instance; HOST_NAME ---------------------------------------------------------------- kiwi701.oraclekiwi.co.nz SQL> create pluggable database DEVPDB2 admin user DEVPDB2 identified by = devpdb2 ; Pluggable database created. SQL> sho pdbs CON_ID CON_NAME=09=09=09 OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- =09 2 PDB$SEED=09=09=09 READ ONLY NO =09 3 DEVPDB=09=09=09 READ WRITE NO =09 4 DEVPDB2=09=09=09 MOUNTED SQL> alter pluggable database DEVPDB2 open; Pluggable database altered. SQL> alter pluggable database all save state; Pluggable database altered. SQL> sho pdbs CON_ID CON_NAME=09=09=09 OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- =09 2 PDB$SEED=09=09=09 READ ONLY NO =09 3 DEVPDB=09=09=09 READ WRITE NO =09 4 DEVPDB2=09=09=09 READ WRITE NO SQL> select name,guid from v$pdbs; NAME=09=09=09 GUID ------------------------------ -------------------------------- PDB$SEED=09=09 87C9DB3334B2180EE053AB02000A067B DEVPDB=09=09=09 87CA561EA0712598E053AB02000AF73A DEVPDB2 =09=09 B70775868225222CE053AB02000AB1E0 SQL> alter session set container=3DDEVPDB2; Session altered. SQL> select name from v$datafile; NAME ---------------------------------------------------------------------------= ----- +DATA/DEV/B70775868225222CE053AB02000AB1E0/DATAFILE/system.628.1059847255 +DATA/DEV/B70775868225222CE053AB02000AB1E0/DATAFILE/sysaux.623.1059847257 +DATA/DEV/B70775868225222CE053AB02000AB1E0/DATAFILE/undotbs1.548.1059847255 SQL> create tablespace users; Tablespace created. SQL> alter tablespace users add datafile; Tablespace altered. SQL> select name from v$datafile; NAME ---------------------------------------------------------------------------= ----- +DATA/DEV/B70775868225222CE053AB02000AB1E0/DATAFILE/system.628.1059847255 +DATA/DEV/B70775868225222CE053AB02000AB1E0/DATAFILE/sysaux.623.1059847257 +DATA/DEV/B70775868225222CE053AB02000AB1E0/DATAFILE/undotbs1.548.1059847255 +DATA/DEV/B70775868225222CE053AB02000AB1E0/DATAFILE/users.632.1059847503 +DATA/DEV/B70775868225222CE053AB02000AB1E0/DATAFILE/users.631.1059847527
The next step is to send archivelogs from primary, this step will take t= he backup of the pluggable database DEVPDB2. The backup is taken in the def= ault location of BCKDIR (/usr/dbvisit/standby/backup/{DDC}) and the backup = files are sent to standby. This is done by running just the dbvctl command = to send archivelogs to standby.
This step does not have to be done manually if your daemon service is ru= nning this step would automatically be taken care during the next scheduled= send of archivelogs to standby. But, if your pluggable database is not cre= ated from seed database, we recommend stopping the daemon service and run t= he below command manually.
[oracle= @kiwi701 /usr/dbvisit/standby]$ ./dbvctl -d DEV =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Dbvisit Standby Database Technology (10.0.0RCFINAL_0_g6d0007e9) (pid 9606) dbvctl started on kiwi701: Tue Dec 22 18:15:46 2020 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> Obtaining information from standby database (RUN_INSPECT=3DY).= .. done Thread: 1 Archive log gap: 1. Transfer log gap: 0 Note FORCE_LOGGING is disabled in the primary database. >>> Exporting PDB B70775868225222CE053AB02000AB1E0... done >>> Transferring Log file(s) from DEV on kiwi701 to kiwi702: thread 1 sequence 249 (thread_1_seq_249.380.1059848245)... done thread 1 sequence 250 (thread_1_seq_250.580.1059848245)... done thread 1 sequence 251 (thread_1_seq_251.629.1059848247)... done =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D dbvctl ended on kiwi701: Tue Dec 22 18:17:47 2020 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
[oracle= @kiwi701 /usr/dbvisit/standby/backup/DEV]$ ls -lrt total 163536 -rw-r-----. 1 oracle asmadmin 54329344 Dec 22 18:16 DEV_DEVPDB2_DBF_35_bfv= invv4_1_1.RMAN -rw-r-----. 1 oracle asmadmin 109682688 Dec 22 18:16 DEV_DEVPDB2_DBF_36_bhv= invvr_1_1.RMAN -rw-r-----. 1 oracle asmadmin 1294336 Dec 22 18:17 DEV_DEVPDB2_DBF_37_bjv= io00r_1_1.RMAN -rw-r-----. 1 oracle asmadmin 1073152 Dec 22 18:17 DEV_DEVPDB2_DBF_38_blv= io015_1_1.RMAN -rw-r-----. 1 oracle asmadmin 1073152 Dec 22 18:17 DEV_DEVPDB2_DBF_39_bnv= io01d_1_1.RMAN -rw-r--r--. 1 oracle oinstall 185 Dec 22 18:17 DEV_DEVPDB2_B707758682= 25222CE053AB02000AB1E0.txt [oracle@kiwi701 /usr/dbvisit/standby/backup/DEV]$
The backup files are automatically removed as soon as the files are tran= sferred to the standby server.
The next step is to run the default apply archivelogs command in the sta= ndby. This command would restore the PDB backup that was taken earlier and = also recover the database.
[oracle= @kiwi702 ~]$ cd /usr/dbvisit/standby/backup/DEV/ [oracle@kiwi702 /usr/dbvisit/standby/backup/DEV]$ ls -lrt total 163532 -rw-r--r-- 1 oracle oinstall 54329344 Dec 22 18:17 DEV_DEVPDB2_DBF_35_bfvi= nvv4_1_1.RMAN -rw-r--r-- 1 oracle oinstall 109682688 Dec 22 18:17 DEV_DEVPDB2_DBF_36_bhvi= nvvr_1_1.RMAN -rw-r--r-- 1 oracle oinstall 1294336 Dec 22 18:17 DEV_DEVPDB2_DBF_37_bjvi= o00r_1_1.RMAN -rw-r--r-- 1 oracle oinstall 1073152 Dec 22 18:17 DEV_DEVPDB2_DBF_38_blvi= o015_1_1.RMAN -rw-r--r-- 1 oracle oinstall 1073152 Dec 22 18:17 DEV_DEVPDB2_DBF_39_bnvi= o01d_1_1.RMAN -rw-r--r-- 1 oracle oinstall 185 Dec 22 18:17 DEV_DEVPDB2_B7077586822= 5222CE053AB02000AB1E0.txt [oracle@kiwi702 /usr/dbvisit/standby/backup/DEV]$
[oracle= @kiwi702 /usr/dbvisit/standby]$ ./dbvctl -d DEV =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Dbvisit Standby Database Technology (10.0.0RCFINAL_0_g6d0007e9) (pid 14676) dbvctl started on kiwi702: Tue Dec 22 18:25:20 2020 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> Applying Log file(s) from kiwi701 to DEV on kiwi702: thread 1 sequence 249 (1_249_1007124153.arc)... done thread 1 sequence 250 (1_250_1007124153.arc)... done thread 1 sequence 251 (1_251_1007124153.arc)... done thread 1 sequence 252 (1_252_1007124153.arc)... done >>> Restoring PDB B70775868225222CE053AB02000AB1E0... done thread 1 sequence 249 (1_249_1007124153.arc)... done thread 1 sequence 250 (1_250_1007124153.arc)... done thread 1 sequence 251 (1_251_1007124153.arc)... done thread 1 sequence 252 (1_252_1007124153.arc)... done Last applied log(s): thread 1 sequence 252 Next SCN required for recovery 5240089 generated at 2020-12-22:18:25:07= +13:00. Next required log thread 1 sequence 253 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D dbvctl ended on kiwi702: Tue Dec 22 18:27:09 2020 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
SQL>= sho pdbs CON_ID CON_NAME=09=09=09 OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- =09 2 PDB$SEED=09=09=09 MOUNTED =09 3 DEVPDB=09=09=09 MOUNTED =09 4 DEVPDB2=09=09=09 MOUNTED SQL> alter session set container=3DDEVPDB2; Session altered. SQL> col Name for a100 SQL> select name from v$datafile; NAME ---------------------------------------------------------------------------= ----- +DATA/DEV/B70775868225222CE053AB02000AB1E0/DATAFILE/system.289.1059848759 +DATA/DEV/B70775868225222CE053AB02000AB1E0/DATAFILE/sysaux.257.1059848773 +DATA/DEV/B70775868225222CE053AB02000AB1E0/DATAFILE/undotbs1.299.1059848799 +DATA/DEV/B70775868225222CE053AB02000AB1E0/DATAFILE/users.339.1059848807 +DATA/DEV/B70775868225222CE053AB02000AB1E0/DATAFILE/users.260.1059848813 SQL>
After the pluggable database is refreshed the backup created under the $= DBVISIT_BASE/standby/backup/DEV is automatically deleted.
The pluggable database that is created in the primary can be refreshed u= sing the procedure refresh_pdb as well in the standby. In below example, we= see how this is done.
[oracle= @kiwi701 /usr/dbvisit/standby]$ ./dbvctl -f refresh_pdb -h FUNCTION refresh_pdb Refresh a standby PDB from primary dbvctl -f refresh_pdb -d <ddc> [-a guid=3D<comma separated list of= PDB GUID>]
Find the GUID of the pluggable database
SQL>= col name for a40 SQL> select name,guid from v$pdbs; NAME=09=09=09=09=09 GUID ---------------------------------------- -------------------------------- PDB$SEED=09=09=09=09 87C9DB3334B2180EE053AB02000A067B DEVPDB=09=09=09=09=09 87CA561EA0712598E053AB02000AF73A DEVPDB2 =09=09=09=09 B707E993AB982BB9E053AB02000A7EF7
Run the PDB refresh command
[oracle= @kiwi701 /usr/dbvisit/standby]$ ./dbvctl -d DEV -f refresh_pdb -a guid=3DB7= 07E993AB982BB9E053AB02000A7EF7 >>> Exporting PDB B707E993AB982BB9E053AB02000A7EF7... done Note FORCE_LOGGING is disabled in the primary database. >>> Transferring Log file(s) from DEV on kiwi701 to kiwi702: thread 1 sequence 254 (thread_1_seq_254.652.1059849591)... done thread 1 sequence 255 (thread_1_seq_255.646.1059849591)... done thread 1 sequence 256 (thread_1_seq_256.320.1059849595)... done thread 1 sequence 257 (thread_1_seq_257.330.1059849607)... done Starting Dbvisit Standby remotely on kiwi702... Feedback will only be given once process has completed. This may take some time. Please wait... Output of Dbvisit Standby on kiwi702: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> Applying Log file(s) from kiwi701 to DEV on kiwi702: thread 1 sequence 254 (1_254_1007124153.arc)... done thread 1 sequence 255 (1_255_1007124153.arc)... done thread 1 sequence 256 (1_256_1007124153.arc)... done thread 1 sequence 257 (1_257_1007124153.arc)... done >>> Restoring PDB B707E993AB982BB9E053AB02000A7EF7... done thread 1 sequence 254 (1_254_1007124153.arc)... done thread 1 sequence 255 (1_255_1007124153.arc)... done thread 1 sequence 256 (1_256_1007124153.arc)... done thread 1 sequence 257 (1_257_1007124153.arc)... done Last applied log(s): thread 1 sequence 257 Next SCN required for recovery 5242018 generated at 2020-12-22:18:40:= 06 +13:00. Next required log thread 1 sequence 258 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Dbvisit Standby on kiwi702 completed. Completed.
SQL>= select open_mode from v$database; OPEN_MODE -------------------- MOUNTED SQL> sho pdbs CON_ID CON_NAME=09=09=09 OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- =09 2 PDB$SEED=09=09=09 MOUNTED =09 3 DEVPDB=09=09=09 MOUNTED =09 5 DEVPDB2=09=09=09 MOUNTED SQL>