CHAPTER 6

image

Installing the Oracle Database

The previous chapter dealt with the installation of Oracle Linux, and its configuration in preparation of the installation of the Oracle binaries. As you have seen there are a number of prerequisites that needed to be met. In this chapter the focus shifts to the Oracle binary installation. In this respect the chapter is divided into two parts. The first one will explain the installation of Oracle Restart or—as it is also known—Grid Infrastructure for a standalone server. You will require such a setup if you would like to make use of ASM, which I recommend as an alternative to older file systems not able to perform concurrent and direct I/O. If you decide to use a file system and don’t want to make use of the features offered by Oracle Restart besides ASM, feel free to skip directly to the RDBMS installation in part two. I recommend you read on for arguments in favor of Oracle Restart because there are significant benefits to using it, as described in the section “Installing Oracle Restart”.

The second part of the chapter explains the installation of the Oracle RDBMS binaries. Following the overall scheme of the book-automation and consolidation-silent installations of the software will be introduced, as well as an option to install Oracle using the Red Hat Package Manager (RPM). Throughout the chapter, it is assumed that you followed Oracle’s advice and use separate accounts for the Grid Infrastructure and RDBMS binaries.

Preparing for the installation

There are a few things that you need to consider before you can start the installation of any Oracle product. First, you obviously need the software, which you can download from OTN or Oracle’s edelivery site. Then you need to either configure your graphical user environment to perform an interactive installation, or alternatively prepare for a silent installation.

Beginning with Oracle 11g Release 2 patchset 1 Oracle did a great thing and introduced patch sets as full releases. In other words, instead of having to apply the base release plus all the patches to get to the desired patch level, all you need to do is to download and install the patchset plus any Patch Set Updates. Just as before patches have to be downloaded from My Oracle Support. Using full releases is a great time saver, and especially from an automation point of view this makes life a lot easier by reducing the number of moving parts in your configuration.

The chapter assumes that Grid Infrastructure for a standalone server is owned by the grid account, whereas the Oracle database binaries are owned by Oracle.

Staging the software

When planning for the next-generation Oracle environment, it is the right time to think about the deployment structure. Instead of downloading and staging software and patches for every Oracle installation, you might consider a central location to stage patches, scripts, and other Oracle related data. Consider a global environment with three different locations for the staging servers: the Americas, Europe, and Asia. The locations have been chosen to be equidistant and minimize network-latency between the sites when operating on a global scale. Standard utilities such as rsync can be used to replicate information to each site overnight, keeping the systems in sync with one another. These servers are very important for day-to-day information and therefore must also be protected locally. This can be achieved by using storage array replication or another rsync process to a local clone of the server for example. Although they should not need mentioning, regular file system backups are of course mandatory.

Once the software is staged, NFS could be used to make the software available for the database servers. In the following example, it is assumed that the software is stored in /media/oracle/x64/12.1.0.1/grid and database.

In order to stage the software, download the latest version of the binaries and use the unzip command to extract the binaries on the staging server, as shown in this example:

[root@stagingServer ∼] # cd /path/to/nfs/export/oracle/x64/12.1.0.1/
[root@stagingServer ∼] # unzip –q V38501-01_1of2.zip
[root@stagingServer ∼] # unzip –q V38500-01_1of2.zip
[root@stagingServer ∼] # unzip –q V38500-01_2of2.zip

Now change permission of the files to match your environment and configuration. You should ensure that you are exporting the file system read only and with maximum security settings enabled to prevent users from tampering with the installation! Standardized (UNIX) user and group IDs work very well toward this goal.

Preparing your environment variables

Whichever way you decided to stage the software—locally or exported via the network—you need to configure the grid user’s environment appropriately before continuing. If you followed the suggestions outlined in Chapter 5, you should have an OFA-compliant setup of directories with correct permissions. The most common pitfall is to have incorrect directory permissions for the inventory, usually /u01/app/oraInventory. The grid user must be the directory owner and the oinstall group should have been assigned.

On systems with small root file systems you might run into problems due to a lack of space in the temp directory. By default Oracle Universal installer bootstraps parts of itself to the /tmp directory before launching. If there is insufficient space, this step will fail. Space pressure is added by the fact that unfinished OUI sessions are not cleared up. Additionally, OUI checks for the existence of 1GiB of free space in that same directory and you are doing well to respect that requirement. To circumvent the problem you could create a temporary directory on your oracle mount point, and redirect the TMP and TEMP environment variables at it:

[grid@server1 ∼]> mkdir /u01/app/grid/temp
[grid@server1 ∼]> export TMP=/u01/app/grid/temp
[grid@server1 ∼]> export TEMP=/u01/app/grid/temp

With these settings the Oracle installer will use $TEMP for its bootstrap process.

Configuring your graphical user interface

Oracle Universal Installer on the UNIX platform requires a graphical user interface to start an interactive session. In the UNIX world, the “GUI” is provided by the X11 software stack. An X-client such as the installer process attaches to an X-server. For most UNIX software this would be a local-to-local connection on a workstation. Very few database systems in the real world however will allow the administrator to use the local console to install the Oracle software! Many even won’t have the X11 libraries and binaries which are required for the GUI installed. There are two ways around this:

  • Forward X11 via SSH
  • Use the VNC server

Let’s have a look at these options in detail.

Forwarding an X11 session

Most database administrators will use some variant of the Microsoft Windows operating system on their workstations or desktops. For them to use X11 forwarding, they need to install an X server which has to be started up and accepting connections on their workstations. Free/Open Source X Servers include the Cygwin environment for example. In addition to the Open Source X Servers, commercial products are available as well. It is more a matter of personal taste as to which one to choose. To allow X11 forwarding on the database server you need to modify the SSH server daemon configuration file on the database server.

image Note  Check with your security department if X11-forwarding is allowed in your environment before enabling it.

For an OpenSSH implementation, you need to add/modify the following variable in /etc/ssh/sshd_config and reload the configuration. The below example is for Linux, after the variable X11Forwarding has been uncommented out and set to yes:

[root@server1 ∼] # grep X11Forwarding /etc/ssh/sshd_config
X11Forwarding yes
[root@server1 ∼] # service sshd reload
Reloading sshd:                                            [  OK  ]
[root@server1 ∼] #

In your putty configuration, ensure to enable X11 forwarding. For putty’s new connection dialog, navigate to Connection imageSSH image X11, tick the checkbox named “Enable X11 Forwarding” before connecting to the server. Unlike port forwarding you can’t retrospectively enable X11 forwarding. Your next session will show lines similar to these:

login as: grid
[email protected]'s password:
Last login: Fri Sep 6 15:31:29 2013 from jumpbox
/usr/bin/xauth:  creating new authority file /home/grid/.Xauthority
$ echo $DISPLAY
localhost:10.0

You can use the xdpyinfo application to check if your terminal session can connect to the X server, which should be the case. This little utility displays information about the X server. Any output different from the below example indicates you can successfully forward your X11 session:

xdpyinfo:  unable to open display "".

Using the Virtual Network Computing Protocol

An alternative to X-forwarding exists in the form of VNC. It is easiest to picture VNC as an operating system independent equivalent to the Microsoft Terminal Services client. VNC is based on a client/server architecture, and supports many operating systems. It is very common to start a server session on Linux and use a Windows client. The VNC server is slightly easier to configure than X11 forwarding. It does not require a change to the SSH daemon configuration which can be difficult to arrange.

To use VNC you need to install the vnc server on the database server. In Oracle Linux 6, the VNC package to be used is called tigervnc-server. Install it using yum as usual. Once the software is installed, start a VNC server session on the database host. Each of these will create a new display ID, as shown in the example below:

