Wednesday, September 9, 2015

Creating Real Application Clusters (RAC) using Oracle Standard Edition SE2 (12.1.0.2.0) with Container Database (CDB) with Pluggable Database (PDB) - Multitenant Environment


Introduction:

In this article, we are creating and configuring two node RAC (Real Application Clusters) setup with container database (CDB) with pluggable database in multitenant environment using Oracle Standard Edition SE2 (12.1.0.2.0)

The information about two RAC setup with container database (CDB) with pluggable database as given below.


RAC Instance
Database Type:                 Container Database with two instances (racdb1 & racdb2)
Pluggable Database:         pluggable database (pdb1)
Oracle_Home:                  /u01/app/oracle/product/12.1.0.2/db_1
GRID_Home:                   /u01/app/12.1.0.2/grid
Oracle Version:                Oracle Standard Edition SE2 (12.1.0.2.0)
Listener:                            1521

Assuming that we have installed Oracle Grid infrastructure (12.1.0.2.0) and installing Oracle Standard Edition SE2 (12.1.0.2.0) on TWO node RAC Database.


Select the option: Create and configure a database


Select the option: Oracle Real Application Clusters database installation


Select the option: Admin Managed


Select the option: Select available NODES


Database Edition: Standard Edition Two (6.1 GB) with container database (racdb) includes one pluggable database (pdb1)


Select the option: Check the database edition



Login to RAC instance-1 (racdb1) and check pluggable database status

login as: oracle
oracle@192.168.2.101's password:

[oracle@rac1-12c ~]$ ps -ef | grep pmon
oracle    4510     1  0 11:26 ?        00:00:00 asm_pmon_+ASM1
oracle    5094     1  0 11:27 ?        00:00:00 mdb_pmon_-MGMTDB
oracle    5170     1  0 11:27 ?        00:00:00 ora_pmon_racdb1
oracle   10291 10005  0 12:47 pts/1    00:00:00 grep pmon

[oracle@rac1-12c ~]$ . oraenv
ORACLE_SID = [racdb1] ? racdb
The Oracle base remains unchanged with value /u01/app/oracle

[oracle@rac1-12c ~]$ sqlplus /nolog

SQL*Plus: Release 12.1.0.2.0 Production on Wed Sep 9 12:47:37 2015
Copyright (c) 1982, 2014, Oracle.  All rights reserved.

SQL> connect sys/oracle@racdb as sysdba
Connected.

SQL> set lines 100 pages 1000
SQL> select con_id, name, open_mode from v$pdbs;

CON_ID                NAME                                  OPEN_MODE
------------------------------------------------------------------------
2                            PDB$SEED                          READ ONLY
3                            PDB1                                   MOUNTED

SQL> alter pluggable database all open;
Pluggable database altered.

SQL> select con_id, name, open_mode from v$pdbs;

CON_ID               NAME                                  OPEN_MODE
------------------------------------------------------------------------
2                            PDB$SEED                          READ ONLY
3                            PDB1                                   READ WRITE

Login to RAC instance-2 (racdb2) and check pluggable database status

login as: oracle
oracle@192.168.2.102's password:

[oracle@rac2-12c ~]$ . oraenv
ORACLE_SID = [rscdb] ? racdb
The Oracle base remains unchanged with value /u01/app/oracle

[oracle@rac2-12c ~]$ sqlplus /nolog

SQL*Plus: Release 12.1.0.2.0 Production on Wed Sep 9 12:49:59 2015
Copyright (c) 1982, 2014, Oracle.  All rights reserved.

SQL> connect sys/oracle@racdb as sysdba
Connected.

SQL> set lines 100 pages 1000
SQL> select con_id, name, open_mode from v$pdbs;

CON_ID               NAME                                  OPEN_MODE
--------------------------------------------------------------------------
2                            PDB$SEED                          READ ONLY
3                            PDB1                                   MOUNTED

SQL> alter pluggable database all open;
Pluggable database altered.

SQL> select con_id, name, open_mode from v$pdbs;

CON_ID               NAME                                  OPEN_MODE
--------------------------------------------------------------------------
2                            PDB$SEED                          READ ONLY
3                            PDB1                                   READ WRITE

Check the Product Component Version

SQL> COL PRODUCT FORMAT A38
SQL> COL VERSION FORMAT A15
SQL> COL STATUS FORMAT A18
SQL> SELECT * FROM PRODUCT_COMPONENT_VERSION;

PRODUCT                                                         VERSION                             STATUS
-----------------------------------------------------------------------------------------------------------
NLSRTL                                                             12.1.0.2.0                           Production
Oracle Database 12c Standard Edition               12.1.0.2.0                           64bit Production
PL/SQL                                                               12.1.0.2.0                           Production
TNS for Linux:                                                   12.1.0.2.0                           Production

Login to pluggable Database (pdb1) from RAC Instance-1 and Create user and assign privileges and insert rows

SQL> connect sys/oracle@192.168.2.101:1521/pdb1 as sysdba
Connected.

SQL> create user user1 identified by oracle;
User created.

SQL> grant connect,resource to user1;
Grant succeeded.

SQL> alter user user1 quota unlimited on users;
User altered.

SQL> connect user1/oracle@192.168.2.101:1521/pdb1
Connected.

SQL> create table orgn (no number, name varchar2(20));
Table created.

SQL> insert into orgn values (1, 'ORACLE');
1 row created.

SQL> commit;
Commit complete.

SQL> select * from orgn;

NO                        NAME
----------------------------------
1                            ORACLE

Login to pluggable Database (pdb1) from RAC Instance-2 and check the rows

SQL> connect user1/oracle@192.168.2.102:1521/pdb1
Connected.

SQL> select * from orgn;

NO                        NAME
----------------------------------
1                            ORACLE

Summary: Installed, Configured and Created TWO Node RAC Database using Oracle Standard Edition SE2 (12.1.0.2.0) with Container Database (racdb) including Pluggable Database (pdb1).

4 comments:

  1. Very nice crafted doc ... very useful for oracle community

    ReplyDelete
  2. Very useful , Thanks Ravi Sir once again for this post ...!!!

    ReplyDelete
  3. Very nice article..Can we install this on the laptop..Please guide on this.

    ReplyDelete