Now that Oracle Database 12c has descended from the clouds, we can enjoy deploying it everywhere. For a few months, we’ve been testing it in depth to foresee all tasks that have to be carried out and determine most of the impacts. First, before even considering a shared « multitenancy » architecture, we’ve performed traditional changes. This approach has allowed us to handle the latest release and leverage many 12c new features.
Let us set the scene and introduce the characters…
As you probably can figure out, we are huge fans of Oracle VM for x86! So we’ve been using 64-bit, 6.4 Oracle Linux virtual machines on top of OVM 3.2. This first article dives into binaries installation and databases creation. To represent real world situations we perform all operations in silent mode.
The Guest
Our virtual machines are built using the Oracle Linux 6 Update 4 OVF paravirtualized x86_64 template, V38315-01, downloaded from Oracle Software Delivery Cloud.
Note:
We can now use a shortcut to the 12c installation with « Oracle VM Templates for Oracle Database – Single Instance and RAC 12cR1 (12.1.0.1.0) – Oracle Linux (64 bit), V38984-01 and V38985-01 » also available on Oracle Software Delivery Cloud.
To minimize the configuration, we use a simple guest with 2 vCPUs, 2 GB of RAM, a 2 GB SWAP and an additional 60 GB hard drive mounted on /u01. One of the benefits of the latest Linux template is the « yum » configuration that already points to Oracle’s public repository (see /etc/yum.repos.d/public-yum-ol6.repo).
One command sets all prerequisites, fast and easy :
yum install oracle-rdbms-server-11gR2-preinstall
Note:
The 12c’s rpm “oracle-rdbms-server-12cR1-preinstall” is available.
Oracle Database 11g Release 2
To compare and test upgrades, we install an 11g Release 2 database. The script below oulines the creation of the directories:
# chmod 777 /u01 # su - oracle$ mkdir -p /u01/distrib/db112 $ mkdir -p /u01/app/oracle/product $ mkdir /u01/app/oracle/oradata $ chown -R oracle:dba /u01/app
We transfer and extract the 11.2.0.3 binaries (10404530) under /u01/distrib/db112 :
p10404530_112030_x86_64_1of7.zip p10404530_112030_x86_64_2of7.zip
Once unzipped, we install the 11.2.0.3 binaries:
$ export DISTRIB=/u01/distrib/db112/database $ cd $DISTRIB $ ./runInstaller -silent -ignoreSysPrereqs \ > -ignorePrereq -responseFile /u01/distrib/db112/database/response/ee_install.rsp \ > oracle.install.option=INSTALL_DB_SWONLY UNIX_GROUP_NAME=oinstall \ > SELECTED_LANGUAGES=en ORACLE_BASE=/u01/app/oracle \ > ORACLE_HOME=/u01/app/oracle/product/11.2.0.3 \ > oracle.install.db.InstallEdition=EE \ > oracle.install.db.DBA_GROUP=dba \ > oracle.install.db.OPER_GROUP=dba \ > DECLINE_SECURITY_UPDATES=true INVENTORY_LOCATION=/u01/app/oracle
Here is the closing message asking for the 2 scripts to be executed as root:
As a root user, execute the following script(s): 1. /u01/app/oracle/orainstRoot.sh 2. /u01/app/oracle/product/11.2.0.3/root.sh Successfully Setup Software.
Then we check that there were no problems whatsoever:
# grep -i err /u01/app/oracle/logs/installActions2013-06-28_03-19-36AM.log \ |grep -v gif |grep -v INFO| grep -v disasterRecovery|grep -v OVERRIDE
There should be no output from the previous command but if there is any, we should dig into log files to find the reason.
To finish, we use a script named crdb_ora112.sh to create a database:
# # Creating ora112 database using dbca in silent mode # export ORACLE_HOME=/u01/app/oracle/product/11.2.0.3 export PATH=$ORACLE_HOME/bin:$PATH dbca -silent -responseFile NO_VALUE -createDatabase \ -templateName General_Purpose.dbc -gdbName ora112 \ -sid ora112 -SysPassword easy_4U -SystemPassword easy_4U \ -emConfiguration LOCAL -dbsnmpPassword easy_4U \ -sysmanPassword easy_4U -storageType FS \ -datafileDestination /u01/app/oracle/oradata \ -redoLogFileSize 200 -sampleSchema true \ -characterSet AL32UTF8 -totalMemory 740
Note
All commands must finish with a back-slash before any new line
The database creation looks like this:
$ ./crdb_ora112.sh Copying database files 1% complete 3% complete 11% complete 18% complete 26% complete 37% complete Creating and starting Oracle instance 40% complete 45% complete 50% complete 55% complete 56% complete 57% complete 60% complete Completing Database Creation 66% complete 70% complete 73% complete 85% complete 96% complete 100% complete Look at the log file "ora112.log" for further details. Vérification : $ grep -i err /u01/app/oracle/cfgtoollogs/dbca/ora112/ora112.log
As you can see, no problem occurs during the installation. The default listener is created and the ora112 database with its dbconsole are up and running:
$ ps -ef |grep smon oracle 10690 1 0 04:07 ? 00:00:01 ora_smon_ora112 oracle 18391 6298 0 05:35 pts/0 00:00:00 grep smon $ ps -ef |grep lsnr oracle 9981 1 0 04:02 ? 00:00:00 /u01/app/oracle/product/11.2.0.3/bin/tnslsnr $ emctl status dbconsole Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0 Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved. https://easydirtech.easyteam.fr:1158/em/console/aboutApplication Oracle Enterprise Manager 11g is running. ------------------------------------------------------------------ Logs are generated in directory /u01/app/oracle...
At this point, we should stop the listener and the ora112 database to carry on with the installation of 12c binaries and the creation of another database:
$ . oraenv ORACLE_SID = [oracle] ? ora112 The Oracle base has been set to /u01/app/oracle $ lsnrctl stop $ sqlplus / as sysdba SQL> shutdown immediate $ emctl stop dbconsole
But we didn’t. We’ll see what that brings later.
Oracle Database 12c Release 1
To install the 12.1.0.1 software, we proceed like with the 11g database for most part. We transfer and extract the distribution, currently available on OTN in /u01/distribs/db121:
linuxamd64_12c_database_1of2.zip linuxamd64_12c_database_2of2.zip
Note:
These files are for Linux x86-64, don’t be fooled by the name “amd64” which is perfectly fine for Intel-based machines.
The silent mode is based on the response file db_install.rsp (located under $DISTRIB/database/response). It contains some minor modifications due to new features, here are some:
- No more choice available regarding the options in the Enterprise version: OLAP, Datamining, OLS, Partitionning and RAT. All of this will be discussed later on a forthcoming episode.
- We can now define separate groups for BACKUPDBA, DGBA and KMDBA privileges. Hence the arrival of new parameters in the command line.
- There is now a specific configuration for RAC databases in which we can specify what kind of configuration we wish to use (ADMIN_MANAGED, POLICY_MANAGED).
- Changes were made regarding options with the default created database (oracle.install.db.*):
- Configuration using the Multitenancy option, container of PDB (pluggable Database) and associated password (oracle.install.db.config.starterdb.PDBADMIN)
- The ASMM configuration is no longer the default one; AMM is
- There are some changes with the administration tools configuration, Database Control has been replaced by Database Express and the way we connect to Cloud Control has been modified.
All of this leads us to a final creation script which looks like the one we’ve used for the 11.2.0.3 version:
$ ./runInstaller -silent -ignoreSysPrereqs > -ignorePrereq -responseFile $DISTRIB/response/ee_install.rsp \ > oracle.install.option=INSTALL_DB_SWONLY UNIX_GROUP_NAME=oinstall \ > SELECTED_LANGUAGES=en ORACLE_BASE=/u01/app/oracle \ > ORACLE_HOME=/u01/app/oracle/product/12.1.0.1 \ > oracle.install.db.InstallEdition=EE \ > oracle.install.db.DBA_GROUP=dba \ > oracle.install.db.OPER_GROUP=dba \ > oracle.install.db.BACKUPDBA_GROUP=dba \ > oracle.install.db.DGDBA_GROUP=dba \ > oracle.install.db.KMDBA_GROUP=dba \ > DECLINE_SECURITY_UPDATES=true
The inventory has already been created and configured by the 11g installation, only one script is left to be executed as root:
$ The installation of Oracle Database 12c was successful. Please check '/u01/app/oracle/logs/silentInstall2013-06-28_09-10-54AM.log' for more details. As a root user, execute the following script(s): 1. /u01/app/oracle/product/12.1.0.1/root.sh Successfully Setup Software.
When everything goes well, it looks like this:
silentInstall2013-06-28_09-10-54AM.log The installation of Oracle Database 12c was successful.
Now we can create a 12c database. We will study the process of upgrading databases from previous versions to 12c, but we need to make sure database creation works just fine first.
Here’s what’s inside the script we use:
# # Creating the ora121 database using dbca in silent mode # export ORACLE_HOME=/u01/app/oracle/product/12.1.0.1 export PATH=$ORACLE_HOME/bin:$PATH dbca -silent -responseFile NO_VALUE -createDatabase \ -templateName General_Purpose.dbc -createAsContainerDatabase false \ -gdbName ora121 -sid ora121 -SysPassword easy_4U \ -SystemPassword easy_4U -emConfiguration DBEXPRESS \ -dbsnmpPassword easy_4U -storageType FS \ -datafileDestination /u01/app/oracle/oradata \ -redoLogFileSize 200 -sampleSchema true \ -characterSet AL32UTF8 -totalMemory 740
Here again, there are some minor changes compared to the 11.2 script:
- -createASContainerDatabase false,
- -emConfiguration DBEXPRESS
- SYSMAN account is not used anymore.
The script output looks like below:
$ ./crdb_ora12.1.sh Copying database files 1% complete 3% complete 11% complete 18% complete 26% complete 37% complete Creating and starting Oracle instance 40% complete 45% complete 50% complete 55% complete 60% complete 61% complete 62% complete 65% complete Completing Database Creation 69% complete 73% complete 76% complete 88% complete 91% complete 100% complete Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/ora121/ora121.log" for further details.
Note
No errors were found inside the generic log file. However, because of the guest memory settings, and the fact our 11.2 database wasn’t stopped at that time, the install wizard automatically switched to ASMM, allowing the database to be created without any errors.
DBCA did not create the listener. That could be due to the 11g database too and we still need to verify it on a vanilla virtual machine. In order to create it, we use netca in silent mode. First, we tweak the netca.rsp response file by removing Oracle Names and name resolution features:
NAMING_METHODS={"TNSNAMES","ONAMES","HOSTNAME"}
It becomes:
NAMING_METHODS={"TNSNAMES","HOSTNAME"}
In our ora121 database environment, the listener creation command is the following:
$ . oraenv ORACLE_SID = [ora112] ? ora121 The Oracle base remains unchanged with value /u01/app/oracle $ netca -silent -responsefile /home/oracle/netca.rsp Parsing command line arguments: Parameter "silent" = true Parameter "responsefile" = /home/oracle/netca.rsp Done parsing command line arguments. Oracle Net Services Configuration: Profile configuration complete. Oracle Net Listener Startup: Running Listener Control: /u01/app/oracle/product/12.1.0.1/bin/lsnrctl start LISTENER Listener Control complete. Listener started successfully. Listener configuration complete. Oracle Net Services configuration successful. The exit code is 0
Here we are! Our test server has an ora112 database using the 11.2.0.3 version, an ora121 database using the 12.1.0.1 version and their associated listeners and management tools. Everything is set for the next episode “Tasks for pre-updating”; Coming soon…