Create a PDB by using a non-CDB

6.1 Create a PDB by using a non-CDB in same version and same characterset

-bash-4.1$ ./dbca -silent -createdatabase -gdbname ncdb -sid ncdb

-syspassword oracle_4U -systempassword oracle_4U

-templatename General_Purpose.dbc -emconfiguration none

-memorypercentage 15 -characterset al32utf8

Copying database files

1% complete

3% complete

11% complete

18% complete

26% complete

37% complete

Creating and starting Oracle instance

40% complete

45% complete

50% complete

55% complete

56% complete

60% complete

62% complete

Completing Database Creation

66% complete

70% complete

73% complete

85% complete

96% complete

100% complete

-bash-4.1$ sql

SQL> select name,open_mode,cdb from v$database;

NAME OPEN_MODE CDB

——— ——————– —

NCDB READ WRITE NO

SQL> select logins from v$instance;

LOGINS

———-

ALLOWED

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup open read only;

ORACLE instance started.

Total System Global Area 704643072 bytes

Fixed Size 2928392 bytes

Variable Size 293601528 bytes

Database Buffers 402653184 bytes

Redo Buffers 5459968 bytes

Database mounted.

Database opened.

SQL>

SQL> set serveroutput on

SQL> EXEC DBMS_PDB.DESCRIBE(‘/home/oracle/ncdb.xml’);

PL/SQL procedure successfully completed.

SQL> shut immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

-bash-4.1$ export ORACLE_SID=orcl12c

-bash-4.1$ sql

SQL> startup

ORACLE instance started.

Total System Global Area 939524096 bytes

Fixed Size 2931088 bytes

Variable Size 348128880 bytes

Database Buffers 583008256 bytes

Redo Buffers 5455872 bytes

Database mounted.

Database opened.

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED

———- —————————— ———- ———-

2 PDB$SEED READ ONLY NO

6 MYPDB4 READ WRITE NO

SQL> SET SERVEROUTPUT ON

SQL> BEGIN

2 IF DBMS_PDB.CHECK_PLUG_COMPATIBILITY(‘/home/oracle/ncdb.xml’) then

3 dbms_output.put_line(‘compatible’);

4 else

5 dbms_output.put_line(‘not compatible’);

6 end if;

7 END;

8 /

compatible

PL/SQL procedure successfully completed.

SQL> create pluggable database mypdb10 using ‘/home/oracle/ncdb.xml’ move

2 file_name_convert=(‘/u01/app/oracle/oradata/ncdb’,

‘/u01/app/oracle/oradata/orcl12c/mypdb10’);

Pluggable database created.

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED

———- —————————— ———- ———-

2 PDB$SEED READ ONLY NO

3 MYPDB10 MOUNTED

6 MYPDB4 READ WRITE NO

SQL> alter session set container=mypdb10;

Session altered.

SQL>@?/rdbms/admin/noncdb_to_pdb.sql

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED

———- —————————— ———- ———-

3 MYPDB10 MOUNTED

SQL> startup

Pluggable Database opened.

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED

———- —————————— ———- ———-

3 MYPDB10 READ WRITE NO

No responses yet

Leave a Reply

Your email address will not be published. Required fields are marked *