Atikh's DBA blog
  • Home
  • Oracle
  • MySQL
  • MongoDB
  • PostgreSQL
  • Snowflake
  • About Me
  • Contact Us

ORACLE : Creating a new pluggable database using PDB$SEED

 Atikh Shaikh     oracle, Oracle 12c, oracle19c     No comments   

As a database administrator, you might come across creating a pluggable database, here is the method to create a pluggable database (PDB), Follow the below steps to create a pluggable database using the default pluggable database PDB$SEED

Step 1: Connect to the Container database using admin privileges

 

[oracle@localhost Desktop]$ sqlplus sys/***@free as sysdba

 

SQL*Plus: Release 23.0.0.0.0 - Developer-Release on Sun Mar 24 06:50:54 2024

Version 23.2.0.0.0

Copyright (c) 1982, 2023, Oracle.  All rights reserved.

 

Connected to:

Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release

Version 23.2.0.0.0

 

 

 

Step 2 : Check existing container databases including pluggable databases

SQL> show pdbs

 

    CON_ID CON_NAME             OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

       2 PDB$SEED               READ ONLY  NO

       3 FREEPDB1               READ WRITE NO

 

Here we can see one default pluggable database and one application pdb (freepdb1)

Check the container id of each container database, this will help to identify datafiles/temp file etc associated with a particular container database

 

SQL> select name,con_id,dbid from v$containers;

 

NAME              CON_ID       DBID

-------------------- ---------- ----------

CDB$ROOT                1 1408182090

PDB$SEED                2  871956951  <-- create a new pdb using this

FREEPDB1                3 1423580300

 

Check the datafile and temp file associated with PDB$SEED to identify the path of datafiles for the new database

SQL> select name from v$datafile where con_id=2;

NAME

-----------------------------------------------------------------

/opt/oracle/oradata/FREE/pdbseed/system01.dbf

/opt/oracle/oradata/FREE/pdbseed/sysaux01.dbf

/opt/oracle/oradata/FREE/pdbseed/undotbs01.dbf

                              

SQL> select name from v$tempfile where con_id=2;

NAME

-----------------------------------------------------------------

/opt/oracle/oradata/FREE/pdbseed/temp01.dbf

 

 

Step 3: Create a directory for new pluggable database datafiles

 

[oracle@localhost Desktop]$

[oracle@localhost Desktop]$ mkdir -p /opt/oracle/oradata/FREE/pdb2

[oracle@localhost Desktop]$

 

 

Step 4 : Create a pluggable database

 

SQL> create pluggable database PDB2 admin user pdb2_user identified by "test123"

default tablespace PDB2_DEFAULT

datafile '/opt/oracle/oradata/FREE/pdb2/PDB2_DEFAULT.dbf' size 100m autoextend on

file_name_convert=('/opt/oracle/oradata/FREE/pdbseed','/opt/oracle/oradata/FREE/pdb2');  2    3    4 

 

Pluggable database created.

 

SQL> show pdbs

 

    CON_ID CON_NAME             OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

       2 PDB$SEED               READ ONLY  NO

       3 FREEPDB1               READ WRITE NO

       4 PDB2                   MOUNTED

 

Step 5: Open pluggable database

 

SQL> alter pluggable database PDB2 open;

 

Pluggable database altered.

 

SQL> show pdbs

 

    CON_ID CON_NAME             OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

       2 PDB$SEED               READ ONLY  NO

       3 FREEPDB1               READ WRITE NO

       4 PDB2                   READ WRITE NO

 

Here we can see PDB2 pluggable database has been created successfully.

  • Share This:  
  •  Facebook
  •  Twitter
  •  Instagram
  •  Pin
  •  linkedin
  •  reddit
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Author

Atikh Shaikh
View my complete profile

Categories

  • MongoDB (18)
  • Oracle 12c (30)
  • Oracle12cR2 New Feature (3)
  • PostgreSQL (20)
  • RMAN (10)
  • Snowflake (8)
  • mysql (23)
  • oracle (74)

Blog Archive

  • ►  2018 (38)
    • ►  November (25)
    • ►  December (13)
  • ►  2019 (33)
    • ►  January (15)
    • ►  February (6)
    • ►  March (2)
    • ►  April (5)
    • ►  May (5)
  • ►  2020 (5)
    • ►  April (1)
    • ►  May (2)
    • ►  July (2)
  • ►  2021 (8)
    • ►  June (3)
    • ►  July (3)
    • ►  August (1)
    • ►  December (1)
  • ►  2022 (33)
    • ►  May (3)
    • ►  June (10)
    • ►  July (3)
    • ►  August (4)
    • ►  September (8)
    • ►  October (3)
    • ►  November (2)
  • ►  2023 (14)
    • ►  February (1)
    • ►  April (5)
    • ►  May (2)
    • ►  June (1)
    • ►  September (1)
    • ►  October (1)
    • ►  December (3)
  • ▼  2024 (5)
    • ►  January (2)
    • ▼  March (3)
      • Error: Unable to find a match: postgresql14-server
      • RMAN Backup of Container and Pluggable Database in...
      • ORACLE : Creating a new pluggable database using ...
  • ►  2025 (6)
    • ►  March (1)
    • ►  April (3)
    • ►  May (2)

Popular Posts

  • ORA-29283: invalid file operation: unexpected "LFI" error (1509)[29437]
    I was trying to export the schema in my windows PC, it got stuck with below error    C:\Users\shaik\Videos\technodba exp>expdp userid...
  • PostgreSQL : How to get data directory location for PostgreSQL instance
    Sometimes, you start working on a PostgreSQL instance but forget about the data directory, here we will discuss different methods to know th...
  • Oracle 23ai : Use of NOVALIDATE Constraints in IMPDP
    While performing impdp operations in the Oracle database, Oracle performs validation checks for every constraint on the imported table, that...
  • ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES
    In previous articles, we have learned about user creation and grants  in MySQL in detail, but there are a few privileges called global priv...
  • Oracle Dataguard Broker Configuration (DGMGRL)
    Data Guard Broker is a command-line interface that makes managing primary and standby databases easy. DBA can use a single command to switch...

Labels

oracle Oracle 12c mysql PostgreSQL MongoDB oracle 19c Oracle23c oracle19c Orale PDB-CDB oracle12c python AWS Oracle ASM Virtualbox pluggable database storage engine

Pages

  • Disclaimer
  • Privacy Policy

Follow TechnoDBA

Copyright © Atikh's DBA blog | Powered by Blogger