[grid@server1 ∼]$ vncserver
 
You will require a password to access your desktops.
 
Password: <not shown>
Verify: <not shown>
 
New 'server1.example.com:1 (grid)' desktop is server1.example.com:1
 
Creating default startup script /home/grid/.vnc/xstartup
Starting applications specified in /home/grid/.vnc/xstartup
Log file is /home/grid/.vnc/server1.example.com:1.log

As you can see the VNC server is started on display one. Subsequent VNC server sessions started will increment that counter and start on the next available display. To connect to the VNC server process, start a VNC client on your workstation and provide the connection string, such as server1.example.com:1. The RealVNC client which is probably the most widely spread viewer has not been updated for quite some time, and the free edition is still at version 4.1.3 but works even with tigervnc used in Oracle Linux 6. The viewer does not require an installation and comes as a binary executable of only a few hundred KiB in size.

The neat aspect about the use of VNC is that it does not require a lot of bandwidth to work properly, and a network glitch does not ruin your installer session. Just like a Microsoft Terminal Server session you can resume where you left off.

Installing Oracle Restart

Beginning with 11g Release 2 Oracle has rolled up the installation of Automatic Storage Management (ASM) and Clusterware into one single Oracle home. The new installation type is called Grid Infrastructure, which can be installed either for a standalone host in which it is called “Oracle Restart”, or it can be installed for a Real Application Cluster. There are good reasons to install Oracle Restart, even if you are not planning to use RAC. First of all, it gives the administrator a unified interface to his environment: the commands to administer Oracle Restart are identical to the ones the RAC DBA uses. Also, there is no more problem with automatically starting the listener and/or the database when the server reboots; it happens automatically. All these entities are registered in the Oracle Restart metadata from where they can be processed during boot and shutdown. And the best is: Oracle Restart behaves identically regardless of the platform. A server reboot is guaranteed to finish with the start of the database instances and the listener. Oracle Restart works really well in standardizing environments, which is one of the ideas of this book.

Interactive installation of Oracle Restart

The interactive installation is the recommended way to get a “feeling” for the new installer. Interactive installation can also be used to create a response file which is going to be used later for the silent installation. The standard layout of the database servers in terms of file system layout and permissions will make it very easy to perform a silent installation.

Log on to the database server as the grid user. Follow the steps as described earlier in this chapter in section “Configuring your graphical user interface” to create a GUI environment; using your terminal session start the Oracle Universal Installer.

[grid@server1 grid]$ ./runInstaller
Starting Oracle Universal Installer...
 
Checking Temp space: must be greater than 120 MB.   Actual 4789 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 767 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-09-06_08-17-48AM. Please wait ...

The installer will bootstrap itself to the /tmp directory by default and a few moments later display the splash screen. Note that the following print screens have been rendered by a forwarded session to my Linux workstation.

Download Software Updates

The software updates screen is the first one you see after the new Oracle 12c logo indicates that you are on the latest release. Figure 6-1 shows this screen.

9781430244288_Fig06-01.jpg

Figure 6-1. Deciding about options for downloading software updates

You have the option to download software updates such as Patch Set Updates and other fixes recommended by Oracle. By selecting the first radio button you allow a connection to My Oracle support to download patches and updates. You can supply proxy connection information to connect to the Internet. In most security conscious environments a direct connection, even facilitated by a proxy server will not be possible or even desirable. Oracle offers the second solution instead, which enables you to make use of previously downloaded patches. OUI has a command line option, called “-downloadUpdates”. When you start OUI in this mode on a workstation connected to the Internet, a configuration dialog will guide you through the necessary steps for downloading the patches. These can then be transferred to the staging server and referenced in the location text field. In the above example no patches have been selected for download or application. You can ignore the warning window which pops up in this case for now.

A click on the “next” button advances to the next screen, as shown in Figure 6-2.

9781430244288_Fig06-02.jpg

Figure 6-2. Deciding installation options

Select Installation Option

Figure 6-2 shows one of the central screens in the whole installation. On this screen you define the further course of the installation, and the next steps depend on the choice you make here. Not all are applicable to the installation of an Oracle Restart environment.

Your choices in Figure 6-2 include the following:

Install and configure Oracle Grid Infrastructure for a cluster: Select this option to install Grid Infrastructure for a Real Application Cluster. Unfortunately, due to space constraints this cannot be discussed in this chapter.

Install and configure Oracle Grid Infrastructure for a standalone server: This is the option you choose for installing Oracle Restart. It will guide you through a set of screens to define the properties of the new installation. In the course of the chapter I am assuming that you chose this option.

Upgrade Oracle Grid Infrastructure or Oracle Automatic Storage Management: This is the entry point for upgrading an existing Oracle Restart and Real Application Cluster environment. It provides a very convenient way to migrate from a previous release to 12.1. More information about upgrade considerations, the upgrade path and more can be found in Chapter 12.

Install Oracle Grid Infrastructure Software only: This option is appropriate for experienced Oracle administrators without root access to immediately execute the root-scripts during the installation. Unlike the second option, which will run all the configuration assistants after the binaries have been deployed, this installation type requires you to perform manual steps. These include running configuration steps for Oracle Restart, as well as the addition of any resource normally created for you by an automated configuration assistant. On the upside you do not need to wait for any configuration assistant to finish. As soon as the software has been installed it is possible to close the OUI session.

Continue the installation by selecting option 2 “Install and Configure Oracle Grid Infrastructure for a Standalone Server” and click on the “Next” button.

Select Product Language

You can see in Figure 6-3 that Oracle supports a wide range of languages out of the box. The American English language will always be pre-selected, and should not be removed from the selection.

9781430244288_Fig06-03.jpg

Figure 6-3. Chosing languages for the installation

Select any other languages you would like to use with the Oracle Restart installation by highlighting them on the left pane and moving them over to the right pane by clicking the arrow button. Click on “Next” to advance to the ASM disk group creation screen.

Create ASM Disk Group

ASM has been discussed in some detail in Chapter 2. At this stage in the installation process you are going to put theory to practice by defining which LUNs are defined in a disk group, using the screen in Figure 6-4. This screen makes use of the fact that the ASM disks have already been defined on the operating system as discussed in Chapter 5.

9781430244288_Fig06-04.jpg

Figure 6-4. Creating ASM disk groups

For ASM disks to be accessible by Oracle Restart and the database in this separation-of-duties scenario, they must be owned by the grid user. The group has to be set to asmdba and the permissions on the block device must be set to 0660-otherwise the installer won’t be able to attach to the LUNs. If no disks appear, the discovery string could be wrong. In this case, click on the button labeled “Change Discovery Path” and enter an appropriate value. For example, if you are using EMC Power Path on Linux you would use /dev/emcpower* instead. Native Linux device-mapper-multipath devices require a discovery string of /dev/mapper/<some identifier>. Click into the checkboxes in front of the LUNs to select the disks to be added to the disk group. Alternatively, change the default allocation unit if you are expecting the disk group to become very large. The default name of the ASM disk group to be created is named “DATA” (change the name to match your naming standards). When you are happy with the settings continue by clicking on “Next”.

Specify ASM Password

On the screen shown in Figure 6-5 you have the choice to enter passwords for the two ASM users: SYS and ASMSNMP.

9781430244288_Fig06-05.jpg

Figure 6-5. Specifying ASM passwords

The sys account is the ASM-equivalent of the UNIX root account, and its password should therefore be chosen carefully. The ASMSNMP has been introduced in 11g Release 2 and is primarily used for monitoring the ASM instance from Enterprise Manager. Although the installer offers you to share a common password for both accounts this is strongly discouraged. Press “Next” to continue to the “Privileged Operating System Groups” screen.

