Creating New Container Database

on my previous post we install oracle 12c software using silent mode. i always use silent mode since the server i’m using is located on other side of the world.

dbca -silent \
-createDatabase \
-templateName General_Purpose.dbc \
-gdbName ORA12C \
-sid ORA12C \
-SysPassword oracle12c \
-SystemPassword manager \
-datafileDestination /backup/ORA12CTESTING/db04/oradata \
-redoLogFileSize 500 \
-storageType FS \
-characterSet AL32UTF8 \
-NATIONALCHARACTERSET AL16UTF16 \
-totalMemory 1000 \
-createAsContainerDatabase true \
-emConfiguration DBEXPRESS  \
-registerWithDirService false 


Below is the output.

dbf10xyz: ORA12C>dbca -silent \
> -createDatabase \
> -templateName General_Purpose.dbc \
> -gdbName ORA12C \
> -sid ORA12C \
> -SysPassword oracle12c \
>
> -datafileDestination /backup/ORA12CTESTING/db04/oradata \
> -redoLogFileSize 500 \
>
> -characterSet AL32UTF8 \
> -NATIONALCHARACTERSET AL16UTF16 \
> -totalMemory 1000 \
> -createAsContainerDatabase true \
> -emConfiguration DBEXPRESS  \
> -registerWithDirService false
Copying database files
1% complete
3% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
46% complete
47% complete
52% complete
57% complete
58% complete
59% complete
62% complete
Completing Database Creation
66% complete
70% complete
74% complete
85% complete
89% complete
100% complete
Look at the log file "/opt/app/oracle/cfgtoollogs/dbca/ORA12C/ORA12C1.log" for further details.
you have mail in /var/spool/mail/oracle
dbf10xyz: ORA12C>

now lets put our newly created database is archivelog mode.

SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     1
Current log sequence           2
SQL> !mkdir -p /backup/ORA12CTESTING/db05/oradata/ORA12C/arch


SQL> alter system set log_archive_dest_1='LOCATION=/backup/ORA12CTESTING/db05/oradata/ORA12C/arch';

System altered.


SQL> alter system set log_archive_format='ORA12C_%t_%s_%r.arc' scope=spfile;

System altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area  784998400 bytes
Fixed Size                  2293296 bytes
Variable Size             369099216 bytes
Database Buffers          406847488 bytes
Redo Buffers                6758400 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /backup/ORA12CTESTING/db05/oradata/ORA12C/arch
Oldest online log sequence     1
Next log sequence to archive   2
Current log sequence           2
SQL>

SQL> alter database open;

Database altered.

SQL>

lets do some check on our newly created database.

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

NAME                        CDB           CON_ID
--------------------------- --------- ----------
ORA12C                      YES                0

SQL> col name format a20;
SQL>  SELECT name, open_mode from v$pdbs;

NAME                 OPEN_MODE
-------------------- ------------------------------
PDB$SEED             READ ONLY

SQL>
Tablespace Name / File Class  Filename                                                               File Size Auto            Next             Max
----------------------------- ---------------------------------------------------------------- --------------- ---- --------------- ---------------
SYSAUX                        /backup/ORA12CTESTING/db04/oradata/ORA12C/sysaux01.dbf                       720 YES       10,485,760          32,768
SYSTEM                        /backup/ORA12CTESTING/db04/oradata/ORA12C/system01.dbf                       780 YES       10,485,760          32,768
TEMP                          /backup/ORA12CTESTING/db04/oradata/ORA12C/temp01.dbf                          88 YES          655,360          32,768
UNDOTBS1                      /backup/ORA12CTESTING/db04/oradata/ORA12C/undotbs01.dbf                      240 YES        5,242,880          32,768
USERS                         /backup/ORA12CTESTING/db04/oradata/ORA12C/users01.dbf                          5 YES        1,310,720          32,768
[ CONTROL FILE    ]           /backup/ORA12CTESTING/db04/oradata/ORA12C/control01.ctl
[ CONTROL FILE    ]           /opt/app/oracle/fast_recovery_area/ORA12C/control02.ctl
[ ONLINE REDO LOG ]           /backup/ORA12CTESTING/db04/oradata/ORA12C/redo01.log                         500
[ ONLINE REDO LOG ]           /backup/ORA12CTESTING/db04/oradata/ORA12C/redo02.log                         500
[ ONLINE REDO LOG ]           /backup/ORA12CTESTING/db04/oradata/ORA12C/redo03.log                         500
                                                                                               ---------------
sum                                                                                                      3,333

10 rows selected.

SQL>

Configure Listener

SID_LIST_LISTENER_ORA12C =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME =ORA12C)
      (ORACLE_HOME = /opt/app/oracle/product/12.1.0.1/dbhome_1)
      (SID_NAME =ORA12C)
    )
  )

LISTENER_ORA12C =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
       (ADDRESS = (PROTOCOL = TCP)(HOST = dbf10xyz)(PORT = 1522))
      )
    )
  )

now our new container database is ready.
tried using sqldeveloper to create/manage a pluggable database… and its really easy.

on my next post i will try to work on pluggable database using commandline.

Advertisements

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