oracle 12c: looking behind the database configuration assistant ( with cdb )

June 27, 2013 — Leave a comment

as usual when oracle releases a new version of its database I start the dbca and generate the scripts to see what happens in the background. there are quite some interesting changes:

  • the create database statement contains new parameters: “enable pluggable database” and “seed file_name_convert”
  • there is a perl wrapper script to setup the database catalog (catcon.pl)
  • xdb is installed by catproc
  • a hidden parameter “_oracle_script” is used while setting up the catalog
  • there is a new parameter for the init.ora: enable_pluggable_database=true
  • files for the seed container get created, so you’ll need more space

I am sure there are much more changes but these are the ones that catched my eyes while looking at the scripts. here is the complete sample setup ( you’ll need to be patient, this will take much more time than you are used to in 11g ):

umask 0027
mkdir -p /oradata/dbs300/admin/adump
mkdir -p /oradata/dbs300/admin/dpdump
mkdir -p /oradata/dbs300/admin/audit
mkdir -p /oradata/dbs300/admin/pfile
mkdir -p /oradata/dbs300/appl
mkdir -p /oradata/dbs300/dbf
mkdir -p /oradata/dbs300/rdo1
mkdir -p /oradata/dbs300/rdo2
mkdir -p /oradata/dbs300/pdbseed
mkdir -p /oradata/dbs300/fast_recovery_area

orapwd file=/oradata/dbs300/admin/pfile/orapwdbs300 force=y format=12 password=oracle

echo "*.db_block_size=8192
*.control_file_record_keep_time=35
*.filesystemio_options='setall'
*.disk_asynch_io=TRUE
*.db_block_checksum=TYPICAL
*.db_block_checking=MEDIUM
*.db_cache_advice='ON'
*.db_keep_cache_size=0m
*.db_files=1024
*.db_recycle_cache_size=0m
*.fast_start_mttr_target=500
*.instance_name='dbs300'
*.open_cursors=300
*.db_domain='local'
*.db_name="dbs300"
*.log_archive_dest_1='location=/oradata/dbs300/fast_recovery_area'
*.log_archive_format='dummy_%r_%t_%S.arc'
*.job_queue_processes=2
*.control_files=('/oradata/dbs300/rdo1/control01.ctl', '/oradata/dbs300/rdo2/control02.ctl')
*.db_recovery_file_dest='/oradata/dbs300/fast_recovery_area'
*.db_recovery_file_dest_size=4815m
*.compatible=12.1.0.0.0
*.diagnostic_dest=/oradata/dbs300/admin/
*.enable_pluggable_database=true
*.processes=300
*.sga_target=256m
*.audit_file_dest='/oradata/dbs300/admin/adump/'
*.audit_trail=db
*.remote_login_passwordfile=EXCLUSIVE
*.pga_aggregate_target=80m
*.parallel_max_servers=5
*.query_rewrite_enabled='FALSE'
*.recovery_parallelism=4
*.star_transformation_enabled='FALSE'
*.statistics_level='typical'
*.timed_statistics=TRUE
*.recyclebin='OFF'
*.undo_management='auto'
*.undo_retention=10800
*.workarea_size_policy='auto'
*.optimizer_capture_sql_plan_baselines='FALSE'
*.optimizer_use_sql_plan_baselines='TRUE'
*.optimizer_dynamic_sampling=2
*.max_dump_file_size=50m
*.remote_login_passwordfile=EXCLUSIVE
*.undo_tablespace=UNDOTBS1" > /oradata/dbs300/admin/pfile/initdbs300.ora

PERL5LIB=$ORACLE_HOME/rdbms/admin:$PERL5LIB; export PERL5LIB

sqlplus / as sysdba
startup force nomount pfile='/oradata/dbs300/admin/pfile/initdbs300.ora';
create spfile='/oradata/dbs300/admin/pfile/spfiledbs300.ora' from pfile='/oradata/dbs300/admin/pfile/initdbs300.ora';
!ln -s /oradata/dbs300/admin/pfile/spfiledbs300.ora $ORACLE_HOME/dbs/
startup force nomount

CREATE DATABASE "dbs300"
MAXINSTANCES 8
MAXLOGHISTORY 5
MAXLOGFILES 16
MAXLOGMEMBERS 5
MAXDATAFILES 1024
DATAFILE '/oradata/dbs300/dbf/system_01.dbf' SIZE 1024m REUSE AUTOEXTEND ON NEXT 8m MAXSIZE 2g EXTENT MANAGEMENT LOCAL
SYSAUX DATAFILE '/oradata/dbs300/dbf/sysaux_01.dbf' SIZE 1024m REUSE AUTOEXTEND ON NEXT 8m MAXSIZE 2g 
DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/oradata/dbs300/dbf/temp_01.dbf' SIZE 1024m REUSE AUTOEXTEND ON NEXT 8m MAXSIZE 2g
UNDO TABLESPACE "UNDOTBS1" DATAFILE  '/oradata/dbs300/dbf/undotbs_01.dbf' SIZE 1024m REUSE AUTOEXTEND ON NEXT 8m MAXSIZE 2g 
CHARACTER SET AL32UTF8
NATIONAL CHARACTER SET AL16UTF16
LOGFILE GROUP 1 ('/oradata/dbs300/rdo1/redo01_1.log', '/oradata/dbs300/rdo2/redo01_2.log') SIZE 64m,
        GROUP 2 ('/oradata/dbs300/rdo1/redo02_1.log', '/oradata/dbs300/rdo2/redo02_2.log') SIZE 64m,
        GROUP 3 ('/oradata/dbs300/rdo1/redo03_1.log', '/oradata/dbs300/rdo2/redo03_2.log') SIZE 64m
