Tuesday, September 24, 2013

Installing Oracle Database Part 02

Dear Readers,

My name is Franz Devantier, creator of this blog.  I am an Oracle Certified Professional (OCP DBA 11g) Security DBA.  I will be sharing with you the basic duties of an Oracle DBA, and also some of the undocumented, and not so well known tasks. 

Installing Oracle Database Part 02
Accessing the Installation Software
The Oracle Database software is available on installation media.  You can request the installation media from Oracle.  I found that it is so much easier to download it from the Oracle Technology Network Web site.  Also you can try downloading from the Oracle Software Delivery Cloud portal.  If you are going to install the Oracle software from a hard disk, then you need to download it and unpack it, or if you do have the installation media, then to copy it from there.

Downloading Oracle Software
You can download the trial version of the oracle installation files from the Oracle Technology Network (OTN) or the Oracle Software Delivery Cloud portal.  Once downloaded you can extract them to your hard disk.  Make sure that you review and understand the terms of the license.  Most downloads include the development license.

Downloading the Installation Archive Files from OTN
=> You can use any browser to access the software download page from OTN:

=> Navigate to the download page for the product that you want to install.

=> On the download page, the required disk space is mentioned.  Make a note of the total space required.  If necessary you can add the individual files up to get the total size.

=> Select a file system with enough free space to store and expand the archive files.  You would probably need at least twice the amount of space of the archive files.

=>  on the file system identified, create a parent directory for each product that you are going to download.

=> Make sure that you have successfully downloaded all of the archive files to the directory that you have created for the software.

=> Compare the file size on your file system to the file size on the Oracle Technology Network to aid you to verify that they were downloaded successfully.

=> In the parent directory that you created, extract the files.  

Downloading the Software from Oracle Software Delivery Cloud
You can download the software from Oracle Software Delivery Cloud as Media Packs.  A Media Pack is in the same format as the software would be were you to receive it on CD-ROM or DVD.
=> Use any browser to access the Oracle Software Delivery Cloud portal;

=> You will need to complete the Export Validation process by entering information such as your name, company, email address and country, in the online form.  If you have an Oracle Single Sign on, then you can just sign on, and you are done.

=> When you get to the Media Pack Search page, you must specify the Product Pack and the Platform, to identify the Media Pack that you want to download.  You can also search for the Media Pack using the license list.

=> In the search results page, first click the “Readme”, and download and review the readme file for the product information and download instructions.

=> Choose the appropriate Media Pack from the search results, and download the zip files.  Once you have downloaded and extracted the zip files, you can proceed to the installation of the software.  You may find it useful to also keep a copy of the page where your media pack was on, because it contains a list of part numbers, and the descriptions.  You may need to refer to this during the installation process.

Extracting the Installation Files
=> Make sure that you are in the directory that contains the downloaded installation archive files.

=> If the downloaded file has the zip extension then.
# unzip filename.zip

If the downloaded file has the cpio.gz extension then.
# gunzip filename.cpio.gz
The above command will create files with that look something like this;
Filename.cpio

Now you need to extract these files further;
# cpio –idcmv < filename.cpio>

For each file, this command creates a subdirectory named Diskn, where n is the disk number identified in the file name.

Look for the instructions on the download page for the correct options to use with the cpio command.  Make a note of these cpio options, to be used when you have downloaded the files.

Copying the Software to the Hard Disk
Before you start the installation, you may like to copy the software to the hard disk, in order to enable the installation process to run faster.  Of course you must first mount the disk, before you can copy the software across.

On most Linux systems the disk should mount automatically after you insert it into the disk drive.  However if the disk does not mount automatically then you can try this process:
=> log in as the root user.  On Asianux, Oracle Linux, and Red Hat Enterprise Linux.
# eject /mnt/dvd
Or
# sudo eject /mnt/dvd
On SUSE Linux Enterprise Server.
# eject /media/dvd

=> Insert the media into the disk drive.

=> Verify that the disk is mounted automatically.
On Asianux, Oracle Linux, and Red Hat Enterprise Linux:
# ls /mnt/dvd
On SUSE Linux Enterprise Server:
# ls /media/dvd

=> On red Hat first verify that /mnt/dvd exists or otherwise create it.
On Asianux, Oracle Linux, and Red Hat Enterprise Linux:
# mount –t iso9660 /dev/dvd  /mnt/dvd
On SUSE Linux Enterprise server:
# mount –t iso9660 /mnt/dvd  /media/dvd
In the above examples /mnt/dvd and /media/dvd are the mount point directories that is to be used by the installation media.

=> Oracle Universal Installer (OUI) may display the Disk Location dialog box or screen.  If so you can enter the disk mount point as /mnt/dvd or /media/dvd.

