DBA Hub

📋Steps in this guide1/3

CREATE PDB USING SEED - Bright DBA

CREATE PLUGGABLE DATABASE MANUALLY USING SEED(PDB$SEED) Contents

oracle clusteringintermediate
by OracleDba
12 views
1

Overview

CREATE PLUGGABLE DATABASE MANUALLY USING SEED(PDB$SEED) Contents 1. Pre-requisites
2

Section 2

1. Pre-requisites 2. Create PDB using seed (PDB$SEED) Pluggable database created.

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL>
show con_name
CON_NAME
------------------------------
CDB$ROOT
SQL> 

SQL>
select name,open_mode,con_id from v$database;
NAME      OPEN_MODE                CON_ID
--------- -------------------- ----------
CDB2      READ WRITE                    0

SQL>
show pdbs;
CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
SQL>
Note: we don't see any pdb database here.
SQL>
select name,con_id,dbid from v$containers;
NAME                               CON_ID       DBID
------------------------------ ---------- ----------
CDB$ROOT                                1  680230459
PDB$SEED
2
2993936271
<--- CON_ID 2 for PDB$SEED
SQL>
select name from v$datafile where con_id=0;
no rows selected

SQL> 

SQL>
select name from v$datafile where con_id=2;
NAME
--------------------------------------------------------------------------------
/u02/oradata/CDB2/pdbseed/system01.dbf
/u02/oradata/CDB2/pdbseed/sysaux01.dbf
/u02/oradata/CDB2/pdbseed/undotbs01.dbf

SQL>
select name from v$tempfile where con_id=2;
NAME
--------------------------------------------------------------------------------
/u02/oradata/CDB2/pdbseed/temp01.dbf

SQL>

[oracle@localhost ~]$
mkdir -p /home/oracle/oradata/PDB1
SQL>
create pluggable database PDB1 admin user pdb1dba identified by "oracle"
  2  default tablespace PDB1_USERS
  3  datafile '/home/oracle/oradata/PDB1/pdb1_users01.dbf' size 250m autoextend on
  4  storage (maxsize 1g max_shared_temp_size 1g)
  5  file_name_convert=('/u02/oradata/CDB2/pdbseed/','/home/oracle/oradata/PDB1/');
Pluggable database created.
SQL>

SQL>
show pdbs;
CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
3 PDB1                           MOUNTED   <-------
SQL>
alter pluggable database PDB1 open;
Pluggable database altered.

SQL>
3

Section 3

3. Verification Caution : Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
SQL>
show pdbs;
CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
3 PDB1                           READ WRITE NO  <------
SQL> 

SQL>
select name from v$datafile where con_id=3;
NAME
--------------------------------------------------------------------------------
/home/oracle/oradata/PDB1/
system01.dbf
/home/oracle/oradata/PDB1/
sysaux01.dbf
/home/oracle/oradata/PDB1/
undotbs01.dbf
/home/oracle/oradata/PDB1/
pdb1_users01.dbf

SQL>
select name from v$tempfile where con_id=3;
NAME
--------------------------------------------------------------------------------
/home/oracle/oradata/PDB1/temp01.dbf

SQL>


SQL>
select name,con_id,dbid from v$containers;
NAME                     CON_ID       DBID
-------------------- ---------- ----------
CDB$ROOT                      1  680230459
PDB$SEED                      2 2993936271
PDB1                          3  627484885

SQL>

Comments (0)

Please to add comments

No comments yet. Be the first to comment!