USER SYS IDENTIFIED BY "oracle" USER SYSTEM IDENTIFIED BY "oracle"
enable pluggable database
seed file_name_convert=('/oradata/dbs300/dbf/system_01.dbf', '/oradata/dbs300/pdbseed/system_01.dbf'
                       ,'/oradata/dbs300/dbf/sysaux_01.dbf', '/oradata/dbs300/pdbseed/sysaux_01.dbf'
                       ,'/oradata/dbs300/dbf/temp_01.dbf', '/oradata/dbs300/pdbseed/temp_01.dbf'
                       ,'/oradata/dbs300/dbf/undotbs_01.dbf', '/oradata/dbs300/pdbseed/undotbs_01.dbf');

CREATE TABLESPACE "USERS" LOGGING DATAFILE '/oradata/dbs300/dbf/users_01.dbf' SIZE 16m REUSE AUTOEXTEND ON NEXT 8m MAXSIZE 2g EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
ALTER DATABASE DEFAULT TABLESPACE "USERS";

alter session set "_oracle_script"=true;
alter pluggable database pdb$seed close;
alter pluggable database pdb$seed open;

!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b catalog /opt/oracle/product/base/12.1.0.1/rdbms/admin/catalog.sql;
!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b catblock /opt/oracle/product/base/12.1.0.1/rdbms/admin/catblock.sql;
!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b catproc /opt/oracle/product/base/12.1.0.1/rdbms/admin/catproc.sql;
!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b catoctk /opt/oracle/product/base/12.1.0.1/rdbms/admin/catoctk.sql;
!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b pupbld -u SYSTEM/oracle /opt/oracle/product/base/12.1.0.1/sqlplus/admin/pupbld.sql;
connect system/oracle
!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b hlpbld -u SYSTEM/oracle -a 1  /opt/oracle/product/base/12.1.0.1/sqlplus/admin/help/hlpbld.sql 1helpus.sql;

conn / as sysdba
!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b catclust /opt/oracle/product/base/12.1.0.1/rdbms/admin/catclust.sql;
grant sysdg to sysdg;
grant sysbackup to sysbackup;
grant syskm to syskm;

@?/rdbms/admin/utlrp

-- for java
!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b initjvm /opt/oracle/product/base/12.1.0.1/javavm/install/initjvm.sql;
!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b initxml /opt/oracle/product/base/12.1.0.1/xdk/admin/initxml.sql;
!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b xmlja /opt/oracle/product/base/12.1.0.1/xdk/admin/xmlja.sql;
!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b catjava /opt/oracle/product/base/12.1.0.1/rdbms/admin/catjava.sql;
connect "SYS"/oracle as SYSDBA
!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b catxdbj /opt/oracle/product/base/12.1.0.1/rdbms/admin/catxdbj.sql;

-- for oracle text
!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b catctx -a 1  /opt/oracle/product/base/12.1.0.1/ctx/admin/catctx.sql 1change_on_install 1SYSAUX 1TEMP 1LOCK;
alter user CTXSYS account unlock identified by "CTXSYS";
!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b dr0defin -u CTXSYS/CTXSYS -a 1  /opt/oracle/product/base/12.1.0.1/ctx/admin/defaults/dr0defin.sql 1\"AMERICAN\";
connect "SYS"/oracle as SYSDBA
alter user CTXSYS password expire account lock;

--for ord
!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b ordinst -a 1  /opt/oracle/product/base/12.1.0.1/ord/admin/ordinst.sql 1SYSAUX 1SYSAUX;

-- for intermedia
!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b iminst /opt/oracle/product/base/12.1.0.1/ord/im/admin/iminst.sql;

-- for olap
!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b olap -a 1  /opt/oracle/product/base/12.1.0.1/olap/admin/olap.sql 1SYSAUX 1TEMP;

-- for spatial
!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b mdinst /opt/oracle/product/base/12.1.0.1/md/admin/mdinst.sql;

-- for label security
!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b catols /opt/oracle/product/base/12.1.0.1/rdbms/admin/catols.sql;

-- for apex
!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b catapx -a 1  /opt/oracle/product/base/12.1.0.1/apex/catapx.sql 1change_on_install 1SYSAUX 1SYSAUX 1TEMP 1/i/ 1NONE;

-- for datavault
!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b catmac -a 1  /opt/oracle/product/base/12.1.0.1/rdbms/admin/catmac.sql 1SYSAUX 1TEMP 1oracle;

-- psu
!perl /opt/oracle/product/base/12.1.0.1/rdbms/admin/catcon.pl -n 1 -l /home/oracle -b catbundle -a 1  /opt/oracle/product/base/12.1.0.1/rdbms/admin/catbundle.sql 1psu 1apply;

select COMP_NAME,VERSION,STATUS from dba_registry

COMP_NAME				 VERSION			STATUS
---------------------------------------- ------------------------------ ------------------------------
Oracle XML Database			 12.1.0.1.0			VALID
Oracle Database Catalog Views		 12.1.0.1.0			VALID
Oracle Database Packages and Types	 12.1.0.1.0			VALID
Oracle Real Application Clusters	 12.1.0.1.0			OPTION OFF
shutdown immediate;
-- add to gi
!/opt/oracle/product/base/12.1.0.1/bin/srvctl add database -d dbs300 -o /opt/oracle/product/base/12.1.0.1 -n dbs300
!/opt/oracle/product/base/12.1.0.1/bin/srvctl start database -d dbs300;

more to come …

About these ads

No Comments

Be the first to start the conversation!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s