Specify Privileged Operating System Groups

On the screen shown in Figure 6-6 you map your previously created operating system groups to privileged groups as defined by Oracle.

9781430244288_Fig06-06.jpg

Figure 6-6. Assigning privileged operating system groups

The mapping of operating system groups to Oracle’s internal groups has been discussed in great detail in Chapter 5. Here is a quick refresher of the discussion:

  • Members of the Oracle ASM Administrator Group (OSASM) can connect to the ASM instance using the SYSASM privilege
  • Members of the Oracle ASM DBA Group (OSDBA) can connect to the ASM instance using the SYSDBA privilege. The RDBMS owner account (oracle in most cases) must be a member of this group. Otherwise the ASM storage will not be visible to the database
  • Members of the optional ASM Operator Group (OSOPER for ASM) can connect using the SYSOPER privilege

Although it is possible to assign the same operating system group to all of the Oracle groups, it is suggested to use the groups as shown in the figure for finer privilege granularity.

image Note  The drop-down boxes on this screen will only display groups currently assigned to the grid owner. Use the usermod command to add additional groups to the grid owner and log out of your X11-session to make the changes take effect.

If you decide to use only one operating system group in this screen, OUI will flag a warning. Click on “Next” to proceed to step 7.

Specify Installation Location

Figure 6-7 shows the screen from which you specify the location of the Oracle binaries. If you followed the advice given in Chapter 5 you should not need to change much. The installer detects an Optimum Flexible Architecture file system layout and proposes the installation locations as shown in the screen. It proposes the home directory to /u01/.../12.1.0/grid. It would be better to add the patch set number to the path however to immediately identify the version of the Oracle Restart installation. When patch set two is going to be released you have to perform an out-of-place upgrade anyway. Creating the directory with the patch set number reduces the potential for mistakes.

9781430244288_Fig06-07.jpg

Figure 6-7. Specifying file locations

Should you have different requirements adjust the paths to match your standards and click “Next” to proceed to the following screen.

Create Inventory

The Oracle central inventory is an important location for the maintenance of the Oracle software. It stores, among other items, which Oracle home has been installed and where. Figure 6-8 shows the screen from which you define the inventory location. The location should not be inside the ORACLE_BASE; you typically define the inventory location to be one hierarchy above the ORACLE_BASE for the Oracle account.

9781430244288_Fig06-08.jpg

Figure 6-8. Defining the Oracle inventory location

If the inventory location is under ORACLE_BASE, the installer will issue a warning which you should not ignore, especially when using different accounts for Grid Infrastructure and the RDBMS binaries. Although you are prompted to run a script after the transfer of the binaries to the hard disk finished OUI insists that the permissions for the inventory directory are as follows:

  • Owner:            grid owner-“grid” in this example
  • Group:             oinstall
  • Permissions: 0770

The inventory group is determined by the grid owner’s primary group-oinstall. Again click “Next” to advance to the next screen.

Running Root Scripts Automatically

A very nice feature has been added to Grid Infrastructure allowing you to have OUI execute the root scripts to be run during the installation automatically. You can either pass the root credentials or provide information needed to use the UNIX sudo-function to execute the root and any other post-installation scripts. Figure 6-9 shows the screen from which you specific these credentials and other login details.

9781430244288_Fig06-09.jpg

Figure 6-9. Optionally run root scripts automatically

Perform Prerequisite checks

You are getting closer to actually transferring the binaries to disk! The installer ensures in this step that the required prerequisites for the installation are met. Depending on your configuration this can take a little while. After the verification has completed, the results are presented to you. If your preparations have been thorough you should not be met with any errors and the installer will proceed straight to the summary screen as shown in Figure 6-11. If you are curious to see the results of the checks anyway you can use the “Back” button to navigate back, the screen will look similar to Figure 6-10.

9781430244288_Fig06-10.jpg

Figure 6-10. Checking the prerequisites

In case of errors you can either manually correct the problems by switching to a shell session, or let the installer do the hard work. Beginning with Oracle 11.2 there is an option to let OUI create a so-called fixup script on the server to be executed as root which should correct many common problems with the configuration. If a failed check has “yes” in the fixable column, then OUI can often correct it. Certain issues such as problems with main memory can obviously not be fixed automatically by the installer.

Once you have run the fixup script as root, return to the installer session and acknowledge the script execution. OUI will check the system once more to ensure you are not missing vital configuration steps.

If you opted to modify the system settings yourself, you can use the “Check Again” button to verify the system settings once more. Thankfully you are not left out in the dark with the task of correcting the settings for a failed check.

In the list of problems, click on an entry to display more information, as shown in Figure 6-11. This is the place to get detailed information about the problem by clicking on the hyperlink named “more details”. This opens the pop-up box shown. As you can see Oracle expects you to have a maximum limit of open file descriptors for the grid users set to 65536.

9781430244288_Fig06-11.jpg

Figure 6-11. Getting more details about a problem

The error messages are helpful in most cases, and usually lead you to the source of the error quite quickly. The most common errors to be corrected are related to missing or invalid kernel parameters, swap space, and shell limits.

Once all the problems are fixed click “Next” to proceed to the summary screen.

Review the Installation Summary

The summary screen shown in Figure 6-12 wraps up all the previously made choices in one place. Review your settings and ensure that the choice made reflects your corporate standards. You can always use the “Back” button or click on the [Edit] link to go back to the relevant screen to make any corrections.

9781430244288_Fig06-12.jpg

Figure 6-12. Installation summary

The greyed-out “Next” button indicates that there are no further screens in the installation wizard. A click on “Install” will initiate the transfer of the software to the defined location. Before doing so, take a moment and consider the creation of the response file. The response file will be needed for a silent install, which will be explained in the next section. The default location OUI offers for the response file is in the grid owner’s home directory, and is usually called grid.rsp.

Figure 6-13 shows the progress screen.

9781430244288_Fig06-13.jpg

Figure 6-13. The installation progress screen

The installation proceeds by preparing, copying, and linking binaries. Once these activities are completed, a window opens as shown in Figure 6-14 and prompts you to run the “root scripts”.

9781430244288_Fig06-14.jpg

Figure 6-14. Prompt for root script execution

Running and troubleshooting configuration scripts

There are two scripts to be executed as root for an Oracle Restart installation:

  • orainstRoot.sh
  • root.sh

Figure 6-14 shows you the pop-up which prompts for the script execution.

The exact path is indicated in the pop-up window, which can be copied into the clipboard. The first script to run, orainstRoot.sh, ensures that the permissions on the central inventory are set correctly. The output of the script execution is shown here:

Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
 
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.

The next script-root.sh-sets up the foundation for Oracle Restart, and the output from running it is shown below:

[root@server1 ∼]# /u01/app/grid/product/12.1.0.1/grid/root.sh
Performing root user operation for Oracle 12c
 
The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/grid/product/12.1.0.1/grid
 
Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...
 
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/grid/product/12.1.0.1/grid/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node server1 successfully pinned.
2013/09/06 18:42:03 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.conf'
 
Server1     2013/09/06 18:42:32     /u01/app/grid/product/12.1.0.1/grid/cdata/server1/backup_20130906_184232.olr
2013/09/06 18:43:18 CLSRSC-327: Successfully configured Oracle Grid Infrastructure
for a Standalone Server

If you see the last line “successfully configured Oracle Grid Infrastructure for a Standalone Server”, all is well you have successfully executed the root.sh script.

In the past it has been difficult to troubleshoot problems with the root.sh script. These have gradually been addressed with the latest releases. A major improvement is the verbose logging created during the execution of the root.sh script. The file you need to consult is in somewhat hidden in $GRID_HOME/cfgtoollogs/crsconfig/roothas.log. Should you run into problems during the execution of root.sh, begin your investigation there. It shows in great detail which steps are performed on your behalf. Studying the contents of the roothas.log file can greatly improve your understanding of how Grid Infrastructure works internally, but has to be left as an exercise to the reader to do so. Unlike the root.sh for a clustered installation, the script does not seem to be restartable.

If you have adhered to the configuration described in Chapter 5, you should not have any problems with the root.sh script. Common problems encountered in the field are mismatches between /etc/hosts and DNS entries, or ignored prerequisites. Usually the error reported in roothas.log is specific enough to point you to the problem.

Finishing the installation

After the successful execution of the root scripts, click the “OK” button to dismiss the dialog. Control will return to the Oracle Universal Installer session, and the final configuration will complete the installation. This is shown in Figure 6-15.

9781430244288_Fig06-15.jpg

Figure 6-15. Oracle Universal Installer is completing the post-installation steps

The following steps are performed:

  • Update of the inventory
  • Configuration of a basic network configuration
  • Creation of the ASM instance
  • A final pass of the cluster verification utility

All of these operations are logged in detail in $GRID_HOME/cfgtoollogs/. The installer will automatically advance to the next screen and displays a success message. Congratulations! You have installed Oracle ASM! You may proceed by drinking a cup of well-deserved coffee before beginning the installation of the database binaries.

Silent installation of Oracle Restart

A silent installation of Oracle Restart is an elegant way to deploy the software to many hosts using a lights-out approach. The standardized approach to deploying hosts and operating systems should make this task even easier, since you can assume a compliant directory layout. You should also assume that all users have been created with the correct group mappings and so forth. Silent installations also don’t need an X11-server anywhere in the network. For secure environments, this is a blessing as it doesn’t involve changing the SSH configuration as described earlier in the chapter. Many secure sites do not allow X11 forwarding or port forwarding at all.

The so-called response file is the basis of the silent installation. Response files contain many key-value pairs to instruct the installer what to do as part of the installation. Response files have been in use with the Universal Installer for a long time, and examples or templates can usually be found on the installation media in the “response” directory. Beginning with Oracle 11.2 it is possible to store the response file by simply clicking on a button on the summary screen. It is no longer necessary to use the “-record” and “-destinationFile” arguments when launching “runInstaller” to generate a recorded response file.

The following example assumes that a response file has been saved in OUI as suggested during the “interactive installation” section. The alternative is to use the grid_install.rsp template and edit it. Apart from the passwords all relevant information is initially present in the response file. Below is an example for a response file, using the values defined earlier in the interactive session. Please ensure to adapt the file to your needs, especially in regards to the passwords.

[grid@server1 ∼] $ sed -e '/^#/d' -e '/^$/d' grid.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v12.1.0
ORACLE_HOSTNAME=server1.example.com
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en
oracle.install.option=HA_CONFIG
ORACLE_BASE=/u01/app/grid
ORACLE_HOME=/u01/app/grid/product/12.1.0.1/grid
oracle.install.asm.OSDBA=asmdba
oracle.install.asm.OSOPER=
oracle.install.asm.OSASM=asmadmin
oracle.install.crs.config.gpnp.scanName=
oracle.install.crs.config.gpnp.scanPort=
oracle.install.crs.config.ClusterType=STANDARD
oracle.install.crs.config.clusterName=
oracle.install.crs.config.gpnp.configureGNS=false
oracle.install.crs.config.autoConfigureClusterNodeVIP=true
oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS
oracle.install.crs.config.gpnp.gnsClientDataFile=
oracle.install.crs.config.gpnp.gnsSubDomain=
oracle.install.crs.config.gpnp.gnsVIPAddress=
oracle.install.crs.config.clusterNodes=
oracle.install.crs.config.networkInterfaceList=
oracle.install.crs.managementdb.configure=true
oracle.install.crs.config.storageOption=
oracle.install.crs.config.sharedFileSystemStorage.votingDiskLocations=
oracle.install.crs.config.sharedFileSystemStorage.votingDiskRedundancy=NORMAL
oracle.install.crs.config.sharedFileSystemStorage.ocrLocations=
oracle.install.crs.config.sharedFileSystemStorage.ocrRedundancy=NORMAL
oracle.install.crs.config.useIPMI=false
oracle.install.crs.config.ipmi.bmcUsername=
oracle.install.crs.config.ipmi.bmcPassword=
oracle.install.asm.SYSASMPassword=
oracle.install.asm.diskGroup.name=DATA
oracle.install.asm.diskGroup.redundancy=EXTERNAL
oracle.install.asm.diskGroup.AUSize=1
oracle.install.asm.diskGroup.disks=/dev/vdc1
oracle.install.asm.diskGroup.diskDiscoveryString=/dev/vd*1
oracle.install.asm.monitorPassword=
oracle.install.crs.config.ignoreDownNodes=false
oracle.installer.autoupdates.option=SKIP_UPDATES
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=
PROXY_HOST=
PROXY_PORT=0
PROXY_USER=
PROXY_PWD=
PROXY_REALM=

For the installation to succeed you need to supply passwords in the response files. Since that is a security problem you can provide the passwords on the command line as well. If you do not choose to provide the passwords on the command line please make sure the response file uses proper operating system security to prevent unauthorized users from gaining access. Better still, change the passwords used during installation as soon as you can during the post-installation steps. This step is so straightforward that it has not been included in the chapter. Do not forget to apply it though!

With a response file in this format you are ready to begin the installation. To start it, use the -silent and -responseFile command line arguments to runInstaller as shown here where passwords are supplied on the command line rather than in the response file. Notice that variables that would normally be supplied in the response file are enclosed in double quotes:

$ ./runInstaller –silent –responseFile /home/grid/grid.rsp 
> "oracle.install.asm.SYSASMPassword=randomSysThrowawayPassword"
> "oracle.install.asm.monitorPassword=randomASMSNMPThrowawayPassword"
Starting Oracle Universal Installer...
 
Checking Temp space: must be greater than 120 MB.   Actual 4691 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 8947 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-09-06_07-15-58PM.
Please wait ...

You can find the log of this install session at:
 /u01/app/oraInventory/logs/installActions2013-09-06_07-15-58PM.log
The installation of Oracle Grid Infrastructure 12c was successful.
Please check '/u01/app/oraInventory/logs/silentInstall2013-09-06_07-15-58PM.log' for more details.
 
As a root user, execute the following script(s):
       1. /u01/app/grid/product/12.1.0.1/grid/root.sh
 
Successfully Setup Software.
As install user, execute the following script to complete the configuration.
       1. /u01/app/grid/product/12.1.0.1/grid/cfgtoollogs/configToolAllCommandsshift-enter.jpg
           RESPONSE_FILE=<response_file>
 
        Note:
       1. This script must be run on the same host from where installer was run.
       2. This script needs a small password properties file for configuration
           assistants that require passwords (refer to install guide documentation).

With the setup of the software complete, you should execute the root.sh script as demonstrated in the interactive installation session. The only difference between the two install types is that the root.sh script won’t print any output on script, but rather in a log file. The part of the installation requiring some more attention is a script called “configToolAllCommands”. It contains commands for all the post-installation configuration assistants to be run. More specifically, it will perform these tasks:

  • Update the central inventory.
  • Call the network configuration assistant to create a default network configuration.
  • Invoke the ASM configuration assistant to start the ASM instance and create the defined disk group.

As the command output from the runInstaller command states, you will need a response file to complete the configToolAllCommands step. Create the response file as shown here, and substitute the values for the passwords (which need to match with the ones specified above):