Now you are ready to copy the installation software from the mounted disk to the hard disk or file system.  Sometimes you will find that the server does not have a disk drive for use.  In this case, you can copy the installation media to another server, and then mount that specific file system where you put the installation media, using NFS.  Alternatively you can FTP or SCP the files across to the server that you are working on.

Copying the contents of the installation media to a hard disk:
=> Firstly you will need to create a directory on the hard disk on a file system that has sufficient space.  Also this directory should be outside of the Oracle Base Directory, where you are going to put the Oracle Installation Software.
# mkdir OraDb11g

=> Now you will continue by changing to the directory that you just created.
# cd OraDb11g

=> If the disk which holds the installation software is not already mounted, then you must mount the disk.  See the above notes on mounting the disk drive.

=>Now you are ready to start copying the installation software.
# cp –R /<mount point directory> OraDb11g
If there is more than one installation disk, then you eject that disk once the copy is complete, make sure the next disk is mounted, and just do the copy again, until you have copied all the disks to the hard drive.

Franz Devantier.


Wednesday, September 18, 2013

Installing Oracle Database Part 01

Dear Readers,

My name is Franz Devantier, creator of this blog.  I am an Oracle Certified Professional (OCP DBA 11g) Security DBA.  I will be sharing with you the basic duties of an Oracle DBA, and also some of the undocumented, and not so well known tasks. 

Installing Oracle Database Part 01
You can obtain the Oracle Database software on installation media.  It is probably easier to download it from the Oracle Technology Network Website.  You can also download from the Oracle Software Delivery Cloud portal.  Once you have the media, then you can install the software.  Typically you would use the Graphical User Interface (GUI) that is part of Oracle Universal Installer (OUI), to install the software.  You may have to configure your X-Windows before using the GUI.  You can also use OUI to install using silent mode installation.

Reviewing Component-Specific Installation Guidelines
We will assume that the pre-installation tasks have been completed.  Now we can review some guidelines before starting OUI.
=> Using OUI from an earlier release of Oracle to install components from a current release is no longer allowed.

=> Oracle Automatic Storage Management (Oracle ASM);
In previous releases Oracle ASM was installed as part of the database installation.  However from 11.2 onwards Oracle ASM is installed as part of the Oracle Grid Infrastructure Installation, either for a cluster, or for a standalone server.

If you want to upgrade an existing Oracle ASM installation, then you upgrade the Oracle ASM by running the Oracle Grid Infrastructure upgrade.

If you do not have Oracle ASM installed, and you want to use Oracle ASM as your storage option, then you should complete an Oracle Grid Infrastructure installation, before you start your Oracle database installation.

=> Installing on a cluster;
If Oracle CLusterware and Oracle RAC are installed on the system, then OUI will display the “Specify Hardware Cluster Installation” screen.  You must select the Local Installation option, unless of course you want to install a RAC configuration.

=> Selecting the Database Character Set
The database character set is used for various purposes.
- Data that is stored in SQL character datatypes, such as CHAR, VARCHAR2, CLOB, LONG.
- Identifiers such as table names, column names and PL/SQL variables.
- Stored PL/SQL and SQL source code, which includes text literals that are embedded in the code.

Changing the character set after a database is created, can take a lot of time and resources.  Also you should consider that if you are converting from a bigger character set to a smaller character set, that you will be losing the definition of characters that are described in the bigger set, but not the smaller set.  Going from a smaller set to a bigger set is generally more successful.

In order to convert the character data, you may need to export the entire database in one character set, and import it in another character set.  You must decide which character set the application is going to use against the database, before you make this decision.

Oracle recommends that you use Unicode AL32UTF8 as your default database character set.  Unicode is a universal character set that will support most of the currently spoken languages of the world, as well as a number of historical alphabets or scripts.

Unicode is also the native encoding of technologies such as Java, XML, XHTML, ECMAScript, and LDAP.  Unicode then displays its usefulness when a database is supporting the internet and global economy, because it can handle all these codes.

AL32UTF8 is a multibyte character set, and so will in most cases be slower in the database than single byte character sets such as WE8MSWIN1252.  Also ASCII characters stored in a multibyte character sets such as AL32UTF8, increases the storage space required.  However the increase in storage space relates only to character based data, and data that is not in English.  However because Unicode for AL32UTF8 is universal and very flexible, it balances well against the additional costs of using Unicode.

However don’t just select AL32UTF8 as your character code.  You should first determine which legacy character codes are being used, and their compatibility to Unicode.  You should consider the storage requirements.  If the performance around text processing is critical, then you should not use a character set that would potentially slow the processing down.  If you determine that the database supports a very limited set of languages, if the character set of most clients connecting to the database is also a legacy character set.  Then that legacy character set may be the best choice.

Also when you run OUI, the suggested or default character set will be based on the language configuration of the Operating System.  So don’t just accept the default, it may not be the ideal character set for your installation.  For many languages including English, the default character set recommended is usually one of the Microsoft Windows character sets, such as WE8MSWIN1252.  This is even recommended on a Linux box.  The reason for this recommendation on Linux is that Oracle makes the assumption that most of the clients connecting to the database, will be Microsoft clients.  The database must be able to store all the characters coming from the clients, otherwise your character data could become corrupted.  Because Microsoft Windows has a richer character repertoire than the ISO 8859 character sets, the Microsoft Windows character sets are usually chosen.

To give an insight into this: EE8MSWIN1250 supports the Euro currency symbol, as well as various small quote characters.  The corresponding character set EE8ISO8859P2 does not support these symbols.

The Oracle Database will convert the data between the database character set and the client character sets.  The client character sets are declared in the NLS_LANG settings.  It would make sense to always have a character set on the database that has a larger set of characters, then the client character sets.  That way you will protect your character data integrity.

OUI presents only the recommended character sets to you during an installation, although the Oracle database supports many more character sets than are displayed to choose from.  Most of the character sets not displayed are either deprecated, or are a binary subset of another character set.  For example WE8DEC is a deprecated character set.  US7ASCII and WE8ISO8859P1 are both binary subsets of WE8MSWIN1252.  

If you have carefully decided on a certain character set for your database, in order to be compatible with other legacy systems for example.  You may find that the character set is not one of the recommended character sets.  You can then select the “Advanced Database Configuration” option.  The Database Configuration Assistant (DBCA) in the interactive mode, will then allow you to select any of the database character sets that are supported on Linux.

Using an Oracle Automatic Storage Management Disk Group
You only need to do this, if you are going to use an ORACLE ASM disk group.  You can store database files as well as recovery files in an existing Oracle ASM disk group, that was created during the Oracle Grid Infrastructure installation.  Remember that the Oracle ASM instance will manage the existing disk groups that are running in the Oracle Grid Infrastructure home direcotory.

Firstly you will need to determine if an existing Oracle ASM disk group exists, and if there is sufficient disk space in the disk group for your purposes.
=> First go and view the contents of the oratab file, because if an Oracle ASM instance is configured on the system, you will see the evidence here.
# more /etc/oratab
You will be looking for a line similar to this:
+ASM:oracle_home_path:N
“+ASM” is the system identifier (SID) of the Oracle ASM instance.
“oracle_home_path” is the Oracle home directory where the Oracle ASM is installed.  By convention the SID for an Oracle ASM instance should be “+ASM”.

=> Open a command shell, and set the ORACLE_SID and ORCLE_HOME environment variables for the Oracle ASM instance.
# export ORACLE_SID=+ASM
# export ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid/
If you are using a C shell, then you should know how the corresponding commands will look.

=> Use SQL*Plus to connect to the Oracle ASM instance as the SYS user with the SYSASM privilege.  If necessary you can start the ASM instance.
# $ORACLE_HOME/bin/sqlplus /nolog
SQL> connect sys as SYSASM
Enter Password: …
SQL> startup

=> You now want to view the existing disk groups, their redundancy level, and the amount of free disk space in each one.
SQL> select name, type, total_mb, free_mb from v$asm_diskgroup;
The relationship between total_mb and free_mb, will tell you what you need to know about the redundancy level.

=> Study the output, and see if you can identify a disk group with the appropriate redundancy level, and with sufficient free space for your purposes.  Allow for growth when you make this decision.   

=> If there is not sufficient disk space available you may decide to install or identify additional disk devices, that would be required to meet your storage requirements.  If you add a device to an existing disk group, Oracle recommends that the additional devices must have the same size, but also the same performance characteristics as the existing devices in the disk group.

Franz Devantier.

Tuesday, September 17, 2013

Oracle Grid Infrastructure – Part 6

Dear Readers,

My name is Franz Devantier, creator of this blog.  I am an Oracle Certified Professional (OCP DBA 11g) Security DBA.  I will be sharing with you the basic duties of an Oracle DBA, and also some of the undocumented, and not so well known tasks. 

Oracle Grid Infrastructure – Part 6
Installing Oracle Grid Infrastructure for an Existing Database
Because Oracle Restart can only manage existing 11.2 resources, you will have to limit yourself to installing Oracle Grid Infrastructure for existing 11.2 databases only.  However releases of the Oracle database prior to 11.2, can exist on the same database server without being managed by Oracle Restart.

=> You will install Oracle Grid Infrastructure for a Standalone server, on the same Host computer as the Oracle database; However the Oracle Grid Infrastructure will be installed in its own separate Oracle Home. 

=> So let’s say you have now installed Oracle Grid Infrastructure.
Go to the Oracle Grid Infrastructure’s home directory /bin.  Use the “svrctl” utility to manually add the database, the listener, the Oracle ASM instance, Oracle ASM disk groups, and any other database services to the Oracle Grid Infrastructure configuration.

Modifying Oracle Grid Infrastructure for a Standalone Server Binaries
To modify the software installed in your Grid home, you must first stop the Oracle Restart stack.  You will need to follow a series of steps in order to stop and restart the “Oracle restart stack”.  You will need to do this before you apply a one-off patch or modify any of the DLL’s used by Oracle Restart or Oracle ASM.  Before relinking executables, you will need to ensure that all the executables that run in the Oracle home directory that you are relinking.  You will also need to shut down applications that are linked with Oracle shared libraries.

To Prepare the Oracle Grid Infrastructure Standalone Server home for modification:
=> log in as the grid owner, and change directory to $GRID_HOME/bin
# cd $GRID_HOME/bin

=> Shut down the Oracle Restart stack;
# crsctl stop has –f

=> Confirm that the Oracle Restart stack is shut down, and then perform the software updates in the Oracle Grid Infrastructure home.

=> Restart the “Oracle Restart stack”.
# crsctl start has

Relink Oracle Grid Infrastructure for a Standalone Server with the following steps;
=> login as root
# cd $GRID_HOME/crs/install
# perl roothas.pl –unlock

=> login as the grid user.
# export ORACLE_HOME=$GRID_HOME
# $GRID_HOME/bin/relink

=> login as the root user again.
# cd $GRID_HOME/rdbms/install
# ./rootadd_rdbms.sh
# cd $GRID_HOME/crs/install
# perl roothas.pl –patch

It is important to relink the Oracle Restart and Oracle ASM binaries, every time you apply an OS patch or after an OS upgrade.


3.Login as root again:
# cd Grid_home/rdbms/install/
# ./rootadd_rdbms.sh
# cd Grid_home/crs/install
# perl roothas.pl -patch
You must relink the Oracle Restart and Oracle ASM binaries every time you apply an operating system patch or after an operating system upgrade.

Manually Configuring Oracle Automatic Storage Management Disk Groups
When you run Oracle Automatic Storage Management Configuration Assistant (ASMCA) utility, it will create a new ASM instance, if there is no ASM instance currently configured on the computer.  After you have installed the Oracle Grid Infrastructure, then you can use ASMCA to create and configure disk groups, as well as Oracle ADVM, and Oracle ACFS.

To create additional disk groups or to manually configure Oracle ASM disks;
# cd $GRID_HOME/bin
# ./asmca

You should have X Windows set up for this to work.

Testing the Oracle Automatic Storage Management Installation
You will use the “asmcmd” command line utility, which will allow you to manage ASM disk groups, files and directories.
=> Open a shell window and set the ORACLE_SID and ORACLE_HOME variables, to point to the Oracle ASM instance.  For example the Oracle ASM SID may be named +ASM
# export ORACLE_SID=+ASM
# export ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid

=> Use the ASMCMD utility to list the disk groups for the Oracle ASM instance;
# $ORACLE_HOME/bin/asmcmd lsdg

“ASMCMD” will connect by default as the SYS user with SYSASM privileges.

If the Oracle ASM instance is not running, then you can start the ASM instance like this:
# $ORACLE_HOME/bin/asmcmd startup

Franz Devantier.

Monday, September 16, 2013

Oracle Grid Infrastructure – Part 5

Dear Readers,

My name is Franz Devantier, creator of this blog.  I am an Oracle Certified Professional (OCP DBA 11g) Security DBA.  I will be sharing with you the basic duties of an Oracle DBA, and also some of the undocumented, and not so well known tasks. 

Oracle Grid Infrastructure – Part 5
Configuring Disk Devices Manually for Oracle ASM
Kernel version 2.6 has a default device file naming scheme call “udev”.  The 2.6 kernel will dynamically create device files names when you restart the server.  Also the devices will be assigned to root ownership.  If udev is allowed to apply the default settings, then it will change device file names and owners for the disks, which will corrupt them, if an Oracle ASM instance is restarted.  Using ASMLIB, means that you alleviate this problem, and you will not have to ensure device path consistency, and permissions in “udev”.

If you are not using ASMLIB, then you can create a custom rules file.  After a restart udev will sequentially carry out rules configuration directives, that are defined in the rules files.  The rules files are stored in the path /etc/udev/rules.d/  The rule files are read in lexical order from the directories.  In the case were the rules files would describe the same device more than once: On Asianux, Red Hat, and Oracle, the last file read would be read and applied.  On SUSE Enterprise Server, with the 2.6 kernel, the first file read is the one that is applied.

Configuring a permissions file for disk devices.
=> Configure the SCSI devices as trusted devices. Edit /etc/scsi_id.config and add “options=ig”

=> Create a udev file for your Oracle ASM devices, using a text editor.  The permissions should be set to 0660 for the installation owner, as well as for the group whose members are administrators of the grid infrastructure software.  So the installation owner could be “grid”, and the OSASM group could be “asmadmin”.

$ vi /etc/udev/rules.d/99-oracle-asmdevices.rules

KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id",
RESULT=="14f70656e66696c00000000", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?2", BUS=="scsi", PROGRAM=="/sbin/scsi_id",
RESULT=="14f70656e66696c00000000", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?3", BUS=="scsi", PROGRAM=="/sbin/scsi_id",
RESULT=="14f70656e66696c00000000", OWNER="grid", GROUP="asmadmin", MODE="0660"

=> Now you can load the updated block device partition tables on the server as the root user:
$ /sbin/partprobe <devicename>

=> Give the commands to restart the udev service.
For Asianux, Oracle Linux 5, Red Hat Enterprise Linux 5:
$ /sbin/udevcontrol reload_rules
$ /sbin/start_udev

For SUSE Linux Enterprise server 10 / 11
$ /etc/init.d boot.udev restart

Installing Oracle Grid Infrastructure Using a Software-Only Installation
Only the binaries are copied to the specified location.  In this case you must manually configure Oracle Grid Infrastructure for a standalone server, and then Oracle ASM must be done manually after the installation is finished.
With this type of installation, you will then also need to manually configure Oracle Restart after you have installed the software.

The software-only installation method provides no validation of the installation, and this type of installation will also require a number of post-installation steps before the Oracle Grid Infrastructure Software is enabled.

Here is a breakdown of the Software-only installation:
Installing the software binaries, and configuring the software binaries.
=> Installing the software binaries
- You start of by running “runInstaller” from the relevant location on the Oracle 11g release 2 installation media or download directory.
- Complete a software only installation of Oracle Grid Infrastructure.
- Verify that the server meets the installation requirements.
$ runcluvfy.sh stage pre hacfg
Ensure that all the storage and server pre-installation steps are completed and successful.

=> Configuring the software binaries.
To configure and activate a software-only Oracle Grid Infrastructure installation for Oracle Restart, you will need to complete the following tasks.
- # $GRID_HOME/perl/bin/perl –l $GRID_HOME/perl lib –l $GRID_HOME/crs/install $GRID_HOME/crs/install/roothas.pl
- Change to $GRID_HOME/oui/bin   $GRID_HOME is the path of the Oracle Grid Infrastructure home.
- # ./runInstaller –updateNodeList ORACLE_HOME=$GRID_HOME -defaultHomeName CLUSTER_NODES=CRS=TRUE
- Now you need to add the listener, the Oracle ASM instance, and all the Oracle ASM disk groups to the Oracle Restart configuration.  To achieve this you can use the SVRCTL utility, Network Configuration Assistant, and Oracle ASMCA.

Installing and Configuring Oracle Grid Infrastructure for a Standalone Server
When you install Oracle Grid Infrastructure first, and then you continue to create your database, the result is that the database is automatically added to the Oracle Grid infrastructure configuration, and will be automatically restarted when required.
However if there is already an Oracle database on a host, and you install Oracle Grid Infrastructure, then you will have to manually add the database, the listener, and Oracle ASM instance, as well as other components to the Oracle Grid Infrastructure configuration.

Oracle Grid Infrastructure will accommodate multiple single instance databases on a single host computer.

Installing Oracle Grid Infrastructure with a New Database Installation
In this case we are going to first install the Oracle Grid Infrastructure, and then create a database, that will be managed by Oracle Restart.  When you install Oracle Grid Infrastructure, then you will be installing Oracle Restart and Oracle ASM at the same time.  You will need to configure ASM with at least one disk group, before you install an Oracle database, that stores database files in the Oracle ASM disk groups.

Before you start with the Oracle Grid Infrastructure installation, make sure that there are no existing Oracle processes running.  Assuming that this is an installation for Oracle Grid Infrastructure for a standalone server, and that we are going to install a new Oracle database on it afterwards.

-> switch user to the Oracle Grid Infrastructure software owner.  Start the Oracle Universal Installer.
- If the installation files are on an installation media, then firstly you must install Oracle Grid Infrastructure for a standalone server in this scenario.
# $DIRECTORY_PATH/runInstaller
- If the installation files are on a hard disk, then you need to change directory to the “Oracle Grid Infrastructure” directory, which is the clusterware directory.
# ./runInstaller

Downloading Updates Before Installation
From Oracle Database 11.2.0.2 onwards, you can download the updates, before starting the installation, provided that the system that you are on, has internet access.
# ./runInstaller –downloadUpdates
You will need to supply your “My Oracle Support”, username and password, and proxy settings if required.  When the download of the updates has finished, then you can transfer the update file to the directory on the host or server where you are going to run Oracle Universal Installer from.  Remember to start the Oracle Universal Installer as the Oracle Grid Infrastructure software owner.  Make sure that your X Window Display is working properly before you start.

