02 Create EMREPOS Database Using DBCA


Overview

After much drama, I managed to patch the GI and RDBMS homes to PSU 12.1.0.2.5. With that out of the way, I can now create a database. Instead of using manual commands, I will use dbca .

References

None.

Procedure

Set Up Environment

Ran the following commands as the oracle user to set up the environment prior to using dbca :

export ORACLE_HOME=/opt/app/oracle/product/12.1.0/dbhome_1
export PERL5LIB=${ORACLE_HOME}/perl/lib
export PATH=${ORACLE_HOME}/bin:${ORACLE_HOME}/perl/bin:${PATH}

Invoke DBCA

dbca was invoked as follows:

dbca

Step 1: Database Operation

On the following screen, chose database creation:


Clicked Next .

Step 2: Creation Mode

Create a database with default configuration

  • Global Database Name emrepos.yaocm.id.au
  • Storage Type ASM
  • Database File Location +DATA
  • Fast Recovery Area +FRA
  • Database Character Set AL32UTF8
  • Create as Container Database
    • Pluggable Database Name repos

Clicked Next .

Step 3: Prerequisite Checks

No problems were found.

Step 4: Summary

No action was required on the following screen:


Clicked Finish .

Step 5: Progress Page

The following progress page appeared:


On the Creating Pluggable Databases step, the following message appeared—there were no other details:


Clicked Ignore .

This was followed by the following message:


Clicked Ignore .

Then another message (not shown) before failing altogether.

MOS Investigation

According to the screen shots, there were two (2) error messages:

  1. ORA-00922: Missing or invalid option
  2. ORA-65000: missing or invalid pluggable database name

The first error returned far too many hits (even when qualified with DBCA ), while the second only returned one (1) hit:

This is not an exact match.

The alert log for EMREPOS shows:

Wed Dec 30 08:52:01 2015
alter pluggable database  open
ORA-65000 signalled during: alter pluggable database  open...
Wed Dec 30 08:54:08 2015
Shutting down instance (abort)
License high water mark = 10
Wed Dec 30 08:54:08 2015
USER (ospid: 13453): terminating the instance
Wed Dec 30 08:54:09 2015
Instance terminated by USER, pid = 13453
Wed Dec 30 08:54:09 2015
Instance shutdown complete

MOS Doc ID 2046208.1 is not a match at all. There was really a missing PDB name.

Manual Repair

Assuming that the database creation is repairable, I went on.

Update /etc/oratab

I added the appropiate entry to /etc/oratab as follows:

cat >>/etc/oratab <<DONE
emrepos:/opt/app/oracle/product/12.1.0/dbhome_1:N       # line added by Douglas 2015/12/31
DONE

Set Up Oracle Environment

Used . oraenv to set up the Oracle environment for emrepos .

Define the Database Resource to GI

I reviewed the alert log for the EMREPOS database to find the name of the SPFILE used on the last startup.

Used srvctl under the database home to define the database resource for EMREPOS :

srvctl add database                                           \
  -db emrepos                                                 \
  -oraclehome /opt/app/oracle/product/12.1.0/dbhome_1         \
  -domain yaocm.id.au                                         \
  -spfile "+DATA/EMREPOS/PARAMETERFILE/spfile.269.899763205"  \
  -role PRIMARY                                               \
  -startoption "READ WRITE"                                   \
  -stopoption "IMMEDIATE"                                     \
  -instance emrepos                                           \
  -policy AUTOMATIC                                           \
  -diskgroup "DATA,FRA"

Created Password File

Used the orapwd command to create a password file for the EMREPOS database as follows:

orapwd file="+DATA" dbuniquename=EMREPOS sysbackup=y sysdg=y syskm=y

The output was:

Enter password for SYS: 

Enter password for SYSBACKUP: 

Enter password for SYSDG: 

Enter password for SYSKM: 

Note: Using orapwd after srvctl add database updates the CRS resource automatically. Using the commands in the reverse order means that you will have to specify the password file name in srvctl add database command.

Verify CRS Definition of EMREPOS

Used the following command to see the current configuration of the CRS resource for the EMREPOS database:

srvctl config database -db emrepos -all

The output was:

Database unique name: emrepos
Database name: 
Oracle home: /opt/app/oracle/product/12.1.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/EMREPOS/PARAMETERFILE/spfile.269.899763205
Password file: +DATA/EMREPOS/PASSWORD/pwdemrepos.271.899898713
Domain: yaocm.id.au
Start options: read write
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Disk Groups: DATA,FRA
Services: 
Database is enabled
OSDBA group: 
OSOPER group: 
Database instance: emrepos

Start the EMREPOS Database Instance

Used the following command to start up the EMREPOS database instance:

srvctl start database -db emrepos

No error messages were produced, nor were there any in the alert log.

Verify Status of PDB

select pdb_id,pdb_name,status from cdb_pdbs;

The output was:

    PDB_ID PDB_NAME		STATUS
---------- -------------------- ---------
	 2 PDB$SEED		NORMAL