Showing posts with label howto. Show all posts
Showing posts with label howto. Show all posts

Wednesday, May 28, 2014

How to resolve "vagrant up" failing with "VBoxManage.exe: error: Code CO_E_SERVER_EXEC_FAILURE"

I'm trying to use a pre-built vagrant box, one built by Mathew Baldwin for WLS12c on CentOS 6.4, and ran into a problem. The vagrant up command failed:


A few things:

  • Running the VirtualBox command "vboxmanage list hostonlyifs" separately is fine.
  • I'm not running the command or session as an Administrator, in fact that fails with a completely different error given that's a separate account and does not have the required vagrant box.
  • I'm using the awesome Console2 (by Marko Bozikovic) but that matters not since the same error occurs in plain old cmd.exe
  • The command does complete successfully in MobaXterm 7.1 (another awesome tool!), though later down during the processing of the box (during Puppet configuration I believe) my machine does a hard shutdown/crash
  • VirtualBox version is 4.3.12
  • Vagrant version is 1.6.2
  • Windows 7 Pro SP1, 64-bit 

A Google search revealed others have had this problem, but not too many actual solutions, or at least one that worked for me. Here's how I got past this problem outside of using my MobaXterm (given that had shutdown my machine each time previously).

The fix was to start VirtualBox before running vagrant up. Even still, there remains some instability due to what seems to me like timing issues with vagrant sending commands to VirtualBox as on occasion the process fails (i.e. times out) waiting for the VM to start up and show the login prompt.

Tuesday, May 01, 2012

Oracle Internet Directory (OID) 11g: Part IV - OID Installation

This is the final post in my series on OID11g. I'll try and follow-up with a few other posts but essentially from here on out you would be ready to go with OID11g. If you are interested in making your OID highly available using LDAP multi-master replication then stay tuned for that follow-up post.

So OID11g  (11.1.1.5.0) installation actually consists of three phases, namely installation, patching and configuration. That is how I've broken up this post which as a side effect I think, makes it easier to follow. To provide some further clarity, some Fusion Middleware 11.1.1.5.0 components are offered as full installers, but not all. You can get the distribution details for the components on MOS, or via the documentation on on OTN. Unfortunately, OID falls into the case requiring a software installation of 11.1.1.2.0, followed by patching to 11.1.1.5.0 and subsequent configuration to complete the "installation". Hopefully Oracle will move towards full installers for all products much like they've done for the database (and other products such as GoldenGate and so on).

Installation of 11.1.1.2.0

1. Edit your response file for silent installation. The items of interest are highlighted as shown below:

[ENGINE]
#DO NOT CHANGE THIS.
Response File Version=1.0.0.0.0


[GENERIC]


#Set this to true if installation and configuration need to be done, all other required variables need to be provided. Variable "INSTALL AND CONFIGURE LATER TYPE" must be set to false if this is set to true as the variables are mutually exclusive
INSTALL AND CONFIGURE TYPE=false


#Set this to true if only Software only installation need to be done. If this is set to true then variable "INSTALL AND CONFIGURE TYPE" must be set to false, since the variables are mutually exclusive.
INSTALL AND CONFIGURE LATER TYPE=true


#Write the name of the Oracle Home directory. The Oracle Home directory name may only contain alphanumeric , hyphen (-) , dot (.) and underscore (_) characters, and it must begin with an alphanumeric character.
ORACLE_HOME=/oracle/app/fmw/Oracle_IDM1


#Write the complete path to a valid Middleware Home.
AS_HOME_LOCATION=/oracle/app/fmw


#Provide the My Oracle Support Username. If you wish to ignore Oracle Configuration Manager configuration provide empty string for user name.
MYORACLESUPPORT_USERNAME=


#Provide the My Oracle Support Password
MYORACLESUPPORT_PASSWORD=


#Set this to true if you wish to decline the security updates. Setting this to true and providing empty string for My Oracle Support username will ignore the Oracle Configuration Manager configuration
DECLINE_SECURITY_UPDATES=true


#Set this to true if My Oracle Support Password is specified
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false


#Provide the Proxy Host
PROXY_HOST=


#Provide the Proxy Port
PROXY_PORT=


#Provide the Proxy Username
PROXY_USER=


#Provide the Proxy Password
PROXY_PWD=


[SYSTEM]


[APPLICATIONS]

[RELATIONSHIPS]

 
2. Run the installation using OUI for OID 11.1.1.2.0, as the oracle user:

./runInstaller -silent -response /oracle/stage/rsp/oid11g-inst.rsp

Below is a sample execution run:

Starting Oracle Universal Installer...


Checking Temp space: must be greater than 80 MB. Actual 18983 MB Passed
Checking swap space: must be greater than 500 MB. Actual 7724 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2012-01-24_04-05-56PM. Please wait ...[oracle@orads02 Disk1]$ Log: /u01/app/oraInventory/logs/install2012-01-24_04-05-56PM.log
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Reading response file..
Expected result: One of enterprise-5.4,enterprise-4,enterprise-5,redhat-5.4,redhat-4,redhat-5,SuSE-10
Actual Result: redhat-5
Check complete. The overall result of this check is: Passed

