Oracle 19c - Creating PDBs in a Transparent Data Encryption Enabled Data Guard Environment - Creating PDB Simple Approach - Demo!
Find the work log and steps here.
Step 1: Stop Standby
On the standby:
SQL> shut immediate
Step 2: Create PDB on Primary
On the primary:
SQL> create pluggable database srcdbplug2 admin user srcdbadmin identified by ora12345;
SQL> alter pluggable database srcdbplug2 open instances = all;
SQL> alter session set container = srcdbplug2;
SQL> administer key management set key force keystore identified by welcome1 with backup;
Step 3: Copy TDE Wallet to Standby
Copy the TDE wallet files from the primary to the standby. The location of the TDE wallet is defined by the ENCRYPTION_WALLET_LOCATION parameter in the sqlnet.ora file:
cat $ORACLE_HOME/network/admin/sqlnet.ora
scp -rp /u01/app/oracle/admin/srcdb/wallet/tde/*wallet.* 192.168.56.101:/u01/app/oracle/admin/srcdbsby/wallet/tde
Step 4: Start Standby
On the standby:
startup mount;
The new PDB will be created on the standby database.
-- status of datafiles
select d.file#, d.name as filename, d.status
from v$datafile d join v$pdbs p on (d.con_id = p.con_id)
where p.name = 'srcdbplug2';
In case of Active Data Guard, open the database and the PDBs in READ ONLY mode.
If ADG, on the standby:
SQL> alter database open; --on all instances
SQL> alter pluggable database all open ;
Step 5: Create TEMP file on Standby
As tempfiles are not copied to the standby PDB, add a new tempfile to the TEMP tablespace.
In case of Active Data Guard, the PDB is already opened in READ ONLY mode as in previous step.
On the standby:
SQL> alter session set container = srcdbplug;
SQL> alter tablespace temp add tempfile;
If you are NOT using Active Data Guard, then add the temp file after switchover/failover, or: stop the redo apply, open the database in READ ONLY, create the temp file, restart in MOUNT mode, and enable redo apply again:
DGMGRL> edit database srcdbsby set state = 'apply-off';
SQL> alter database open;
SQL> alter pluggable database srcdbplug open;
SQL> alter session set container = srcdbplug;
SQL> alter tablespace temp add tempfile;
SQL> alter session set container = cdb$root;
SQL> shutdown immediate
SQL> startup mount
DGMGRL> edit database <standby_db_unique_name> set state = 'apply-on';
System altered.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0
[oracle@srlabdg2 admin]$ pw
bash: pw: command not found...
[oracle@srlabdg2 admin]$ cd /u01/app/oracle/admin/
[oracle@srlabdg2 admin]$ ls -lrt
total 16
drwxr-x---. 6 oracle oinstall 4096 Jul 18 21:27 srcdb1
drwxr-xr-x. 6 oracle oinstall 4096 Jul 21 20:12 srcdb2
drwxr-xr-x. 3 oracle oinstall 4096 Oct 15 18:51 srcdbsby
drwxr-xr-x. 4 oracle oinstall 4096 Oct 15 18:53 srcdb
[oracle@srlabdg2 admin]$ cd srcdbsby
[oracle@srlabdg2 srcdbsby]$ ls -lrt
total 4
drwxr-xr-x. 2 oracle oinstall 4096 Oct 15 18:51 xdb_wallet
[oracle@srlabdg2 srcdbsby]$ mkdir wallet
[oracle@srlabdg2 srcdbsby]$ cd wallet/
[oracle@srlabdg2 wallet]$ mkdir tde
[oracle@srlabdg2 wallet]$ ls -lrt
total 4
drwxr-xr-x. 2 oracle oinstall 4096 Oct 15 20:00 tde
[oracle@srlabdg2 wallet]$ cd tde
[oracle@srlabdg2 tde]$ pwd
/u01/app/oracle/admin/srcdbsby/wallet/tde
[oracle@srlabdg2 tde]$ clear
[oracle@srlabdg2 tde]$ hostname
srlabdg2
[oracle@srlabdg2 tde]$ ps -ef |grep pmon
oracle 17168 1 0 18:55 ? 00:00:00 ora_pmon_srcdbsby
oracle 22647 2971 0 20:07 pts/0 00:00:00 grep --color=auto pmon
[oracle@srlabdg2 tde]$ ps -ef |grep tns
root 22 2 0 10:49 ? 00:00:00 [netns]
oracle 20770 1 0 19:41 ? 00:00:00 /u01/app/oracle/product/19.0.0.0/db_1/bin/tnslsnr LISTENER -inherit
oracle 22662 2971 0 20:07 pts/0 00:00:00 grep --color=auto tns
[oracle@srlabdg2 tde]$ lsnrctl status LISTENER
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 15-OCT-2021 20:07:26
Copyright (c) 1991, 2021, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.101)(PORT=1525)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 15-OCT-2021 19:41:23
Uptime 0 days 0 hr. 26 min. 3 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/19.0.0.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/srlabdg2/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1525)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1525)))
Services Summary...
Service "srcdbsby" has 1 instance(s).
Instance "srcdbsby", status UNKNOWN, has 1 handler(s) for this service...
Service "srcdbsby_dgmgrl" has 1 instance(s).
Instance "srcdbsby", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@srlabdg2 tde]$ dgmgrl /
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Fri Oct 15 20:07:39 2021
Version 19.12.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected to "srcdbsby"
Connected as SYSDG.
DGMGRL> show configuration;
Configuration - srcdb
Protection Mode: MaxPerformance
Members:
srcdb - Primary database
srcdbsby - Physical standby database
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 45 seconds ago)
DGMGRL> show database srcdb;
Database - srcdb
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
srcdb
Database Status:
SUCCESS
DGMGRL> show database srcdbsby;
Database - srcdbsby
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 0 seconds ago)
Apply Lag: 0 seconds (computed 0 seconds ago)
Average Apply Rate: 1.00 KByte/s
Real Time Query: OFF
Instance(s):
srcdbsby
Database Status:
SUCCESS
DGMGRL> show configuration lag;
Configuration - srcdb
Protection Mode: MaxPerformance
Members:
srcdb - Primary database
srcdbsby - Physical standby database
Transport Lag: 0 seconds (computed 1 second ago)
Apply Lag: 0 seconds (computed 1 second ago)
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 59 seconds ago)
DGMGRL> exit
[oracle@srlabdg2 tde]$ sql
SQL*Plus: Release 19.0.0.0.0 - Production on Fri Oct 15 20:08:37 2021
Version 19.12.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0
SQL> shut immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0
[oracle@srlabdg2 tde]$ pwd
/u01/app/oracle/admin/srcdbsby/wallet/tde
[oracle@srlabdg2 tde]$ ls -lrt
total 28
-rw-------. 1 oracle oinstall 7000 Oct 15 20:14 cwallet.sso
-rw-------. 1 oracle oinstall 2555 Oct 15 20:14 ewallet_2021101509490529.p12
-rw-------. 1 oracle oinstall 5467 Oct 15 20:14 ewallet_2021101514420896.p12
-rw-------. 1 oracle oinstall 6955 Oct 15 20:14 ewallet.p12
[oracle@srlabdg2 tde]$ cd /u01/app/oracle/product/19.0.0.0/db_1/network/admin/
[oracle@srlabdg2 admin]$ vi sqlnet.ora
[oracle@srlabdg2 admin]$
[oracle@srlabdg2 admin]$ sql
SQL*Plus: Release 19.0.0.0.0 - Production on Fri Oct 15 20:16:23 2021
Version 19.12.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 1493169032 bytes
Fixed Size 9134984 bytes
Variable Size 369098752 bytes
Database Buffers 1107296256 bytes
Redo Buffers 7639040 bytes
Database mounted.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED MOUNTED
3 SRCDBPLUG MOUNTED
4 SRCDBPLUG2 MOUNTED
SQL>
SQL> col name for a40
SQL> select name,recovery_status from v$pdbs;
NAME RECOVERY
---------------------------------------- --------
PDB$SEED ENABLED
SRCDBPLUG ENABLED
SRCDBPLUG2 ENABLED
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------------------------------
/oradata/data/SRCDB/SRCDBSBY/datafile/o1_mf_system_050bmvt7_.dbf
/oradata/data/SRCDB/SRCDBSBY/datafile/o1_mf_sysaux_060bmvub_.dbf
/oradata/data/SRCDB/SRCDBSBY/datafile/o1_mf_undotbs1_070bmvv4_.dbf
/oradata/data/SRCDB/SRCDBSBY/CE5FF02D57CE28BFE0536438A8C00786/datafile/o1_mf_system_0a0bn00j_.dbf
/oradata/data/SRCDB/SRCDBSBY/CE5FF02D57CE28BFE0536438A8C00786/datafile/o1_mf_sysaux_090bn004_.dbf
/oradata/data/SRCDB/SRCDBSBY/datafile/o1_mf_users_0f0bn025_.dbf
/oradata/data/SRCDB/SRCDBSBY/CE5FF02D57CE28BFE0536438A8C00786/datafile/o1_mf_undotbs1_0c0bn01i_.dbf
/oradata/data/SRCDB/SRCDBSBY/CE60BBF5E74B40DDE0536438A8C0AA60/datafile/o1_mf_system_0b0bn013_.dbf
/oradata/data/SRCDB/SRCDBSBY/CE60BBF5E74B40DDE0536438A8C0AA60/datafile/o1_mf_sysaux_080bmvvk_.dbf
/oradata/data/SRCDB/SRCDBSBY/CE60BBF5E74B40DDE0536438A8C0AA60/datafile/o1_mf_undotbs1_0d0bn01q_.dbf
/oradata/data/SRCDB/SRCDBSBY/CE60BBF5E74B40DDE0536438A8C0AA60/datafile/o1_mf_users_0g0bn026_.dbf
/oradata/data/SRCDB/SRCDBSBY/CE60BBF5E74B40DDE0536438A8C0AA60/datafile/o1_mf_enctbs_0e0bn021_.dbf
/oradata/data/SRCDB/SRCDBSBY/CE6629624C673864E0536438A8C0767E/datafile/o1_mf_system_jpm4o0no_.dbf
/oradata/data/SRCDB/SRCDBSBY/CE6629624C673864E0536438A8C0767E/datafile/o1_mf_sysaux_jpm4o0pv_.dbf
/oradata/data/SRCDB/SRCDBSBY/CE6629624C673864E0536438A8C0767E/datafile/o1_mf_undotbs1_jpm4o0px_.dbf
15 rows selected.
SQL> select con_id,name from v$datafile;
CON_ID NAME
---------- --------------------------------------------------------------------------------------------------------
1 /oradata/data/SRCDB/SRCDBSBY/datafile/o1_mf_system_050bmvt7_.dbf
1 /oradata/data/SRCDB/SRCDBSBY/datafile/o1_mf_sysaux_060bmvub_.dbf
1 /oradata/data/SRCDB/SRCDBSBY/datafile/o1_mf_undotbs1_070bmvv4_.dbf
2 /oradata/data/SRCDB/SRCDBSBY/CE5FF02D57CE28BFE0536438A8C00786/datafile/o1_mf_system_0a0bn00j_.dbf
2 /oradata/data/SRCDB/SRCDBSBY/CE5FF02D57CE28BFE0536438A8C00786/datafile/o1_mf_sysaux_090bn004_.dbf
1 /oradata/data/SRCDB/SRCDBSBY/datafile/o1_mf_users_0f0bn025_.dbf
2 /oradata/data/SRCDB/SRCDBSBY/CE5FF02D57CE28BFE0536438A8C00786/datafile/o1_mf_undotbs1_0c0bn01i_.dbf
3 /oradata/data/SRCDB/SRCDBSBY/CE60BBF5E74B40DDE0536438A8C0AA60/datafile/o1_mf_system_0b0bn013_.dbf
3 /oradata/data/SRCDB/SRCDBSBY/CE60BBF5E74B40DDE0536438A8C0AA60/datafile/o1_mf_sysaux_080bmvvk_.dbf
3 /oradata/data/SRCDB/SRCDBSBY/CE60BBF5E74B40DDE0536438A8C0AA60/datafile/o1_mf_undotbs1_0d0bn01q_.dbf
3 /oradata/data/SRCDB/SRCDBSBY/CE60BBF5E74B40DDE0536438A8C0AA60/datafile/o1_mf_users_0g0bn026_.dbf
3 /oradata/data/SRCDB/SRCDBSBY/CE60BBF5E74B40DDE0536438A8C0AA60/datafile/o1_mf_enctbs_0e0bn021_.dbf
4 /oradata/data/SRCDB/SRCDBSBY/CE6629624C673864E0536438A8C0767E/datafile/o1_mf_system_jpm4o0no_.dbf
4 /oradata/data/SRCDB/SRCDBSBY/CE6629624C673864E0536438A8C0767E/datafile/o1_mf_sysaux_jpm4o0pv_.dbf
4 /oradata/data/SRCDB/SRCDBSBY/CE6629624C673864E0536438A8C0767E/datafile/o1_mf_undotbs1_jpm4o0px_.dbf
15 rows selected.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0
[oracle@srlabdg2 admin]$ dgmgrl /
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Fri Oct 15 20:20:46 2021
Version 19.12.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected to "srcdbsby"
Connected as SYSDG.
DGMGRL> show configuration;
Configuration - srcdb
Protection Mode: MaxPerformance
Members:
srcdb - Primary database
srcdbsby - Physical standby database
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 57 seconds ago)
DGMGRL> show configuration lag;
Configuration - srcdb
Protection Mode: MaxPerformance
Members:
srcdb - Primary database
srcdbsby - Physical standby database
Transport Lag: 0 seconds (computed 1 second ago)
Apply Lag: 0 seconds (computed 1 second ago)
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 55 seconds ago)
DGMGRL> show database srcdb;
Database - srcdb
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
srcdb
Database Status:
SUCCESS
DGMGRL> show database srcdbsby;
Database - srcdbsby
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 0 seconds ago)
Apply Lag: 0 seconds (computed 0 seconds ago)
Average Apply Rate: 13.00 KByte/s
Real Time Query: OFF
Instance(s):
srcdbsby
Database Status:
SUCCESS
DGMGRL> show configuration lag;
Configuration - srcdb
Protection Mode: MaxPerformance
Members:
srcdb - Primary database
srcdbsby - Physical standby database
Transport Lag: 0 seconds (computed 1 second ago)
Apply Lag: 0 seconds (computed 1 second ago)
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 20 seconds ago)
DGMGRL> exit
[oracle@srlabdg2 admin]$ sql
SQL*Plus: Release 19.0.0.0.0 - Production on Fri Oct 15 20:24:02 2021
Version 19.12.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0
SQL> select name,open_mode,log_mode,database_role,flashback_on from v$database;
NAME OPEN_MODE LOG_MODE DATABASE_ROLE FLASHBACK_ON
--------- -------------------- ------------ ---------------- ------------------
SRCDB MOUNTED ARCHIVELOG PHYSICAL STANDBY YES
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED MOUNTED
3 SRCDBPLUG MOUNTED
4 SRCDBPLUG2 MOUNTED
SQL>
SQL> alter session set container=SRCDBPLUG;
Session altered.
SQL> select name from v$tempfile;
NAME
-----------------------------------------------------------------------------------------
/oradata/data/SRCDB/SRCDBSBY/CE60BBF5E74B40DDE0536438A8C0AA60/datafile/o1_mf_temp_%u_.tmp
SQL> alter session set container=SRCDBPLUG2;
Session altered.
SQL> select name from v$tempfile;
no rows selected
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
4 SRCDBPLUG2 MOUNTED
SQL> alter session set container=cdb$root;
Session altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED MOUNTED
3 SRCDBPLUG MOUNTED
4 SRCDBPLUG2 MOUNTED
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0
[oracle@srlabdg2 admin]$ dgmgrl /
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Fri Oct 15 20:36:42 2021
Version 19.12.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected to "srcdbsby"
Connected as SYSDG.
DGMGRL> show configuration lag;
Configuration - srcdb
Protection Mode: MaxPerformance
Members:
srcdb - Primary database
srcdbsby - Physical standby database
Transport Lag: 0 seconds (computed 0 seconds ago)
Apply Lag: 0 seconds (computed 0 seconds ago)
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 54 seconds ago)
DGMGRL> edit database srcdbsby set state = 'apply-off';
Succeeded.
DGMGRL> exit
[oracle@srlabdg2 admin]$ sql
SQL*Plus: Release 19.0.0.0.0 - Production on Fri Oct 15 20:37:46 2021
Version 19.12.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED MOUNTED
3 SRCDBPLUG MOUNTED
4 SRCDBPLUG2 MOUNTED
SQL> alter pluggable database SRCDBPLUG2 open read only;
alter pluggable database SRCDBPLUG2 open read only
*
ERROR at line 1:
ORA-01109: database not open
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED MOUNTED
3 SRCDBPLUG MOUNTED
4 SRCDBPLUG2 MOUNTED
SQL>
SQL> alter database open;
Database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 SRCDBPLUG MOUNTED
4 SRCDBPLUG2 MOUNTED
SQL> alter pluggable database SRCDBPLUG2 open read only;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 SRCDBPLUG MOUNTED
4 SRCDBPLUG2 READ ONLY NO
SQL> alter sessoin set container=SRCDBPLUG2;
alter sessoin set container=SRCDBPLUG2
*
ERROR at line 1:
ORA-00940: invalid ALTER command
SQL> alter session set container=SRCDBPLUG2;
Session altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
4 SRCDBPLUG2 READ ONLY NO
SQL>
SQL> alter tablespace temp add tempfile;
Tablespace altered.
SQL> select name from v$tempfile;
NAME
-----------------------------------------------------------------------------------------------
/oradata/data/SRCDB/SRCDBSBY/CE6629624C673864E0536438A8C0767E/datafile/o1_mf_temp_jpm6j2sr_.tmp
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
4 SRCDBPLUG2 READ ONLY NO
SQL> alter session set container=cdb$root;
Session altered.
SQL> show pd bs
SP2-0158: unknown SHOW option "pd"
SP2-0158: unknown SHOW option "bs"
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 SRCDBPLUG MOUNTED
4 SRCDBPLUG2 READ ONLY NO
SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 1493169032 bytes
Fixed Size 9134984 bytes
Variable Size 369098752 bytes
Database Buffers 1107296256 bytes
Redo Buffers 7639040 bytes
Database mounted.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED MOUNTED
3 SRCDBPLUG MOUNTED
4 SRCDBPLUG2 MOUNTED
SQL>
SQL>
SQL> alter session set container=SRCDBPLUG2;
Session altered.
SQL> select name from v$tempfile;
NAME
-----------------------------------------------------------------------------------------------
/oradata/data/SRCDB/SRCDBSBY/CE6629624C673864E0536438A8C0767E/datafile/o1_mf_temp_jpm6j2sr_.tmp
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0
[oracle@srlabdg2 admin]$ dgmgrl /
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Fri Oct 15 20:43:05 2021
Version 19.12.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected to "srcdbsby"
Connected as SYSDG.
DGMGRL> show configuration;
Configuration - srcdb
Protection Mode: MaxPerformance
Members:
srcdb - Primary database
srcdbsby - Physical standby database
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 19 seconds ago)
DGMGRL> show configuration lag;
Configuration - srcdb
Protection Mode: MaxPerformance
Members:
srcdb - Primary database
srcdbsby - Physical standby database
Transport Lag: 0 seconds (computed 0 seconds ago)
Apply Lag: (unknown)
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 28 seconds ago)
DGMGRL>
Configuration - srcdb
Protection Mode: MaxPerformance
Members:
srcdb - Primary database
srcdbsby - Physical standby database
Transport Lag: 0 seconds (computed 0 seconds ago)
Apply Lag: 0 seconds (computed 0 seconds ago)
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 10 seconds ago)
DGMGRL> exit
[oracle@srlabdg1 admin]$ cd /u01/app/oracle/admin/srcdb/wallet/tde/
[oracle@srlabdg1 tde]$ ls -lrt
total 20
-rw-------. 1 oracle oinstall 2555 Oct 15 15:19 ewallet_2021101509490529.p12
-rw-------. 1 oracle oinstall 5467 Oct 15 15:19 ewallet.p12
-rw-------. 1 oracle oinstall 5512 Oct 15 15:30 cwallet.sso
[oracle@srlabdg1 tde]$ cd ..
[oracle@srlabdg1 wallet]$ ls -lrt
total 4
drwxr-xr-x. 2 oracle oinstall 4096 Oct 15 15:30 tde
[oracle@srlabdg1 wallet]$ cd tde/
[oracle@srlabdg1 tde]$ pwd
/u01/app/oracle/admin/srcdb/wallet/tde
[oracle@srlabdg1 tde]$ clear
[oracle@srlabdg1 tde]$ hostname
srlabdg1
[oracle@srlabdg1 tde]$ ps -ef |grep pmon
oracle 14313 22153 0 20:06 pts/2 00:00:00 grep --color=auto pmon
oracle 25190 1 0 15:26 ? 00:00:04 ora_pmon_srcdb
[oracle@srlabdg1 tde]$ ps -ef |grep tns
root 22 2 0 11:30 ? 00:00:00 [netns]
oracle 12293 1 0 19:39 ? 00:00:00 /u01/app/oracle/product/19.0.0.0/db_1/bin/tnslsnr LISTENER -inherit
oracle 14319 22153 0 20:06 pts/2 00:00:00 grep --color=auto tns
[oracle@srlabdg1 tde]$ lsnrctl status LISTENER
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 15-OCT-2021 20:06:50
Copyright (c) 1991, 2021, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=srlabdg1)(PORT=1525)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 15-OCT-2021 19:39:59
Uptime 0 days 0 hr. 26 min. 51 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/19.0.0.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/srlabdg1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=srlabdg1)(PORT=1525)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1525)))
Services Summary...
Service "86b637b62fdf7a65e053f706e80a27ca" has 1 instance(s).
Instance "srcdb", status READY, has 1 handler(s) for this service...
Service "ce60bbf5e74b40dde0536438a8c0aa60" has 1 instance(s).
Instance "srcdb", status READY, has 1 handler(s) for this service...
Service "srcdb" has 2 instance(s).
Instance "srcdb", status UNKNOWN, has 1 handler(s) for this service...
Instance "srcdb", status READY, has 1 handler(s) for this service...
Service "srcdbXDB" has 1 instance(s).
Instance "srcdb", status READY, has 1 handler(s) for this service...
Service "srcdb_CFG" has 1 instance(s).
Instance "srcdb", status READY, has 1 handler(s) for this service...
Service "srcdb_dgmgrl" has 1 instance(s).
Instance "srcdb", status UNKNOWN, has 1 handler(s) for this service...
Service "srcdbplug" has 1 instance(s).
Instance "srcdb", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@srlabdg1 tde]$ sql
SQL*Plus: Release 19.0.0.0.0 - Production on Fri Oct 15 20:08:19 2021
Version 19.12.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0
SQL> select * from global_name;
GLOBAL_NAME
--------------------------------------------------------------------------------
SRCDB
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 SRCDBPLUG READ WRITE NO
SQL> set lines 300 pages 2000
SQL>
SQL> create pluggable database srcdbplug2 admin user srcdbadmin identified by ora12345;
Pluggable database created.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 SRCDBPLUG READ WRITE NO
4 SRCDBPLUG2 MOUNTED
SQL>
SQL> alter pluggable database SRCDBPLUG2 open;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 SRCDBPLUG READ WRITE NO
4 SRCDBPLUG2 READ WRITE NO
SQL> alter session set container=SRCDBPLUG2;
Session altered.
SQL> administer key management set key force keystore identified by welcome1 with backup;
keystore altered.
SQL> col name for a75
SQL> select name from v$datafile;
NAME
-----------------------------------------------------------------------------------------------
/oradata/data/SRCDB/SRCDB/CE6629624C673864E0536438A8C0767E/datafile/o1_mf_system_jpm4o0no_.dbf
/oradata/data/SRCDB/SRCDB/CE6629624C673864E0536438A8C0767E/datafile/o1_mf_sysaux_jpm4o0pv_.dbf
/oradata/data/SRCDB/SRCDB/CE6629624C673864E0536438A8C0767E/datafile/o1_mf_undotbs1_jpm4o0px_.dbf
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0
[oracle@srlabdg1 tde]$ ls -lrt
total 28
-rw-------. 1 oracle oinstall 2555 Oct 15 15:19 ewallet_2021101509490529.p12
-rw-------. 1 oracle oinstall 5467 Oct 15 20:12 ewallet_2021101514420896.p12
-rw-------. 1 oracle oinstall 6955 Oct 15 20:12 ewallet.p12
-rw-------. 1 oracle oinstall 7000 Oct 15 20:12 cwallet.sso
[oracle@srlabdg1 tde]$ pwd
/u01/app/oracle/admin/srcdb/wallet/tde
[oracle@srlabdg1 tde]$ scp * 192.168.56.101:/u01/app/oracle/admin/srcdbsby/wallet/tde
oracle@192.168.56.101's password:
cwallet.sso 100% 7000 1.5MB/s 00:00
ewallet_2021101509490529.p12 100% 2555 79.4KB/s 00:00
ewallet_2021101514420896.p12 100% 5467 1.1MB/s 00:00
ewallet.p12 100% 6955 3.0MB/s 00:00
[oracle@srlabdg1 tde]$ cd /u01/app/oracle/product/19.0.0.0/db_1/network/admin/
[oracle@srlabdg1 admin]$ cat sqlnet.ora
# sqlnet.ora Network Configuration File: /u01/app/oracle/product/19.0.0.0/db_1/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.
NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)
ENCRYPTION_WALLET_LOCATION=(SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=/u01/app/oracle/admin/srcdb/wallet/tde)))
[oracle@srlabdg1 admin]$ sql
SQL*Plus: Release 19.0.0.0.0 - Production on Fri Oct 15 20:21:43 2021
Version 19.12.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0
SQL> select * from global_name;
GLOBAL_NAME
--------------------------------------------------------------------------------
SRCDB
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 SRCDBPLUG READ WRITE NO
4 SRCDBPLUG2 READ WRITE NO
SQL> alter system switch logfile;
System altered.
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oradata/archive/srcdb
Oldest online log sequence 21
Next log sequence to archive 23
Current log sequence 23
SQL> select name,open_mode,log_mode,database_role,flashback_on from v$database;
NAME OPEN_MODE LOG_MODE DATABASE_ROLE FLASHBACK_ON
--------- -------------------- ------------ ---------------- ------------------
SRCDB READ WRITE ARCHIVELOG PRIMARY YES
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 SRCDBPLUG READ WRITE NO
4 SRCDBPLUG2 READ WRITE NO
SQL>
SQL> alter session set container=SRCDBPLUG;
Session altered.
SQL> select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
/oradata/data/SRCDB/srcdbplug/temp01.dbf
SQL> alter session set container=SRCDBPLUG2;
Session altered.
SQL> select name from v$tempfile;
NAME
--------------------------------------------------------------------------------------------
/oradata/data/SRCDB/SRCDB/CE6629624C673864E0536438A8C0767E/datafile/o1_mf_temp_jpm4o0pz_.dbf
Post a Comment: