Translate

Thursday, 3 December 2015

Upgrading OCM 11g to OCM 12c (Series) 5 - Create and Manage Pluggable Databases

Check out other posts of this Series:

Thanks to Alex, we now have a lot of information on this topic. Without further ado, let’s get into it.

The first thing we need to do is to create a Container Database so that we can practice creating and managing pluggable databases on it.

The process of creation a Container Database is described in the Oracle Documentation.

clip_image0028_thumbHow to Get to It in the Documentation?
Oracle Database Online Documentation 12c Release 1 (12.1) / Database Administration /  Administrator’s Guide / Creating and Configuring and Oracle Database

Since the documentation is pretty clear when it says Pluggable Databases, we will not concentrate too much on the creation of the CDB itself but on the PDBs.

In this chapter, two instances will be created, one instance for a CDB database – prod1,  and another instance for a Non-CDB database - prod2.

Container Database Creation

As mentioned earlier, we will be using DBCA, which is the recommended procedure for creating Oracle Databases according to Oracle.

clip_image0028_thumbHow to Get to It in the Documentation?
Oracle Database Online Documentation 12c Release 1 (12.1) / Database Administration /  2 Day DBA / Installing Oracle Database and Creating a Database / Creating and Managing a Database with DBCA


$ cd /u01/app/oracle/product/12.1.0/dbhome_1/bin
$ ./dbca
 

Create CDB 1

image

image

image

image

image

image

image

image

image

image

image

image

Below, we select Generate Database Creation Scripts as well as Create Database.

This way, we can have a look at the scripts later.

image

image

You may choose to run the database creation from DBCA or you may run the scripts from the command prompt.

image

The database creation process might take a long time. In my case, it took over 40 minutes to finish.

image

Checking the Environment


$ cat /etc/oratab
#Backup file is  /u01/app/12.1.0/grid/srvm/admin/oratab.bak.ocmdb12c line added by Agent
#

# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third field indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
+ASM:/u01/app/12.1.0/grid:N        # line added by Agent
prod1:/u01/app/oracle/product/12.1.0/dbhome_1:N        # line added by Agent

$ . oraenv
ORACLE_SID = [oracle] ? prod1
The Oracle base has been set to /u01/app/oracle
$ srvctl config
prod1

$ srvctl config database -d prod1 -v
Database unique name: prod1
Database name: prod1
Oracle home: /u01/app/oracle/product/12.1.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/PROD1/PARAMETERFILE/spfile.261.897844519
Password file:
Domain: xps15z.com
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Disk Groups: FRA,DATA
Services:
OSDBA group:
OSOPER group:
Database instance: prod1

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT

SQL> select name, open_mode from v$pdbs;

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

 

I will also create a non-CDB database called prod2 so that we can perform actions like migrating Non-CDB databases to a CDB as a PDB.

Creating  Pluggable Databases

Pluggable Databases can be created in multiple ways, and with multiple tools, we will be cover some of the ways and tools available for this purpose. We will pay special attention to a few manual ways to create PDBs.

The following table, describes which tools can be used to either create, explore and manage both CDBs and PDBs

image

clip_image0028_thumbHow to Get to It in the Documentation?
Oracle Database Online Documentation 12c Release 1 (12.1) / Database Administration /  Database Administrator’s Guide / Creating and Removing PDBs with SQL*Plus

The following are a few methods which have been selected to be part of this post. There are more ways and variants to the methods described below. For the sake of this study, we will be concentrating on the following ones.

* Creating a PDB using the Seed Database

* Creating a PDB From a local PDB via Database Link

* Creating a PDB From a remote PDB or Non-CDB via Database Link

* Creating a PDB by Plugging an Unplugged PDB into a CDB

* Creating a PDB using a Non-CDB

* Unplugging a PDB from a CDB

* Dropping a PDB

Oracle Pluggable Databases can be used to consolidate multiple Single-Instance Databases into a single Container Database. Some of the PDB creation methods described below can be used to migrate Non-CDB databases to a CDB.

Creating a PDB using the Seed Database

The creation of a PDB from the PDB$SEED, is a very simple procedure. It can be performed either via SQL*PLUS, DBCA, Enterprise Manager, SQL*Developer or Oracle Database Express

