12c CDB with PDB as simple as possible



Following on in a pointless series on how to create things as simply as possible here are the steps to create a cdb (and the included initial seed pdb) as simply as possible.

This is the abridged version as there are some issues with the oracle provided scripts that I'll do a long version of the post to describe.

So first up we create as small an init file as possible - this is slightly bigger than my previous example for an old style database (i.e. no cdb or pdb just a 'db').

This is to enable the cdb parameter, make use of db_create_file_dest (to avoid having to specify file names for temp files), and setting a java pool size as the default script for cdb creation installs every possible option.

So we end up with a pfile containing this

db_name='DEMO'
shared_pool_size=1G
enable_pluggable_database=true
java_pool_size=256M
db_create_file_dest='/oracle/DEMO/oradata'


We now just need to set our ORACLE_SID to DEMO (I'm assuming here ORACLE_HOME etc is set)

#export ORACLE_SID=DEMO
#sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Mon Jan 20 21:02:56 2014

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

Connected to an idle instance.

SQL> startup nomount


ORACLE instance started.

Total System Global Area 1169227776 bytes
Fixed Size                  2680792 bytes
Variable Size            1107298344 bytes
Database Buffers           50331648 bytes
Redo Buffers                8916992 bytes
SQL>


SQL> create database enable pluggable database default temporary tablespace temp;

Now we have the raw cdb (and pdb) created but we need to run catalog/catproc etc against them both - this would be pretty painful but oracle provide a perl wrapper script to simplify this which will run the scripts against all CDB/PDB's in the whole DB.

For the initial creation from scratch there is a master script that calls everything. We are prompted for 3 things but then it just goes away and does its stuff.

So lets run that:

SQL> @catcdb
Enter new password for SYS:
Enter new password for SYSTEM:
Enter temporary tablespace name: temp
Connected.








old   1: select '&&oracle_home'||'&&slash'||'rdbms'||'&&slash'||'admin'||'&&slash' as rdbms_admin_slash from dual
new   1: select '/oracle/12.0.0.1'||'/'||'rdbms'||'/'||'admin'||'/' as rdbms_admin_slash from dual




old   1: select '&&oracle_home'||'&&slash'||'rdbms'||'&&slash'||'admin' as rdbms_admin from dual
new   1: select '/oracle/12.0.0.1'||'/'||'rdbms'||'/'||'admin' as rdbms_admin from dual




old   1: select '&&oracle_home'||'&&slash'||'sqlplus'||'&&slash'||'admin'||'&&slash' as sqlplus_admin_slash from dual
new   1: select '/oracle/12.0.0.1'||'/'||'sqlplus'||'/'||'admin'||'/' as sqlplus_admin_slash from dual




old   1: select '&&oracle_home'||'&&slash'||'sqlplus'||'&&slash'||'admin' as sqlplus_admin from dual
new   1: select '/oracle/12.0.0.1'||'/'||'sqlplus'||'/'||'admin' as sqlplus_admin from dual




old   1: select '&&oracle_home'||'&&slash'||'javavm'||'&&slash'||'install' as jvm_install from dual
new   1: select '/oracle/12.0.0.1'||'/'||'javavm'||'/'||'install' as jvm_install from dual




old   1: select '&&oracle_home'||'&&slash'||'ovm'||'&&slash'||'admin' as ovm_admin from dual
new   1: select '/oracle/12.0.0.1'||'/'||'ovm'||'/'||'admin' as ovm_admin from dual




old   1: select '&&oracle_home'||'&&slash'||'xdk'||'&&slash'||'admin' as xdk_admin from dual
new   1: select '/oracle/12.0.0.1'||'/'||'xdk'||'/'||'admin' as xdk_admin from dual




old   1: select '&&oracle_home'||'&&slash'||'ctx'||'&&slash'||'admin' as ctx_admin from dual
new   1: select '/oracle/12.0.0.1'||'/'||'ctx'||'/'||'admin' as ctx_admin from dual




old   1: select '&&oracle_home'||'&&slash'||'ctx'||'&&slash'||'admin'||'&&slash' as ctx_admin_slash from dual
new   1: select '/oracle/12.0.0.1'||'/'||'ctx'||'/'||'admin'||'/' as ctx_admin_slash from dual




old   1: select '&&oracle_home'||'&&slash'||'ord'||'&&slash'||'admin' as ord_admin from dual
new   1: select '/oracle/12.0.0.1'||'/'||'ord'||'/'||'admin' as ord_admin from dual




old   1: select '&&oracle_home'||'&&slash'||'ord'||'&&slash'||'im'||'&&slash'||'admin' as im_admin from dual
new   1: select '/oracle/12.0.0.1'||'/'||'ord'||'/'||'im'||'/'||'admin' as im_admin from dual




old   1: select '&&oracle_home'||'&&slash'||'olap'||'&&slash'||'admin' as olap_admin from dual
new   1: select '/oracle/12.0.0.1'||'/'||'olap'||'/'||'admin' as olap_admin from dual




old   1: select '&&oracle_home'||'&&slash'||'md'||'&&slash'||'admin' as md_admin from dual
new   1: select '/oracle/12.0.0.1'||'/'||'md'||'/'||'admin' as md_admin from dual




old   1: select '&&oracle_home'||'&&slash'||'apex' as apex_home from dual
new   1: select '/oracle/12.0.0.1'||'/'||'apex' as apex_home from dual


















User altered.



User altered.












Connected.

Session altered.


Pluggable database altered.


Pluggable database altered.


PL/SQL procedure successfully completed.


Session altered.


PL/SQL procedure successfully completed.


Session altered.


Pluggable database altered.


Pluggable database altered.


Session altered.

SQL>


Now the CDB and the PDB$SEED have all the options installed and everything is ready to go....

Comments