-> From Oracle Database 11.2.0.2 onwards, you have the option when you run Universal Installer, to dynamically download and apply the latest updates.  When you start Universal Installer, you will come to the “Download Software Updates” screen.  On this screen you will be presented with three options.  Select one of them and click on the “Next” button.
Option 1: “Use My Oracle Software Support credentials for download:”
This option will download and apply the latest software updates.  You must click on the “Proxy Settings”, to configure a proxy for Oracle Universal Installer to use, for the connection to the internet.  You will also need to give the details of a user account that has access to the local area network, through which the server is connecting.
From Oracle database 11.2.0.3, you can enter the Proxy realm information, such as the Proxy Username, Proxy Password, and Proxy Realm fields.
Before you leave this screen you should press the “Test Connection” button, to make sure that Oracle Universal Installer can access the downloads.

Option 2: “Use pre-downloaded software updates:”
If you had previously downloaded the latest downloads, then you can choose this option.
# ./runInstaller –downloadUpdates

Option 3: “Skip software updates:”.
If you don’t want to download and or apply any updates, then you can select this option.

=> If you had selected to download or apply updates from the previous screen, then you will be brought to the “Apply Software Updates” screen.
- If you had selected “Use My Oracle Support Credentials for Download”, then you should select the “Download and apply all updates” option and click on the “Next” button to apply the updates.
OUI places the downloads in the home directory of the Oracle Installation Owner, that is running the installation.  However if you would prefer the downloads to go to another location, then you can click on the “Browse” button, and select the location on the server that you want the updates to go to.
- If you had selected “Use pre-downloaded software updates”, then you can select “Apply all updates”, and click on the “Next” button to apply the downloads, before the installation starts.

=> Next you come to the “Select Installation Option” screen.  On this screen you need to select the “Configure Oracle Grid Infrastructure for a Standalone Server” option.  Selecting this option will then install and configure Oracle Restart and Oracle ASM.  When you are ready click the “Next” button.

=> “Product Languages” screen.  You can select one or more languages, and move the languages from the Available languages list to the Selected Languages list.  When you are ready, you can click on the “Next” button.

=> “Create ASM Disk Group” screen will display.  On this screen you will see a list of all the Oracle ASM disks.  You may like to change the devices that are to be used by Oracle ASM.  You can click on the “Change Discovery Path” button.  In the “Change Discovery Path” window, you can enter a string for Oracle to use to search for devices that Oracle ASM will use.  The disk string may be set to “” for example, or to “ORACL:*”.  During installation Oracle with look for disks mounted on Oracle ASM, and registered on ASMLIB with the string “ORCL:*”, such disks will be listed by default as database storage candidate disks.
After you have finished selecting the disks on the “Create ASM Disk Group” screen to be used by Oracle ASM, then before you click the “Next” button, consider this:
- The default Disk Group Name is “DATA”.  You can use this default name or enter a new name for the disk group.
- The disk devices must be owned by the user performing the grid installation.
- Verify with your system administrator, if the disks to be used by Oracle ASM are mirrored at the storage level.  If they are, then you must select “External” for the redundancy, otherwise you must select “Normal” for the redundancy.  Keep in mind that for normal redundancy you will require roughly double the storage or disk space to hold the same amount of data.  So if you are allowing 200GB for your database, you will need 400GB of storage.
- Every Oracle ASM disk is divided into allocation units (AU).  Allocation Units are the fundamental unit of allocation within disk groups.  From Oracle 11.2.0.3 onwards, you can select the AU sizes.  By default they are set to 1MB, but you can also select 2,4,8,or 16MB.  This will depend on the disk group compatibility level and so is not guaranteed.
When you are satisfied you can click on the “Next button” to get to the next screen.

=> “Specify ASM Password” screen.  You must enter the SYSASM password, that will be required to connect to the Oracle ASM instance.
The Oracle ASM instance is managed by a privileged role “SYSASM”.  This role grants full access to the Oracle ASM disk groups.  You should create a less privileged user called ASMSNMP with the SYSDBA privileges, that can be used to monitor the Oracle ASM instance.
Now you can enter the passwords for the SYS and ASMSNMP user accounts.  There are rules for the passwords, for example, they should be a minimal of 8 characters long.  The password should include at least one alphabetic character, one numeric character and one of the following: hyphen “-“, underscore “_”, or the number sign “#”.  These three are the only special characters allowed.  You do have the option of using the same password for all the accounts that you are defining here.  Oracle recommends that you should specify a different password for each account.  Perhaps a good idea to write them on a piece of paper, put it in an envelope and lock it up in a safe, because you really need to be able to remember these passwords.
When you are ready you can click on the “Next” button.

=> Privileged Operating System Groups” screen.  On this screen you must select the name of the operating system group that you created for the OSDBA group, as well as the OSASM group, as well as the OSOPER group.  If you were lazy and created only the OSDBA group, then you can use this group for all three privileged groups.  If you did create a separate “asmadmin” group, then use that group for the OSASM group.
When you are satisfied, then click on the “Next” button.

=> “Specify Installation Location” screen, you need to specify the following information:
- Oracle Base: No spaces in the path name, and as short as possible.
- Software Location: You can either accept the default path given, or you can enter the directory path in which you want to install the software.  No spaces in the path name.
When you are satisfied you can click on the “Next” button.   

=> “Create Inventory” screen.  This screen will only appear if you have not previously installed Oracle software on the server.  If you are not happy with the default Inventory Directory, you can change the Directory path.  Remember that all the Oracle products will be using this same directory path.
Select “oinstall” for the “oraInventory” group name, if you are not satisfied with the default.
When you are satisfied you can click on the next button.

=> “Perform Prerequisite Checks” screen.  On this screen oracle will perform a check to see if the minimal requirements are met to perform the Oracle Grid Infrastructure installation.
- If all the system requirements are met, then you are directed to the Summary Sreen.
- If there are some components that don’t meet the requirements, then there will be a note about them.  You can try to manually fix whatever the problem is, and then click on the “Check Again” button.  You can also click on the “Fix & Check Again” button, which will cause the installer to try to remedy the problem, and then to check again.  The Fix & check again will generate a fix script, which you must run as the root user.  This script may set some system and kernel parameters.  It is not a good idea to modify the contents of this script.  Once you have run the script, you are ready to check again.

You may decide to get a list of the failed requirements.  You can select the “Show Failed” button.  To see the successful pre-requisites select “Show Successful”, and to see all the pre-requisites select “Show All”.

You should consider a problem on this screen to be a show-stopper as far as the installation is concerned.  If you select the “Ignore All” option and continue with the installation, then you must remember that Oracle Universal Installer was not able to confirm that the server is configured in such a way that you will be able to install an Oracle database on it.  So you may go ahead with the installation, but the chances are that you will have huge problems down the line.

When you are satisfied, you can click on the “Next” button.

=> You arrive at the Summary screen.  You must review everything on the Summary screen, to make sure that the configuration is setup in the way that you intended.  Once you are happy you can click on the “Install” button.

From 11.2 onwards, you can click the “Save Response File” option, which will save all the installation steps into a response file for you.  You can then use this response file for a silent installation.

=> “Install Product” screen will display the progress of the Oracle Grid Infrastructure installation.
During the installation another window will appear “Execute Configuration Scripts”.  You must first successfully verify that these scripts have been run as the root user, before you click on the “Ok” button.  The scripts mentioned to be run may be the “root.sh”, and the “orainstRoot.sh”.

=> “Finish” screen will finally display the installation status.  If all your pre-requisites were met, then there is a good chance of having success on this screen.  If you did encounter problems, then you must make a note of the location of the configuration log, to search for more information.  You can click on the “Close” button to end the installation.  Then you click on the “Yes” button to exit Oracle Universal Installer (OUI).   

=> Oracle ASMCA will be installed as part of the Oracle Grid Infrastructure for a standalone server installation.  Now if you want to crate additional disk groups, you can run the Oracle ASMCA utility.  You may like to create a disk group called “RECOVERY” to store or house the fast recovery area.

You will want to verify that Oracle High Availability Service has been installed properly.
Change directory to the $GRID_HOME/bin directory.  $GRID_HOME is the path to the Oracle Grid Infrastructure home for a standalone server.
# ./crsctl check has

Ohasd is a software daemon that gets installed with Oracle Grid Infrastructure, that will start the software services such as Oracle ASM.

=> Now you are ready to install the Oracle database.
Remember that if the database is installed after a Grid Infrastructure installation, then the listener will run from the Oracle Grid Infrastructure home.  When you subsequently install a database, then the database must use the same listener that was created during the Oracle Grid Infrastructure installation.

If you are using Oracle Restart then the default listener, as well as any additional listeners have to run from the Oracle Grid Infrastructure home.

Franz Devantier,
Need a database health check?
devantierf@gmail.com


Sunday, August 11, 2013

Oracle Grid Infrastructure – Part 4

Dear Readers,

My name is Franz Devantier, creator of this blog.  I am an Oracle Certified Professional (OCP DBA 11g) Security DBA.  I will be sharing with you the basic duties of an Oracle DBA, and also some of the undocumented, and not so well known tasks. 

Contact me: devantierf@gmail.com

Oracle Grid Infrastructure – Part 4
Configuring Disks for Oracle Automatic Storage Management Using the Automatic Storage Management Library Driver (ASMLIB)
To do this we need to install and configure the ASMLIB software, Configure the Disk Devices to use ASMLIB, be able to administer the ASMLIB and disks.  Now that is quite a task list, so let’s give it a go.

Installing and Configuring the ASMLIB Software
Firstly you should determine the kernel version and architecture of the system you are on.
$ uname –rm

Secondly make sure that you have the required ASMLIB packages available.
oracleasm-support-<version>.<arch>.rpm
oracleasm-<kernel>-<version>.<arch>.rpm
oracleasmlib-<version>.<arch>.rpm
Make sure that you download the correct packages.
<version> should be the version of ASMLIB driver
<arch> should march your system architecture  verify against (uname -rm)
<kernel> is the version of the kernel that you are using

Thirdly you can install the packages:
$ rpm -Uvh oracleasm-support-<version>.<arch>.rpm \
oracleasm-<kernel>-<version>.<arch>.rpm \
oracleasmlib-<version>.<arch>.rpm

Fourthly you need to determine the UID of the Oracle software owner, as well as GID of the OSASM group.
$ id oracle

Fifthly, you must run the oracleasm initialization script
$ /etc/init.d/oracleasm configure

Next you will need to enter values for the prompts that the above script displays.
Prompt
Possible Response
Default UID to own the driver interface:
Specify the UID of the Oracle Grid Infrastructure owner user, which by default may be grid.
Default GID to own the driver interface:
Specify the GID of the OSASM group which by default may be asmadmin.
Start Oracle Automatic Storage Management Library driver on start (y/n):
Recommended to enter y to start the Oracle Automatic Storage Management library driver when the system starts.
Scan for Oracle ASM disks on boot (y/n):
Recommended to enter y to scan for the presence of any Oracle Automatic Storage Management disks when the system starts.


Configuring the Disk Devices to Use the Oracle ASMLIB Driver
If you are going to use IDE, SCSI, or RAID devices in your ASM disk group then you should:
=> if needed, install or configure the disk devices intended for the disk group and restart the system.
=> Identify the device name for the disks that you are going to use.
$ /sbin/fdisk –l
The device name will probably vary, depending on the type of disk.
Disk Type
Device Name Format
Description
IDE disk
/dev/hdyn
Here “y” identifies the IDE disk, and “n” is the partition number. The first disk on the IDE bus could be something like: /dev/hda
SCSI disk
/dev/sdxn
Here “y” identifies the SCSI disk, and “n” is the partition number. The first disk on the first SCSI bus: /dev/sda
RAID disk
/dev/rd/cxdypz/dev/ida/cxdypz
RAID devices can have different device names, depending on the RAID controller. Here “x” is a number that identifies the controller, “y” is a number that identifies the disk, and “z” is a number that identifies the partition. The second logical drive on the first controller: /dev/ida/c0d1   They are numbered from 0 of course.

=> Create a single whole-disk partition on each disk that you are going to use.
You can use fdisk for this task.

=> Mark the disk as an Oracle Automatic Storage Management disk with a disk-name of DISK1.
$ /etc/init.d/oracleasm createdisk DISK1 /dev/sdb1

If you are using a multipathing disk driver with ASM, then you must make sure that you specify the correct logical device name for the disk.  Although the disk names must start with an uppercase letter, they can also contain uppercase letters, numbers and the underscore character

Remember that if you are going to create a database during the installation of the Oracle software, using ASMLIB driver, then you must change the default disk discovery string to ORCL:*

Administering the Oracle ASMLIB  Driver and Disks
You should use the oracleasm initialization script, to administer the ASMLIB driver and disks.
Option
Description
configure
You can reconfigure the Oracle ASM library driver, with this option.
$ /etc/init.d/oracleasm configure
Enable / disable
You can modify the behaviour of the ASMLIB driver when your system starts.  The “enable” option will cause the ASMLIB driver to load when the system starts.
$ /etc/init.d/oracleasm enable
Start / stop / restart
You can use these options to start or stop or restart ASMLIB driver without restarting the system.
$ /etc/init.d/oracleasm restart
createdisk
This option will mark a disk device for use with ASMLIB driver, and also give it a name.
$ /etc/init.d/oracleasm createdisk <DISKNAME> devicename
deletedisk
You must first drop the disk you want to process from the ASM disk group.
deletedisk will then unmark a named disk device:
$ /etc/init.d/oracleasm deletedisk <DISKNAME>
querydisk
In order to determine if a disk device or disk is being used by ASMLIB driver.
# /etc/init.d/oracleasm querydisk {<DISKNAME> | devicename}
listdisks
To list disk names of all the marked ASMLIB driver disks.
$ /etc/init.d/oracleasm listdisks
scandisks
This option will enable cluster nodes to identify which shared disks have been marked as ASMLIB driver disks on other nodes.
$ /etc/init.d/oracleasm scandisks

Franz Devantier,
Need a database health check?

Classifieds