OCI | Database Cloud Service | Tutorial | Create PDB

YouTube Link: Coming Soon

Ali Hassane
2 min readNov 20, 2020

SE Database Cloud Service — Create PDB

With the changes in Oracle Database 19C Licensing you can now create up to 3 pluggable databases (PDBs) per your Standard Edition Database Cloud container without extra licensing cost.

If you tried to add a new pdb and got ‘ORA-28374 error’ in this tutorial I’ll walk you through the steps to successfully add a pluggable database and solve that.

ORA-28374 error: typed master key not found in wallet

Let’s Start:

00: Connect to your database instance over SSH session, then switch to Oracle user.

OPC $ sudo su -
root$ su — oracle

01: Check db Version by logging to your database as sysdba and issue the following command:

set lines 120
Select * from v$version;

02: Create Test PLUGGABLE database TESTPDB

CREATE PLUGGABLE DATABASE TESTPDB ADMIN USER test_admin IDENTIFIED BY test_admin
STORAGE (MAXSIZE 2G)
DEFAULT TABLESPACE USERS
DATAFILE '+DATA' SIZE 250M AUTOEXTEND ON;

03: Check the PDB

set lines 120
COLUMN PDB_ID for 99
COLUMN PDB_NAME for a20
COLUMN STATUS for a15
select PDB_ID,PDB_NAME,STATUS from cdb_pdbs;

04: Open database for READ/WRITE

ALTER PLUGGABLE DATABASE TESTPDB OPEN READ WRITE;
ALTER PLUGGABLE DATABASE ALL save STATE;

05: Switch to the new PDB — TESTPDB

alter session set container=TESTPDB;

06: Check TESTPDB Data Files and Tablespaces

set lines 140
COLUMN TABLESPACE_NAME format a10
COLUMN FILE_NAME format a90 TRUNCATED
select TABLESPACE_NAME,FILE_NAME from dba_data_files;

07: Create new Tablespace

create tablespace TEST datafile '+DATA';
-- After issuing create tablespace statement we expect to receive ORA-28374 error: typed master key not found in wallet

08: Exit SQLPLUS then switch to root user and use dbcli to obtain your databases ID

dbid=$(dbcli list-databases | awk 'BEGIN { FS = " " } ; { print $1 }' | tail -n 1)

09: Update the database wallet

dbcli update-tdekey -i $dbid -p -n TESTPDB — You’ll be prompted to enter the TDE Admin Wallet Password, once you do it take few seconds to perform the update and you’ll get a message similar to the following
{
“jobId” : “8f7b97ac-62ae-4195-a16c-4995469b4c32”,
“status” : “Created”,
“message” : null,
“reports” : [ ],
“createTimestamp” : “May 14, 2019 10:41:18 AM UTC”,
“resourceList” : [ ],
“description” : “TDE update alisedb”,
“updatedTime” : “May 14, 2019 10:41:18 AM UTC”
}

Now you should be able to create the new tablespace without any issue. Repeat the steps 00, 05, 07 then repeat step 06 to check the tablespace.

--

--