CertifiedVersions Check: Success.
Checking for binutils-2.17.50.0.6; found binutils-2.17.50.0.6-14.el5-x86_64. Passed
Checking for compat-libstdc++-33-3.2.3-x86_64; found compat-libstdc++-33-3.2.3-61-x86_64. Passed
Checking for compat-libstdc++-33-3.2.3-i386; found compat-libstdc++-33-3.2.3-61-i386. Passed
Checking for elfutils-libelf-0.125; found elfutils-libelf-0.137-3.el5-i386. Passed
Checking for elfutils-libelf-devel-0.125; found elfutils-libelf-devel-0.137-3.el5-x86_64. Passed
Checking for gcc-4.1.1; found gcc-4.1.2-50.el5-x86_64. Passed
Checking for gcc-c++-4.1.1; found gcc-c++-4.1.2-50.el5-x86_64. Passed
Checking for glibc-2.5-12-x86_64; found glibc-2.5-58.el5_6.3-x86_64. Passed
Checking for glibc-2.5-12-i686; found glibc-2.5-58.el5_6.3-i686. Passed
Checking for glibc-common-2.5; found glibc-common-2.5-58.el5_6.3-x86_64. Passed
Checking for glibc-devel-2.5-x86_64; found glibc-devel-2.5-58.el5_6.3-x86_64. Passed
Checking for glibc-devel-2.5-12-i386; found glibc-devel-2.5-58.el5_6.3-i386. Passed
Checking for libaio-0.3.106-x86_64; found libaio-0.3.106-5-x86_64. Passed
Checking for libaio-0.3.106-i386; found libaio-0.3.106-5-i386. Passed
Checking for libaio-devel-0.3.106; found libaio-devel-0.3.106-5-i386. Passed
Checking for libgcc-4.1.1-x86_64; found libgcc-4.1.2-50.el5-x86_64. Passed
Checking for libgcc-4.1.1-i386; found libgcc-4.1.2-50.el5-i386. Passed
Checking for libstdc++-4.1.1-x86_64; found libstdc++-4.1.2-50.el5-x86_64. Passed
Checking for libstdc++-4.1.1-i386; found libstdc++-4.1.2-50.el5-i386. Passed
Checking for libstdc++-devel-4.1.1; found libstdc++-devel-4.1.2-50.el5-x86_64. Passed
Checking for make-3.81; found make-1:3.81-3.el5-x86_64. Passed
Checking for sysstat-7.0.0; found sysstat-7.0.2-3.el5_5.1-x86_64. Passed

Check complete. The overall result of this check is: Passed
Packages Check: Success.
Checking for VERSION=2.6.18; found VERSION=2.6.18-238.12.1.el5. Passed
Checking for hardnofiles=4096; found hardnofiles=131072. Passed
Checking for softnofiles=4096; found softnofiles=131072. Passed
Check complete. The overall result of this check is: Passed
Kernel Check: Success.
Expected result: ATLEAST=2.5-12
Actual Result: 2.5-58.el5_6.3
Check complete. The overall result of this check is: Passed
GLIBC Check: Success.
Expected result: 1024MB
Actual Result: 3948MB
Check complete. The overall result of this check is: Passed
TotalMemory Check: Success.
Expected result: LD_ASSUME_KERNEL environment variable should not be set in the environment.
Actual Result: Variable Not set.
Check complete. The overall result of this check is: Passed
Check Env Variable Check: Success.
Verifying data......
Copying Files...
-----------20%----------40%----------60%----------80%--------100%


Applying Oneoff Patch...
The installation of Oracle AS Common Toplevel Component, Oracle Identity Management 11g completed successfully.

Patching 11.1.1.2.0 to 11.1.1.5.0

1. Edit your response file for silent patching. It's not much different from the installation, the items of interest are highlighted as shown below:


[ENGINE]



#DO NOT CHANGE THIS.
Response File Version=1.0.0.0.0


[GENERIC]


#Provide the Oracle Home location. The location has to be the immediate child under the specified Middleware Home location. The Oracle Home directory name may only contain alphanumeric , hyphen (-) , dot (.) and underscore (_) characters, and it must begin with an alphanumeric character. The total length has to be less than or equal to 128 characters. The location has to be an empty directory or a valid IDM Oracle Home.
ORACLE_HOME=/oracle/app/fmw/Oracle_IDM1


#Provide existing Middleware Home location.
MIDDLEWARE_HOME=/oracle/app/fmw


#Provide the My Oracle Support Username. If you wish to ignore Oracle Configuration Manager configuration provide empty string for user name.
MYORACLESUPPORT_USERNAME=


#Provide the My Oracle Support Password
MYORACLESUPPORT_PASSWORD=


#Set this to true if you wish to decline the security updates. Setting this to true and providing empty string for My Oracle Support username will ignore the Oracle Configuration Manager configuration
DECLINE_SECURITY_UPDATES=true


#Set this to true if My Oracle Support Password is specified
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false


#Provide the Proxy Host
PROXY_HOST=


#Provide the Proxy Port
PROXY_PORT=


#Provide the Proxy Username
PROXY_USER=


#Provide the Proxy Password
PROXY_PWD=


#Type String (URL format) Indicates the OCM Repeater URL which should be of the format [scheme[Http/Https]]://[repeater host]:[repeater port]
COLLECTOR_SUPPORTHUB_URL=


#
CONFIG_WIZARD_RESPONSE_FILE_LOCATION=0


[SYSTEM]


[APPLICATIONS]


[RELATIONSHIPS]


2. Run the patch application using OUI for OID 11.1.1.5.0, as the oracle user:


./runInstaller -silent -response /oracle/stage/rsp/oid11g-patch.rsp

Below is a sample execution run:

Starting Oracle Universal Installer...



Checking Temp space: must be greater than 80 MB. Actual 18983 MB Passed
Checking swap space: must be greater than 512 MB. Actual 7406 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2012-01-24_04-27-11PM. Please wait ...[oracle@orads02 Disk1]$ Log: /u01/app/oraInventory/logs/install2012-01-24_04-27-11PM.log
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Reading response file..
Verifying data......
Copying Files...
-----------20%----------40%----------60%----------80%--------100%


Applying Oneoff Patch...
The installation of Oracle AS Common Toplevel Component on Oracle AS Common Toplevel Component home ,Oracle Identity Management 11g Patchset on Oracle Identity Management 11g home completed successfully.

 

Configuring OID with ODIP, ODSM and Fusion Middleware Control in a new WebLogic Domain

At this point you now need to configure your installation of OID11g. I went with the option of configuring OID with ODIP, ODSM and Fusion Middleware Control in a new WebLogic Domain. I wanted ODIP as an option to connect and synchronize to AD, ODSM and Fusion Middleware Control (FMC) for the GUI management and monitoring, and a new WebLogic Domain (for ODSM and FMC) since I don't have one that I would like to use currently. Please check the documentation for configuration using other options.

The steps to conduct the configuration are below. Note that I've not had any success doing a silent command line installation and as such the GUI method is what is shown. I suspect this is the only option thus far unless I am missing something (not unlikely) though I have attempted many options.

1. Start the configuration as the oracle user by running '$ORACLE_HOME/bin/config.sh':

oid_inst-01

Click 'Next' to continue to the next screen...

2. Enter the credentials for the new domain's user, along with the domain name. Click on 'Next' to continue.

oid_inst-02

3. Confirm and/or correct the locations for the WebLogic Server and Oracle Instance directories as well as specify an Oracle Instance Name. When completed click 'Next' to continue.

oid_inst-03

4. The next screen concerns the usual security notifications. I do not care for security updates so I simply continued.

oid_inst-04

5. Select Oracle Internet Directory and Oracle Directory Integration Platform. The Oracle Directory Services Manager and Fusion Middleware Control management components are automatically selected for this installation. Ensure no other components are selected and click 'Next' when completed to continue.

oid_inst-05

6. Select Auto Port Configuration to allow the installer to configure ports from a predetermined range. Click 'Next' when completed to continue.

oid_inst-06

7. We already used RCU to create and configure the OID schema so here we just need to select 'Use Existing Schema', enter the connection details to the repository database in the form '::' and enter the ODS schema password. Click 'Next' when completed to continue.

oid_inst-07

8. Next up is the OID information, i.e. the realm and administrator ('orcladmin') credentials. Click 'Next' to continue to the installation summary when completed.

oid_inst-08

9. Following the installation summary you will see the configuration progress screen.

oid_inst-09

oid_inst-09b

10. If all goes well you will see the Installation Completion screen

oid_inst-10


Installation Verification

To verify a successful installation you should run the following commands:

1. Execute '$ORACLE_INSTANCE/bin/opmnctl status -l'


Processes in Instance: asinst_1
---------------------------------+--------------------+---------+----------+------------+----------+-----------+------
ias-component                    | process-type       |     pid | status   |        uid |  memused |    uptime | ports
---------------------------------+--------------------+---------+----------+------------+----------+-----------+------
oid1                             | oidldapd           |    8245 | Alive    | 1068702846 |   375296 |  67:57:58 | N/A
oid1                             | oidldapd           |    8229 | Alive    | 1068702845 |    95868 |  67:57:58 | N/A
oid1                             | oidmon             |    8214 | Alive    | 1068702844 |    83744 |  67:57:58 | LDAPS:3131,LDAP:3060
EMAGENT                          | EMAGENT            |    7402 | Alive    | 1068702843 |    63908 |  68:01:31 | N/A



2. Execute the '$ORACLE_HOME/bin/ldapbind' command on the Oracle Internet Directory for non-SSL and SSL ports. Note that ORACLE_HOME must be set correctly (i.e. not the DB_HOME).

On Non-SSL ports:

$ORACLE_HOME/bin/ldapbind -h -p -D cn=orcladmin -w

On SSL ports:

$ORACLE_HOME/bin/ldapbind -h -p -D cn=orcladmin -w -U 1


Enabling WebLogic Startup


Every time an Administrator wants to run the WebLogic startup script, he/she is prompted with username and password. If the administrator wants to be configure weblogic to startup on bootup or reboot, then they will need the username and password to be automatically recognized. To enable WLS startup without password prompting create $DOMAIN_HOME/servers/AdminServer/security/boot.properties and $DOMAIN_HOME/servers/wls_ods1/security/boot.properties files with entries:

username=weblogic
password=wlsP#ssw0rd

After the initial startup, the password will be encrypted.


Summary

So now you have your first OID instance up and functional. All that is left is some configuration and tuning after some period of being operational. I will end the series on OID11g here but will try and follow-up with some further entries on setting up LDAP multi-master replication (MMR), backup/recovery and migration from 10g. I would like to point out that you should enable  anonymous binds which are disabled by default. Otherwise, you will receive the error:

"Configuration exception: Could not check for the Oracle Schema:
oracle.net.config.ConfigException: TNS-04409: Directory Service Error"

When attempting to use DBCA to add your database to OID. This can be done in two ways:

Using OEM11g Fusion Middleware Control
a. Navigate to "Identity and Access' -> oid1
b. Click on 'Oracle Internet Directory' and select 'Administration' -> 'Server Properties'
c. Switch 'Anonymous Bind' from 'Disallow except for Read Access on the root DSE' to 'Allows'
d. Click 'Apply'

Using Command-line
ldapmodify -D cn=orcladmin -q -p 3060 -h orads01.na.ds.g240.lab -f [ldifFile]

LDIF File:
dn: cn=oid1,cn=osdldapd,cn=subconfigsubentry
changetype: modify
replace: orclAnonymousBindsFlag
orclAnonymousBindsFlag: 1

Friday, April 13, 2012

WebLogic Server (WLS) Installation

I was going to this blog entry under my OID series but it occured to me that it made more sense to do a generic installation blog post instead given WLS is used by OID, OEM and many other components with which I've used and the only difference would be the WLS version used. The installation process is the same for 10.3.4 to 10.3.6. I can't vouch for other versions since I've not used prior versions and 12c is a bit different. So without further ado here is the install process, first the usual command line silent installation and then the GUI method.

Common Step - JDK Installation

1. Install a certified version of JDK to use. In the case of WLS 10.3.5 this would be JDK 1.6.0_24

For Oracle JRocket (required a GUI):

chmod +x jrockit-jdk1.6.0_24-R28.1.3-4.0.1-linux-x64.bin
./jrockit-jdk1.6.0_24-R28.1.3-4.0.1-linux-x64.bin

For Sun JDK:
chmod +x jdk-6u24-linux-x64.bin
./jdk-6u24-linux-x64.bin

2. I like to setup the environment for the installation process, specfiically calling out the location of the Java version to use. This would be required if you have multiple Java installations and you want to ensure the correct location/version is used.

export JAVA_HOME=/u01/app/oracle/jdk
export PATH=$JAVA_HOME/bin:$PATH

Method 1: Command Line Silent Installation

1. Build or edit the "silent.xml" file as below:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Silent installer option -mode=silent -silent_xml=/u01/app/stage/silent.xml -->
<!-- Specify values for each data-value name as follows:
BEAHOME - Complete pathname to the Middleware Home directory that will contain this installation.
WLS_INSTALL_DIR - Complete pathname to the product installation directory in which to install WebLogic Server.
COMPONENT_PATHS - Components and subcomponents to be installed. To install multiple components, separate the components with a bar (|). To install subcomponents, specify a component/subcomponent combination. For example, to install Core Application Server, use "WebLogic Server/Core Application Server".
INSTALL_NODE_MANAGER_SERVICE - Install Node Manager as a Windows service. The default is "no". Requires Administrator privileges.
NODEMGR_PORT - Node Manager listen port number. If none specified, installer uses default port 5556.
INSTALL_NODE_MANAGER_SERVICE - must be set to "yes".
INSTALL_SHORTCUT_IN_ALL_USERS_FOLDER - The Windows Start menu folder in which you want the Start menu shortcuts created. The user performing the installation must have Administrator privileges to install the shortcuts in the All Users folder. Possible values: true/yes The shortcuts are created in the All Users folder (default) false/no The shortcuts are created in the local user's folder
BEA_BUNDLED_JVMS - Option to select BEA bundled JVMS (for e.g. either jrockit_160_05 or jdk160_05 for Windows and Linux platforms). The default value is all BEA bundled JVMs for selected platform.
LOCAL_JVMS - Option to select supported JVM, which is already installed. Note: The presence of either(BEA_BUNDLED_JVMS or LOCAL_JVMS) or both of these tokens negates any default selection and only sets the values assigned for these tokens as user selection. The value of the token can be a pipe ('|') separated JavaHomes. -->
<bea-installer>
<input-fields>
<data-value name="BEAHOME" value="/u01/app/oracle/fmw" />
<data-value name="WLS_INSTALL_DIR" value="/u01/app/oracle/fmw/wlserver_10.3" />
<data-value name="COMPONENT_PATHS" value="WebLogic Server/Core Application Server|WebLogic Server/Administration Console|WebLogic Server/Configuration Wizard and Upgrade Framework|WebLogic Server/Web 2.0 HTTP Pub-Sub Server|WebLogic Server/WebLogic SCA|WebLogic Server/WebLogic JDBC Drivers|WebLogic Server/Third Party JDBC Drivers|WebLogic Server/WebLogic Server Clients|WebLogic Server/WebLogic Web Server Plugins|WebLogic Server/UDDI and Xquery Support|Oracle Coherence/Coherence Product Files" />
<data-value name="LOCAL_JVMS" value="/u01/app/oracle/jdk"/>
</input-fields>
</bea-installer>

Save the file in the same location as the installation program ("/u01/app/stage" in my case).

2. Run the installation as the oracle user:

cd /u01/app/stage/
java -d64 -Xms512m -Xmx1024m -jar wls103x_generic.jar -mode=silent -silent_xml=/u01/app/stage/silent.xml

Extracting 0%....................................................................................................100%
Jan 24, 2012 3:10:29 PM java.util.prefs.FileSystemPreferences$2 run
INFO: Created user preferences directory.


Method 2: GUI Installation

1. Run the installation as the oracle user:

For Oracle JRocket:
java -Xms512m -Xmx1024m -jar wls103x_generic.jar


For Hybrid Oracle/Sun JDK:
java -d64 -Xms512m -Xmx1024m -jar wls103x_generic.jar

wls1035-inst01

2. Choose the location of middleware home:

wls1035-inst02

3. Optionally register for security updates. I tend to decline since this is not production, but feel free.

wls1035-inst03

wls1035-inst03a

wls1035-inst03b

It requires internet access so if you don't have, you should decline otherwise you will be greeted with the message below (you can also setup your proxy access here as well):

wls1035-inst03c

4. Select "Typical" installation. If you want to be a bit more specific in the components select "Custom" but ensure all the expected components are installed as expected by the application.

wls1035-inst04

5. Next up is the JDK select screen. The installation will detect the available JDK versions on your server if you have multiple versions and allow you to select the appropriate version. Select the correct version.

wls1035-inst05

6. Specify the product installation directories:

wls1035-inst05

7. You are presented with an installation summary where you can review what products will be installed:

wls1035-inst07

8. Following is the actual installation process where you can view the progress:

wls1035-inst08

9. Following a successful installation the completion screen is shown. Deselect the option to run the Quickstart process and you have completed your WLS installation:

wls1035-inst09

Tuesday, July 19, 2011

Oracle 11gR2 (11.2.0.2) Installation - Database software

This is the 2nd in my series of Oracle11gR2 installations, focusing now on the installation of the database or RDBMS software for 11.2.0.2 having already installed the Grid Infrastructure component per my previous post here. If you don't want to install the Grid Infrastructure and use ASM (and Oracle Restart) that is fine, go ahead and skip that first article. In such a case I assume you would be using file systems (perhaps with dNFS which is a post for another time).

Here again, I will be using the command line approach since this is an easy way to have everything scripted and automated (and not require a GUI). I'll show the parameters that need to be adjusted, but if you are not comfortable then I'd suggest doing an initial GUI installation, saving that response file when prompted and then using the saved response file as your gold image for further scripted installations. Note that in the below I use RDBMS_HOME instead of ORACLE_HOME to make the distinction between the actual database home and the grid infrastructure home.

Requirements
See my previous post here

Installation
1. If this is your first installation, then you will want to create the '/etc/oraInst.loc' file, as the root user:

Note: This is optional since you will be prompted at the end of the installation to run $ORACLE_BASE/../oraInventory/orainstRoot.sh which does this for you if this files does not exist.

echo "inventory_loc=/oracle/app/oraInventory
inst_group=dba"
> /etc/oraInst.loc
chown oracle:dba /etc/oraInst.loc
chmod 664 oraInst.loc


2. Edit the DB response file, 'db_inst.rsp' for the values as show below:

ORACLE_HOSTNAME=oradb01
ORACLE_BASE=/oracle/app/oracle
ORACLE_HOME=/oracle/app/product/11.2.0/db_1


3. Run the DB installation (using responsefile and silent installation) as the oracle user:

Note: Ensure you set your DISPLAY environment variable, or you are at run level 5, otherwise you will encounter an error.

./runInstaller -silent -noconfig -responseFile /home/oracle/rsp/db_inst.rsp


4. As the root user run '$RDBMS_HOME/root.sh' when the above completes as prompted.


5. As the oracle user, create an OCM response file. This saves a lot of time later down when you are prompted for those values. Simple run the following and follow the instructions to create and save the response file:

$RDBMS_HOME/OPatch/ocm/bin/emocmrsp


6. Apply the latest OPatch patch (MOS patch ID 6880880), then the latest PSU to this installation as the oracle user. Simple unzip the OPatch patch to the $RDBMS_HOME. For the PSU, unzip to a temporary location, navigate to the patch location and run:

$RDBMS_HOME/OPatch/opatch apply -ocmrf /home/oracle/rsp/ocm.rsp 


7. Apply patch 12431716 (as required by PSU 2) by unzipping to a temporary location, change to the patch directory and as oracle user running: 

$RDBMS_HOME/OPatch/opatch apply -ocmrf /home/oracle/rsp/ocm.rsp


At this point you have fully prepared GI and RDBMS software installations with a ready listener and two disk groups. Now you can create a new database, or migrate an exiting database. I'll leave the new installation to another post in which I'll show how to use DBCA and a template to do it silently, without a GUI.

Thursday, July 07, 2011

Oracle 11gR2 (11.2.0.2) Installation - Grid Infrastructure

I quite often find myself doing Oracle installations and referencing back to the manuals, read me, other blogs, and various other information sources in an attempt to ensure I get everything just perfect. This is regardless of having done it many times and having documented it myself. These days however, I find this a time consuming exercise, especially given my increasing workload so I thought to simply blog about my method which follows below.

The installation below utilizes a command line only method as I often need to be do multiple installations in a standard, and scripted way. The best method I've found for reaching this point is to initially start with a GUI approach, from which the response file is saved which can then be used for further silent, command line driven installations. I'll start with the installation of the Grid Infrastructure component which is used for ASM and Oracle Restart, and continue with a follow-up posting with the RDBMS software installation. In the method that follows I use a simplified setup with only a single group assigned to the oracle user, i.e. 'dba'. Of course you will need to modify the below for your environment.

Requirements
OS: SUSE Linux Enterprise Service 10.3 (64-bit)

Packages (standard installation):
make-3.80-202.2
binutils-2.16.91.0.5-23.34.33
libstdc++33-3.3.3-7.8.1
gcc-4.1.2_20070115-0.29.6
gcc-c++-4.1.2_20070115-0.29.6
glibc-2.4-31.74.1
glibc-devel-2.4-31.74.1
glibc-devel-32bit-2.4-31.74.1
ksh-93s-59.11.35
libaio-0.3.104-14.2
libaio-32bit-0.3.104-14.2
libaio-devel-0.3.104-14.2
libaio-devel-32bit-0.3.104-14.2
libelf-0.8.5-47.2
libgcc-4.1.2_20070115-0.29.6
libstdc++-4.1.2_20070115-0.29.6
libstdc++-devel-4.1.2_20070115-0.29.6
numactl-0.9.6-3.25.28
sysstat-8.0.4-1.7.27
unixODBC-2.2.12
unixODBC-devel-2.2.12
unixODBC-32bit-2.2.12
oracleasmlib-2.0.4-1.SLE10
oracleasm-2.0.5-7.4.50
oracleasm-support-2.1.4-1.SLE10

Configuration files & settings:
/etc/sysctl.conf
# Oracle settings
kernel.core_uses_pid = 1
kernel.suid_dumpable = 1
kernel.msgmni = 2878
# physical RAM size (8 GB) / pagesize (4096)
kernel.shmall = 2097152
# 1/2 of physical RAM typically, 5 GB here
kernel.shmmax = 5368709120
kernel.shmmni = 4096
#kernel.sem = 250 32000 100 128
kernel.sem = 250 32000 100 142
# 512 x processes (for example 6815744 for 13312 processes)
fs.file-max = 6815744
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
net.ipv4.conf.default.rp_filter = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
# For RDS use larger value below
#net.core.wmem_max = 2097152
net.core.wmem_max = 1048576
# group ID of dba group
vm.hugetlb_shm_group = 7001
# number of hugepages (2 MB size) to be used for ASMM
vm.nr_hugepages=2560

/etc/security/limits.conf
# Oracle settings
oracle soft core unlimited
oracle hard core unlimited
oracle soft nproc 131072
oracle hard nproc 131072
oracle soft nofile 131072
oracle hard nofile 131072
oracle soft stack 32768
oracle hard stack 32768
oracle soft memlock 5242880
oracle hard memlock 5242880
root soft core unlimited
root hard core unlimited
root soft nproc 131072
root hard nproc 131072
root soft nofile 131072
root hard nofile 131072
root soft memlock 5242880
root hard memlock 5242880

/etc/pam.d/su
# Oracle setting
session  required       pam_limits.so

/etc/pam.d/xdm
# Oracle setting
session  required       pam_limits.so

/etc/sysconfig/ntp
NTPD_OPTIONS="-x -u ntp"    # add '-x' to existing string

~/.ssh/config
Host *
ForwardX11 no    # Set in the oracle user's file

~/.bashrc
if [ -t 0 ]; then
   stty intr ^C
fi    # Disable terminal output commands (assumes bash shell)

Links
ln -s /bin/fuser /sbin/fuser
ln -s /usr/bin/ssh /usr/local/bin/ssh
ln -s /usr/bin/perl /usr/local/bin/perl
ln -s /usr/bin/scp /usr/local/bin/scp



Installation
1. (optional) Create '/etc/oraInst.loc' file as the root user.

Note: This step is optional as it will be done automatically for first time installations when the oraInst.sh script is run.

echo "inventory_loc=/oracle/app/oraInventory
inst_group=dba"
> /etc/oraInst.loc
chown oracle:dba /etc/oraInst.loc
chmod 664 oraInst.loc


2. Edit GI response file, 'grid.rsp' for the below values:

ORACLE_HOSTNAME=oradb01
ORACLE_BASE=/oracle/app/oracle
ORACLE_HOME=/oracle/app/11.2.0/grid_1


3. As the oracle user, run GI installation (using responsefile 'grid.rsp' and silent installation).

Notes: 
   - Ensure your DISPLAY environment variable is set, or you are at run level 5. Otherwise you will not be able to run the command successfully.
   - You may see some warnings for the installation pertaining to a missing library package compat-libstdc++ which can safely be ignored as for SLES 10.3 and greater libstdc++33 is used instead (reference MOS: 'Requirements for Installing Oracle 11gR2 64-bit (AMD64/EM64T) on SLES 10 (Doc ID 884435.1)').

./runInstaller -silent -noconfig -responseFile /home/oracle/rsp/grid.rsp


4. As the root user, run '/oracle/app/oraInventory/oraInst.sh', '$GI_HOME/root.sh' and then '$GI_HOME/crs/install/roothas.pl' (per log file contents) after the above completes. See below for example run of '$GI_HOME/crs/install/roothas.pl':

/oracle/app/11.2.0/grid_1/perl/bin/perl -I/oracle/app/11.2.0/grid_1/perl/lib -I/oracle/app/11.2.0/grid_1/crs/install /oracle/app/11.2.0/grid_1/crs/install/roothas.pl
Using configuration parameter file: /oracle/app/11.2.0/grid_1/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'oracle', privgrp 'dba'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node oemgc02 successfully pinned.
Adding daemon to inittab
ACFS-9300: ADVM/ACFS distribution files found.
ACFS-9307: Installing requested ADVM/ACFS software.
ACFS-9308: Loading installed ADVM/ACFS drivers.
ACFS-9321: Creating udev for ADVM/ACFS.
ACFS-9323: Creating module dependencies - this may take some time.
FATAL: Module oracleoks not found.
FATAL: Module oracleadvm not found.
FATAL: Module oracleacfs not found.
ACFS-9327: Verifying ADVM/ACFS devices.
ACFS-9121: Failed to detect control device '/dev/asm/.asm_ctl_spec'.
ACFS-9310: ADVM/ACFS installation failed.
ACFS-9311: not all components were detected after the installation.

oemgc02     2011/06/23 10:02:19     /oracle/app/11.2.0/grid_1/cdata/oemgc02/backup_20110623_100219.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server

4b. To address the failure of the modules as seen above, reference MOS article "ACFS-9327 ACFS-9121 ACFS-9310: ADVM/ACFS installation failed [ID 1265276.1]" and run the following as the root user:

mkdir -p /lib/modules/`uname -r`/extra/usm
cp -p /lib/modules/2.6.16.60-0.54.5*/extra/usm/* /lib/modules/`uname -r`/extra/usm
/sbin/depmod

4c. OHASD will not starting after reboot on SLES (reference MOS: "OHASD not Starting After Reboot on SLES [ID 1325718.1]"). Run the following to fix this issue:

oradb01:~ # chkconfig --list|grep ohasd
init.ohasd                0:off  1:off  2:off  3:off  4:off  5:off  6:off
ohasd                     0:off  1:off  2:off  3:off  4:off  5:off  6:off
oradb01:~ # chkconfig --list|grep raw
raw                       0:off  1:off  2:off  3:off  4:off  5:off  6:off
oradb01:~ # chkconfig raw on
oradb01:~ # chkconfig ohasd on
oradb01:~ # chkconfig --list|grep raw
raw                       0:off  1:off  2:on   3:on   4:off  5:on   6:off
oradb01:~ # chkconfig --list|grep ohasd
init.ohasd                0:off  1:off  2:off  3:off  4:off  5:off  6:off
ohasd                     0:off  1:off  2:off  3:on   4:off  5:on   6:off

Note: Just turning on OHASD will result in error:

oradb01:~ # chkconfig ohasd on
insserv: Service raw has to be enabled for service oracle_has
insserv: exiting now!
/sbin/insserv failed, exit code 1


5. Apply latest OPatch patch, then latest PSU to GI software installation (Oracle Restart Home). As root user run '$GI_HOME/OPatch/opatch auto /oracle/stage/patches_grid -oh $GI_HOME -ocmrf /home/oracle/rsp/ocm.rsp'. An example below:

oemgc02:/oracle/stage/patches_grid # $ORACLE_HOME/OPatch/opatch auto /oracle/stage/patches_grid -oh $ORACLE_HOME -ocmrf /home/oracle/rsp/ocm.rsp
Executing /usr/bin/perl /oracle/app/11.2.0/grid_1/OPatch/crs/patch112.pl -patchdir /oracle/stage -patchn patches_grid -oh /oracle/app/11.2.0/grid_1 -ocmrf /home/oracle/rsp/ocm.rsp -paramfile /oracle/app/11.2.0/grid_1/crs/install/crsconfig_params
opatch auto log file location is /oracle/app/11.2.0/grid_1/OPatch/crs/../../cfgtoollogs/opatchauto2011-06-23_10-32-00.log
Detected Oracle Restart install
Using configuration parameter file: /oracle/app/11.2.0/grid_1/crs/install/crsconfig_params
Successfully unlock /oracle/app/11.2.0/grid_1
patch /oracle/stage/patches_grid/12311357  apply successful for home  /oracle/app/11.2.0/grid_1
patch /oracle/stage/patches_grid/11724916  apply successful for home  /oracle/app/11.2.0/grid_1
ACFS-9300: ADVM/ACFS distribution files found.
ACFS-9312: Existing ADVM/ACFS installation detected.
ACFS-9314: Removing previous ADVM/ACFS installation.
ACFS-9315: Previous ADVM/ACFS components successfully removed.
ACFS-9307: Installing requested ADVM/ACFS software.
ACFS-9308: Loading installed ADVM/ACFS drivers.
ACFS-9321: Creating udev for ADVM/ACFS.
ACFS-9323: Creating module dependencies - this may take some time.
ACFS-9327: Verifying ADVM/ACFS devices.
ACFS-9309: ADVM/ACFS installation correctness verified.
CRS-4123: Oracle High Availability Services has been started.

5b. Apply patch 12431716, as root user run '$GI_HOME/crs/install/roothas.pl -unlock'. An example below:

oemgc02:/oracle/stage/12431716 # $ORACLE_HOME/crs/install/roothas.pl -unlock
Using configuration parameter file: /oracle/app/11.2.0/grid_1/crs/install/crsconfig_params
Successfully unlock /oracle/app/11.2.0/grid_1

Next, as GI owner run '$GI_HOME/OPatch/opatch apply -oh $GI_HOME -local  -ocmrf /home/oracle/rsp/ocm.rsp'.
Next, as root user run '$GI_HOME/crs/install/roothas.pl -patch'. An example below:

oemgc02:/oracle/stage/12431716 # $ORACLE_HOME/crs/install/roothas.pl -patch
Using configuration parameter file: /oracle/app/11.2.0/grid_1/crs/install/crsconfig_params
ACFS-9300: ADVM/ACFS distribution files found.
ACFS-9312: Existing ADVM/ACFS installation detected.
ACFS-9314: Removing previous ADVM/ACFS installation.
ACFS-9315: Previous ADVM/ACFS components successfully removed.
ACFS-9307: Installing requested ADVM/ACFS software.
ACFS-9308: Loading installed ADVM/ACFS drivers.
ACFS-9321: Creating udev for ADVM/ACFS.
ACFS-9323: Creating module dependencies - this may take some time.
ACFS-9327: Verifying ADVM/ACFS devices.
ACFS-9309: ADVM/ACFS installation correctness verified.
CRS-4123: Oracle High Availability Services has been started.


6. Create listener from GI home (it will automatically get added to CRS by NETCA). By creating the listener before the ASM or database instances, Clusterware will automatically make the dependency relation. As oracle user edit the netca.rsp file and run:

Note: Ensure you have set the DISPLAY environment variable, or you are at run level 5. Otherwise the command will fail.

$GI_HOME/bin/netca -silent -responsefile /home/oracle/resp/netca.rsp


7. Create an ASM instance in silent mode by using ASMCA. The parameters for ASM in 11.2 require a disk group. I like to create a separate disk group (using a 2 GB disk) for this purpose which also serves the purpose of storing the OCR and voting files should the instance be migrated to RAC (since I also like to store those files using a separate disk group). To create this initial disk group, called SYSTEMDG run ASMCA as the oracle (or GI owner) user, then to create the additional disk groups for DATA and FRA, run similar commands using '-createDiskGroup' instead of '-configureASM'. See the examples below:

oracle@oradb01:~/bin> $GI_HOME/bin/asmca -silent -configureASM -sysAsmPassword sysPassw0rd -asmsnmpPassword asmsnmpPassw0rd -diskGroupName SYSTEMDG -diskList 'ORCL:SYSTEMD' -redundancy EXTERNAL -au_size 4 -compatible.asm '11.2.0.2.0' -compatible.rdbms '11.2.0.2.0'

ASM created and started successfully.

Disk Group SYSTEMDG created successfully.

oracle@oradb01:~/bin> $GI_HOME/bin/asmca -silent -createDiskGroup -sysAsmPassword sysPassw0rd -diskGroupName D1_T2_A4 -diskList 'ORCL:D_T2_*' -redundancy EXTERNAL -au_size 4 -compatible.asm '11.2.0.2.0' -compatible.rdbms '11.2.0.2.0'

Disk Group D1_T2_A4 created successfully.

oracle@oradb01:~/bin> $GI_HOME/bin/asmca -silent -createDiskGroup -sysAsmPassword sysPassw0rd -diskGroupName F1_T2_A4 -diskList 'ORCL:F_T2_*' -redundancy EXTERNAL -au_size 4 -compatible.asm '11.2.0.2.0' -compatible.rdbms '11.2.0.2.0'

Disk Group F1_T2_A4 created successfully.


You have now successfully installed Grid Infrastructure 11.2.0.2, applied a PSU and recommended patch, and created an ASM instance (along with a corresponding listener). At this point you are ready to commence the database installation process which I will include in a follow-up blog.