Oracle Linux 6+udev+oracle11gr2+oracle ASM

Source: Internet
Author: User
Tags dba ole uuid sqlplus
Oracle Linux 4.7 Configuration documentation for Oracle ASM
http://blog.csdn.net/liumengcheng/article/details/37358567

Oracle Linux 6 installation oracle11g R2 and Oracle Linux 4.7 installation oracle10g R2 different places are:
Required RPM Package:
binutils-2.20.51.0.2-5.11.el6.i686
compat-libcap1-1.10-1.i686
compat-libstdc++-33-3.2.3-69.el6.i686
gcc-4.4.4-13.el6.i686
gcc-c++-4.4.4-13.el6.i686
glibc-2.12-1.7.el6.i686
glibc-devel-2.12-1.7.el6.i686
Ksh (this do not install)
libgcc-4.4.4-13.el6.i686
libstdc++-4.4.4-13.el6.i686
libstdc++-devel-4.4.4-13.el6.i686
libaio-0.3.107-10.el6.i686
libaio-devel-0.3.107-10.el6.i686
make-3.81-19.el6.i686
sysstat-9.0.4-11.el6.i686
In addition to
unixodbc-2.2.14-11.el6.i686
unixodbc-devel-2.2.14-11.el6.i686
pdksh-5.2.14 (To install this)
Kernel parameters:
FS.AIO-MAX-NR = 1048576
Fs.file-max = 6815744
Kernel.shmall = 2097152
Kernel.shmmax = 536870912
Kernel.shmmni = 4096
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 = 1048576
Lifting shell Limits
Add the following content to the file/etc/security/limits.conf:
Oracle Soft Nproc 2047
Oracle Hard Nproc 16384
Oracle Soft Nofile 4096
Oracle Hard Nofile 65536

Everything else is the same.

The root user mounts the Oracle installation media ISO,
Mount/dev/cdrom/mnt/cdrom
Then Oracle users home Directory execution/mnt/cdrom/runinstaller
Choose to install only the database software, follow the prompts step-by-step, so that the Oracle database software installed


ASM Disk creation:
ASM disk I use Udev here instead of Asmlib (Red Hat Enterprise version 6 after the system seems to be unable to use the Asmlib).
The advantage of using udev is that no matter how the disks and SDA,SDB,SDC are going to change, because Udev only looks at the disk's UUID;
When you frequently add to the system, delete a disk, or two nodes to a common set of disks, the benefits of udev are reflected.
More simply, by Udev, you can map the specified disk (through the uniquely determined disk of the UUID) to device files such as/DEV/ASM-DISKB,/DEV/ASM-DISKC,/DEV/ASM-DISKD
In fact, you look at the contents of the/etc/fstab file, the attached directory of the device is not/dev/sda1,/dev/sdb1 these, but the UUID


Oracle Linux 6 is as follows:
1, view the disk's UUID
scsi_id--whitelisted--replace-whitespace--device=/dev/sdb
Note: Since I am doing the experiment using the VirtualBox virtual machine, when adding a disk to note that to load an existing disk drive, you cannot create a new disk drive and add a disk, no
The UUID will not be visible. The existing disk drive is the SATA disk drive that corresponds to the system disk when the virtual machine is installed


2, generate the rule file
I've added 3 disks here, so the script looks like this and executes the script with root (owner and group in the script can be changed to something else, just for simplicity, so use the Oracle user and DBA group directly) to generate the rule file/etc/udev/ Rules.d/99-oracle-asmdevices.rules

For i in B c D;
Todo
echo "kernel==\" sd*\ ", bus==\" scsi\ ", program==\"/sbin/scsi_id--whitelisted "--replace-whitespace"--device=/dev/\$ Name\ ",


Result==\ "'/sbin/scsi_id--whitelisted--replace-whitespace--device=/dev/sd$i '", name=\ "asm-disk$i\", OWNER=\ " Oracle\ ",


Group=\ "Dba\", mode=\ "0660\" ">>/etc/udev/rules.d/99-oracle-asmdevices.rules
Done


3, restart Udev equipment
/sbin/udevadm Control--reload-rules
/sbin/start_udev

4, check the UDEV equipment
ls-lsa/dev/asm*

5, Test Udev equipment
Udevadm Info--query=all--path=/sys/block/sdb
Udevadm Info--query=all--NAME=ASM-DISKB

After the machine restarts, use Fdisk-l to see the original hard drive.
Execute Start_udev at this time, and then fdisk-l can see the original disk again

After installing Oracle database software, execute DBCA with an Oracle user and discover that ASM cannot be configured (it is only then known to install Oracle Grid Infrastructure
)。 In order to figure Labor. I installed Oracle Grid infrastructure with Oracle users and only software,
After installing the software, follow the prompts to execute with the root user
[Root@ole ~]#/u01/app/11.2.0/grid/crs/install/roothas.pl
2014-07-08 12:57:33:checking for Super User privileges
2014-07-08 12:57:33:user has super User privileges
2014-07-08 12:57:33:parsing the host name
Using configuration parameter file:/u01/app/11.2.0/grid/crs/install/crsconfig_params
Creating Trace Directory
Local ADD MODE
Creating OCR keys for user ' Oracle ', Privgrp ' Oinstall '.
Operation successful.
Crs-4664:node OLE successfully pinned.
Adding daemon to Inittab
Crs-4124:oracle High Availability Services startup failed.
Crs-4000:command Start failed, or completed with errors.
OHASD failed to start: improper IOCTL operation of the device
OHASD failed to start: improper IOCTL operation of the device at/u01/app/11.2.0/grid/crs/install/roothas.pl line 296.


This situation is not urgent, the implementation of/u01/app/11.2.0/grid/crs/install/roothas.pl-delete-force-verbose to clear the previous information,
Then start another terminal, we call Terminal 2, execute input with root/bin/dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1, do not press ENTER
And then we execute the roothas.pl script,
When the adding daemon to Inittab message appears, Terminal 2 executes the command:
/bin/dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1
To succeed:
[Root@ole grid]#/u01/app/11.2.0/grid/perl/bin/perl-i/u01/app/11.2.0/grid/perl/lib-i/u01/app/11.2.0/grid/crs/ Install


/u01/app/11.2.0/grid/crs/install/roothas.pl
2014-07-08 14:44:45:checking for Super User privileges
2014-07-08 14:44:45:user has super User privileges
2014-07-08 14:44:45:parsing the host name
Using configuration parameter file:/u01/app/11.2.0/grid/crs/install/crsconfig_params
Local ADD MODE
Creating OCR keys for user ' Oracle ', Privgrp ' Oinstall '.
Operation successful.
Crs-4664:node OLE successfully pinned.
Adding daemon to Inittab
Crs-4123:oracle High Availability Services has been started.
OHASD is starting
ADVM/ACFS is isn't supported on oraclelinux-release-6server-0.0.5.i686








OLE 2014/07/08 14:45:04/U01/APP/11.2.0/GRID/CDATA/OLE/BACKUP_20140708_144504.OLR
Successfully configured Oracle Grid infrastructure for a Standalone Server


Execute CRS_STAT-T with an Oracle user, if the information indicates that has started successfully.
Modify. Bash_profile with Oracle users (this file was originally intended for the Oracle database, and now the ASM instance is built, so I've changed two of these environment variables here):
Export Oracle_home=/u01/app/11.2.0/grid
Export Oracle_sid=+asm
When you enter ASMCA in the Xmanager Xshell terminal, you can create an ASM instance and configure the disk group.
Remember asm_diskstring and discovery paths are all/dev/asm*




ASM instance is created and then entered Crs_stat-t.
[Oracle@ole ~]$ Crs_stat-t
Name Type Target State Host
------------------------------------------------------------
Ora. DGROUP1.DG ora....up.type Online Online OLE
Ora.asm ora.asm.type Online Online OLE
ORA.CSSD ora.cssd.type Online Online OLE
Ora.diskmon ora....on.type Online Online OLE

Enter Sqlplus Execute Select name| | header_status| | path from V$asm_disk; You can also query for disks created in ASMCA


Sqlplus/as sysasm Login (if SYSDBA error ora-15260:permission denied on ASM disk group)
Then create a disk group
Create DiskGroup dgtest Normal redundancy
Failgroup fg1 disk '/DEV/ASM-DISKC ' name DISKC
Failgroup fg2 disk '/DEV/ASM-DISKD ' name DISKD;

To view disk and disk group information:
Col State format A10
Col name format A15
Col failgroup format A20
Set Line 200
Select State,redundancy,total_mb,free_mb,name,failgroup from V$asm_disk;
Select Group_number,name,state,type,total_mb,free_mb from V$asm_diskgroup;

The effect is as follows:


Delete DiskGroup:
Drop DiskGroup dgtest including contents;


Mount
ALTER DiskGroup dgtest Dismount;
ALTER DiskGroup dgtest MOUNT;
ALTER DiskGroup all dismount;
ALTER DiskGroup all MOUNT;


Add Disk for DiskGroup:
Alter DiskGroup dgtest add disk '/dev/asm-diske ' name
Diske, '/DEV/ASM-DISKF ' name DISKF;


Delete disk from DiskGroup:
Alter DiskGroup dgtest drop disk DISKF;

Create a listener using the NETCA under the grid software

To create an ASM based database using DBCA:

The first 5 steps are the same as the common DBCA, starting from step sixth,





The following is the same as the ordinary DBCA, this is omitted.


Attention:

The OHASD service cannot be restarted automatically after restarting the operating system.
Since Oracle Linux 6 has abandoned the inittab mechanism, it is not possible to start OHASD automatically.
11.2.0.1 does not support Oracle Linux 6,11.2.0.3 to support Oracle Linux 6
Manually execute/ETC/INIT.D/INIT.OHASD Run & with the root user
This will enable Oracle ASM and RDBMS to start successfully.

Remember to switch an ORACLE user's environment variable back to the database's environment variable, such as Oracle_sid to Orcl,oracle_home= $ORACLE _base/product/11.2.0/db_1

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.