11gR2 ASM – Inside story – Part1 (including grid infrastructure installation)
Introduction:
This is a series of articles which contains several important enhancements to Automatic Storage Management in Oracle 11gR2.
In this part1, we are going to prepare, install our 11gR2 ASM environment.
In this ASM inside story articles, we are going to use Oracle Linux 5 as the guest operating system, Oracle 11gR2 as database version.
Oracle VirtualBox is our virtualization software.
Oracle Linux Installation
Download and install Oracle Linux.
The following rpm packages must be installed in your system:
binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
elfutils-libelf-devel-static-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-common-2.5
glibc-devel-2.5
glibc-headers-2.5
kernel-headers-2.6.18
ksh-20060214
libaio-0.3.106
libaio-devel-0.3.106
libgcc-4.1.2
libgomp-4.1.2
libstdc++-4.1.2
libstdc++-devel-4.1.2
make-3.81
sysstat-7.0.2
unixODBC-2.2.11
unixODBC-devel-2.2.11
Example:
For Automatic Memory Manager, make the shared memory file system big enough and add the “tmpfs” setting in the “/etc/fstab” file:
Add the following lines in the /etc/sysctl.conf file:
Run the following command to change the current kernel parameters:
Make sure the SELINUX=disabled in the “/etc/selinux/config” file.
Set environment variables for Oracle system user
Login as Oracle system user. Then, edit the file .bash_profile and add the following lines. After that, save the changes and run the command “source .bash_profile”:
Configure devices for ASM using file system files and loop devices
In this step we are going to:
1- Create a directory to hold the files to be used as ASM devices, as Oracle system user.
2- Create 4 files to be used as Asm devices, 1GB of size for each, as root system user.
3- Check the created files, as root system user.
4- Create the loop devices, as root system user.
5- Bind the loop devices to raw devices, as root system user.
6- Setup raw devices permissions and ownership, as root system user.
7- Edit the “/etc/rc.local” file and add the same commands mentioned before. why? Because after a reboot, the ownership and permisions will change back to root and “-rw-r–r–” files attributes.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
[oracle@localhost orawiss]$ mkdir asmdisk
[root@localhost orawiss]# dd if=/dev/zero
of=/u01/app/oracle/product/11.2.0/orawiss/asmdisk/disk1 bs=1024k
count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 23.5853 seconds, 44.5 MB/s
[root@localhost orawiss]# dd if=/dev/zero
of=/u01/app/oracle/product/11.2.0/orawiss/asmdisk/disk2 bs=1024k
count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 22.9174 seconds, 45.8 MB/s
[root@localhost orawiss]# dd if=/dev/zero
of=/u01/app/oracle/product/11.2.0/orawiss/asmdisk/disk3 bs=1024k
count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 32.2912 seconds, 32.5 MB/s
[root@localhost orawiss]# dd if=/dev/zero
of=/u01/app/oracle/product/11.2.0/orawiss/asmdisk/disk4 bs=1024k
count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 36.1176 seconds, 29.0 MB/s
[root@localhost orawiss]# /sbin/losetup /dev/loop1
/u01/app/oracle/product/11.2.0/orawiss/asmdisk/disk1
[root@localhost orawiss]# /sbin/losetup /dev/loop2
/u01/app/oracle/product/11.2.0/orawiss/asmdisk/disk2
[root@localhost orawiss]# /sbin/losetup /dev/loop3
/u01/app/oracle/product/11.2.0/orawiss/asmdisk/disk3
[root@localhost orawiss]# /sbin/losetup /dev/loop4
/u01/app/oracle/product/11.2.0/orawiss/asmdisk/disk4
[root@localhost orawiss]# raw /dev/raw/raw1 /dev/loop1
/dev/raw/raw1: bound to major 7, minor 1
[root@localhost orawiss]# raw /dev/raw/raw2 /dev/loop2
/dev/raw/raw2: bound to major 7, minor 2
[root@localhost orawiss]# raw /dev/raw/raw3 /dev/loop3
/dev/raw/raw3: bound to major 7, minor 3
[root@localhost orawiss]# raw /dev/raw/raw4 /dev/loop4
/dev/raw/raw4: bound to major 7, minor 4
[root@localhost orawiss]# cd /dev/raw
[root@localhost raw]# ls -ltr
total 0
crw------- 1 root root 162, 1 Feb 28 20:27 raw1
crw------- 1 root root 162, 2 Feb 28 20:27 raw2
crw------- 1 root root 162, 3 Feb 28 20:28 raw3
crw------- 1 root root 162, 4 Feb 28 20:28 raw4
[root@localhost raw]# ---change owner raw devices
[root@localhost raw]# chown -R oracle:oinstall *
[root@localhost raw]# chmod 660 *
[root@localhost raw]# ls -ltr
total 0
crw-rw---- 1 oracle oinstall 162, 1 Feb 28 20:27 raw1
crw-rw---- 1 oracle oinstall 162, 2 Feb 28 20:27 raw2
crw-rw---- 1 oracle oinstall 162, 3 Feb 28 20:28 raw3
crw-rw---- 1 oracle oinstall 162, 4 Feb 28 20:28 raw4
[root@wissem tmp]# chown -R oracle:oinstall
/u01/app/oracle/product/11.2.0/orawiss/*
[root@localhost raw]# vi /etc/rc.local
Note that to delete a loop device, you can use the following sintax: “losetup –d /dev/loopX”
Oracle binary files installation
This is my own method I use; I first install the Oracle binaries, install the grid infrastructure for standalone server and then use the dbca to install the Oracle database.
To install the Oracle binaries, you can follow the screen shots below.
1
[oracle@wissem database]$ ./runInstaller
Select the Oracle software languages:
Open a new terminal window, login as root and run the “*.root.sh” scripts. After that click on “ok”.
Now the Oracle binaries are installed. Let’s configure ASM when installing the Oracle grid infrastructure for standalone server.
Grid Infrastructure Installation for standalone server
To configure ASM, we are going to install the grid infrastructure for standalone server.
The following screen shots best describe the steps you need to perform.
1
[oracle@wissem grid]$ ./runInstaller
Choose to install Grid Infrastructure for standalone server option:
Select the software languages:
Select the ASM disk files we already created in the previous section:
Choose the sys password for SYSASM new privilege appeared with Oracle 11g version.
Choose the operating system groups for OSDBA, OSOPER and OSASM.
Confirm the Oracle base and the grid infrastructure software locations:
Configuration requirements verification status:
Confirm the Oracle grid infrastructure resume:
Installation progress:
Open a new terminal window, login as root and run the “root.sh” script. After that click on “ok”.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
[root@wissem ~]# /u01/app/oracle/product/11.2.0/grid/root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.2.0/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
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.sh script.
Now product-specific root actions will be performed.
2011-03-01 11:29:22: Checking for super user privileges
2011-03-01 11:29:22: User has super user privileges
2011-03-01 11:29:22: Parsing the host name
Using configuration parameter file:
/u01/app/oracle/product/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
/home/oracle/.bash_profile: line 1: racle: command not found
LOCAL ADD MODE
Creating OCR keys for user 'oracle', privgrp 'oinstall'..
Operation successful.
CRS-4664: Node wissem successfully pinned.
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting
wissem 2011/03/01 11:33:09
/u01/app/oracle/product/11.2.0/grid/cdata/wissem/backup_20110301_113309.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
Updating inventory properties for clusterware
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 1702 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
'UpdateNodeList' was successful.
[root@wissem ~]#
Installation progress:
The installation confirmation message:
Database installation
Using dbca, we are going to install the Oracle 11gR2 database.
The screen shots below best describe the installation steps.
1
[oracle@wissem database]$ dbca
Choose to create a database and generate a creation database script for future quick database installation:
Nice reading ,
This is a series of articles which contains several important enhancements to Automatic Storage Management in Oracle 11gR2.
In this part1, we are going to prepare, install our 11gR2 ASM environment.
In this ASM inside story articles, we are going to use Oracle Linux 5 as the guest operating system, Oracle 11gR2 as database version.
Oracle VirtualBox is our virtualization software.
Download and install Oracle Linux.
The following rpm packages must be installed in your system:
binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
elfutils-libelf-devel-static-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-common-2.5
glibc-devel-2.5
glibc-headers-2.5
kernel-headers-2.6.18
ksh-20060214
libaio-0.3.106
libaio-devel-0.3.106
libgcc-4.1.2
libgomp-4.1.2
libstdc++-4.1.2
libstdc++-devel-4.1.2
make-3.81
sysstat-7.0.2
unixODBC-2.2.11
unixODBC-devel-2.2.11
Login as Oracle system user. Then, edit the file .bash_profile and add the following lines. After that, save the changes and run the command “source .bash_profile”:
In this step we are going to:
1- Create a directory to hold the files to be used as ASM devices, as Oracle system user.
2- Create 4 files to be used as Asm devices, 1GB of size for each, as root system user.
3- Check the created files, as root system user.
4- Create the loop devices, as root system user.
5- Bind the loop devices to raw devices, as root system user.
6- Setup raw devices permissions and ownership, as root system user.
7- Edit the “/etc/rc.local” file and add the same commands mentioned before. why? Because after a reboot, the ownership and permisions will change back to root and “-rw-r–r–” files attributes.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
| [oracle@localhost orawiss]$ mkdir asmdisk [root@localhost orawiss]# dd if=/dev/zero of=/u01/app/oracle/product/11.2.0/orawiss/asmdisk/disk1 bs=1024k count=1000 1000+0 records in 1000+0 records out 1048576000 bytes (1.0 GB) copied, 23.5853 seconds, 44.5 MB/s [root@localhost orawiss]# dd if=/dev/zero of=/u01/app/oracle/product/11.2.0/orawiss/asmdisk/disk2 bs=1024k count=1000 1000+0 records in 1000+0 records out 1048576000 bytes (1.0 GB) copied, 22.9174 seconds, 45.8 MB/s [root@localhost orawiss]# dd if=/dev/zero of=/u01/app/oracle/product/11.2.0/orawiss/asmdisk/disk3 bs=1024k count=1000 1000+0 records in 1000+0 records out 1048576000 bytes (1.0 GB) copied, 32.2912 seconds, 32.5 MB/s [root@localhost orawiss]# dd if=/dev/zero of=/u01/app/oracle/product/11.2.0/orawiss/asmdisk/disk4 bs=1024k count=1000 1000+0 records in 1000+0 records out 1048576000 bytes (1.0 GB) copied, 36.1176 seconds, 29.0 MB/s [root@localhost orawiss]# /sbin/losetup /dev/loop1 /u01/app/oracle/product/11.2.0/orawiss/asmdisk/disk1 [root@localhost orawiss]# /sbin/losetup /dev/loop2 /u01/app/oracle/product/11.2.0/orawiss/asmdisk/disk2 [root@localhost orawiss]# /sbin/losetup /dev/loop3 /u01/app/oracle/product/11.2.0/orawiss/asmdisk/disk3 [root@localhost orawiss]# /sbin/losetup /dev/loop4 /u01/app/oracle/product/11.2.0/orawiss/asmdisk/disk4 [root@localhost orawiss]# raw /dev/raw/raw1 /dev/loop1 /dev/raw/raw1: bound to major 7, minor 1 [root@localhost orawiss]# raw /dev/raw/raw2 /dev/loop2 /dev/raw/raw2: bound to major 7, minor 2 [root@localhost orawiss]# raw /dev/raw/raw3 /dev/loop3 /dev/raw/raw3: bound to major 7, minor 3 [root@localhost orawiss]# raw /dev/raw/raw4 /dev/loop4 /dev/raw/raw4: bound to major 7, minor 4 [root@localhost orawiss]# cd /dev/raw [root@localhost raw]# ls -ltr total 0 crw------- 1 root root 162, 1 Feb 28 20:27 raw1 crw------- 1 root root 162, 2 Feb 28 20:27 raw2 crw------- 1 root root 162, 3 Feb 28 20:28 raw3 crw------- 1 root root 162, 4 Feb 28 20:28 raw4 [root@localhost raw]# ---change owner raw devices [root@localhost raw]# chown -R oracle:oinstall * [root@localhost raw]# chmod 660 * [root@localhost raw]# ls -ltr total 0 crw-rw---- 1 oracle oinstall 162, 1 Feb 28 20:27 raw1 crw-rw---- 1 oracle oinstall 162, 2 Feb 28 20:27 raw2 crw-rw---- 1 oracle oinstall 162, 3 Feb 28 20:28 raw3 crw-rw---- 1 oracle oinstall 162, 4 Feb 28 20:28 raw4 [root@wissem tmp]# chown -R oracle:oinstall /u01/app/oracle/product/11.2.0/orawiss/* [root@localhost raw]# vi /etc/rc.local |
This is my own method I use; I first install the Oracle binaries, install the grid infrastructure for standalone server and then use the dbca to install the Oracle database.
To install the Oracle binaries, you can follow the screen shots below.
1
| [oracle@wissem database]$ ./runInstaller |
To configure ASM, we are going to install the grid infrastructure for standalone server.
The following screen shots best describe the steps you need to perform.
1
| [oracle@wissem grid]$ ./runInstaller |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
| [root@wissem ~]# /u01/app/oracle/product/11.2.0/grid/root.sh Running Oracle 11g root.sh script... The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/11.2.0/grid Enter the full pathname of the local bin directory: [/usr/local/bin]: The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: 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.sh script. Now product-specific root actions will be performed. 2011-03-01 11:29:22: Checking for super user privileges 2011-03-01 11:29:22: User has super user privileges 2011-03-01 11:29:22: Parsing the host name Using configuration parameter file: /u01/app/oracle/product/11.2.0/grid/crs/install/crsconfig_params Creating trace directory /home/oracle/.bash_profile: line 1: racle: command not found LOCAL ADD MODE Creating OCR keys for user 'oracle', privgrp 'oinstall'.. Operation successful. CRS-4664: Node wissem successfully pinned. Adding daemon to inittab CRS-4123: Oracle High Availability Services has been started. ohasd is starting wissem 2011/03/01 11:33:09 /u01/app/oracle/product/11.2.0/grid/cdata/wissem/backup_20110301_113309.olr Successfully configured Oracle Grid Infrastructure for a Standalone Server Updating inventory properties for clusterware Starting Oracle Universal Installer... Checking swap space: must be greater than 500 MB. Actual 1702 MB Passed The inventory pointer is located at /etc/oraInst.loc The inventory is located at /u01/app/oraInventory 'UpdateNodeList' was successful. [root@wissem ~]# |
Using dbca, we are going to install the Oracle 11gR2 database.
The screen shots below best describe the installation steps.
1
| [oracle@wissem database]$ dbca |
No comments:
Post a Comment