When you create a PDB using the seed, you must get familiar with the clauses described here. The table in the link describes some CREATE PLUGGABLE DATABASE parameters which will drive the way a PDB is going to be created.


$ sqlplus / as sysdba


SQL*Plus: Release 12.1.0.2.0 Production on Mon Dec 7 18:14:14 2015

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SQL> CREATE PLUGGABLE DATABASE prod1pdb1 ADMIN USER prod1pdb1 IDENTIFIED BY password STORAGE (MAXSIZE 2G MAX_SHARED_TEMP_SIZE 100M) DEFAULT TABLESPACE USERS DATAFILE SIZE 250M AUTOEXTEND ON;

Pluggable database created

SQL> select name, open_mode from v$pdbs;

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

 

 

On the above example, I am not setting the location for the data files due to the DB_CREATE_FILE_DEST parameter being set for the instance.

Creating a PDB by Cloning an Existing Non-CDB

 

You can use the CREATE PLUGGABLE DATABASE statement to clone a PDB from a source PDB or from a non-CDB. This technique clones a source PDB or non-CDB and plugs the clone into the CDB. To use this technique, you must include a FROM clause that specifies the source.

Both the CDB and the non-CDB must be running Oracle Database 12c Release 1 (12.1.0.2) or later. If your current non-CDB uses an Oracle Database release before Oracle Database 12c Release 1 (12.1.0.2), then you must upgrade the non-CDB to Oracle Database 12c Release 1 (12.1.0.2) to use this technique.

The prod1 databases corresponds to the CDB and the prod2 corresponds to the Non-CDB database.


$ cd /u01/app/oracle/product/12.1.0/dbhome_1/bin
$ ./dbca
 

For the sake of this exercise, I will be creating a non-CDB database on the same server using the same steps described in the above section Container Database Creation.

Pointing upWatch Out
Make sure both CDB and Non-CDB databases have compatible character sets. Otherwise, the PDB might get cloned but you wont be able to open it in READ-WRITE until you convert it.

The new non-CDB database I’ve created is called prod2. We will be creating a PDB called prod1pdb2 on the prod1 Container Database.

non-CDB Database

We must observe that the source and target platforms must have the same endianness and have the same set of database options installed. Also, If you are creating a PDB by cloning a non-CDB, then both the CDB and the non-CDB must be running Oracle Database 12c Release 1 (12.1.0.2) or later.

Let’s create a user on the source non-CDB database:


+ASM:/u01/app/12.1.0/grid:N        # line added by Agent
prod1:/u01/app/oracle/product/12.1.0/dbhome_1:N        # line added by Agent
prod2:/u01/app/oracle/product/12.1.0/dbhome_1:N        # line added by Agent

$ . oraenv
ORACLE_SID = [oracle] ? prod2
The Oracle base has been set to /u01/app/oracle
[oracle@ocmdb12c Desktop]$ srvctl config
prod1
prod2

$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Tue Dec 8 16:20:54 2015

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SQL> create user myapp identified by myapp default tablespace users temporary tablespace temp;

User created.

SQL> grant connect, resource, create pluggable database to myapp;

Grant succeeded.

SQL> set linesize 80
SQL> set pages 1000
SQL> col username for a40
SQL> select username from dba_users;

SQL> select username from dba_users;

USERNAME
----------------------------------------
HR
OE
SH
PM
BI

42 rows selected.

Let’s create a database link on the target CDB


SQL> CREATE DATABASE LINK noncdb CONNECT TO myapp IDENTIFIED BY myapp USING 'noncdb';

Database link created.

SQL> select sysdate from dual@noncdb;

SYSDATE
---------
09-DEC-15

 

clip_image0028_thumbHow to Get to It in the Documentation?  - Database Links
Oracle Database Online Documentation 12c Release 1 (12.1) / Database Administrator’s Guide / Expand All / <CTRL + F> Database Links <ENTER> /  Creation of Database Links: Examples

The database link is making use of net service name noncdb, therefore, we must add an Oracle Net Service Name to the local tnsnames.ora.

Add a new Net Service Name noncdb following the steps described in the post Adding Net Service Names.

clip_image0028_thumbHow to Get to It in the Documentation? – tnsnames.ora
Oracle Database Online Documentation 12c Release 1 (12.1) / Database Net Services Administrator’s Guide / Expand All / <CTRL + F> tnsnames.ora <ENTER> /  Configuring the tnsnames.ora File After Installation

Once the Oracle Net Service has been added, we go ahead and connect to the CDB using it.

CREATE PLUGGABLE DATABASE prod1pdb2 FROM prod2@noncdb;
Pluggable database created.

Since the source database was a non-CDB, we must run the the ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql script. This script must be run before the PDB can be opened for the first time.

SQL> col pdb_name for a40
SQL> select pdb_name, status from cdb_pdbs;

PDB_NAME                                 STATUS
---------------------------------------- ---------
PROD1PDB1                               
NORMAL
PDB$SEED                                 NORMAL
PROD1PDB2                                NEW

If the PDB was not a non-CDB, then running the noncdb_to_pdb.sql script is not required.


$ sqlplus /nolog

SQL> connect sys@"ocmdb12c:1521/prod1pdb2.xps15z.com" as sysdba
Enter password:
Connected.

Above, Since we haven’t configured a connection descriptor for the new PDB, we are making use of the easy connect feature.

clip_image0028_thumbHow to Get to It in the Documentation? – easy connect

Oracle Database Online Documentation 12c Release 1 (12.1) / Database Administration / Net Services Administratior’s Guide / Expand All / <CTRL + F> easy connect <ENTER> / Using Easy Connect to Connect to a Database

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

SQL> alter pluggable database prod1pdb2 open;

 

Creating a PDB based on a Non-CDB using DBMS_PDB

clip_image0028_thumbHow to Get to It in the Documentation?

Oracle Database Online Documentation 12c Release 1 (12.1) / Database Administration / Database Administrator’s Guide / Expand All / <CTRL + F> multitenant <ENTER> / Creating and Removing PDBs with SQL*Plus / Creating a PDB Using a Non-CDB

Another way of creating a PDB based on a non-CDB is via DBMS_PDB.

To use this technique, the non-CDB must be an Oracle Database 12c non-CDB. This method requires more steps than creating a PDB by cloning a non-CDB, but it enables you to create a PDB using a non-CDB without moving the non-CDB files in some situations.

Let’s connect to our non-CDB and run the DBMS_PDB.DESCRIBE procedure.

$ . oraenv
ORACLE_SID = [oracle] ? prod2
The Oracle base has been set to /u01/app/oracle
$ srvctl config
prod1
prod2
$ srvctl status database -d prod2
Database is running.

$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Thu Dec 10 12:25:47 2015

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

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

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

Total System Global Area 1577058304 bytes
Fixed Size            2924832 bytes
Variable Size         1023413984 bytes
Database Buffers      536870912 bytes
Redo Buffers           13848576 bytes
Database mounted.
SQL> alter database open read only;

Database altered.

SQL> BEGIN
  DBMS_PDB.DESCRIBE(
    pdb_descr_file => '/tmp/ncdb.xml');
END;
/PL/SQL procedure successfully completed.
-- You can see what is inside the file if you want…
SQL> !gedit /tmp/ncdb.xml

We must now make use of this XML file on the container Database. In this case, prod1.

First, we stop the non-CDB instance – prod2 -, so we have no locks on any database files.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

$ . oraenv
ORACLE_SID = [prod2] ? prod1
The Oracle base remains unchanged with value /u01/app/oracle
$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Thu Dec 10 13:35:14 2015

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SQL> CREATE PLUGGABLE DATABASE prod1pdb3 USING '/tmp/ncdb.xml'
  COPY;
  --FILE_NAME_CONVERT = ('/disk1/oracle/dbs/', '/disk2/oracle/ncdb/');
  --USER_TABLESPACES=('tbs3');

-- This can take a while… a big while in my case

Pluggable database created.

Post PDB Creation from Non-CDB

-- At this point, if you attempt to open the PDB, you will will get a warning like so:

SQL> alter pluggable database PROD1PDB3 open;

Warning: PDB altered with errors.

-- This is a reminder that you must first convert the non-CDB to PDB by running the noncdb_to_pdb.sql script.

-- You can query the PDB_PLUG_IN_VIOLATIONS

SQL> col cause for a40

SQL> select name, cause from pdb_plug_in_violations;

NAME                   CAUSE
------------------------------ ----------------------------------------
PROD1PDB3               Non-CDB to PDB
PROD1PDB3               Service Name Conflict

-- In fact, the just-plugged database has a distinct status of NEW:

SQL> col pdb_name for a40
SQL> select pdb_name, status from cdb_pdbs;

PDB_NAME                 STATUS
---------------------------------------- ---------
PROD1PDB3                 NEW
PDB$SEED                 NORMAL

-- As usual, since the source database was a non-CDB, we must run the

ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql script.

-- So, we connect to the newly plugged-in PDB.

$ sqlplus /nolog

SQL*Plus: Release 12.1.0.2.0 Production on Thu Dec 10 14:19:24 2015

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

SQL> !hostname          
ocmdb12c.xps15z.com

SQL> connect sys@"ocmdb12c.xps15z.com:1521/prod1pdb3.xps15z.com" as sysdba
Enter password:
Connected.
SQL>

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

-- This can also take a good while.

SQL> alter pluggable database prod1pdb3 open;

Pluggable database altered.

-- You can query the PDB_PLUG_IN_VIOLATIONS

SQL> col cause for a40

SQL> select name, cause from pdb_plug_in_violations;

On the above example, I commented out two clauses since we do not need them. However, this is to remind us that there are multiple clauses which can be used to suit different needs.

Follows three examples of such clauses and their purpose:

COPY: Copies the non-CDB datafiles to a new location. Since we are using ASM, OMF and DB_CREATE_FILE_DEST, the copied datafiles will automatically be placed where I want.

FILE_NAME_CONVERT: If we want to override the default location dictated by other parameters or simply convert source path of the original database files with a new one.

USER_TABLESPACES: Enables us to separate data that was used for multiple “tenants” in a non-CDB into different PDBs. You can use multiple CREATE PLUGGABLE DATABASE statements with this clause to create other PDBs that include the data from other tablespaces that existed in the non-CDB.

Plugging In an Unplugged PDB

This technique also uses the XML metadata file that describes the PDB and the files associated with the PDB to be plugged into either the same CDB or a different CDB.

We will be using the PDB named prod1pdb3 for this exercise. The prod1pdb3 PDB has been cloned from a non-CDB database in the previous document. What we will do now, is to unplug it and plug it back to the same CDB but with a different name.

Pointing upWatch Out
The source and target CDB platforms must have the same endianness and the same set of database options installed.

The function DBMS_PDB.CHECK_PLUG_COMPATIBILITY can be used to determine whether these and other requirements are met.

Let’s run the DBMS_PDB.DESCRIBE procedure on the prod1pdb3 PDB prior to unplugging it.

SQL> BEGIN
  DBMS_PDB.DESCRIBE(
    pdb_descr_file => '/tmp/prod1pdb3.xml',
    pdb_name       => 'PROD1PDB3');
END;
/
PL/SQL procedure successfully completed.

-- Note that I did not need to place the CDB or the PDB in READ-ONLY mode to do this

Let’s check whether the PDB we just described is compatible with the target CDB. In this case, the same CDB.

SET SERVEROUTPUT ON
DECLARE
  compatible CONSTANT VARCHAR2(3) :=
    CASE DBMS_PDB.CHECK_PLUG_COMPATIBILITY(
           pdb_descr_file => '/tmp/prod1pdb3.xml',
           pdb_name       => 'PROD1PDB4')--Note that this is the name for a new PDB!
    WHEN TRUE THEN 'YES'
    ELSE 'NO'
END;
BEGIN
  DBMS_OUTPUT.PUT_LINE(compatible);
END;
/
YES
PL/SQL procedure successfully completed.

Unplug the PDB connected to the ROOT container AS SYSDBA

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT

SQL> alter pluggable database prod1pdb3 close;

Pluggable database altered.

SQL> ALTER PLUGGABLE DATABASE prod1pdb3 UNPLUG INTO '/tmp/unpluggedprod1pdb3.xml';Pluggable database altered.

SQL> select pdb_name, status from cdb_pdbs;

PDB_NAME                                 STATUS
---------------------------------------- ---------
PROD1PDB3                                UNPLUGGED
PDB$SEED                                 NORMAL

From the above, we can see that the PDB has been unplugged but it’s reference still remains in the control file. This is because the PDB has not been dropped yet.

Now, we have two choices.

* Drop the PDB and keep the datafiles so that I can plug it back with a different name and it will use the same datafiles already on disk.

* Leave the PDB in unplugged state and plug it back with a different name, namely, a clone

CREATE PLUGGABLE DATABASE prod1pdb4 AS CLONE USING '/tmp/unpluggedprod1pdb3.xml' COPY TEMPFILE REUSE;

Pluggable database created.

SQL> select pdb_name, status from cdb_pdbs;

PDB_NAME                                 STATUS
---------------------------------------- ---------
PROD1PDB3                                UNPLUGGED
PDB$SEED                                 NORMAL
PROD1PDB4                                NEW

SQL> alter pluggable database prod1pdb4 open;

Pluggable database altered.

SQL> select con_id,dbid,con_uid,guid,open_mode,restricted,name from v$pdbs;

    CON_ID       DBID    CON_UID GUID                             OPEN_MODE  RES NAME
---------- ---------- ---------- -------------------------------- ---------- --- ---------
         2   46422225   46422225 267C2065292336A8E0533800A8C0090D READ ONLY  NO  PDB$SEED
         3 1549763120 2791557375 2665E19260DD187FE0533800A8C0194F MOUNTED        PROD1PDB3
         4 4198388046 4198388046 26900D6154962BCAE0533800A8C01A1C READ WRITE NO  PROD1PDB4

3 rows selected.

-- We can see the newly generated identifiers for the prod1pdb4 PDB.

SQL> select con_id, file_name from cdb_data_files;

SQL> col file_name for a80
SQL> /

    CON_ID FILE_NAME
---------- --------------------------------------------------------------------------------
         1 +DATA/PROD1/DATAFILE/system.266.898020911
         1 +DATA/PROD1/DATAFILE/sysaux.261.898020847
         1 +DATA/PROD1/DATAFILE/undotbs1.272.898020989
         1 +DATA/PROD1/DATAFILE/users.289.898020987
         4 +DATA/PROD1/26900D6154962BCAE0533800A8C01A1C/DATAFILE/system.269.898106731
         4 +DATA/PROD1/26900D6154962BCAE0533800A8C01A1C/DATAFILE/sysaux.268.898106731
         4 +DATA/PROD1/26900D6154962BCAE0533800A8C01A1C/DATAFILE/users.257.898106875
         4 +DATA/PROD1/26900D6154962BCAE0533800A8C01A1C/DATAFILE/example.270.898106875

8 rows selected.

-- The datafiles where copied and placed as OMF under an alias directory that matches the new GUI assigned to the prod1pdb4 PDB. If we had specified the NOCOPY clause, we would be using the same original datafiles from the prod1pdb3 PDB.

Ok, let’s check the clauses chose for this PDB creation.

AS CLONE: Well, since I am creating a new PDB based on a PDB that still exists in the CDB… Now, that’s confusing… I need to tell Oracle to generate a new unique PDB DBID, GUID and other identifiers expected for the new PDB. Otherwise, it will use the ones found in the XML file which will clash with the PDB that is in UNPLUGGED state in the CDB.

COPY: I am creating a new PDB based on the existing one. However, I want it to have a complete set of datafiles all for itself. So I may or may not drop the original prod1pdb3 PDB.

TEMPFILE REUSE: I am instructing Oracle to use the TEMPFILE that is already in place at the target CDB.

Let’s have a look in the ASM. We should see an alias directory that matches the unplugged database too.


$ su - grid
Password:
[grid@ocmdb12c ~]$ . oraenv
ORACLE_SID = [grid] ? +ASM
The Oracle base has been set to /u01/app/grid


[grid@ocmdb12c ~]$ asmcmd
ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  1048576     18425     5950                0            5950              0             N  DATA/
MOUNTED  EXTERN  N         512   4096  1048576      8189     5940                0            5940              0             N  FRA/

ASMCMD> cd DATA

ASMCMD> ls
ASM/
PROD1/
PROD2/
orapwasm

ASMCMD> cd PROD1

ASMCMD> ls
2665E19260DD187FE0533800A8C0194F/
267C2065292336A8E0533800A8C0090D/
26900D6154962BCAE0533800A8C01A1C/
CONTROLFILE/
DATAFILE/
FD9AC20F64D244D7E043B6A9E80A2F2F/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/

 

The 2665E19260DD187FE0533800A8C0194F/ ASM directory is still there. Just as we thought.

 

Dropping a PDB

This technique also uses the XML metadata file that describes the PDB and the files associated with the PDB to be plugged into either the same CDB or a different CDB.

We will be using the PDB named prod1pdb3 for this

 

Check out other posts of this Series:

Upgrading OCM 11g to OCM 12c (Series) 1 - Initial Assessment

Upgrading OCM 11g to OCM 12c (Series) 2 - Building your Study Lab

Upgrading OCM 11g to OCM 12c (Series) 3 - Install Oracle Grid Infrastructure

Upgrading OCM 11g to OCM 12c (Series) 4 – Install Oracle Database Software

Upgrading OCM 11g to OCM 12c (Series) 5 - Create and Manage Pluggable Databases

Upgrading OCM 11g to OCM 12c (Series) 4 - Install Oracle Database Software

Check out other posts of this Series:

In this post, I will be detailing the Oracle 12c database installation process making use of the guest Virtual Machine we have created on post Upgrading OCM 11g to OCM 12c (Series) 2 - Building your Study Lab.

This will most likely be the shortest post of all as most of the foundation work has been done on previous posts. The installation of the database software itself is pretty simple.

Prior to installing the Oracle Database Software, it is recommended that you get familiar with the following topics from the Oracle Database Documentation:

Oracle Database Installation Checklist

Overview of Oracle Database Installation

Oracle Database Preinstallation Tasks

Installing Oracle Database

Let’s get started!

We will be making use of the shared folders we setup earlier to copy the installation files into the VM.

$ cd /media
$ cd sf_Oracle_Software/
$ cd OCM\ 12c\ Upgrade/
$ ls
$ cp -v linuxamd64_12102_database_1of2.zip linuxamd64_12102_database_2of2.zip /u01/app/software/
$ cd /u01/app/software/
$ unzip linuxamd64_12102_database_1of2.zip
$ unzip linuxamd64_12102_database_2of2.zip
 
$ ll
total 4963016
drwxr-xr-x. 7 oracle oinstall       4096 Jul  7  2014 database
drwxr-xr-x. 7 grid   oinstall       4096 Jul  7  2014 grid
-rwxr-x---. 1 oracle oinstall 1673544724 Dec  3 15:41 linuxamd64_12102_database_1of2.zip
-rwxr-x---. 1 oracle oinstall 1014530602 Dec  3 15:41 linuxamd64_12102_database_2of2.zip
-rwxr-x---. 1 grid   oinstall 1747043545 Nov 25 17:09 linuxamd64_12102_grid_1of2.zip
-rwxr-x---. 1 grid   oinstall  646972897 Nov 25 17:09 linuxamd64_12102_grid_2of2.zip
 
-- Removing the grid directory to free up some space
 
$ cd database
$ ./runInstaller
 

Oracle Database Software Installation 1

Oracle Database Software Installation 2

Oracle Database Software Installation 3

We are installing the database software only as the database creation itself will be covered on a subsequent post.

Oracle Database Software Installation 4

Oracle Database Software Installation 5

Oracle Database Software Installation 6

Oracle Database Software Installation 7

Oracle Database Software Installation 8

Oracle Database Software Installation 9

I am ignoring the Swap Size since this is an installation for a Study Lab.

Oracle Database Software Installation 10

Oracle Database Software Installation 11

Oracle Database Software Installation 12

Oracle Database Software Installation 13

# /u01/app/oracle/product/12.1.0/dbhome_1/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/12.1.0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.

Oracle Database Software Installation 14

That’s it for now.

On the next post, I will be taking us through the exam topic create and manage pluggable databases.

Many thanks to Alex Zaballa who already sent me his study notes on this next subject, which is a quite large topic to be covered.

In the next few days, I will be compiling information from a few sources in order to create a concise post.

Até la!

Daniel

Check out other posts of this Series: