Installing Oracle Linux 6.6, Prepping Linux OS for Oracle Database 12c Install, and Installing Oracle Database 12c

Installing Oracle Linux 6.6, Prepping Linux OS for Oracle Database 12c Install, and Installing Oracle Database 12c

I know it seems simple to install Linux and Oracle Dtaabase. But I felt a need to standardize on how we do it internally at Viscosity. So I provided this little note to our DBA team to build out a new Oracle Database 12c on Linux 6.6 server.  There are options also for configuring for VMWare as well.  PS, Thx to EMC folks for helping out w/the hardware config

In this example, we will be implementing 12c Grid Infrastructure/Automatic Storage Management and create two disk groups (data and deco)  using four-disks each.

Installing Oracle Linux 6.6
1. Insert the Oracle Linux 6.6 DVD into the server, and boot to it.
2. Select Install or upgrade an existing system
3. Skip
4. In the opening splash screen, select Next.
5. Choose the language you wish to use, and click Next.
6. Select the keyboard layout, and click Next.
7. Select Basic Storage Devices, and click Next.
8. Select Fresh Installation, and click Next.
9. Insert the hostname, and select Configure Network.
10. In the Network Connections menu, configure network connections.
11. After configuring the network connections, click Close.
12. Click Next.
13. Select the nearest city in your time zone, and click Next.
14. Enter the root password, and click Next.
15. Select Use All Space, and click Next.
16. When the installation prompts you to confirm that you are writing changes to the disk, select Write changes to disk.
17. Select Software Basic Server, and click Next. Oracle Linux installation begins.
18. When the installation completes, select Reboot to restart the server.

Initial configuration tasks
Complete the following steps to provide the functionality that Oracle Database requires. We performed all of these tasks as root.
Disable firewall services. In the command line (as root), type:
 # service iptables stop
# chkconfig iptables off
# service ip6tables stop
# chkconfig ip6tables off

Set SELinux:
 # vi /etc/selinux/config


Modify /etc/hosts to include the IP address of the internal IP and the hostname.
Edit 90-nproc.conf:

# vi /etc/security/limits.d/90-nproc.conf
 Change this:
 * soft nproc 1024

To this:
 * – nproc 16384

Install 12c RPM packages, resolve package dependencies, and modify kernel parameters:                                        

# yum install oracle-rdbms-server-12cR1-preinstall–y

Install automatic system tuning for database storage through yum:
 # yum install tuned
# chkconfig tuned on
# tuned-adm profile enterprise-storage

Using yum, install the following prerequisite packages for Oracle Database:
 # yum install elfutils-libelf-devel
# yum install xhost
# yum install unixODBC
# yum install unixODBC-devel
# yum install oracleasm-support oracleasmlib oracleasm

Create the oracle user account and groups and password:

 # groupadd -g 6003 oper
 # groupadd -g 6004 asmadmin
 # groupadd -g 6005 asmdba
 # groupadd -g 6006 asmoper
 # usermod -G dba,oper,asmadmin,asmdba,asmoper oracle # passwd oracle

Create the /u01 directory for Oracle inventory and software and give it to the oracle user:

 # mkdir -p /u01/app/oracle/product/12.1.0/grid
 # mkdir -p /u01/app/oracle/product/12.1.0/dbs                                                 
# chown -R oracle:oinstall /u01
 # chmod -R 775 /u01

Optionally, edit bash profiles to set up user environments:
# vim /home/oracle/.bash_profile

Adding the four data and four log drives to the VM and modifying the vmfx file
1. Power off the VM.
2. Right-click the VM in the vSphere Web Client, and choose Edit Settings…
3. Click on the VM Options tab, and expand the Advanced menu option.
4. Choose Edit Configuration…
5. Click Add Row, and enter disk.EnableUUID in the parameter field and TRUE in the value field.
6. Go back to the Virtual Hardware tab.
7. Click the drop-down menu for New device, and choose New Hard Disk.
8. Name the Hard Disk and choose the size that you want it to be.
9. Repeat steps 7 and 8 for all remaining drives.
10. Click OK.
11. Power the VM back on.

 Configuring disks for ASM
