Showing posts with label how to. Show all posts
Showing posts with label how to. Show all posts

Wednesday, April 11, 2012

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

This is part II in the series I started on installating and setting up OID11g (11.1.1.5.0) which is part of Oracle Fusion Middleware 11g and in this case licensed under Oracle Directory Services Plus. Please check my previous posts on licensing and requirements for those details. For this posting I'm assuming you've already created a certified repository database and are now ready to install and setup the OID schemas. In my case I created an 11.2.0.3 EE single instance database repository using ASM for storage management. Check my blog entries for details on installing and setting up Grid Infrastructure, and installing and creating a database. Yes, I know these are shameless plugs for additional page views and I would also appreciate you clicking on a few advertiser links while there as well, thanks!

The OID 11g installation will no longer create a repository so this must be done upfront. You do have the option of setting up the schemas but using the Repository Creation Utility or RCU upfront is recommended. RCU is a tool to create the repositories scheams for various Fusion Middleware tools, which in this case we will be using it to create schemas required for OID and DIP (Directory Integration Platform). What is RCU exactly? It is effectively the replacement in FMW 11g for the Oracle Application Server 10g Metadata Repository Creation Assistant (also known as MRCA or RepCA). The documentation will tell you that RCU can be downloaded from MOS, OTN and Oracle e-Delivery Cloud but for me it was a bit difficult to locate the actual download except for the latter, i.e. Oracle e-Delivery Cloud, so this is where I'd recommend searching to save time and effort. The RCU version must match the version of FMW or rather OID that you intend to use, which in my case is 11.1.1.5.0. I prefer command line installations since they can be scripted and run without user interaction so I'll start out with that method and show the GUI interactive method following.


Setup
1. Extract the download to a staging directory and export the location to your environment as RCU_HOME:

$> export RCU_HOME=/tmp/stage/rcu

2. RCU is apparently a 32-bit installation and requires a 32-bit OS to install but it is possible since 11.1.1.4.0 to install from a  64-bit OS:

$> set linux32 bash

Method 1 - Using Command Line in Silent Mode

3. Create a text file which contains the various passwords in sequence of being prompted:

$> vim rcupwd.txt
sysP#ssw0rd
odsP#ssw0rd
odsP#ssw0rd

The first password is for SYS, the second and third are for the Oracle Directory Services or ODS schema. It is repeated since there are two prompts for this user's password.

4. I prefer to use ASSM for my tablespaces but by default RCU does not create all the required tablespaces for the schemas as such. A bit curious given Oracle's constant recommendations on this front but not completely unexpected if you've done repository installations before. Modify file $RCU_HOME/integration/oid/oid_Storage.xml replacing as shown below:


      <TablespaceAttributes NAME="OLTS_BATTRSTORE" >
      <AutoSegmentSpaceManagement>false</AutoSegmentSpaceManagement>
...
    <TablespaceAttributes NAME="OLTS_SVRMGSTORE" >
      <AutoSegmentSpaceManagement>false</AutoSegmentSpaceManagement>
TO
    <TablespaceAttributes NAME="OLTS_BATTRSTORE" >
      <AutoSegmentSpaceManagement>true</AutoSegmentSpaceManagement>
...
    <TablespaceAttributes NAME="OLTS_SVRMGSTORE" >
      <AutoSegmentSpaceManagement>true</AutoSegmentSpaceManagement>


This ensures all TBS are created with ASSM as the database default of local extent management will be picked up. You may need to modify the extend sizes for the DBF manually after installation to ensure all extents are spread across all ASM disks for your AU size.

Installation
5. Run the RCU installation:

$> cd $RCU_HOME/bin
$> ./rcu -silent -createRepository -databaseType ORACLE -connectString [orads01.mydomain.lab:1521:dsrep.mydomain.lab] -dbUser sys -dbRole SYSDBA -component OID -variables RCU_LOG_LOCATION=/tmp -schemaPrefix LAB -f < rcupwd.txt
Processing command line ....
Repository Creation Utility - Checking Prerequisites
Checking Global Prerequisites

Repository Creation Utility - Checking Prerequisites
Checking Component Prerequisites
Repository Creation Utility - Creating Tablespaces
Validating and Creating Tablespaces
Repository Creation Utility - Create
Repository Create in progress.
Percent Complete: 0
Percent Complete: 35
Percent Complete: 29
Percent Complete: 91
Repository Creation Utility: Create - Completion Summary
Database details:
Host Name                       : orads02.mydomain.lab
Port                            : 1521
Service Name                    : DSREP.MYDOMAIN.LAB
Connected As                    : sys
Prefix for (non-prefixable) Schema Owners : DEFAULT_PREFIX
RCU Logfile                     : /u01/app/rcuHome/rcu/log/logdir.2012-01-24_13-37/rcu.log
Component schemas created:
Component                       Status  Logfile
Oracle Internet Directory               Success /u01/app/rcuHome/rcu/log/logdir.2012-01-24_13-37/oid.log
Repository Creation Utility - Create : Operation Completed

You can get the meaning of the various arguments I've used from the RCU documentation but they are pretty self explanatory.

Method 2 - Using the GUI

1. Issue the command:

$> $RCU_HOME/bin/rcu

rcu_oidschema-01

On the welcome screen, click "Next".

2. Select "Create" for creation of the schemas:

rcu_oidschema-02

3. Input the connection details into the appropriate fields, as shown in the screen shot:

rcu_oidschema-03

RCU will verify the information by making a test connection while also verifying that the database requirements are met to act as a repository:

rcu_oidschema-03b

4. Select the components to install, which is "Oracle Internet Directory". I also chose the "Directory Integration Platform" in my case though this is not shown in the screen shots.

rcu_oidschema-04

RCU checks that the component prequisites are okay.

rcu_oidschema-04b

5. The tablespace mapping is shown. I suggest leaving the defaults with the possible exception of the temp changed if needed (I changed mine to TEMP). You can manage the settings (such as ASSM and so on) via clicking on the "Manage Tablespaces" button.

rcu_oidschema-05

A confirmation box is displayed informing any non-existent tablespaces are about to be created, which is followed by another completion confirmation box:

rcu_oidschema-05b

rcu_oidschema-05c

6. The summary screen is displayed which indicates you are about to begin creation of the schemas:

rcu_oidschema-06

7. Once completed summary completion screen is shown:

rcu_oidschema-07

At this point setup of the OID repository is complete and you can move on to the installation of WebLogic or OID software which I will demonstrate in another blog entry. The sequence does not matter since only the software for OID will be installed (and patched), however, the WLS piece and all other pre-requisites (DB repository) should be in place prior to starting OID configuration.

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.