[grid@server1 ∼]$ ls -l cfgrsp.properties
-rw-------. 1 grid oinstall 87 Mar  8 23:08 cfgrsp.properties
[grid@server1 ∼]$ cat cfgrsp.properties
oracle.assistants.asm|S_ASMPASSWORD=randomSysThrowawayPassword
oracle.assistants.asm|S_ASMMONITORPASSWORD=randomASMSNMPThrowawayPassword

Now run the configuration assistant as the installation owner-grid in this case:

[grid@server1 ∼]$ cd /u01/app/grid/product/12.1.0.1/grid/cfgtoollogs/
[grid@server1 cfgtoollogs]$ ./configToolAllCommands RESPONSE_FILE=∼/cfgrsp.properties

Once completed, the operation will have produced a log file which indicates success or failure of each component. Should one of the components have failed you can check for logs in the $GRID_HOME/cfgttoollogs/cfgfw/ directory. Testing showed that the configToolAllCommand execution occasionally can fail if the Oracle environment variables for the Oracle Restart home were not set. If you get strange error messages in the log file review the environment variables and run the script again. When finished you might want to remove the response files now as they might contain sensitive information.

Automatic installation of Oracle Restart using RPM

Most platforms have their proprietary way of deploying software packages, and keeping track of them. Red Hat Linux is based on the Red Hat Package Manager or RPM.  Although there are alternatives to RPM, non-RPM Linux distributions such as Debian were never officially supported by Oracle for non-free versions of the database. Attempts to run Oracle on Debian for example have been made, but any success is negated by the lack of support.

Unfortunately Oracle binaries don’t lend themselves to installation using RPM. The whole RPM process is more geared toward compiling and installing software from source. Since you can’t download and compile Oracle source code a slightly different approach was needed to make Oracle installable with RPM. To do so a post-installation routine is executed calling OUI in silent mode with a response file to perform the installation. The downside to this approach is quickly identified: the RPM containing the Oracle Restart installation code hardly contains a file. System administrators used to verifying the contents of a packages using the --verify option to an RPM query will notice that the files inside the Oracle home are not registered in the RPM database. The examples in this chapter will not include a de-installation section for the RPM, as a hint the reader should consider invoking the $ORACLE_HOME/deinstall/deinstall tool to remove the software cleanly.

image Note  There are other methods available to create an Oracle home, such as cloning. In the example shown in this chapter it is assumed that the DBA has control over the application of Patch Set Updates. Cloning the Oracle home seems elegant as well, but the overhead involved in creating a new (tested and validated!) golden image after each release of a PSU is enormous.

The following sections provide a short explanation of how to create the RPM for Grid Infrastructure installation. More details about the RPM building process can be found on the Fedora project’s website. Fedora is the “community” distribution made by Red Hat. Red Hat Enterprise Linux is based on an earlier Fedora release.

Preparing the RPM build environment

A few additional packages need to be installed on the host on which you are preparing to install the RPM. On Oracle Linux these are:

  • rpmlint
  • rpmdevtools
  • Plus all their dependencies

It is not recommended to build RPMs as root. Often, the “rpmbuild” account is used, and that is the account used in the following example.

If user rpmbuild does not exist, create it:

[root@server1 ∼]# useradd -m -g users -G users rpmbuild
[root@server1 ∼]# passwd rpmbuild
Changing password for user rpmbuild.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

Now log on as user rpmbuild to complete the process. When building RPMs, a certain directory structure is assumed, such as a top directory ($HOME/rpmbuild) and certain subdirectories:

  • BUILD
  • BUILDROOT
  • RPMS
  • SOURCES
  • SPECS
  • SRPMS

The easiest way to create the required directories is to call the rpmdev-setuptree command in the user’s home directory. Thankfully this is all you need to do, as it will also create a small configuration file in ∼/ .rpmmacros pointing to the newly created directory tree.

The RPM build process is controlled via a specification or “SPEC” file. Documentation of SPEC files isn’t too great, especially since the format has changed over time. The SPEC file describes the steps you would normally follow when compiling a piece of software from a source. The great benefit of the SPEC file is that it puts more structure around the process. Once you understand the SPEC file syntax the process is really powerful, but the initial learning curve is steep. The SPEC file for the Oracle Restart installation has the following content, and resides in the SPEC directory as grid.spec:

[rpmbuild@server1 SPECS]$ cat grid.spec
Name:           GridInfrastructure
Version:        12.1.0.1
Release:        1%{?dist}
Summary:        installation of Grid Infrastructure for Enterprise Linux 6.x
Group:          Applications/Databases
License:        Commercial
URL:            http://engineering.example.com/builds/
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 
Requires:       oracle-rdbms-server-12cR1-preinstall
 
%description
This RPM checks for the required RPMs on Oracle Linux 6.x and adds them
as dependencies when needed.
 
Additionally, the RPM deploys the /etc/oraInst.loc file as per the standard
document, with /u01/app/oraInventory as the central inventory.
 
This RPM is not suitable for a RAC installation, it can only install Oracle
Restart. It will install the software as the grid user.
 
After deploying the files the Oracle Universal Installer is invoked with the
silent response file from /opt/oracle/grid.rsp, and required configuration
assistants are executed. Be patient!
 
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/etc
mkdir -p $RPM_BUILD_ROOT/opt/oracle
cp oraInst.loc $RPM_BUILD_ROOT/etc/
cp grid.rsp $RPM_BUILD_ROOT/opt/oracle
cp cfgrsp.properties $RPM_BUILD_ROOT/opt/oracle
 
%post
GRID_OWNER=grid
GRID_HOME=/u01/app/grid/product/12.1.0.1/grid
 
# mount the software
umount /mnt
mount -t nfs stagingServer:/export/oracle/x64/ /mnt
 
if [ $? -ne 0 ]; then
  echo "FATAL error trying to mount the binares from the staging server"
  exit 1
fi
 
# Here we invoke the installer. Testing for FATAL errors in the installer
# output. If there is, we abort and say so
 
su - $GRID_OWNER -c
"/mnt/12.1.0.1/grid/runInstaller -silent -responseFile /opt/oracle/grid.rsp"
2>&1 | grep FATAL
if [ $? -eq 0 ]; then
  echo "FATAL error occured-installation NOT completed"
  touch /tmp/gridInstall.failed
  exit 2
fi
 
#wait 30x30 seconds for OUI to complete. Increase if needed!
cnt=0
while ! test -e $GRID_HOME/root.sh
do
  echo "waiting for the software installation to complete"
  sleep 30
  cnt=$(( $cnt + 1 ))
  if [ $cnt -eq 30 ]; then break ; fi
done
 
# execute the root.sh script and dependent scripts.
$GRID_HOME/root.sh
 
su - $GRID_OWNER -c  
"$GRID_HOME/cfgtoollogs/configToolAllCommands RESPONSE_FILE=/opt/oracle/cfgrsp.properties"
 
rm /opt/oracle/cfgrsp.properties
rm /opt/oracle/grid.rsp
 
%clean
rm -rf $RPM_BUILD_ROOT
 
%files
%defattr(0660, grid, oinstall)
/etc/oraInst.loc
/opt/oracle/grid.rsp
%attr(0600, grid, oinstall) /opt/oracle/cfgrsp.properties
%config /etc/oraInst.loc
 
%changelog
* Fri Sep 5 2013 Engineering <[email protected]>
- initial version
- requires more error checking

The SPEC file references three files, which need to be present in the BUILD directory. The grid.rsp file is the same just used for the silent installation and can be used without modification. The oraInst.loc file will be deployed to /etc and contains the pointer to the central inventory. It contains the following familiar lines:

[rpmbuild@server1 BUILD]$ cat oraInst.loc
inventory_loc=/u01/app/oraInventory
inst_group=oinstall

Finally the cfgrsp.properties file contains the ASM and ASMSNMP passwords, and again is identical to the one used for the silent installation.

Building the RPM

With all preparations in place it is time to build the RPM. Change directory to “SPEC” and execute the rpmbuild executable as shown here:

[rpmbuild@server1 SPECS]$ rpmbuild -ba --rebuild grid.spec
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.gz353e
+ umask 022
+ cd /home/rpmbuild/rpmbuild/BUILD
+ rm -rf /home/rpmbuild/rpmbuild/BUILDROOT/GridInfrastructure-12.1.0.1-0.el6.x86_64
+ mkdir -p /home/rpmbuild/rpmbuild/BUILDROOT/GridInfrastructure-12.1.0.1-0.el6.x86_64/etc
+ mkdir -p /home/rpmbuild/rpmbuild/BUILDROOT/GridInfrastructure-12.1.0.1-0.el6.x86_64/opt/oracle
+ cp oraInst.loc /home/rpmbuild/rpmbuild/BUILDROOT/GridInfrastructure-12.1.0.1-0.el6.x86_64/etc/
+ cp grid.rsp /home/rpmbuild/rpmbuild/BUILDROOT/GridInfrastructure-12.1.0.1-0.el6.x86_64/opt/oracle
+ cp cfgrsp.properties /home/rpmbuild/rpmbuild/BUILDROOT/GridInfrastructure-12.1.0.1-0.el6.x86_64/opt/oracle
+ /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip
+ /usr/lib/rpm/brp-strip-static-archive
+ /usr/lib/rpm/brp-strip-comment-note
Processing files: GridInfrastructure-12.1.0.1-0.el6.x86_64
warning: File listed twice: /etc/oraInst.loc
Provides: config(GridInfrastructure) = 12.1.0.1-0.el6
Requires(interp): /bin/sh
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix)
<= 4.0-1
Requires(post): /bin/sh
Conflicts: Database
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/rpmbuild/rpmbuild/BUILDROOT/GridInfrastructure-12.1.0.1-0.el6.x86_64
Wrote: /home/rpmbuild/rpmbuild/SRPMS/GridInfrastructure-12.1.0.1-0.el6.src.rpm
Wrote: /home/rpmbuild/rpmbuild/RPMS/x86_64/GridInfrastructure-12.1.0.1-0.el6.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.3aTrRY
+ umask 022
+ cd /home/rpmbuild/rpmbuild/BUILD
+ rm -rf /home/rpmbuild/rpmbuild/BUILDROOT/GridInfrastructure-12.1.0.1-0.el6.x86_64
+ exit 0

The exit code of each step was 0, indicating success. Two RPMs have been build: the source RPM as well as the one to be deployed. Check the contents of the RPM/x86-64 directory for the result.

Installing the RPM

With the RPM in place it is time to put the procedure to a test. Transfer GridInfrastructure-12.1.0.1-0.el6.x86_64.rpm to the test yum repository server and install it using YUM as shown in this example:

[root@server1 ∼]# yum install GridInfrastructure-12.1.0.1-0.el6.x86_64.rpm

It will download and install the dependent packages from your repository and install Grid Infrastructure using the silent response file. If anything goes wrong at any phase, warnings are printed on the screen pointing you to the correct log file to check. It is recommended to try the procedure in a (virtual?) test environment first before running live builds.

Installing the Oracle database

After the installation of Oracle Restart has been completed, it is time to focus on the installation of the database binaries. After all, we want to run a database on our server! The installation process will again be divided into the same parts as the Oracle Restart installation.

If you just skipped the Oracle Restart part of the chapter, don’t worry there will be references to a filesystem-only database installation in the next chapter. If you have the time please revisit Chapter 2 and the first half of this chapter for an explanation of why I like ASM and recommend it to you.

If you followed the advice laid out earlier in this chapter to use a central staging server, ensure that the installation binaries are mounted and accessible to the installation. If not, pick a suitable staging area with enough free space and deploy the downloaded zip files.

Interactive installation of the RDBMS binaries

The same principle already applied to the Oracle Restart installation holds true for the RDBMS installation: the interactive installer is the best way to get a feel for what’s new in a release.  Even if you plan to use silent installations only, it is still recommended to step through the assistants once to generate the response file.

The installation of the RDBMS binaries is usually owned by the oracle account. You need to log out of the grid account if you still happen to be connected and start the X11 session as explained previously in this chapter. Begin the installation by starting Oracle Universal Installer similar to the call shown here:

[oracle@server1 ∼]$ /mnt/12.1.0.1/database/runInstaller

This command will initiate the bootstrap process and start the graphical user interface.

Security updates

Figure 6-16 shows the security updates screen, which is very similar to the wizard shown with Oracle Restart. The database installer prompts you to enter your My Oracle Support credentials. For some time now you are prompted to provide your email address for Oracle to receive security updates and other information from Oracle. Do this at your own discretion. If you decline the option by unchecking the “I wish to receive security updates via My Oracle Support” you will be prompted once more to confirm you really want to stay uniformed of advisories. You can normally safely ignore the warning. Your enterprise monitoring solution should prompt you for security updates anyway (OEM 12 does this for example).

9781430244288_Fig06-16.jpg

Figure 6-16. Configuration of security updates

Proceed to the next screen by clicking the “Next” button.

Downloading updates

As with the Grid Infrastructure installation you are offered the option to download and install updates as part of the installation process. See Figure 6-17.

9781430244288_Fig06-17.jpg

Figure 6-17. Optionally download and  apply updates

The options are exactly the same as shown earlier in this chapter for Grid Infrastructure. Please refer to section “Download Software Updates” for a more detailed explanation.

Selecting Installation Options

When installing the Oracle database binaries you are offered three options shown in Figure 6-18. The first is to install the binaries and then install a database. The second option, which I recommend, is to install the database software only. The final option is to upgrade an existing database as part of the installation process. It is strongly recommended not to perform that step at this stage! Take your time to plan the installation and upgrade in your own time. Please refer to Chapter 12 which is all about upgrading to Oracle 12c.

9781430244288_Fig06-18.jpg

Figure 6-18. Chosing the various installation options

A safe way to proceed with the installation is to limit yourself to the installation of the binaries only. This makes patching significantly easier without an existing database. This is especially true in a Grid Infrastructure/RDBMS combination as proposed here. Recommended patches are most often bundled together as Patch Set Updates. These are very easy to install using the automatic detection of Oracle homes and the “opatch auto” feature. If you decided to create a database as part of the installation process you will see a few additional screens presenting a cut-down version of the database configuration assistant (dbca). It is slightly less flexible than invoking dbca directly, which is why I suggest you run it separately after the installation.

To follow the print screens, check the “Install database software only” radio button and click on “Next”.

Picking a Grid Installation Option

The screen shown in Figure 6-19 allows you to configure whether you want a single instance database installation, a Real Application Cluster, or alternatively a RAC One Node database installation. All but the single instance database installation option are not applicable unless you have a Grid Infrastructure configuration for RAC.

9781430244288_Fig06-19.jpg

Figure 6-19. Listing the Grid Installation Options

Leave the “Single instance database installation” radio button selected and proceed to the next screen by clicking on “Next”.

Installing Product Languages

The Oracle database comes with lots of supported languages out of the box, as shown in Figure 6-20. These should make it easy for anyone to get localized messages on the screen. You can select a language from the left-hand side, highlight it by clicking on it, and then use the single arrow to add it to the list of selected languages.

9781430244288_Fig06-20.jpg

Figure 6-20. Picking product languages

It is strongly recommended not to remove English! Once you are happy with your selection, click on “Next” to continue the installation process.

Choosing a Database Edition

