Tuesday, August 6, 2013

Oracle Database Preinstallation – Part 13

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. 

For Companies:
Free Database health check, for your database installation.  One months free database support, for you, as a proof of concept.

For individuals:
Refer me to a company for a database support contract.
=> I will then give you 10% of the monthly contract value, for the duration of the contract.  Plus when the contract is extended or renewed you will still get 10% of the monthly contract value, until I no longer support the company, sometime in the future.
=> This 10% is my marketing budget, so if you refer me to a company I will give you my marketing budget.  Now that is probably the best deal you will ever get for a referral.

Oracle Database Preinstallation – Part 13
Configuring Storage for Oracle Database Files Using Block Devices
=> Firstly you need to use fdisk to create disk partitions on block devices for your database files.

=>  Create or modify the rules file in /etc/udev/rules.d, to change the permissions of the data files from the default root ownership.  Call this file 99-oracle.rules
Sample 1:
/etc/udev/rules.d/99-oracle.rules
#
# ASM disks
KERNEL=="sdb[6-9]", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sdb10", OWNER="oracle", GROUP="dba", MODE="0660"

Sample 2:
/etc/udev/rules.d/99-oracle.rules
#
# ASM disks
KERNEL=="sdb[6-9]", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sdb10", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="sdb[6-9]", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sdb10", OWNER="grid", GROUP="asmadmin", MODE="0660"

Configuring Disk Devices for Oracle Database
The parameter O_DIRECT enables direct read and write to block devices, which avoids the kernel overhead.  With Oracle Database Server 10.2 and later, the Oracle Database files are configured by default to use direct input/output.

However with the 2.6 kernel or later for Red Hat Enterprise Linux, Oracle Linux, and SUSE Linux Enterprise Server, you will need to create a permissions file to maintain permissions on Oracle database files.  Without this permissions file, the permissions on disk devices revert to their default values, which are root:disk, this will result in Oracle failing to start.

=> On Red Hat Enterprise Linux 4 and Oracle Linux 4, you must create a permissions file number that is lower than 50.
=> On Asianux server 3, Red Hat Enterprise Linux 5 / 6, Oracle Linux 5 /6, SUSE Linux Enterprise Server 10 / 11, you must create a permissions file number that is higher than 50.

Configuring Block Device Storage for Oracle Database
=> Log on as the root user, or switch or sudo su switch to the root user.
$ sudo sh
Password
=> use the fdisk command to format a storage disk.  This could be something like /dev/sdb for example.
$ /sbin/fdisk /dev/sdb
=> Create a partition on this device, for example a few hundred megabytes that will be reserved for data files.
=> Update the kernel partition table for the shared storage device.
$ /sbin/partprobe diskpath

If you are installing additional Oracle Database 11.2 products in an existing oracle home.  Remember to stop all the processes, as well as the listener and database, that are running in this Oracle Home.  This is to enable OUI to relink the executables and libraries.  If everything is not stopped, then the relink could fail.

If you are going to use ASM and Oracle Restart, then you should start your Oracle 11.2 installation by installing the Oracle Grid Infrastructure.  If you have installed Oracle Grid Infrastructure, then the database must use the same listener that was created during the Oracle Grid Infrastructure installation, which will of course be running in the Oracle Grid Infrastructure home.

If you have an existing ASM infrastructure, then stop the existing ASM instance, Install the Oracle Grid Infrastructure software, and the start the Oracle ASM instance again.

If you choose to create a database, while you are installing the Oracle software with Oracle Universal Installer (OUI), then you will probably end up with an Oracle Net Listener using TCP/IP port 1521, and an IPC key value of “EXTPROC”.  If there is already an existing Oracle Net Listener process using for example 1521, then OUI will use the next available port, for example 1522, and will configure and start the new listener on this port (1522).

You must first determine if a listener process is running, and identify its name.
$ su – oracle

$ ps –ef | grep tnslsnr

You should get output something like:
$ORACLE_HOME/bin/tnslsnr LISTENER -inherit

You can set the ORACLE_HOME environment variable, if it is not already set by your .profile or similar file.

$ export ORACLE_HOME=/app/oracle…/home_1

Or in a C shell
$ setenv ORACLE_HOME <oracle_home>

=> Identify the TCP/IP port number and the IPC key value that the listener is using.

$ORACLE_HOME/bin/lsnrctl status <listener_name>

By default the listener name will be “LISTENER”.

If the listener running is using the default name, then you only need to enter.

$ lsnrctl status

To stop or start the listeners, you will enter something like the below for each listener on the server.

$ lsnrctl stop <listener_name>
$ lsnrctl start <listener_name>
And then to confirm that it is running as it should.

$ lsnrctl status <listener_name>

If you just enter:
$ lsnrctl
You will get the listener control prompt, whicu you can exit again with the “quit” command.

LSNRCTL> status <listener_name>

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

Classifieds

No comments:

Post a Comment