For each of the eight shared disks, create a GPT label, and create one partition. For example, see the following shell script:
 for disk in sdb sdc sdd sde sdf sdg sdh sdi; do
parted /dev/$disk mklabel gpt
parted /dev/$disk mkpart primary “1 -1″

If desired, label the disk’s partition with its Oracle function. For example:
 # parted /dev/sdc name 1 DATA1
# parted /dev/sdd name 1 DATA2
# parted /dev/sde name 1 DATA3
# parted /dev/sdf name 1 DATA4
# parted /dev/sdg name 1 LOG1
# parted /dev/sdh name 1 LOG2
# parted /dev/sdh name 1 LOG3
# parted /dev/sdi name 1 LOG4

Initialize Oracle ASM on each server by executing the following commands as root on each node.
 oracleasm init
oracleasm configure -e -u grid -g oinstall -s y -x sda

Label each shared disk-partition with an appropriate ASM name. For example, following the OS partition names
created above, execute the following commands on one system:
 # oracleasm createdisk DATA1 /dev/sdc1
# oracleasm createdisk DATA2/dev/sdd1
# oracleasm createdisk DATA3 /dev/sde1
# oracleasm createdisk DATA4 /dev/sdf1
# oracleasm createdisk LOG1 /dev/sdg1
# oracleasm createdisk LOG2 /dev/sdh1
# oracleasm createdisk LOG3 /dev/sdi1
# oracleasm createdisk LOG4 /dev/sdj1

On each server, scan the disks to make the disks immediately available to Oracle ASM.
 # oracleasm scandisks
# oracleasm listdisks

Installing Oracle Grid Infrastructure 12c
1. Log in as the oracle user.
2. Unzip and
3. Open a terminal to the unzipped database directory.
4. Type grid_env to set the Oracle grid environment.
5. To start the installer, type./runInstaller
6. At the Updates screen, select Skip updates.
7. In the Select Installation Option screen, select Install and Configure Grid Infrastructure for a Standalone Server,and click Next.
8. Choose the language, and click Next.
9. In the Create ASM Disk Group screen, choose the Disk Group Name, and change redundancy to External.
10. Select the four disks that you are planning to use for the database, and click Next.
11. In the Specify ASM Password screen, choose Use same password for these accounts, write the passwords for the ASM users, and click Next.
12. Leave the default Operating System Groups, and click Next.
13. Leave the default installation, and click Next.
14. Leave the default inventory location, and click Next.
15. Under Root script execution, select Automatically run configuration scripts and enter root credentials.
16. In the Prerequisite Checks screen, make sure that there are no errors.
17. In the Summary screen, verify that everything is correct, and click Finish to install Oracle Grid Infrastructure.
18. At one point during the installation, the installation prompts you to execute two configuration scripts as root.

Follow the instructions to run the scripts.
19. At the Finish screen, click Close.
20. To run the ASM Configuration Assistant, type asmca.
21. In the ASM Configuration Assistant, click Create.
22. In the Create Disk Group window, name the new disk group log, choose redundancy External (None), and select the four disks for redo logs.
23. Click Advanced Options, and type in ASM Compatibility and Database Compatibility. Click OK.
24. Right-click the DATA drive, and choose Edit Attributes. Make sure both ASM and Database Compatibility fields list, and click OK.
25. Exit the ASM Configuration Assistant.

Installing Oracle Database 12c
1. Unzip and
2. Open a terminal to the unzipped database directory.
3. Type db_env to set the Oracle database environment.
4. Run ./
5. Wait for the GUI installer loads.
6. On the Configure Security Updates screen, enter the credentials for My Oracle Support. If you do not have an account, uncheck the box I wish to receive security updates via My Oracle Support, and click Next.
7. At the warning, click Yes.
8. On the Download Software Updates screen, enter the desired update option, and click Next.
9. On the Select Installation Option screen, select Install database software only, and click Next.
10. On the Grid Installation Options screen, select Single instance database installation, and click Next.
11. On the Select Product Languages screen, leave the default setting of English, and click Next.
12. On the Select Database Edition screen, select Enterprise Edition, and click Next.
13. On the Specify Installation Location, leave the defaults, and click Next.
14. On the Create Inventory screen, leave the default settings, and click Next.
15. On the Privileged Operating System groups screen, keep the defaults, and click Next.
16. Allow the prerequisite checker to complete.
17. On the Summary screen, click Install.
18. Once the Execute Configuration scripts prompt appears, ssh into the server as root, and run the following command:

# /home/oracle/app/oracle/product/12.1.0/dbs/
19. Return to the prompt, and click OK.
20. Once the installer completes, click Close.

12c PDB Multitenancy, Schema Consolidation, and whatever

Many of you have probably have heard me speak over the years (at OOW, local user groups and at the local bars) about the virtues of simplification, rationalization, and consolidation. I mentioned the different database consolidation and multi-tenancy models: Virtualization based, Database Instance and Schema consolidation.

The following papers I wrote [when I was at Oracle] touch in detail on this topic –

And here’s a more current version of that paper., updated for 12c and PDB.

For those who have done consolidation via Virtualization platforms such as VMWare or OVM know its fairly straightforward and its a simple “drag and drop”, as I say. Similarly consolidation of many databases as separate database instances on platform is also fairly straightforward. Its the consolidation of many disparate schemas into a common database that makes things interesting. Couple of key points on “why schema consolidation” from the paper:

  • The schema consolidation model has consistently provided the most opportunities for reducing operating expenses, since you only have a single big database to maintain,monitor, mange and maintain.
  • Though schema consolidation allows the best ROI (w.r.t CapEX/OPex), you are sacrificing flexibility for compaction. As I’ve stated in my presentations and papers, “…consolidation and isolation move in opposite directions” The more you consolidate the less capabilities you’ll have for isolation; in contrast, the more you try to isolate, the more you sacrifice benefits of consolidation.
  • Custom (home-grown) apps have been best fit use cases for schema consolidation, since application owners and developers have more control on how the application and schema is built.

Well, with the 12c Oracle Database feature Pluggable Database (PDB) , you now have more incentive to lean towards the schema consolidation. PDB “begins” to eliminate the typical issues that come with schema consolidation; such as namespace collisions, security, granularity of recovery.

In this 1st part of the three part series on PDB, I’ll illustrate the installation of the 12c Database with Pluggable Database feature. The next upcoming parts of the series will cover management and user isolation (security) with PDB.

But first a very, very high-level primer on terminology:

  • Root Container Database – Or the root CDB (cdb$root) is the real database (if you will), and the name you give it will be name of the instance. The CDB database owns the SGA and running processes. I can have many CDBs on the same database server (each with its own PDBs). But the cool thing is that you can have a more than one CDB, allowing DBAs to have a Database Instance consolidation model coupled a schema consolidation. For best scalability, mix in RAC and leverage all the benefits of RAC Services, QoS, and Workload Distribution. The seed PDB (PDB$SEED) is a Oracle supplied system template that the CDB can use to create new PDBs. The seed PDB is named PDB$SEED. One cannot add or modify objects in PDB$SEED.
  • Pluggable Database – The PDB databases are sub-containers that serviced by CDB resources. The true beauty of the PDB is its mobility; i.e., I can unplug and plug 12c databases into and out of CDBs. I can “create like” new PDBs from existing PDB, like full snapshots.

So, now I’ll illustrate the important/interesting and new screens of 12c Database Installer:

PDB12c 2013 08 19 17 22 42

We chose Server Class

PDB12c 2013 08 19 17 23 09

It will single instance ..for now 🙂

PDB12c 2013 08 19 17 23 37

Choose Advanced Install

PDB12c 2013 08 19 17 24 07

And now for the fun step. We choose a Enterprise Edition, as Pluggable Database feature is only available in EE

PDB12c 2013 08 19 17 24 47

The next couple of screens ask about the Oracle Home and Oracle Base location, nothing new, but look at screen for Step 11. This where the fun is. We specify the Database name, but also specify if we want to create a Container Database. If we check it, it allows us to create our first PDB database in the Container Database (CDB). In my example I speficied Yoda as my CDB name and (in keeping with Star Wars theme) I said PDB is PDBOBI

PDB12c 2013 08 19 17 27 19

We obviously choose ASM as the storage location

PDB12c 2013 08 19 17 28 18

And we have the opportunity to register EM Cloud Control this new target database.

PDB12c 2013 08 20 17 46 20

The rest of the steps/screens are standard stuff, so I won’t bore you with it. But here’s an excerpt from the database alert that shows magic underneath:

create pluggable database PDB$SEED as clone  using '/u02/app/oracle/product/12.1.0/dbhome_1/assistants/dbca/templates//pdbseed.xml'  source_file_name_convert = ('/ade/b/3593327372/oracle/oradata/seeddata/pdbseed/temp01.dbf','+PDBDATA/YODA/DD7C48AA5A4404A2E04325AAE80A403C/DATAFILE/pdbseed_temp01.dbf',
'/ade/b/3593327372/oracle/oradata/seeddata/pdbseed/sysaux01.dbf','+PDBDATA/YODA/DD7C48AA5A4404A2E04325AAE80A403C/DATAFILE/sysaux.270.823892297') file_name_convert=NONE  NOCOPY
Mon Aug 19 18:58:59 2013
Post plug operations are now complete.
Pluggable database PDB$SEED with pdb id - 2 is now marked as NEW.

create pluggable database pdbobi as clone  using '/u02/app/oracle/product/12.1.0/dbhome_1/assistants/dbca/templates//sampleschema.xml'  source_file_name_convert = ('/ade/b/3593327372/oracle/oradata/seeddata/SAMPLE_SCHEMA/temp01.dbf','+PDBDATA/YODA/DD7D8C1D4C234B38E04325AAE80AF577/DATAFILE/pdbobi_temp01.dbf',
'/ade/b/3593327372/oracle/oradata/seeddata/SAMPLE_SCHEMA/sysaux01.dbf','+PDBDATA/YODA/DD7D8C1D4C234B38E04325AAE80AF577/DATAFILE/sysaux.274.823892813') file_name_convert=NONE  NOCOPY
Mon Aug 19 19:07:42 2013
Post plug operations are now complete.
Pluggable database PDBOBI with pdb id - 3 is now marked as NEW.
Completed: create pluggable database pdbobi as clone  using '/u02/app/oracle/product/12.1.0/dbhome_1/assistants/dbca/templates//sampleschema.xml'  source_file_name_convert = ('/ade/b/3593327372/oracle/oradata/seeddata/SAMPLE_SCHEMA/temp01.dbf','+PDBDATA/YODA/DD7D8C1D4C234B38E04325AAE80AF577/DATAFILE/pdbobi_temp01.dbf',
'/ade/b/3593327372/oracle/oradata/seeddata/SAMPLE_SCHEMA/sysaux01.dbf','+PDBDATA/YODA/DD7D8C1D4C234B38E04325AAE80AF577/DATAFILE/sysaux.274.823892813') file_name_convert=NONE  NOCOPY
alter pluggable database pdbobi open restricted
Pluggable database PDBOBI dictionary check beginning
Pluggable Database PDBOBI Dictionary check complete
Database Characterset is US7ASCII

XDB installed.

XDB initialized.
Mon Aug 19 19:08:01 2013
Pluggable database PDBOBI opened read write
Completed: alter pluggable database pdbobi open restricted

I will cover more of PDB creation and management in the next blog. But I’ll leave you with this teaser of DBCA screen:

PDB12c 2013 08 20 17 46 20