The Oracle database can be licensed in many forms. On the screen in Figure 6-21 you have the option to install the Enterprise Edition, Standard Edition, and Standard Edition One. The choice depends directly on your license agreement with Oracle. Don’t be tempted to install Enterprise Edition if there is no license for it. Not only is that a breach of your contract with Oracle (which is bound to be noticed), but there is also a lot of work involved in downgrading from Enterprise Edition to Standard Edition.

9781430244288_Fig06-21.jpg

Figure 6-21. Selecting from the list of available database editions

In this example Enterprise Edition has been selected.

Defining the Installation Location

Figure 6-22 is the next screen in the installation wizard, and prompts you for the installation locations. You need to pick a suitable location for the Oracle base as well as the software binaries. There is no real restriction to directories, except that the software location should be in the path of the ORACLE_BASE. The Oracle base directory contains many important files, among them the admin directory. It contains the audit trail files per database. By default the Automatic Diagnostic Repository (ADR) is also located underneath the $ORACLE_BASE variable.

9781430244288_Fig06-22.jpg

Figure 6-22. Setting Oracle base and software location

If you followed the instructions in Chapter 5 about the OFA, then Oracle’s installer should have picked up the directories on its own. You should consider changing the software location path to include the patch set number just as with Oracle Restart. At the time of writing only the base release was available. As a result your path should refer to 12.1.0.1 instead of just 12.1.0. Using the patch set number makes it easier to differentiate Oracle homes.

Obviously, you should adhere to your corporate standards if they contradict the OFA. You will notice that the ORACLE_BASE is different from the Grid Infrastructure installation because there was a separate account used to install Oracle Restart. Had you used “oracle” to install Grid Infrastructure and the database, then the ORACLE_BASE would have been /u01/app/oracle for both. By convention, the Oracle base variable is defined as /u01/app/user. Review the settings one last time and click on the “Next” button to continue.

image Note  If you did not install Oracle Restart/Grid Infrastructure you will then be prompted to define the central inventory location. You should set this to the $ORACLE_BASE parent directory which is /u01/app/oraInventory by default. Do not place the inventory inside the $ORACLE_BASE!

Mapping Privileged Operating System Groups

The screen shown in Figure 6-23 is one of the few really new screens when comparing Oracle 12c to 11g Release 2. Previous releases only used the OSDBA and OSOPER groups, whereas Oracle 12c adds some new ones to worry about. These groups allow an even finer separation of duties. Refer back to Chapter 5 for a complete discussion of their roles and purposes.

9781430244288_Fig06-23.jpg

Figure 6-23. Mapping oracle’s groups to privileged groups

It is of course still possible to use the “dba” operating system group exclusively for all the different groups available in Oracle, but doing so negates the advantages offered by the new system. I recommend the creation of the backupdba, dgdba, and kmdba groups on the operating system, and the Oracle user should have these assigned as its secondary groups. At the risk of repeating myself: you should create the operating system groups and map the Oracle user to them even if you are not planning to use them straight away. Configuring the database software in the new way gives you the flexibility of gradually adding functionality without having to reinstall the binaries. In the screen above the Oracle user had all of the default groups assigned, and the installer picked those up.

Review your settings and click on “Next” to proceed.

Checking the Prerequisites

Oracle will check for the required settings before starting the installation. This step is not new and has been performed in previous releases. If all prerequisites are met, the installer will bypass the screen shown in Figure 6-24 and move to the summary page. If the installer detects any problems, it will report them.

9781430244288_Fig06-24.jpg

Figure 6-24. Output from the prerequisite checks

The process of fixing problems is identical to the Grid Infrastructure installation. Highlight the entry and click on the link labelled “more details” to find out what Oracle expects. If the problem reported is “Fixable”, you can make use of the fixup scripts to save yourself some time. Alternatively, correct the problem yourself on the command line, return to the OUI session and click on “Check Again” to instruct the software to reconsider.

Once you are confident that all requirements have been met, click on “Next” to proceed. If the “Next” button is greyed-out you need to check the “Ignore All” checkbox in the top-right corner of the screen after careful consideration of the impact. Be warned that ignoring requirements can lead to installation failures!

Reviewing the Installation Summary

The summary screen in Figure 6-25 presents all your choices made previously on one screen. It also allows you to save the response file, which is recommended. Carefully review all the information presented and check against your corporate standard.

9781430244288_Fig06-25.jpg

Figure 6-25. Reviewing the installation summary

Initiate the software installation by clicking on “Install”, or use the “Back” button to go back in the wizard to make any changes to the parameters you provided.

Waiting for the Installation to Complete

Congratulations, you may go and get a cup of coffee while the installation proceeds. Depending on the speed of your NFS mount, DVD drive and hard disks you may have to wait a few minutes for the software to be transferred to the server, linked and ready for use. Figure 6-26 shows the installation status screen that will keep you apprised of progress.

9781430244288_Fig06-26.jpg

Figure 6-26. Watching the progress bar

When the installer has almost finished its work, it presents the familiar pop-up window shown in Figure 6-27 to run the root.sh script. This will take considerably less time to execute compared with the one executed during the Grid Infrastructure installation.

9781430244288_Fig06-27.jpg

Figure 6-27. The installer prompts for the execution of the root.sh script

The output of the root script is shown here for your reference:

[root@server1 ∼]# /u01/app/oracle/product/12.1.0.1/dbhome_1/root.sh
Performing root user operation for Oracle 12c
 
The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/12.1.0.1/dbhome_1
 
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
 
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
[root@server1 ∼]#

This completes the interactive installation of the Oracle database 12c.

Silent Installation of the Database Software

Similar to the Grid Infrastructure installation, a silent installation does not require X11 to be present on the server, making the lights-out installation of the software a lot easier. The following is an example of a response file to install the database. Remember response files are always recorded as part of the installation wizard, and can be saved on the summary screen.

[oracle@server1 ∼]$ sed -e '/^#/d' -e '/^$/d' -e '/=$/d' db.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.1.0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=server1.example.com
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=/u01/app/oracle/product/12.1.0.1/dbhome_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba
oracle.install.db.BACKUPDBA_GROUP=backupdba
oracle.install.db.DGDBA_GROUP=dgdba
oracle.install.db.KMDBA_GROUP=kmdba
oracle.install.db.isRACOneInstall=false
oracle.install.db.rac.serverpoolCardinality=0
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.ConfigureAsContainerDB=false
oracle.install.db.config.starterdb.memoryOption=false
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.managementOption=DEFAULT
oracle.install.db.config.starterdb.omsPort=0
oracle.install.db.config.starterdb.enableRecovery=false
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
oracle.installer.autoupdates.option=SKIP_UPDATES
[oracle@server1 ∼]$

It has been generated from the same installation session as shown above in the interactive wizard. As you can see it’s fairly lengthy; the examples in db_install.rsp are even longer! The above file has all empty configuration directives and comments removed. Although you find configuration options pertaining to the starter database these are ignored since the installation type is “INSTALL_DB_SWONLY”.

With the response file double-checked, you can begin the installation as shown here:

[oracle@server1 ∼]$ /mnt/12.1.0.1/database/runInstaller -silent 
> -responseFile /home/oracle/db.rsp
Starting Oracle Universal Installer...
 
Checking Temp space: must be greater than 500 MB.   Actual 4699 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 8956 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-09-09_12-37-02PM. Please wait ...
[oracle@server1 ∼]$
You can find the log of this install session at:
 /u01/app/oraInventory/logs/installActions2013-09-09_12-37-02PM.log
The installation of Oracle Database 12c was successful.
Please check '/u01/app/oraInventory/logs/silentInstall2013-09-09_12-37-02PM.log' for more details.
 
