Sie sind auf Seite 1von 65

https://eudba.wordpress.

com/2012/08/10/installing-oracle-11gon-oracle-linux-6-with-asm-eng/Installing Oracle Database


11g R2 on Oracle Linux 6.3 with ASM (ENG)

August 10, 2012 Emmanuel Leave a comment Go to comments


On this post, i am going to show you how to install a single instance Oracle Database 11g release
2 with ASM using Oracle Enterprise Linux 6 x86_64 and role separation.
In order to setup the environment you will need:
The Oracle Database 11g Software (11.2.0.3). LINK
The Oracle Grid Infrastructure 11g Software (11.2.0.3). LINK
The Oracle Linux 6.3 x86_64 installation CD/ISO. LINK
A Virtual Machine/ Server with x86_64 support
Note: You will need your OTN login in order to download the products. If you dont have one, go
ahead and register.
I am going to use Oracle Virtual Box to setup the lab. Here are the details for the VM.
Name: oralab1
RAM: 3.5 GB
Hostname: oralab1.localdomain
Ip: 192.168.10.151/255.255.255.0 gw 192.168.10.1
Nics: 1 bridged adapter
Disks: 1 * 54 GB, 3 * 9 GB
We are going to make the installation in the following order.
1. Installing and configuring the Operating system.
2. Installing Oracle Grid Infrastructure and ASM.
3. Installing the Database Software and creating the Database.
Lets Begin
PART I Installing and configuring Oracle Enterprise Linux 6 x86_64
Once you create your VM/Server and downloaded your Linux media, boot your VM/Server to begin
the installation.

Once the anaconda installer loads up, click next to begin

Select your preferred language and keyboard

Select your type for storage and continue

Setup your hostname and network interfaces and continue

Choose your time zone

Choose your root password

Select your type of installation and continue.

Next you will be prompted to choose which type of server installation you want. Here I prefer to
select a custom installation to select only the packages that i need.

In the next screen select all the required packages that you need, at least include:
Desktop Environment
X Server
Administration tools
Oracle 11g Preinstall package and the AsmLib driver

Once youre done with the packages, click next to begin the installation

Click reboot to finish

When the operating system reboots, you will need to complete the setup as follows

You could create the grid user here. I prefer to do it later, click Forward to continue

Select your time to continue

Click Finnish

Now you will need to login using the root user. This is because the oracle user created by the
Oracle Preinstall package does not have password. Log on and set it up

Disable the firewall. Go go System/Administration/Firewall

Depending on your environment edit your network interface as follows.

Edit your hosts file hosts file with your hostname and ip.

Reload your network as follows

Install your virtual box guest additions. This will not be necessary if youre on a physical server or
VmWare.

Create the necessary directories and the grid user.

Set the necessary permissions

Edit the file /home/grid/.bash_profile and add the following lines to set up the grid user
environment

Edit the file /home/oracle/.bash_profile and add the following lines to set up the oracle user
environment

Shutdown your system and add the necessary disks to be used as ASM disks. In this case Ill created
3 disks

Startup you system and configure you ASM driver as the root user

Check if your disks are available

Its time to setup the disks. As you saw in the previous screenshot, i have three additional disks
named (/dev/sdb, /dev/sdc, /dev/sdd ) we need to partition each disks in order to make them
available for ASM. We will use fdisk to partition them, here is the order youll have to follow.
1.
2.
3.
4.
5.

fdisk /dev/sdb
n,p,1,1,w
fdisk /dev/sdc
n,p,1,1,w
fdisk /dev/sdd

6. n,p,1,1,w
Here is how it looks like:

Lets check again our disks. You will notice that 3 more devices appear, those are the partition we
created.

Next lets disable SELinux as follows vi /etc/selinux/config

Create your ASM disks as follows


oracleam createdisk DISK1 /dev/sdb1
oracleam createdisk DISK2 /dev/sdc1
oracleam createdisk DISK3 /dev/sdd1

At this point we will have our server ready for the grid infrastructure installation.
PART II Installing Oracle Grid Infrastructure 11.2.0.3 and ASM
In this installation we will use role separation of duties; we will proceed as the grid user whos
going to be the GRID_HOME owner
If you have downloaded all the files required, unzip the file p10404530_112030_Linux-x8664_3of7.zip as follows

After unzipping the file, you will have a folder called grid. Start the installer with ./runInstaler

Skip the software updates

Select the option for a standalone server as shown in the picture

Select you languages

Create one diskgroup called DATA with disks ( DISK1, DISK2 ) with external redundancy a shown.

Specify a password for sys and asmsnmp accounts

Leave the default groups and continue

Choose the paths to de ORACLE_BASE and ORACLE_HOME

Note: 11.0.3 in the path, should be 11.2.3 if you follow OFA or you can choose whatever you want

in your ORACLE_HOME path


Specify for inventory

Next the installer will perform a check on your server as shown

If the installer finds that something is not right with your server, it will tell you to run some fixup
scripts. Run them as root until your good

Once ready continue with the installation

During the installation you will prompted to run two scripts a root user, run them to continue

After the installation ends click close to finnish

To verify the installation just execute the command crsctl status resource t as grid user

And with sqlplus

At this point we have our Oracle Restart and ASM in place.

PART III Installing the Database Software and creating the Database
Now we are going to install the database software as the oracle user. Unzip all the files required as
follows

Hosts File
The "/etc/hosts" file must contain a fully qualified name for the server.
<IP-address> <fully-qualified-machine-name> <machine-name>
For example.
127.0.0.1
localhost localhost.localdomain localhost4 localhost4.localdomain4
192.168.0.215 ol6.localdomain ol6
Set the correct hostname in the "/etc/hostname" file.
ol6.localdomain
Oracle Installation Prerequisites
Perform either the Automatic Setup or the Manual Setup to complete the basic prerequisites. The
Additional Setup is required for all installations.
Automatic Setup
If you plan to use the "oracle-rdbms-server-11gR2-preinstall" package to perform all your
prerequisite setup, follow the instructions at http://public-yum.oracle.com to setup the yum
repository for OL, then perform the following command.
# yum install oracle-rdbms-server-11gR2-preinstall
All necessary prerequisites will be performed automatically.
It is probably worth doing a full update as well, but this is not strictly speaking necessary.
# yum update
Manual Setup
If you have not used the "oracle-rdbms-server-11gR2-preinstall" package to perform all
prerequisites, you will need to manually perform the following setup tasks.
Add or amend the following lines in the "/etc/sysctl.conf" file.
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152

kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586
Run the following command to change the current kernel parameters.
/sbin/sysctl -p
Add the following lines to the "/etc/security/limits.conf" file.
oracle
oracle
oracle
oracle
oracle

soft nproc 2047


hard nproc 16384
soft nofile 4096
hard nofile 65536
soft stack 10240

Add the following line to the "/etc/pam.d/login" file, if it does not already exist.
session

required

pam_limits.so

The following packages are listed as required, including the 32-bit version of some of the packages.
Many of the packages should be installed already.
yum install binutils -y
yum install compat-libstdc++-33 -y
yum install compat-libstdc++-33.i686 -y
yum install gcc -y
yum install gcc-c++ -y
yum install glibc -y
yum install glibc.i686 -y
yum install glibc-devel -y
yum install glibc-devel.i686 -y
yum install ksh -y
yum install libgcc -y
yum install libgcc.i686 -y
yum install libstdc++ -y
yum install libstdc++.i686 -y
yum install libstdc++-devel -y
yum install libstdc++-devel.i686 -y
yum install libaio -y
yum install libaio.i686 -y
yum install libaio-devel -y
yum install libaio-devel.i686 -y
yum install libXext -y
yum install libXext.i686 -y
yum install libXtst -y

yum install libXtst.i686 -y


yum install libX11 -y
yum install libX11.i686 -y
yum install libXau -y
yum install libXau.i686 -y
yum install libxcb -y
yum install libxcb.i686 -y
yum install libXi -y
yum install libXi.i686 -y
yum install make -y
yum install sysstat -y
yum install unixODBC -y
yum install unixODBC-devel -y
yum install zlib-devel -y
yum install elfutils-libelf-devel -y
Create the new groups and users.
groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
#groupadd -g 54324 backupdba
#groupadd -g 54325 dgdba
#groupadd -g 54326 kmdba
#groupadd -g 54327 asmdba
#groupadd -g 54328 asmoper
#groupadd -g 54329 asmadmin
useradd -g oinstall -G dba,oper oracle
Note. We are not going to use the extra groups, but include them if you do plan on using them.
Additional Setup
The following steps must be performed, whether you did the manual or automatic setup.
Set the password for the "oracle" user.
passwd oracle
Set secure Linux to permissive by editing the "/etc/selinux/config" file, making sure the SELINUX
flag is set as follows.
SELINUX=permissive
Once the change is complete, restart the server or run the following command.
# setenforce Permissive
If you have the Linux firewall enabled, you will need to disable or configure it, as shown here or
here. To disable it, do the following.
# service iptables stop

# chkconfig iptables off


Create the directories in which the Oracle software will be installed.
mkdir -p /u01/app/oracle/product/11.2.0.4/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01
Unless you are working from the console, or using SSH tunnelling, login as root and issue the
following command.
xhost +<machine-name>
Hoje eu vou abordar como mudar o nome do hostname do servidor Red Hat, pois fiz 1 clone da
minha maquina e preciso que ela tenha hostnames diferente para no confundir.
Verificar o hostname atual:
[root@hodb001vtr ~]# uname -a
Linux hodb001vtr.localdomain 2.6.18-194.el5 #1 SMP Mon Mar 29 20:06:41 EDT 2010 i686 i686
i386 GNU/Linux
[root@hodb001vtr ~]# hostname
hodb001vtr.localdomain
[root@hodb001vtr ~]#
Ento vamos l em sistemas baseados em Red Hat usa o arquivo abaixo para ler e gravar a
informao quando o sistema boota:
/etc/sysconfig/network
Neste arquivo apenas alterar o parametro HOSTNAME.
Alterado e o meu ficou desta maneira:
[root@hodb001vtr ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=hodb002vtr.localdomain
[root@hodb001vtr ~]#
necessrio 1 reboot do server para aplicar as configuraes.
No esquecer de alterar o /etc/hosts e alterar a linha do servidor para o novo nome tambm.
Bom e tem outro jeito mais eficiente pois no necessrio fazer o reboot do servidor simplesmente
altera dinamicamente, porm no altera o /etc/hosts tambm voc ter que alterar manualmente.
Verificao do hostname atual:
[root@hodb001vtr ~]# sysctl kernel.hostname
kernel.hostname = hodb001vtr.localdomain
[root@hodb001vtr ~]#

Alterao do hostname:
[root@hodb001vtr ~]# sysctl kernel.hostname=hodb002vtr.localdomain
kernel.hostname = hodb002vtr.localdomain
[root@hodb002vtr ~]#

Add the following lines at the end of the "/home/oracle/.bash_profile" file.


# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=ol6.localdomain; export ORACLE_HOSTNAME
ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0.4/db_1; export ORACLE_HOME
ORACLE_SID=DB11G; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
export CLASSPATH
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
Descompactar os instaladores do Oracle
cd /11gR2/
unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip
Installation
Log into the oracle user. If you are using X emulation then set the DISPLAY environmental
variable.
DISPLAY=<machine-name>:0.0; export DISPLAY

Start the Oracle Universal Installer (OUI) by issuing the following command in the database
directory.
./runInstaller
Enterprise Manager Database Control URL - (orcl):
https://ol6.localdomain:1158/em

unzip p10404530_112030_Linux-x86-64_1of7.zip
unzip p10404530_112030_Linux-x86-64_2of7.zip

Youll have a folder called database lets get inside and ejecute the oracle installer with
./runInstaller

If you have toy Oracle Support credencials put them in place and continue.

Skip Sofware updates if you want and continue

Select install software only and continue

Select Single instance Database installation and continue

Select your language and continue

Select enterprise Edition or the one you prefer and continue

Choose your ORACLE_BASE and ORACLE_HOME

Review your installation and click install to proceed

As the installation goes on, you will need to execute a script as the root user

At the end of the installation you will see something like this.

Now lets create our database with dbca. As the oracle user execute the dbca

Select create a database

Select your template, this time were going to select general purpose

Write your Global database name and sid

Choose to configure the enterprise manager

Write in the passwords for the administrative users

Choose the storage for your database. Select ASM and write the name of your diskgroup.

Specify your asm credentials

Choose to enable or not archiving and the FRA for you database. This time we are not going to set it
up. NOT RECOMMENDED IN PRODUCCTION SYSTEM.

Adjust your memory settings as you want or leave the defaults

Next review your database storage. You dont really need yo modify anything here.

On the summary screen click OK to begin the creation of the database

At the end you will see a summary of the database you just created

Lets verify

Done! We now have a fully functional single database instance using ASM for storage over Oracle
Linux 6.

Das könnte Ihnen auch gefallen