As a root user, execute the following script(s):
       1. /u01/app/oracle/product/12.1.0.1/dbhome_1/root.sh
 
 
Successfully Setup Software.

In case of a database-only installation you would be prompted for the execution of the orainstRoot.sh script in addition to the root.sh script. The root script is “silent”, as it creates a log file only:

[root@server1 ∼]# /u01/app/oracle/product/12.1.0.1/dbhome_1/root.sh
Check /u01/app/oracle/product/12.1.0.1/dbhome_1/install/root_server1.example.com_2013-09-shift-enter.jpg
09_12-44-10.log for the output of root script

The database installation is complete with the execution of the root script.

Automatic Installation of the Database Software RPM

Creating an RPM for the database is easier than for Grid Infrastructure. The concept will remain the same though: the installer is given the response file to perform a silent installation, and a loop will poll for the completion of the software transfer. Then it is just a matter of executing the root.sh script at the end. If you haven’t created the environment to build the RPM yet, refer back to the “Automatic Installation of Oracle Restart” section above. The SPEC file is shown here, it expects the db.rsp and oraInst.loc files to be present in the BUILD directory.

Name:           Database
Version:        12.1.0.1
Release:        0%{?dist}
Summary:        installation of the Oracle Database for Enterprise Linux 6.x
Group:          Applications/Databases
License:        Commercial
URL:            http://engineering.example.com/builds/
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 
Requires:       oracle-rdbms-server-12cR1-preinstall
 
%description
This RPM checks for the required RPMs for the Oracle database
on Oracle Linux 6.x and adds them as dependencies if necessary.
 
If necessary, an /etc/oraInst.loc file will be deployed, that is unless a
previous Oracle installation has done so already. The central inventory is
defined as /u01/app/oraInventory as per the standard document
 
This RPM is not suitable for a RAC installation. An Enterprise Edition database
home will be created.
 
After deploying the files the Oracle Universal Installer is going to be
invoked with the silent response file from /opt/oracle/db.rsp, and needed
configuration files are executed.
 
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/etc
mkdir -p $RPM_BUILD_ROOT/opt/oracle
 
cp oraInst.loc $RPM_BUILD_ROOT/etc/
cp db.rsp $RPM_BUILD_ROOT/opt/oracle
 
%post
ORACLE_HOME=/u01/app/oracle/product/12.1.0.1/dbhome_1
ORACLE_OWNER=oracle
 
# make the software available
umount /mnt
mount -t nfs stagingServer:/m/oracle/linux/x64/ /mnt
if [ $? -ne 0 ]; then
  echo "FATAL error trying to mount the binares from the staging server"
  exit 1
fi
 
if [ ! -f /mnt/12.1.0.1/database/runInstaller ]; then
  echo "FATAL: cannot find OUI in the install location"
  exit 2
fi
 
# here we invoke the installer. Testing for FATAL output and won't
# proceed if there is.
su - $ORACLE_OWNER -c
"/mnt/12.1.0.1/database/runInstaller -silent -responseFile /opt/oracle/db.rsp"
2>&1 | grep FATAL
if [ $? -eq 0 ]; then
  echo "FATAL error occured-installation NOT completed"
  exit 3
fi
 
cnt=0
while ! test -e $ORACLE_HOME/root.sh
do
  echo "waiting for the software installation to complete"
  sleep 30
  cnt=$(( $cnt + 1 ))
  if [ $cnt -eq 30 ]; then
   echo "FATAL: timout waiting for the creation of root.sh "
   exit 4
  fi
done
 
# run the root script.
$ORACLE_HOME/root.sh
 
%files
%defattr(-,oracle,oinstall)
%config /etc/oraInst.loc
%attr(0660, oracle, oinstall) /etc/oraInst.loc
%attr(0660, oracle, oinstall) /opt/oracle/db.rsp
 
%changelog
* Mon Sep 9 2013 Engineering <[email protected]>
- initial version
- needs more error checking and handling

The response file in use is the same as previously described in the silent install section above, and the oraInst.loc file likewise is the same as previously used in the Grid Infrastructure part of the chapter. The RPM can then be built using the rpmbuild command as shown in the below output:

[rpmbuild@server1 SPECS]$ rpmbuild -ba --rebuild db.spec
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.xMaFZt
+ umask 022
+ cd /home/rpmbuild/rpmbuild/BUILD
+ rm -rf /home/rpmbuild/rpmbuild/BUILDROOT/Database-12.1.0.1-0.el6.x86_64
+ mkdir -p /home/rpmbuild/rpmbuild/BUILDROOT/Database-12.1.0.1-0.el6.x86_64/etc
+ mkdir -p /home/rpmbuild/rpmbuild/BUILDROOT/Database-12.1.0.1-0.el6.x86_64/opt/oracle
+ cp oraInst.loc /home/rpmbuild/rpmbuild/BUILDROOT/Database-12.1.0.1-0.el6.x86_64/etc/
+ cp db.rsp /home/rpmbuild/rpmbuild/BUILDROOT/Database-12.1.0.1-0.el6.x86_64/opt/oracle
+ /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip
+ /usr/lib/rpm/brp-strip-static-archive
+ /usr/lib/rpm/brp-strip-comment-note
Processing files: Database-12.1.0.1-0.el6.x86_64
warning: File listed twice: /etc/oraInst.loc
Provides: config(Database) = 12.1.0.1-0.el6
Requires(interp): /bin/sh
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires(post): /bin/sh
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/rpmbuild/rpmbuild/BUILDROOT/Database-12.1.0.1-0.el6.x86_64
Wrote: /home/rpmbuild/rpmbuild/SRPMS/Database-12.1.0.1-0.el6.src.rpm
Wrote: /home/rpmbuild/rpmbuild/RPMS/x86_64/Database-12.1.0.1-0.el6.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.gkp4kz
+ umask 022
+ cd /home/rpmbuild/rpmbuild/BUILD
+ rm -rf /home/rpmbuild/rpmbuild/BUILDROOT/Database-12.1.0.1-0.el6.x86_64
+ exit 0

Once the RPM is built, it is simple to install using the YUM command, referencing the location of the RPM:

# yum install Database-12.1.0.1-0.el6.x86_64.rpm

After a little while the database software should be installed and ready to assume an operational role.

Summary

In this chapter you learned how to install Oracle Grid Infrastructure and the Oracle database. There are many good reasons for installing Oracle Restart, including the benefit ASM gives over file systems such as ext3. The maintenance overhead you might hear as a counterargument is not as high as in the 10g days. Regardless of the existence of Oracle Restart you will use the same patch command since Oracle Restart and the database are patched together. So instead of having to patch three Oracle homes, the opatch auto option will detect Oracle homes and automatically apply the right patch to the home, as well as any custom scripts that made the application of recommended patches prior to 11.2 so labor intensive a true joy.

The Grid Infrastructure layer provides a common user interface to the database in addition to the Automatic Storage Management instance. The immediate benefit in addition to ASM is the auto-start facility offered by Oracle Restart.

In terms of the installation an interactive, silent, and RPM-based installation has been shown. The examples have been tested on Oracle Linux 6.4 and were correct at the time of writing. Hopefully the code snippets stir your creativity in automating the installation of the database. A consistent, standard compliant setup will be the end result, making future maintenance a lot easier. You might of course say that a clone of an Oracle software home is a better alternative, and there is merit in that argument. Cloning the Oracle home however requires engineering to create a new “golden” image-base release plus PSU or one-off patch even to be created. For each supported release, and each platform. The software must of course be validated and tested, problems in the software release can have far-reaching consequences. If your engineering department can produce such builds: great! But many may struggle to find sufficient time to do so.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset