In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
[ASM] Oracle ASM + 11gR2 + RHEL6.5 installation
1.1 introduction
1.1.1 ASMLib
1.1.2 what is udev
1.1.3 Why ASMLIB and why not
1.2 install Oracle 11gR2 + ASM on RHEL 6.4Use udev
1.2.1 check hardware
1.2.2 installation package check
1.2.3 modify hostname
1.2.4 Network configuration
1.2.5 disk preparation
1.2.6 configure directories, users, etc.
1.2.7 Managing disks using udev
1.2.8 system kernel parameter modification
1.2.9 configure the local YUM source for the Linux system
1.2.10 install grid
1.2.11 use netmgr to establish snooping
1.2.12 start building Oracle database
1.2.13 use netmgr to set up snooping-Oracle users do not need to create
1.2.14 create a database using dbca
1.2.15 configure ORACLE Auto start
1.2.16 Verification
1.3 start crs
1.4 error:
1.4.1 Oracle 11gR2 RAC ohasd failed to start solution
1.4.2 CRS-4639: Could not contact Oracle High Availability Services
1.4.3 ORA-29701: unable to connect to Cluster Synchronization Service
1.4.4 asm instance failed to load diskgroups,ORA-15110: no diskgroups mounted
1.4.5 wrong ORA-27154 ORA-27300 ORA-27301 ORA-27302 when starting DB Times
1.4.6 ORA-29786: SIHA attribute GET failed
1.4.7 ORA-29786 error solution for manual creation of ASM instance by 11gR2
1.4.8 ORACLE dbca cannot find asm disks
1.4.9 ora-15077,ASM disk group cannot be mounted
Readme
I was saddened to see that there were still people in the group who struggled with the installation of ASM, but it took me nearly a week to install it, mainly working during the day and without a network, so I had to install it at night. When I started the installation, it was 11.2.0.1.0. This version had a lot of bug installed, although the installation was successful, but it was very painful. Later, I took part in OCP training. The teacher gave version 11.2.0.3.0, which was installed smoothly and did not make a mistake.
The first installation, involving a pile of ASMlib,udev god horse, there is no good tutor pain to learn Oracle, finally after a large number of Baidu, their own groping to solve this problem. When you read this blog, pay attention to the hierarchical structure of the document, very depressed, publishing a blog can not well send out the structure of the article. Finally, the article contains some problems that may appear in the installation process for your reference. If you have any comments, please leave a message or add QQ. Thank you for your visit.
Introduction to ASMLib
Prior to Red Hat Enterprise Linux (RHEL) 6, Oracle used ASMLib, the kernel support library, to configure ASM. ASMLIB is a kernel support library (kernel support library) based on Linux module and specifically designed for Oracle Automatic Storage Management features. However, in May 2011, Oracle issued a statement from the Oracle database ASMLib, saying that Oracle would no longer provide Red Hat Enterprise Linux (RHEL) 6 ASMLib and related updates.
Oracle said in the statement that ASMLib updates will be released through Unbreakable Linux Network (ULN) and will be available only to Oracle Linux customers. ULN serves Oracle and Red Hat customers, but if customers want to use ASMlib, they must replace Red Hat with Oracle's kernel.
This statement is detailed in the Oracle Metalink documentation:
Oracle ASMLib Software Update Policy for Red Hat Enterprise Linux Supported by Red Hat [ID 1089399.1]
Software Update Policy for ASMLib running on future releases of Red Hat Enterprise Linux Red Hat Enterprise Linux 6 (RHEL6) For RHEL6 or Oracle Linux 6, Oracle will only provide ASMLib software and updates when configuredUnbreakable Enterprise Kernel (UEK). Oracle will not provide ASMLib packages for kernels distributedby Red Hat as part of RHEL 6 or the Red Hat compatible kernel in Oracle Linux 6. ASMLib updates will be delivered via Unbreakable Linux Network (ULN) which is available to customers with Oracle Linux support. ULN works with both Oracle Linux or Red Hat Linux installations, but ASMlib usage will require replacing any Red Hat kernel with UEK
Therefore, it is no longer realistic to use ASMLib on Red Hat Enterprise Linux (RHEL) 6, and ASMLib also has some disadvantages, as described in the document:
Http://www.oracledatabase12g.com/archives/why-asmlib-and-why-not.html
As a result, currently using Oracle+ASM on Red Hat Enterprise Linux (RHEL) 6, instead of using ASMLib, the udev device file is used to configure ASM.
What is udev?
Udev is a function in the Linux2.6 kernel, which replaces the original devfs and becomes the default device management tool of Linux. Udev runs as a daemon and manages the device files in the / dev directory by listening for the uevent sent by the kernel. Unlike previous device management tools, udev runs in user space (user space), not kernel space (kernel space).
Why ASMLIB and why not?
ASMLIB is a kernel support library (kernel support library) based on Linux module and specifically designed for Oracle Automatic Storage Management features.
We haven't had a comprehensive understanding of ASMLIB for a long time, so let's take a look at the pros and cons of using ASMLIB.
Theoretically, we can get the following benefits from ASMLIB API:
The problem of permanent device names is always solved by using direct,async IO, even if the file permissions and owner problems are solved when the device name has been changed after reboot, which reduces the context switching from user mode to kernel mode during cpu O, which may reduce the usage of cpu and reduce the usage of file handles. ASMLIB API provides the possibility of passing meta-information such as Imax O priority to storage devices.
Although we can get performance benefits from ASMLIB in theory, this advantage is almost negligible in practice, and there is no performance report showing that ASMLIB has any performance advantage over the original udev device management service on Linux. You can see "asmlib wouldn't necessarily give you much of an io performance benefit, it's mainly for ease of management as it will find/discover the right devices for you, the io effect of asmlib is large the same as doing async io to raw devices." in a post on the official Oracle forum that discusses the benefits of ASMLIB performance. There is actually no difference in performance between using ASMLIB and directly using bare device (raw device).
Possible disadvantages of ASMLIB:
For multipath devices (multipathing), you need to set ORACLEASM_SCANORDER and ORACLEASM_SCANEXCLUDE in the / etc/sysconfig/oracleasm-_dev_oracleasm configuration file so that ASMLIB can find the correct device file. For more information, please see Metalink Note. Because ASM INSTANCE uses the asm disk provided by ASMLIB, an additional layer is added for each Linux Kernel update. All need to replace the new ASMLIB package to increase the possibility of downtime downtime due to human error to use ASMLIB means to spend more time to create and maintain because of the existence of ASMLIB, may introduce more bug, this is the last thing we want to see using ASMLIB to create disk, its disk header will not be any different from ordinary asm disk header, just more ASMLIB attribute space in the header.
Conclusion: my personal view is to avoid using ASMLIB as much as possible, which is certainly not something that DBA can decide personally. On the other hand, it depends on personal habits. Device management services such as udev were not provided in early releases of rhel4, which led to the use of ASMLIB in a large number of ASM+RAC composite systems in rhel 4. Netizens pointed out that udev was introduced as a new feature of kernel 2.6.The udev binding service was added in the initial version of rhel4. However, in the era of rhel4, the actual use of udev is not widespread (In Linux 2.6, a new feature was introduced to simplify device management and hot plug capabilities. This feature is called udev and is a standard package in RHEL4 or OracleEnterprise Linux 4 (OEL4) as well as Novell's SLES9 and SLES10.). If you are in RHEL/OEL 5, then you already have good reason to use udev and give up ASMLIB.
Reference:ASMLIB Performance vs UdevRAC+ASM 3 years in production Stories to shareHow To Setup ASM & ASMLIB On Native Linux Multipath Mapper disks? [ID 602952.1] ASMLib and Linux block devices
Install Oracle 11gR2 + ASM on RHEL 6.4Use udev
Experimental environment:
OS: Oracle Linux Server release 6.4x64 or RHEL6.4
Database: Oracle Database 11gR2 x64 (11.2.0.1.0)
VMware: VMware Workstation 10.0.0 build-812388
Software:
Xmanager-passiveXSHELL
Check the hardware
Before the formal installation begins, please check whether your hardware and software conditions meet the installation needs.
On hardware, you can use commands to view memory and CPU features:
# more / proc/meminfo
# more / proc/cpuinfo
The requirement of memory is not less than 1G.
The following is not required and is optional to use
# df-k / dev/shm check shared memory
# df-k / tmp check temporary disk space
# more / proc/version check operating system version
# uname-r check the kernel version
Memory
# grep MemTotal / proc/meminfo
Swap space
# grep SwapTotal / proc/meminfo
Disk space
# df-ah
# free
# free-m
Minimum: 1 GB of RAM
Recommended: 2 GB of RAM or more
?
To determine the RAM size, enter the following command:
# grep MemTotal / proc/meminfo
Swap check
Between 1 GB and 2 GB 1.5 times the size of the RAM
Between 2 GB and 16 GB Equal to the size of the RAM
More than 16 GB 16 GB
# grep SwapTotal / proc/meminfo
To determine the available RAM and swap space, enter the following command:
# free-m
? The following tables describe the disk space requirements for software files and data files for each installation type on Linux x86:
Installation Type Requirement for Software Files (GB)
Enterprise Edition 3.95
Standard Edition 3.88
Installation Type Disk Space for Data Files (GB)
Enterprise Edition 1.7
Standard Edition 1.5
[root@yutian ~] # cat / proc/version
Linux version 2.6.18-164.el5 (mockbuild@x86-002.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)) # 1 SMP Tue Aug 18 15:51:54 EDT 2009
[root@yutian ~] # lsb_release-id
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 5.4 (Tikanga)
[root@yutian ~] #
Install package check
It can be checked uniformly:
Rpm-Q binutils\
Compat-libstdc++-33\
Elfutils-libelf\
Gcc\
Gcc-c++\
Glibc\
Glibc-common\
Glibc-devel\
Glibc-headers\
Ksh\
Libaio\
Libaio-devel\
Libgomp\
Libgcc\
Libstdc++\
Libstdc++-devel\
Make\
Sysstat\
UnixODBC\
UnixODBC-devel\
Numactl-devel
We can see that packages that have not been installed have is not installed:
[root@rhel6_lhr ~] # rpm-Q binutils\
> compat-libstdc++-33\
> elfutils-libelf\
> gcc\
> gcc-c++\
> glibc\
> glibc-common\
> glibc-devel\
> glibc-headers\
> ksh\
> libaio\
> libaio-devel\
> libgomp\
> libgcc\
> libstdc++\
> libstdc++-devel\
> make\
> sysstat\
> unixODBC\
> unixODBC-devel\
> numactl-devel
Binutils-2.20.51.0.2-5.36.el6.x86_64
Compat-libstdc++-33-3.2.3-69.el6.x86_64
Compat-libstdc++-33-3.2.3-69.el6.i686
Elfutils-libelf-0.152-1.el6.x86_64
Gcc-4.4.7-4.el6.x86_64
Gcc-c++-4.4.7-4.el6.x86_64
Glibc-2.12-1.132.el6.x86_64
Glibc-common-2.12-1.132.el6.x86_64
Glibc-devel-2.12-1.132.el6.x86_64
Glibc-headers-2.12-1.132.el6.x86_64
Package ksh is not installed
Libaio-0.3.107-10.el6.x86_64
Libaio-devel-0.3.107-10.el6.x86_64
Libaio-devel-0.3.107-10.el6.i686
Libgomp-4.4.7-4.el6.x86_64
Libgcc-4.4.7-4.el6.x86_64
Libstdc++-4.4.7-4.el6.x86_64
Libstdc++-devel-4.4.7-4.el6.x86_64
Libstdc++-devel-4.4.7-4.el6.i686
Make-3.81-20.el6.x86_64
Sysstat-9.0.4-22.el6.x86_64
UnixODBC-2.2.14-12.el6_3.x86_64
UnixODBC-2.2.14-12.el6_3.i686
UnixODBC-devel-2.2.14-12.el6_3.i686
UnixODBC-devel-2.2.14-12.el6_3.x86_64
Package numactl-devel is not installed
[root@rhel6_lhr ~] #
If some packages do not exist
You can update the installation in batches, but if the dependency is missing, you may need to perform it twice more
Or adjust it manually.
Check whether the following packages are installed, if not, install them first:
Rpm-qa | grep binutils-
Rpm-qa | grep compat-libstdc++-
Rpm-qa | grep elfutils-libelf-
Rpm-qa | grep elfutils-libelf-devel-
Rpm-qa | grep glibc-
Rpm-qa | grep glibc-common-
Rpm-qa | grep glibc-devel-
Rpm-qa | grep gcc-
Rpm-qa | grep gcc-c++-
Rpm-qa | grep libaio-
Rpm-qa | grep libaio-devel-
Rpm-qa | grep libgcc-
Rpm-qa | grep libstdc++-
Rpm-qa | grep libstdc++-devel-
Rpm-qa | grep make-
Rpm-qa | grep sysstat-
Rpm-qa | grep unixODBC-
Rpm-qa | grep unixODBC-devel-
Binutils-2.17.50.0.6-2.el5
Compat-libstdc++-33-3.2.3-61
Elfutils-libelf-0.125-3.el5
Elfutils-libelf-devel-0.125
Glibc-2.5-12
Glibc-common-2.5-12
Glibc-devel-2.5-12
Gcc-4.1.1-52
Gcc-c++-4.1.1-52
Libaio-0.3.106
Libaio-devel-0.3.106
Libgcc-4.1.1-52
Libstdc++-4.1.1
Libstdc++-devel-4.1.1-52.e15
Make-3.81-1.1
Sysstat-7.0.0
UnixODBC-2.2.11
UnixODBC-devel-2.2.11
# rpm-qa | grep make gcc glibc compat openmotif21 setarch, etc.
It is recommended that you use rpm-Q packagename to check one by one, because it is an official requirement, so in order not to have unnecessary trouble during installation, it is better to make sure that all of them are installed.
Although I am a freshly installed system, there are three packages that have not been installed: Libaio-devel numactl-devel sysstat
Mount the Linux 5 CD and find the full path name of the package:
[root@localhost] # mkdir / media/cdrom; mount / dev/cdrom / media/cdrom
[root@localhost ~] # ll / media/cdrom/Server/ | grep libaio-devel
[root@localhost ~] # ll / media/cdrom/Server/ | grep numactl-devel
[root@localhost ~] # ll / media/cdrom/Server/ | grep sysstat
Install the RPM package:
[root@localhost] # rpm-ivh / media/cdrom/Server/libaio-devel-0.3.106-3.2.i386.rpm
[root@localhost] # rpm-ivh / media/cdrom/Server/numactl-devel-0.9.8-7.el5.i386.rpm
[root@localhost] # rpm-ivh / media/cdrom/Server/sysstat-7.0.2-3.el5.i386.rpm
Rpm-ivh compat-libstdc++-33-3.2.3-69.el6.i686.rpm-- force-- nodeps
[root@localhost RHEL_6.5 x86_64 Disc 1] # pwd
/ media/RHEL_6.5 x86_64 Disc 1
[root@localhost RHEL_6.5 x86_64 Disc 1] #
In addition, in order to support ODBC, it is recommended to install the following two packages:
UnixODBC-2.2.11 (32 bit) or later
UnixODBC-devel-2.2.11 (32 bit) or later
Modify hostname
Permanent effect:
[root@zijuan /] # vim / etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=zijuan
HOSTNAME=zijuan means that the host is set to zijuan.
Note: after modifying the hostname, it will take effect after you restart the system, or switch to a user and then switch back to OK.
View / etc/hosts file must contain a fully qualified name for the server
[root@localhost lhr] # cat / etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
:: 1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.128.131 rhel6_linux_asm
[root@localhost lhr] # hostname
Localhost.localdomain
[root@localhost lhr] # hostname rhel6.5_linux
[root@localhost lhr] # hostname
Rhel6_linux_asm
Modify / etc/hosts file
[root@oracle ~] # vim/etc/hosts
127.0.0.1 localhost.localdomainlocalhost
:: 1 localhost6.localdomain6localhost6
192.168.137.112 oracle.domain.comoracle
Be careful to map the hostname to the real ip address, otherwise oracle may build the listener only on 127.0.0.1
Network configuration
If you want to configure em, finally set the ip address of the system to a static ip address, otherwise it may cause the ip address of the database server to be changed during em access, which will lead to other problems. For specific static ip address configuration reference (o () address)) o alas. This piece of content has not yet written a blog, you can Baidu or private chat me)
Disk preparation
Here we prepare five hard drives.
1 hard disk to install the operating system
234 blocks are used to store data in ASM.
5 hard drives are used to store FRA
Add disk
1.1. Edit virtual machine configuration
1.2. Add Hardwar
1.3. Add the first hard drive
1.4. Create a new virtual disk
1.5. Select disk type
1.6. Set disk size
1.7. Complete
1.8.
Add the second, third, fourth and fifth disks: repeat step 1 # 7
1.9.
After the five disks are added here, in order to avoid a restart later, you can first do the next step, that is, find the configuration file of the virtual machine, and add a line of disk.EnableUUID= "TRUE" at the end. Here, be sure to modify the parameter file when you shut down the file.
Partition the disk
After the disks are added, start the virtual machine, log in to the system as a root user, and format the two newly added disks.
[root@localhost share] # fdisk-l | grep "Disk / dev/sd"
Disk / dev/sde: 10.7 GB, 10737418240 bytes
Disk / dev/sdd: 10.7 GB, 10737418240 bytes
Disk / dev/sda: 53.7 GB, 53687091200 bytes
Disk / dev/sdb: 10.7 GB, 10737418240 bytes
Disk / dev/sdc: 10.7 GB, 10737418240 bytes
After the disk partition is complete, check all the disks.
Note that here you only partition the disk, not format and mount the disk.
Configure directories, users, etc.
Configure users and user groups
Use the / usr/sbin/groupadd command
-what Oracle users may have installed here has no effect:
Code:
Groupadd oinstall
Groupadd dba
Groupadd oper
Groupadd asmadmin
Groupadd asmoper
Groupadd asmdba
-- add users to the group
Useradd-g oinstall-G dba,asmdba,oper,asmadmin oracle
Useradd-g oinstall-G asmadmin,asmdba,asmoper,dba grid
-- change the password
Passwd oracle
Passwd grid
Echo oracle | passwd-- stdin lhr
Echo grid | passwd-- stdin lhr
-check the owner
[root@rhel_linux_asm ~] # id oracle
Uid=501 (oracle) gid=502 (dba) groups=502 (dba), 501,504 (asmadmin), 506 (asmdba)
[root@rhel_linux_asm ~] # id grid
Uid=502 (grid) gid=501 (oinstall) groups=501 (oinstall), 502,504 (asmadmin), 505 (asmoper), 506 (asmdba)
[root@rhel_linux_asm ~] #
Create directories and configure profiles for grid and oracle users
Code:
-- under root users:
Mkdir-p / u01/app/oracle
Mkdir-p / u01/app/grid
Mkdir-p / u01/app/grid/11.2.0
Chown-R grid:oinstall / u01/app/grid-change the owner of / u01/app/grid to grid
Chown-R oracle:oinstall / u01/app/oracle
Chmod-R 775 / U01
-Oracle User---- switches to Oracle users-
[root@rhel_linux_asm ~] # su-oracle
[grid@rhel_linux_asm] $vi ~ / .bash_profile
Export ORACLE_SID=orcl
Export ORACLE_BASE=/u01/app/oracle
Export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
Export LD_LIBRARY_PATH=$ORACLE_HOME/lib
Export TMP=/tmp
Export TMPDIR=$TMP
Export PATH=$PATH:$ORACLE_HOME/bin
-Grid User- switches to grid users-
Cd / home/grid
Vim .bash _ profile
Export ORACLE_SID=+ASM
Export ORACLE_BASE=/u01/app/grid
Export ORACLE_HOME=/u01/app/grid/11.2.0
Export LD_LIBRARY_PATH=$ORACLE_HOME/lib
Export PATH=$ORACLE_HOME/bin:$PATH
Umask 022
[oracle@dbserver1 ~] $source .bash _ profile
Use udev to manage disks
Configure scsi_id for udev binding
Note the following two points:
First, switch to root user:
5.1. The location of the scsi_id command varies with different operating systems.
[root@localhost ~] # cat / etc/issue
Oracle Linux Server release 6.4
Kernel\ r on an\ m
[root@localhost ~] # which scsi_id
/ sbin/scsi_id
[root@localhost ~] #
5.2. Edit the / etc/scsi_id.config file, and if it does not exist, create it and add the following line:
[root@localhost ~] # vi / etc/scsi_id.config
Options=--whitelisted-replace-whitespace
[root@localhost ~] #
5.3. If you are using a VMware virtual machine, you may not be able to get the id by entering the scsi_id command directly. You need to modify the parameters of the VMware file. If you skip this step when adding the disk, you can skip it and get the uuid directly.
[root@localhost] # scsi_id-whitelisted-replace-whitespace-device=/dev/sdb
[root@localhost] # scsi_id-whitelisted-replace-whitespace-device=/dev/sdc
D:\ VMs\ Oracle Database 11gR2\ Oracle Database 11gR2.vmx
Edit the file using a text editor, adding a line of parameters at the end:
Disk.EnableUUID= "TRUE"
Save the file and restart the virtual machine. Note here that when you modify the file, you must change it when you turn it off, or scsi_id-g-u / dev/sdc to obtain the uuid,-g-u parameter is no longer used after rhel6.
[root@localhost share] # scsi_id-whitelisted-replace-whitespace-device=/dev/sdb
36000c29fbe57659626ee89b4fba07616
[root@localhost share] # scsi_id-whitelisted-replace-whitespace-device=/dev/sdc
36000c29384cde894e087e5f0fcaa80f4
[root@localhost share] # scsi_id-whitelisted-replace-whitespace-device=/dev/sdd
36000c29022aee23728231ed9b1f9743d
[root@localhost share] # scsi_id-whitelisted-replace-whitespace-device=/dev/sde
36000c2938f431664218d1d2632ff1352
Create and configure udev rules files
[root@localhost ~] # vi / etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL== "sd*", SUBSYSTEM== "block", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "36000c29fe0fc917d7e9982742a28ce7c", NAME= "asm-diskb", OWNER= "grid", GROUP= "asmadmin", MODE= "0660"
KERNEL== "sd*", SUBSYSTEM== "block", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "36000c293ffc0900fd932348de4b6baf8", NAME= "asm-diskc", OWNER= "grid", GROUP= "asmadmin", MODE= "0660"
Modify the RESULT value according to the ID obtained in step 5
It should be noted here that a KERNEL is a line and cannot be changed. I made this mistake before.
Add 4 hard drives:
KERNEL== "sd*", SUBSYSTEM== "block", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "36000c29346c1344ffb26f0e5603d519e", NAME= "asm-diskb", OWNER= "grid", GROUP= "asmadmin", MODE= "0660"
KERNEL== "sd*", SUBSYSTEM== "block", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "36000c29d08ee059a345571054517cd03", NAME= "asm-diskc", OWNER= "grid", GROUP= "asmadmin", MODE= "0660"
KERNEL== "sd*", SUBSYSTEM== "block", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "36000c295037a910bfb765af8f400aa07", NAME= "asm-diskd", OWNER= "grid", GROUP= "asmadmin", MODE= "0660"
KERNEL== "sd*", SUBSYSTEM== "block", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "36000c2982bda048f642acd3c429ec983", NAME= "asm-diske", OWNER= "grid", GROUP= "asmadmin", MODE= "0660"
Note: the GROUP= "asmadmin" here had better be changed to GROUP= "asmdba", otherwise the disk group may not be found when creating the database instance with dbca.
After the addition is completed, restart udev. The restart method varies with different Linux distributions.
This step is a little slower, it may take about 30 seconds, and so on.
[root@localhost ~] # start_udev
Starting udev: [OK]
[root@localhost ~] #
Check the bound asm. If you still can't see the asm disk at this time, restart the operating system and check it again.
[root@localhost ~] # ll / dev/asm*
Brw-rw---- 1 grid asmadmin 8, 17 Oct 17 14:26 / dev/asm-diskb
Brw-rw---- 1 grid asmadmin 8, 33 Oct 17 14:26 / dev/asm-diskc
Modify the system kernel parameters and edit the / etc/security/limits.conf file, adding the following at the end of the file:
[root@localhost] # tail-8 / etc/security/limits.conf
# add by lhr for oracle and grid on 2014-05-02
Oracle soft nproc 2047
Oracle hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536
Grid soft nproc 2047
Grid hard nproc 16384
Grid soft nofile 1024
Grid hard nofile 65536
Edit the / etc/pam.d/login file and add the following at the end of the file:
[root@localhost] # tail-1 / etc/pam.d/login
Session required pam_limis.so
[root@localhost ~] #
Edit the / etc/profile file, set the shell limit, and add the following at the end of the file:
[root@localhost] # tail-9 / etc/profile
If [/ $USER = "oracle"] | | [/ $USER = "grid"]; then
If [/ $SHELL = "/ bin/ksh"]; then
Ulimit-p 16384
Ulimit-n 65536
Else
Ulimit-u 16384-n 65536
Fi
Umask 022
Fi
/ etc/sysctl.conf
Configuring Kernel Parameters for Linux
Vim / etc/sysctl.conf
Fs.aio-max-nr = 1048576
Fs.file-max = 6815744
Kernel.shmall = 2097152
Kernel.shmmax = 4294967295
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
Take effect
# / sbin/sysctl-p
Install grid
Upload the file linux.x64_11gR2_grid.zip to the grid user's home directory / home/grid/ via ZMODEM
Of course, you can also use other software instead of uploading software packages:
[root@localhost ~] # ll / home/grid/
Total 1028228
-rw-r--r-- 1 root root 1052897657 Oct 16 13:22 linux.x64_11gR2_grid.zip
[root@localhost ~] #
Extract the file
[root@localhost grid] # unzip linux.x64_11gR2_grid.zip
[root@localhost grid] # ll
Total 1028232
Drwxr-xr-x 8 root root 4096 Aug 21 2009 grid
-rw-r--r-- 1 root root 1052897657 Oct 16 13:22 linux.x64_11gR2_grid.zip
[root@localhost grid] #
Log in to the system as a grid user and execute the installer. Journal
Log generation address during installation:
/ u01/app/oraInventory/logs/installActions2014-06-14 10-32-53PM.log
16.1. Check that the installation script has executable permissions
[grid@localhost grid] $id
Uid=501 (grid) gid=500 (oinstall) groups=500 (oinstall), 501,503 (asmadmin), 504 (asmoper), 505 (asmdba)
[grid@localhost grid] $ll runInstaller
-rwxr-xr-x 1 root root 3227 Aug 15 2009 runInstaller
[grid@localhost grid] $
If there is no executable permission, execute the following command to authorize:
[root@localhost] # chown-R grid:oinstall / home/grid/grid/
[root@localhost ~] # ll / home/grid/grid/runInstaller
-rwxr-xr-x 1 grid oinstall 3227 Aug 15 2009 / home/grid/grid/runInstaller
[root@localhost ~] #
16.2. Execute the installation script / home/grid/grid/runInstaller
First open the Xmanager-Passive software, and then set up the following in the Xshell session:
[grid@rhel_linux_asm grid] $clear
[grid@rhel_linux_asm grid] $export DISPLAY=192.168.1.100:0.0-the ip address here is the local ip address (ipconfig)
[grid@rhel_linux_asm grid] $xhost +
Access control disabled, clients can connect from any host
[grid@rhel_linux_asm grid] $ls
Doc install response rpm runcluvfy.sh runInstaller sshsetup stage welcome.html
[grid@rhel_linux_asm grid] $. / runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 31642 MB Passed
Checking swap space: must be greater than 150 MB. Actual 383 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from / tmp/OraInstall2014-04-297 10-53-18PM. Please wait... [grid@rhel_linux_asm grid] $
The screenshot is as follows:
17. Installation process
[grid@localhost ~] $/ home/grid/grid/runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 38826 MB Passed
Checking swap space: must be greater than 150 MB. Actual 4095 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from / tmp/OraInstall2013-10-17003-31-41PM. Please wait... [grid@localhost ~] $
17.1.
17.2.
17.3.
17.4.
17.5.
17.6.
17.6.1. Check the installation conditions
17.6.2.
Execute the repair script:
[root@localhost ~] # / tmp/CVU_11.2.0.1.0_grid/runfixup.sh
Response file being used is: / tmp/CVU_11.2.0.1.0_grid/fixup.response
Enable file being used is: / tmp/CVU_11.2.0.1.0_grid/fixup.enable
Log file location: / tmp/CVU_11.2.0.1.0_grid/orarun.log
Setting Kernel Parameters...
Kernel.sem = 250 32000 100 128
Fs.file-max = 6815744
Net.ipv4.ip_local_port_range = 9000 65500
Net.core.rmem_default = 262144
Net.core.wmem_default = 262144
Net.core.rmem_max = 4194304
Net.core.wmem_max = 1048576
Fs.aio-max-nr = 1048576
17.6.3. Install the missing package
# yum install-y package_name
These packages are actually installed, but because the version of the package that comes with Oracle Linux 6.4. is higher than the check version, so the check fails and you can ignore it.
There is no pdksh package in the installation CD of Oracle Linux 6.4.Just install the ksh package.
# yum install-y ksh
Because there is no NTP clock server, so the NTP check failed, just ignore it.
17.6.4.
17.7.
17.8.
17.9. Installation time is long, please wait patiently.
The final step of executing the script
A dialog box pops up during installation, prompting you to execute two scripts as root:
[root@localhost ~] # / u01/app/oraInventory/orainstRoot.sh
Changing permissions of / u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of / u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@localhost ~] # / u01/app/11.2.0/grid/root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= / u01/app/11.2.0/grid
Enter the full pathname of the local bin directory: [/ usr/local/bin]:-- enter enter
Copying dbhome to / usr/local/bin...
Copying oraenv to / usr/local/bin...
Copying coraenv to / usr/local/bin...
Creating / etc/oratab file...
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.
To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:-- A single instance installation needs to execute the following script
/ 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
To configure Grid Infrastructure for a Cluster perform the following steps:
1. Provide values for Grid Infrastructure configuration parameters in the file-/ u01/app/11.2.0/grid/crs/install/crsconfig_params. For details on how to do this, see the installation guide.
2. Run the following command as the root user:
/ 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/rootcrs.pl
To update inventory properties for Grid Infrastructure, perform the following
Steps. If a pre-11.2 home is already configured, execute the following:
11.2_Home/oui/bin/runInstaller-updateNodeList-silent-local CRS=false ORACLE_HOME=pre-11.2_Home
Always execute the following to register the current home:
11.2_Home/oui/bin/runInstaller-updateNodeList-silent-local CRS=true ORACLE_HOME=11.2_Home.
If either home is shared, provide the additional argument-cfs.
The screenshot is as follows:
The following script is executed as required:
[root@localhost] # / 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
2013-10-17 16:18:19: Checking for super user privileges
2013-10-17 16:18:19: User has super user privileges
2013-10-17 16:18:19: Parsing the host name
Using configuration parameter file: / u01/app/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
/ u01/app/11.2.0/grid/bin/clscfg.bin: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory-- error report
Failed to create keys in the OLR, rc = 32512, 32512
OLR configuration failed
[root@localhost ~] #
Resolve error reporting:
17.9.1. Check whether libcap.so is installed in the operating system
If it is a 64-bit system, both i686 and x86room64 should be installed.
# yum install-y libcap*.i686
# yum install-y libcap*.x86_64
[root@localhost ~] # rpm-qa | grep libcap
Libcap-ng-0.6.4-3.el6_0.1.i686
Libcap-2.16-5.5.el6.x86_64
Libcap-devel-2.16-5.5.el6.x86_64
Libcap-devel-2.16-5.5.el6.i686
Libcap-ng-0.6.4-3.el6_0.1.x86_64
Libcap-2.16-5.5.el6.i686
Libcap-ng-devel-0.6.4-3.el6_0.1.i686
Libcap-ng-devel-0.6.4-3.el6_0.1.x86_64
[root@localhost ~] #
17.9.2. Check the libcap.so file
[root@localhost ~] # ll / lib64/libcap.so*
Lrwxrwxrwx 1 root root 11 Oct 17 16:28 / lib64/libcap.so-> libcap.so.2
Lrwxrwxrwx. 1 root root 14 Oct 16 15:22 / lib64/libcap.so.2-> libcap.so.2.16
-rwxr-xr-x 1 root root 19016 Oct 13 2011 / lib64/libcap.so.2.16
[root@localhost ~] #
17.9.3.
[root@localhost] # ln-s / lib64/libcap.so.2.16 / lib64/libcap.so.1
[root@localhost] # ln-s / lib64/libcap.so.2 / lib64/libcap.so
[root@localhost ~] # ll / lib64/libcap.so*
Lrwxrwxrwx 1 root root 11 Oct 17 16:28 / lib64/libcap.so-> libcap.so.2
Lrwxrwxrwx 1 root root 21 Oct 17 17:01 / lib64/libcap.so.1-> / lib64/libcap.so.2.16
Lrwxrwxrwx. 1 root root 14 Oct 16 15:22 / lib64/libcap.so.2-> libcap.so.2.16
-rwxr-xr-x 1 root root 19016 Oct 13 2011 / lib64/libcap.so.2.16
[root@localhost ~] #
17.9.4. Re-execute the / u01/app/11.2.0/grid/root.sh script
[root@localhost ~] # / u01/app/11.2.0/grid/root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= / u01/app/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? (YBO)
[n]: y-enter y to overwrite the installation
Copying dbhome to / usr/local/bin...
The file "oraenv" already exists in / usr/local/bin. Overwrite it? (YBO)
[n]: y-enter y to overwrite the installation
Copying oraenv to / usr/local/bin...
The file "coraenv" already exists in / usr/local/bin. Overwrite it? (YBO)
[n]: y-enter y to overwrite the installation
Copying coraenv to / usr/local/bin...
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.
To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:
/ 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
To configure Grid Infrastructure for a Cluster perform the following steps:
1. Provide values for Grid Infrastructure configuration parameters in the file-/ u01/app/11.2.0/grid/crs/install/crsconfig_params. For details on how to do this, see the installation guide.
2. Run the following command as the root user:
/ 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/rootcrs.pl
To update inventory properties for Grid Infrastructure, perform the following
Steps. If a pre-11.2 home is already configured, execute the following:
11.2_Home/oui/bin/runInstaller-updateNodeList-silent-local CRS=false ORACLE_HOME=pre-11.2_Home
Always execute the following to register the current home:
11.2_Home/oui/bin/runInstaller-updateNodeList-silent-local CRS=true ORACLE_HOME=11.2_Home.
If either home is shared, provide the additional argument-cfs.
[root@localhost] # / 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
2013-10-17 17:04:58: Checking for super user privileges
2013-10-17 17:04:58: User has super user privileges
2013-10-17 17:04:58: Parsing the host name
Using configuration parameter file: / u01/app/11.2.0/grid/crs/install/crsconfig_params
Improper Oracle Clusterware configuration found on this host
Deconfigure the existing cluster configuration before starting-error report
To configure a new Clusterware
Run'/ u01/app/11.2.0/grid/crs/install/rootcrs.pl-deconfig'
To configure existing failed configuration and then rerun root.sh
17.9.5. Resolve the error in step 4)
[root@localhost] # / u01/app/11.2.0/grid/crs/install/roothas.pl-verbose-delete-force
2013-10-17 18:25:15: Checking for super user privileges
2013-10-17 18:25:15: User has super user privileges
2013-10-17 18:25:15: Parsing the host name
Using configuration parameter file: / u01/app/11.2.0/grid/crs/install/crsconfig_params
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Stop failed, or completed with errors.
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Delete failed, or completed with errors.
CRS-4544: Unable to connect to OHAS
CRS-4000: Command Stop failed, or completed with errors.
/ u01/app/11.2.0/grid/bin/acfsdriverstate: line 51: / lib/acfstoolsdriver.sh: No such file or directory
/ u01/app/11.2.0/grid/bin/acfsdriverstate: line 51: exec: / lib/acfstoolsdriver.sh: cannot execute: No such file or directory
Successfully deconfigured Oracle Restart stack
[root@localhost ~] #
17.9.6. Re-execute the / u01/app/11.2.0/grid/root.sh script
[root@localhost ~] # / u01/app/11.2.0/grid/root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= / u01/app/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? (YBO)
[n]: y
Copying dbhome to / usr/local/bin...
The file "oraenv" already exists in / usr/local/bin. Overwrite it? (YBO)
[n]: y
Copying oraenv to / usr/local/bin...
The file "coraenv" already exists in / usr/local/bin. Overwrite it? (YBO)
[n]: y
Copying coraenv to / usr/local/bin...
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.
To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:
/ 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
To configure Grid Infrastructure for a Cluster perform the following steps:
1. Provide values for Grid Infrastructure configuration parameters in the file-/ u01/app/11.2.0/grid/crs/install/crsconfig_params. For details on how to do this, see the installation guide.
2. Run the following command as the root user:
/ 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/rootcrs.pl
To update inventory properties for Grid Infrastructure, perform the following
Steps. If a pre-11.2 home is already configured, execute the following:
11.2_Home/oui/bin/runInstaller-updateNodeList-silent-local CRS=false ORACLE_HOME=pre-11.2_Home
Always execute the following to register the current home:
11.2_Home/oui/bin/runInstaller-updateNodeList-silent-local CRS=true ORACLE_HOME=11.2_Home.
If either home is shared, provide the additional argument-cfs.
[root@localhost] # / 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
2013-10-17 18:27:55: Checking for super user privileges
2013-10-17 18:27:55: User has super user privileges
2013-10-17 18:27:55: 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 'grid', privgrp' oinstall'..
Operation successful.
CRS-4664: Node localhost successfully pinned.
Adding daemon to inittab
CRS-4124: Oracle High Availability Services startup failed. -- reporting errors
CRS-4000: Command Start failed, or completed with errors.
Ohasd failed to start: Inappropriate ioctl for device
Ohasd failed to start: Inappropriate ioctl for device at / u01/app/11.2.0/grid/crs/install/roothas.pl line 296.
[root@localhost ~] #
This is a BUG of 11.0.2.1, and this problem does not exist if you install 11.2.0.3
17.9.7. Resolve BUG
17.9.7.1. Actions generated by rollback / u01/app/11.2.0/grid/root.sh
[root@localhost] # / u01/app/11.2.0/grid/crs/install/roothas.pl-verbose-delete-force
2013-10-17 18:45:42: Checking for super user privileges
2013-10-17 18:45:42: User has super user privileges
2013-10-17 18:45:42: Parsing the host name
Using configuration parameter file: / u01/app/11.2.0/grid/crs/install/crsconfig_params
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Stop failed, or completed with errors.
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Delete failed, or completed with errors.
CRS-4544: Unable to connect to OHAS
CRS-4000: Command Stop failed, or completed with errors.
/ u01/app/11.2.0/grid/bin/acfsdriverstate: line 51: / lib/acfstoolsdriver.sh: No such file or directory
/ u01/app/11.2.0/grid/bin/acfsdriverstate: line 51: exec: / lib/acfstoolsdriver.sh: cannot execute: No such file or directory
Successfully deconfigured Oracle Restart stack
[root@localhost ~] #
17.9.7.2. As soon as Adding daemon to inittab appears in the execution of the root.sh script, execute the following command as root:
# / bin/dd if=/var/tmp/.oracle/npohasd of=/dev/nullbs=1024 count=1
If / bin/dd: opening `/ var/tmp/.oracle/npohasd': No such file or directory appears, the file has not been generated yet. Continue execution until it can be executed.
Open two SSH sessions simultaneously to perform the following two steps
[root@localhost ~] # / bin/dd if=/var/tmp/.oracle/npohasd of=/dev/nullbs=1024 count=1
/ bin/dd: opening `/ var/tmp/.oracle/npohasd': No such file or directory
[root@localhost ~] # / bin/dd if=/var/tmp/.oracle/npohasd of=/dev/nullbs=1024 count=1
[root@localhost ~] # / u01/app/11.2.0/grid/root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= / u01/app/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? (YBO)
[n]: y
Copying dbhome to / usr/local/bin...
The file "oraenv" already exists in / usr/local/bin. Overwrite it? (YBO)
[n]: y
Copying oraenv to / usr/local/bin...
The file "coraenv" already exists in / usr/local/bin. Overwrite it? (YBO)
[n]: y
Copying coraenv to / usr/local/bin...
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.
To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:
/ 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
To configure Grid Infrastructure for a Cluster perform the following steps:
1. Provide values for Grid Infrastructure configuration parameters in the file-/ u01/app/11.2.0/grid/crs/install/crsconfig_params. For details on how to do this, see the installation guide.
2. Run the following command as the root user:
/ 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/rootcrs.pl
To update inventory properties for Grid Infrastructure, perform the following
Steps. If a pre-11.2 home is already configured, execute the following:
11.2_Home/oui/bin/runInstaller-updateNodeList-silent-local CRS=false ORACLE_HOME=pre-11.2_Home
Always execute the following to register the current home:
11.2_Home/oui/bin/runInstaller-updateNodeList-silent-local CRS=true ORACLE_HOME=11.2_Home.
If either home is shared, provide the additional argument-cfs.
[root@localhost] # / 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
2013-10-17 18:55:45: Checking for super user privileges
2013-10-17 18:55:45: User has super user privileges
2013-10-17 18:55: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 'grid', privgrp' oinstall'..
Operation successful.
CRS-4664: Node localhost successfully pinned.
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
Ohasd is starting
ADVM/ACFS is not supported on redhat-release-server-6Server-6.4.0.4.0.1.el6.x86_64
Localhost 2013-10-17 18:56:11 / u01/app/11.2.0/grid/cdata/localhost/backup_20131017_185611.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
[root@localhost ~] #
17.10. End Grid installation
11.2.0.3.0 root script
The new version will not be wrong.
[root@rhel6_lhr oraInventory] # / u01/app/grid/11.2.0/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= / u01/app/grid/11.2.0
Enter the full pathname of the local bin directory: [/ usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
Creating / etc/oratab file...
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 script.
Now product-specific root actions will be performed.
Using configuration parameter file: / u01/app/grid/11.2.0/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp' oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp' root'..
Operation successful.
CRS-4664: Node rhel6_lhr successfully pinned.
Adding Clusterware entries to upstart
Rhel6_lhr 2014-06-14 22:42:26 / u01/app/grid/11.2.0/cdata/rhel6_lhr/backup_20140614_224226.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
Using asmca to create disk groups
[grid@rhel6_lhr ~] $export DISPLAY=192.168.1.100:0.0
[grid@rhel6_lhr ~] $xhost +
Execute the asmca command as the grid user
Here, when creating a disk group using asmca, you need to start the ASM instance to configure it. We reported an error when we clicked yes:
Check the log to solve the problem, or use the command line to start the asm instance:
18.1.
SYS Password-sys
ASMSNMP Password-asmsnmp
18.2.
Step 1. Name the disk group
Step 2. Select redundancy mode
High: create three copies of each allocation unit (so at least three disks are required)
Normal: single mirror image (default)
External: no mirroring, assuming that there is an underlying LVM and that it is performing any RAID level it deems appropriate.
Step 3. Add disk mount location
Step 4. Enter disk mount location and name
18.3.
Here I only created two disks, one disk group, and did not create a FRA area. If you have created 3 or more disks, you can set aside some of them for later FRA use (what is FRA? Is the flashback zone).
18.4. Click Create ASM to create a Disk Group
If the following error is reported after clicking yes, the previous Oracle Grid Infrastructure is not configured properly and needs to be reconfigured:
After configuring Oracle Grid Infrastructure, click Create ASM again to create Disk Group
After a while (actually, it will take about 1 minute):
18.5. Disk Group creation is complete, exit.
Set up snooping using netmgr
After installing grid, grid is used to manage listening, so listening is also created under grid users. For more information on how to create listeners, please see the methods below under Oracle users.
Check whether the ASM is installed by crs_stat-t by the grid user, as shown below to set up the OK.
[grid@localhost] $crs_stat-t
Name Type Target State Host
-
Ora.DATA.dg ora....up.type ONLINE ONLINE localhost
Ora.asm ora.asm.type ONLINE ONLINE localhost
Ora.cssd ora.cssd.type ONLINE ONLINE localhost
Ora.diskmon ora....on.type ONLINE ONLINE localhost
[grid@localhost ~] $
[grid@rhel_linux_asm ~] $echo $ORACLE_SID
+ ASM
[grid@rhel_linux_asm ~] $sqlplus / as sysasm
SQL*Plus: Release 11.2.0.1.0 Production on Mon Apr 28 23:07:24 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL > startup
ASM instance started
Total System Global Area 283930624 bytes
Fixed Size 2212656 bytes
Variable Size 256552144 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL > select * from v$version
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production
PL/SQL Release 11.2.0.1.0-Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0-Production
NLSRTL Version 11.2.0.1.0-Production
SQL > select name,total_mb from v$asm_diskgroup
NAME TOTAL_MB
DATA 20480
SQL > select name,group_number,file_number,alias_index,alias_directory,system_created from v$asm_alias
Start building Oracle database
If the system has built the ORACLE database before, you don't have to build the database anymore, you just need to create a new instance.
20.1. Log in as an oracle user and upload the installation package to the Oracle home directory.
20.2. Decompress two compressed packages
[oracle@localhost ~] $ll linux*
-rw-r--r-- 1 oracle oinstall 1239269270 Apr 18 20:44 linux.x64_11gR2_database_1of2.zip
-rw-r--r-- 1 oracle oinstall 1111416131 Apr 18 20:47 linux.x64_11gR2_database_2of2.zip
[oracle@localhost] $unzip linux.x64_11gR2_database_1of2.zip & & unzip linux.x64_11gR2_database_2of2.zip
20.3. Execute runInstaller
[oracle@localhost ~] $/ home/oracle/database/runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 30971 MB Passed
Checking swap space: must be greater than 150 MB. Actual 4088 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from / tmp/OraInstall2013-10-170801-38PM. Please wait... [oracle@localhost ~] $
20.4.
20.5.
20.6.
20.7.
When you choose a character set here, you'd better install it in simplified Chinese, otherwise after installing OEM, there may be garbled codes in web browsing.
20.8.
20.9.
20.10.
20.11.
20.12.
20.13.
Installation time is long, please wait patiently.
Near the end of the installation, a pop-up window prompts you to execute a script as root.
[root@localhost ~] # / u01/app/oracle/product/11.2.0/dbhome_1/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/dbhome_1
Enter the full pathname of the local bin directory: [/ usr/local/bin]:
The file "dbhome" already exists in / usr/local/bin. Overwrite it? (YBO)
[n]: y
Copying dbhome to / usr/local/bin...
The file "oraenv" already exists in / usr/local/bin. Overwrite it? (YBO)
[n]: y
Copying oraenv to / usr/local/bin...
The file "coraenv" already exists in / usr/local/bin. Overwrite it? (YBO)
[n]: y
Copying coraenv to / usr/local/bin...
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.
Finished product-specific root actions.
[root@localhost ~] #
20.14. End installation
Check the group of the $ORACLE_HOME/bin/oracle file
This step is not necessary. If you can't select a disk group when creating a database using dbca later, come back and do it.
In RAC or ORACLE RESTART, the group of oracle executables is asmadmin.
[root@khm5 bin] # chown oracle:asmadmin oracle
[root@khm5 bin] # ls-l oracle
-rwxr-x--x 1 oracle asmadmin 232399473 Apr 19 07:04 oracle
[root@khm5 bin] # chmod + s oracle
[root@khm5 bin] # ls-l oracle
-rwsr-s--x 1 oracle asmadmin 232399473 Apr 19 07:04 oracle
Use netmgr to set up snooping-- Oracle users do not need to create
You need to configure the environment variables, otherwise the command will not be found.
This step is to create a listening file, copy it from other places, or create a new file yourself: / u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
[oracle@rhel_linux_asm grid] $netmgr
21.1.
21.2.
21.3.
21.4.
21.5.
21.6.
Click File-- > Save Network Configuration
Then exit, and after execution, there are files in the following path:
[oracle@rhel_linux_asm admin] $pwd
/ u01/app/oracle/product/11.2.0/dbhome_1/network/admin
[oracle@rhel_linux_asm admin] $ll
Total 8
Drwxr-xr-x. 2 oracle dba 4096 Apr 28 23:24 samples
-rw-r--r--. 1 oracle dba 187 May 7 2007 shrept.lst
[oracle@rhel_linux_asm admin] $netmgr
[oracle@rhel_linux_asm admin] $ll
Total 12
-rw-r--r--. 1 oracle dba 475 Apr 28 23:47 listener.ora
Drwxr-xr-x. 2 oracle dba 4096 Apr 28 23:24 samples
-rw-r--r--. 1 oracle dba 187 May 7 2007 shrept.lst
[oracle@rhel_linux_asm admin] $cat listener.ora
# listener.ora Network Configuration File: / u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orclasm)
(ORACLE_HOME = / u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = orclasm)
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = rhel_linux_asm) (PORT = 1521))
)
ADR_BASE_LISTENER = / u01/app/oracle
Create a database using dbca
Create a database by executing the dbca command as the oracle user:
27.2.
27.3.
27.4.
27.5.
27.6.
27.7.
27.8.
If the flashback area and archiving are enabled, select the fra disk group. If not, you can not select it.
27.9.
27.10.
27.11.
27.12.
27.13.
You can view the log during installation:
[root@rhel_linux_asm ~] # cd / u01/app/grid/cfgtoollogs/dbca/oralasm2/
[root@rhel_linux_asm oralasm2] # tail-f trace.log
.
Datafile
'+ DATA/oralasm2/datafile/system.256.845998107'
'+ DATA/oralasm2/datafile/sysaux.257.845998109'
'+ DATA/oralasm2/datafile/undotbs1.258.845998109'
'+ DATA/oralasm2/datafile/users.259.845998109'
[Thread-151] [2014-04-27 1515 purge 29,49.328 CST] [CloneDBCreationStep.executeImpl:419] Length of OriginalRedoLogsGrNames=3
[Thread-151] [2014-04-27 15 CloneDBCreationStep.executeImpl:427 29buret 49.330 CST] [CloneDBCreationStep.executeImpl:427] 0th redoLogText = GROUP 1 SIZE 51200K
[Thread-151] [2014-04-27 15 CloneDBCreationStep.executeImpl:427 29Jiang 49.331 CST] [CloneDBCreationStep.executeImpl:427] 1th redoLogText = GROUP 2 SIZE 51200K
[Thread-151] [2014-04-27 15 CloneDBCreationStep.executeImpl:427 29Jiang 49.331 CST] [CloneDBCreationStep.executeImpl:427] 2th redoLogText = GROUP 3 SIZE 51200K
[Thread-151] [2014-04-27 1515 createCTLSql=Create controlfile reuse set database 49.332 CST] [CloneDBCreationStep.executeImpl:448] "oralasm2"
MAXINSTANCES 8
MAXLOGHISTORY 1
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
Datafile
'+ DATA/oralasm2/datafile/system.256.845998107'
'+ DATA/oralasm2/datafile/sysaux.257.845998109'
'+ DATA/oralasm2/datafile/undotbs1.258.845998109'
'+ DATA/oralasm2/datafile/users.259.845998109'
LOGFILE GROUP 1 SIZE 51200K
GROUP 2 SIZE 51200K
GROUP 3 SIZE 51200K RESETLOGS
[Thread-151] [2014-04-27 15 CloneDBCreationStep.executeImpl:460 29buret 55.330 CST] [CloneDBCreationStep.executeImpl:460] calling zerodbid
[Thread-151] [2014-04-27 1515 purge 30purl 02.332 CST] [CloneDBCreationStep.executeImpl:470] Shutdown database
[Thread-151] [2014-04-27 1515 Startup 02.334 CST] [CloneDBCreationStep.executeImpl:492] .nomount.
[Thread-151] [2014-04-27 1515 CloneDBCreationStep.executeImpl:500 30group 04.131 CST] [CloneDBCreationStep.executeImpl:500] deleting dummy controlfile from v$controlfile: + DATA/oralasm2/controlfile/current.260.845998195
[Thread-151] [2014-04-27 1515 CloneDBCreationStep.executeImpl:511 3015 CST] [CloneDBCreationStep.executeImpl:511] Enabling restricted session.
[Thread-151] [2014-04-27 15 CloneDBCreationStep.executeImpl:513 30 alter database 11.028 CST] alter database "oralasm2" open resetlogs
[Thread-151] [2014-04-27 1515 virtual 30 CloneDBCreationStep.executeImpl:521 29.193 CST] [CloneDBCreationStep.executeImpl:521] Removing existing services from sourcedb seeddata
[Thread-151] [2014-04-27 1515 CloneDBCreationStep.executeImpl:526 3015 CST] [CloneDBCreationStep.executeImpl:526] Renaming globale_name
[Thread-151] [2014-04-27 1515 purge 30.163 CST] [CloneDBCreationStep.executeImpl:542] controlfile from v$controlfile: + DATA/oralasm2/controlfile/current.260.845998209
[Thread-151] [2014-04-27 15 controlfiles 30 CloneDBCreationStep.executeImpl:557 30.164 CST] ("+ DATA/oralasm2/controlfile/current.260.845998209")
[Thread-151] [2014-04-27 15 CloneDBCreationStep.executeImpl:601 30 CloneDBCreationStep.executeImpl:601] Temp file to be added:=+DATA/ {DB_UNIQUE_NAME} / temp01.dbf
[Thread-151] [2014-04-27 1515 CloneDBCreationStep.executeImpl:602 30.187 CST] [CloneDBCreationStep.executeImpl:602] Temp file size in KB:=20480
[Thread-151] [2014-04-27 15 CloneDBCreationStep.executeImpl:632 30 CloneDBCreationStep.executeImpl:632 31.603 CST] [CloneDBCreationStep.executeImpl:632] Establish USERS as the default permanent tablespace of the database
[Thread-151] [2014-04-27 1515 purge 31.704 CST] [TemplateManager.isInstallTemplate:2300] Selected Template by user:=General Purpose
[Thread-151] [2014-04-27 1515 purge 31.704 CST] [TemplateManager.isInstallTemplate:2307] The Message Id to be searched:=GENERAL_PURPOSE
.
27.14.
At this point, the Oracle Database 11g environment based on ASM has been built.
Turn off the firewall-otherwise the client may not be able to connect
Service iptables stop
[root@rhel6_lhr ~] # service iptables stop
Iptables: Setting chains to policy ACCEPT: filter [OK]
Iptables: Flushing firewall rules: [OK]
Iptables: Unloading modules: [OK]
[root@rhel6_lhr ~] #
Whether there is tnsnames.ora generation
Check whether there is tnsnames.ora under / u01/app/oracle/product/11.2.0/dbhome_1/network/, and if not, generate it as a file:
/ u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
Orclasm =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.128.134) (PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orclasm)
)
)
Configure ORACLE to start automatically
If you don't need the system to start automatically, you don't have to configure it.
Edit / etc/oratab
[oracle@dbserver1 ~] $vi / etc/oratab
Orcl:/u01/app/oracle/product/11.2.0/db_1:Y
ROOT user creation / etc/init.d/dbora
[root@dbserver1 ~] # cat / etc/init.d/dbora
#! / bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
# ORA_HOME=/u01/app/oracle/product/10.2.0/db_1
# ORA_HOME=/u01/app/oracle/product/11.1.0/db_1
ORA_HOME=/u01/app/oracle/product/11.2.0/db_1
ORA_OWNER=oracle
If [!-f $ORA_HOME/bin/dbstart]
Then
Echo "Oracle startup: cannot start"
Exit
Fi
Case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
Su-$ORA_OWNER-c "$ORA_HOME/bin/dbstart $ORA_HOME"
Touch / var/lock/subsys/dbora
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
Su-$ORA_OWNER-c "$ORA_HOME/bin/dbshut $ORA_HOME"
Rm-f / var/lock/subsys/dbora
Esac
Add startup item
[root@dbserver1 ~] # chmod 750 / etc/init.d/dbora
[root@dbserver1] # chkconfig-- add dbora
Verification
[oracle@localhost ~] $sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Oct 17 21:37:22 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
And Real Application Testing options
SQL > select * from v$version
BANNER
-
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production
PL/SQL Release 11.2.0.1.0-Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0-Production
NLSRTL Version 11.2.0.1.0-Production
SQL > select file_name from dba_data_files
FILE_NAME
-
+ DATA/orcl/datafile/users.259.829084507
+ DATA/orcl/datafile/undotbs1.258.829084505
+ DATA/orcl/datafile/sysaux.257.829084505
+ DATA/orcl/datafile/system.256.829084505
+ DATA/orcl/datafile/example.265.829084649
SQL > select name,total_mb,state from v$asm_diskgroup
Select name,group_number,file_number,alias_index,alias_directory,system_created from v$asm_alias
# su-grid$ crsctl check has$ crsctl check css$ crsctl check evm$ crs_stat-t-v$ ocrcheck
# su-oracle$ sqlplus / as sysdbaSQL > select name from v$datafile 2 union all 3 select name from v$controlfile 4 union all 5 select member from v$logfile
Check the status of the high availability server [grid@restart ~] $crsctl check hasCRS-4638: Oracle High Availability Services is online [grid@restart ~] $crsctl check cssCRS-4529: Cluster Synchronization Services is online [grid@restart ~] $crsctl check evmCRS-4533: Event Manager is online
[grid@restart] $crs_stat-tName Type Target State Host-ora.CRS.dg ora... .up.type ONLINE ONLINE restart ora... .ER.lsnr ora... .er.type ONLINE ONLINE restart ora.asm ora.asm.type ONLINE ONLINE restart ora.cssd ora.cssd.type ONLINE ONLINE restart ora.diskmon ora... .on.type OFFLINE OFFLINE ora.evmd ora.evm.type ONLINE ONLINE restart ora.ons ora.ons.type OFFLINE OFFLINE
[grid@restart ~] $ps-ef | grep asmgrid 16058 10 19:56? 00:00:00 asm_pmon_+ASMgrid 16060 10 19:56? 00:00:00 asm_psp0_+ASMgrid 16062 10 19:56? 00:00:00 asm_vktm_+ASMgrid 16066 10 19:56? 00:00:00 asm_gen0_+ASMgrid 16068 10 19:56? 00:00:00 asm_diag_+ASMgrid 16070 10 19:56? 00:00:00 asm_dia0_+ASMgrid 16072 10 19: 56? 00:00:00 asm_mman_+ASMgrid 16074 1 0 19:56? 00:00:00 asm_dbw0_+ASMgrid 16076 1 0 19:56? 00:00:00 asm_lgwr_+ASMgrid 16078 1 0 19:56? 00:00:00 asm_ckpt_+ASMgrid 16080 1 0 19:56? 00:00:00 asm_smon_+ASMgrid 16082 1 0 19:56? 00:00:00 asm_rbal_+ASMgrid 16084 1 0 19:56? 00:00:00 asm_gmon_+ASMgrid 16086 1 0 19:56 ? 00:00:00 asm_mmon_+ASMgrid 16088 1 0 19:56? 00:00:00 asm_mmnl_+ASMgrid 16188 16152 0 19:59 pts/1 00:00:00 grep asm
# cat / etc/oracle/ocr.lococrconfig_loc=/u01/app/11.2.0/grid/cdata/localhost/local.ocrlocal_only=TRUE
# / u01/app/11.2.0/grid/bin/ocrcheckStatus of Oracle Cluster Registry is as follows: Version: 3 Total space (kbytes): 262120 Used space (kbytes): 152 Available space (kbytes): 261968 ID: 1179492779 Device/File Name: / u01/app/11.2.0/grid/cdata/localhost/local.ocr Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check succeeded
[grid@restart] $crs_stat-t-vName Type R/RA F/FT Target State Host-ora.ARCH.dg ora... .up.type 0amp 5 0 / ONLINE ONLINE restart ora.CRS.dg ora... .up.type 0amp 5 0 / ONLINE ONLINE restart ora.DATA.dg ora... .up.type 0amp 5 0 / ONLINE ONLINE restart ora... .ER.lsnr ora... .er.type 0 ONLINE ONLINE restart ora.asm ora.asm.type 5 0 / ONLINE ONLINE restart ora.cssd ora.cssd.type 0 ONLINE ONLINE restart ora.cssd ora.cssd.type 5 0 ONLINE ONLINE restart ora.diskmon ora 5. .on.type 0 ONLINE ONLINE restart ora.ons ora.ons.type 10 0 OFFLINE OFFLINE ora.evmd ora.evm.type 0 ONLINE ONLINE restart ora.ons ora.ons.type 10 0 / OFFLINE OFFLINE ora.restart.db ora... .se.type 0/2 0/1 ONLINE ONLINE restart
SQL > select name from v$datafile 2 union all 3 select name from v$controlfile 4 union all 5 select member from v$logfile
NAME--+DATA/restart/datafile/system.260.790288571+DATA/restart/datafile/sysaux.261.790288633+DATA/restart/datafile/undotbs1.262.790288683+DATA/restart/datafile/users.264.790288715+DATA/restart/controlfile/current.256.790288547+DATA/restart/onlinelog/group_1.257.790288549+DATA/restart/onlinelog/group_2.258.790288555+DATA/restart/onlinelog/group_3.259.790288561
8 rows selected.
SQL > SQL > archive log listDatabase log mode No Archive ModeAutomatic archival DisabledArchive destination / u01/app/oracle/product/11.2.0/dbhome_1/dbs/archOldest online log sequence 36Current log sequence 38
It is not running in archive mode. Now open it manually.
SQL > create pfile='/u01/pfile-0802.bak' from spfile
File created.
SQL > alter system set log_archive_dest_1='LOCATION=+ARCH'
System altered.
SQL > shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.
SQL > startup mountORACLE instance started.
Total System Global Area 839282688 bytesFixed Size 2233000 bytesVariable Size 528485720 bytesDatabase Buffers 306184192 bytesRedo Buffers 2379776 bytesDatabase mounted.
SQL > alter database archivelog
Database altered.
SQL > alter database open
Database altered.
SQL > archive log list;Database log mode Archive ModeAutomatic archival EnabledArchive destination + ARCHOldest online log sequence 36Next log sequence to archive 38Current log sequence 38
SQL > select name from v$archived_log
No rows selected
SQL > alter system switch logfile
System altered.
SQL > select name from v$archived_log
NAME--+ARCH/restart/archivelog/2012_08_02/thread_1_seq_38.256.790292467
Take monitoring as an example, start the test with srvctl shutdown: [grid@restart ~] $srvctl status listenerListener LISTENER is enabledListener LISTENER is running on node (s): restart [grid@restart ~] $srvctl stop listener [grid@restart ~] $srvctl status listenerListener LISTENER is enabledListener LISTENER is not running
[grid@restart] $srvctl start listener [grid@restart] $crs_stat-t-vName Type R/RA F/FT Target State Host-ora.ARCH.dg ora... .up.type 0amp 5 0 / ONLINE ONLINE restart ora.CRS.dg ora... .up.type 0amp 5 0 / ONLINE ONLINE restart ora.DATA.dg ora... .up.type 0amp 5 0 / ONLINE ONLINE restart ora... .ER.lsnr ora... .er.type 0 ONLINE ONLINE restart ora.asm ora.asm.type 5 0 / ONLINE ONLINE restart ora.cssd ora.cssd.type 0 ONLINE ONLINE restart ora.cssd ora.cssd.type 5 0 ONLINE ONLINE restart ora.diskmon ora 5. .on.type 0 ONLINE ONLINE restart ora.ons ora.ons.type 10 0 OFFLINE OFFLINE ora.evmd ora.evm.type 0 ONLINE ONLINE restart ora.ons ora.ons.type 10 0 / OFFLINE OFFLINE ora.restart.db ora... .se.type 0/2 0/1 ONLINE ONLINE restart
Then test the kill snooping process to see if it starts automatically.
[grid@restart ~] $ps-ef | grep lsnrgrid 28139 1 0 21:43? 00:00:00 / u01/app/11.2.0/grid/bin/tnslsnr LISTENER-inheritgrid 28325 28251 0 21:46 pts/1 00:00:00 grep lsnr
[grid@restart] $kill-9 28139
He will get up after a few seconds, because there is a period of time to monitor the progress.
[grid@restart ~] $ps-ef | grep lsnrgrid 28455 1 0 21:47? 00:00:00 / u01/app/11.2.0/grid/bin/tnslsnr LISTENER-inheritgrid 28469 28251 0 21:47 pts/1 00:00:00 grep lsnr
OK, finally test the hard restart to see if ORACLE can automatically start # reboot.
Wait a moment after the system is up: [root@restart bin] #. / crs_stat-tName Type Target State Host-ora.ARCH.dg ora... .up.type ONLINE ONLINE restart ora.CRS.dg ora... .up.type ONLINE ONLINE restart ora.DATA.dg ora... .up.type ONLINE ONLINE restart ora... .ER.lsnr ora... .er.type ONLINE ONLINE restart ora.asm ora.asm.type ONLINE ONLINE restart ora.cssd ora.cssd.type ONLINE ONLINE restart ora.diskmon ora... .on.type OFFLINE OFFLINE ora.evmd ora.evm.type ONLINE ONLINE restart ora.ons ora.ons.type OFFLINE OFFLINE ora.restart.db ora... .se.type ONLINE ONLINE restart
Start crs
[root@b1 install] # / u01/app/grid/11.2.0/crs/install/roothas.pl-deconfig-force-verbose
[root@b1 grid] # / u01/app/grid/11.2.0/root.sh
-simultaneous execution
/ u01/app/grid/11.2.0/perl/bin/perl-I/u01/app/grid/11.2.0/perl/lib-I/u01/app/grid/11.2.0/crs/install / u01/app/grid/11.2.0/crs/install/roothas.pl
/ bin/dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1
-start under grid user
Crs_start-all
Crs_start-t
Crsctl check css
Crsctl check has
Some error reporting solutions: Oracle 11gR2 RAC ohasd failed to start solution
CRS-4124: Oracle High Availability Services startup failed.
CRS-4000: Command Start failed, or completed with errors.
Ohasd failed to start: Inappropriate ioctl for device
Ohasd failed to start at/u01/app/11.2.0/grid/crs/install/rootcrs.pl line 443.
I encountered this classic problem of 11.0.2.1 when I installed 11gR2 RAC for the first time. I found out that it was a bug after looking it up on the Internet, and the solution was very simple.
Is to execute the following command before executing root.sh
/ bin/dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1
If it appears
/ bin/dd: opening` / var/tmp/.oracle/npohasd': No such file or directory
Continue to execute the file before it is generated, until it can be executed, and usually execute the dd command when the message Adding daemon to inittab appears.
Another solution is to change file permissions.
Chown root:oinstall / var/tmp/.oracle/npohasd
Don't forget to delete the configuration before re-executing root.sh: / u01/app/11.2.0/grid/crs/install/roothas.pl-deconfig-force-verbose
CRS-4639: Could not contact Oracle High Availability Services
The following error is reported when starting the asm instance:
[grid@b1 ~] $sqlplus / as sysasm
SQL*Plus: Release 11.2.0.1.0 Production on Thu Sep 12 18:14:13 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL > startupORA-01078: failure in processing system parametersORA-29701: unable to connect to Cluster Synchronization Service
Then the following error is reported when checking with crsctl check css:
[grid@b1] $crsctl check cssCRS-4639: Could not contact Oracle High Availability ServicesCRS-4000: Command Check failed, or completed with errors.
The process of resolving CRS-4639: Could not contact Oracle High Availability Services is as follows:
[root@b1 grid] # cd / u01/app/11.2.0/grid/crs/install [root@b1 install] #. / roothas.pl-deconfig-force-verbose2013-09-12 19:25:05: Checking for super user privileges2013-09-12 19:25:05: User has super user privileges2013-09-12 19:25:05: Parsing the host nameUsing configuration parameter file:. / crsconfig_paramsCRS-4639: Could not contact Oracle High Availability ServicesCRS-4000: Command Stop failed Or completed with errors.CRS-4639: Could not contact Oracle High Availability ServicesCRS-4000: Command Delete failed, or completed with errors.Failure at scls_scr_getval with code 1Internal Error Information: Category:-2 Operation: opendir Location: scrsearch2 Other: cant open scr home dir scls_scr_getval System Dependent Information: 2
CRS-4544: Unable to connect to OHASCRS-4000: Command Stop failed, or completed with errors.ACFS-9200: SupportedSuccessfully deconfigured Oracle Restart stack
[root@b1 install] # cd / u01/app/11.2.0/grid/ [root@b1 grid] #. / root.shRunning Oracle 11g root.sh script...
The following environment variables are set as: ORACLE_OWNER= grid ORACLE_HOME= / u01/app/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? [n]: y Copying dbhome to / usr/local/bin... The file "oraenv" already exists in / usr/local/bin. Overwrite it? [n]: y Copying oraenv to / usr/local/bin... The file "coraenv" already exists in / usr/local/bin. Overwrite it? (YBO) [n]: y Copying coraenv to / usr/local/bin...
Entries will be added to the / etc/oratab file as needed byDatabase Configuration Assistant when a database is createdFinished running generic part of root.sh script.Now product-specific root actions will be performed.2013-09-12 19:27:31: Checking for super user privileges2013-09-12 19:27:31: User has super user privileges2013-09-12 19:27:31: Parsing the host nameUsing configuration parameter file: / u01/app/11.2.0/grid/crs/install/crsconfig_paramsLOCAL ADD MODE Creating OCR keys for user 'grid' Privgrp 'oinstall'..Operation successful.CRS-4664: Node b1 successfully pinned.Adding daemon to inittabCRS-4123: Oracle High Availability Services has been started.ohasd is starting
B1 2013-09-12 19:29:12 / u01/app/11.2.0/grid/cdata/b1/backup_20130912_192912.olrSuccessfully configured Oracle Grid Infrastructure for a Standalone ServerUpdating inventory properties for clusterwareStarting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 4094 MB PassedThe inventory pointer is located at / etc/oraInst.locThe inventory is located at / u01 was successful.
[grid@b1 ~] $crs_stat-tName Type Target State Host-- ora.cssd ora.cssd.type OFFLINE OFFLINE ora.diskmon ora....on.type OFFLINE OFFLINE [grid@b1 ~] $crs_start-allAttempting to start `ora.diskmon` on member `b1`Attempting to Start `ora.cssd` on member `b1`Start of `ora.diskmon` on member `b1` succeeded.Start of `ora.cssd` on member `b1` succeeded.
[grid@b1 ~] $sqlplus / as sysasm
SQL*Plus: Release 11.2.0.1.0 Production on Thu Sep 12 19:34:50 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL > startupASM instance started
Total System Global Area 283930624 bytesFixed Size 2212656 bytesVariable Size 256552144 bytesASM Cache 25165824 bytesASM diskgroups mountedASM diskgroups volume enabled
ORA-29701: unable to connect to Cluster Synchronization Service
[grid@vm11gr2] / home/grid > sqlplus "/ as sysasm" SQL*Plus: Release 11.2.0.1.0 Production on Sun Oct 25 10:16:21 2009 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to an idle instance. SQL > startup ORA-01078: failure in processing system parametersORA-29701: unable to connect to Cluster Synchronization Service SQL > cannot connect to the CSS service. Check [grid@vm11gr2] / home/grid > crsctl check css CRS-4530: Communications failure contacting Cluster Synchronization Services daemon [grid@vm11gr2] / home/grid > [grid@vm11gr2] / home/grid > ps-ef on the operating system | sure enough, grep cssd does not have CSS service daemon process. Take another look at the status of HAS (High Availability Service) [grid@vm11gr2] / home/grid > crsctl check has CRS-4638: Oracle High Availability Services is online [grid@vm11gr2] / home/grid > ps-ef | grep d.bin grid 5886 10 10:06 / 00:00:01 / u01/app/grid/product/11.2/grid/bin/ohasd.bin reboot [grid@vm11gr2] / home/grid > found that HAS services are indeed started, while ora.cssd and ora.diskmon services are maintained by HAS. Further check the status of each resource [grid@vm11gr2] / home/grid > crs_stat-t Name Type Target State Host-ora.FLASH_DATA.dg ora.diskgroup.type OFFLINE OFFLINE vm11gr2 ora.SYS_DATA.dg ora.diskgroup. Type OFFLINE OFFLINE vm11gr2 ora.asm ora.asm.type OFFLINE OFFLINE vm11gr2 ora.cssd ora.cssd.type OFFLINE OFFLINE vm11gr2 ora.diskmon ora.diskmon.type OFFLINE OFFLINE vm11gr2 [grid@vm11gr2] / home/grid > [grid@vm11gr2] / home/grid > crsctl status resource-t-- -NAME TARGET STATE SERVER STATE_ DETAILS-Local Resources- -ora.FLASH_DATA.dg OFFLINE OFFLINE vm11gr2 ora.SYS_DATA.dg OFFLINE OFFLINE vm11gr2 ora.asm OFFLINE OFFLINE vm11gr2 -Cluster Resources -ora.cssd 1 OFFLINE OFFLINE ora.diskmon 1 OFFLINE OFFLINE take a look at the properties of ora.cssd and ora.diskmon [grid@vm11gr2] / home/grid > crs_stat-p ora.cssd NAME=ora.cssd TYPE=ora.cssd.type ACTION_SCRIPT= ACTIVE_PLACEMENT=0AUTO_START=never CHECK_INTERVAL=30 DESCRIPTION= "Resource type for CSSD" FAILOVER_DELAY=0 FAILURE_INTERVAL=3 FAILURE_THRESHOLD=5 HOSTING_MEMBERS= PLACEMENT=balanced RESTART_ATTEMPTS=5 SCRIPT_TIMEOUT=600 START_TIMEOUT=600 STOP_TIMEOUT=900 UPTIME_THRESHOLD=1m [grid @ vm11gr2] / home/grid > crs_stat-p ora.diskmon NAME=ora.diskmon TYPE=ora.diskmon.type ACTION_SCRIPT= ACTIVE_PLACEMENT=0AUTO_START=never CHECK_INTERVAL=20 DESCRIPTION= "Resource type for Diskmon" FAILOVER_DELAY=0 FAILURE_INTERVAL=3 FAILURE_THRESHOLD=5 HOSTING_MEMBERS= PLACEMENT=balanced RESTART_ATTEMPTS=10 SCRIPT_TIMEOUT=60 START_TIMEOUT=60 STOP_TIMEOUT=60 UPTIME_THRESHOLD=5s [grid@vm11gr2] / home/grid > basically found the reason here You can see that the AUTO_START property of both resources is set to never by default, which means that they do not start automatically when the HAS service starts, although the HAS service starts automatically by default. Okay, Let's start it manually: [grid@vm11gr2] / home/grid > crsctl start resource ora.cssd CRS-2672: Attempting to start 'ora.cssd' on' vm11gr2' CRS-2679: Attempting to clean' ora.diskmon' on' vm11gr2' CRS-2681: Clean of 'ora.diskmon' on' vm11gr2' succeeded CRS-2672: Attempting to start' ora.diskmon' on' vm11gr2' CRS-2676: Start of 'ora.diskmon' on' vm11gr2' succeeded CRS-2676: Start of' ora.cssd' On 'vm11gr2' succeeded [grid@vm11gr2] / home/grid > Note: ora.cssd and ora.diskmon are dependent services. Starting either will get both of them up. [grid@vm11gr2] / home/grid > crs_stat-t Name Type Target State Host-ora.FLASH_DATA.dg ora.diskgroup.type OFFLINE OFFLINE vm11gr2 ora.SYS_DATA.dg ora.diskgroup.type OFFLINE OFFLINE vm11gr2 ora.asm ora.asm.type OFFLINE OFFLINE vm11gr2 ora.cssd ora.cssd.type ONLINE ONLINE vm11gr2 ora.diskmon ora.diskmon.type ONLINE ONLINE vm11gr2 [grid@vm11gr2] / home/grid > CSS service is up Restart asm instance [grid@vm11gr2] / home/grid > sqlplus "/ as sysasm" SQL*Plus: Release 11.2.0.1.0 Production on Sun Oct 25 10:30:03 2009 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to an idle instance. SQL > startup ASM instance started Total System Global Area 284565504 bytes Fixed Size 1336036 bytes Variable Size 258063644 bytes ASM Cache 25165824 bytes ASM diskgroups mounted SQL > exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production With the Automatic Storage Management option [grid@vm11gr2] / home/grid > crs_stat-t Name Type Target State Host-- -ora.FLASH_DATA.dg ora.diskgroup.type ONLINE ONLINE vm11gr2 ora.SYS_DATA.dg ora.diskgroup.type ONLINE ONLINE vm11gr2 ora.asm ora.asm.type ONLINE ONLINE vm11gr2 ora.cssd ora.cssd.type ONLINE ONLINE vm11gr2 ora.diskmon ora.diskmon.type ONLINE ONLINE vm11gr2 [grid@vm11gr2] / home/grid > tips 1) HAS (High Availability Service) is started automatically by default. You can cancel and enable automatic startup of crsctl disable has crsctl enable has 2) HAS manually start and stop crsctl start has crsctl stop has 3) View the status of HAS crsctl check has 4) if you want ora.css and ora.diskmon services to start automatically with the start of HAS So you can crsctl modify resource "ora.cssd"-attr "AUTO_START=1" or crsctl modify resource "ora.diskmon"-attr "AUTO_START=1" 5) if you want to cancel the Auto start crsctl modify resource "ora.cssd"-attr "AUTO_START=never" crsctl modify resource "ora.diskmon"-attr "AUTO_START=never" of ora.css and ora.diskmon.
Asm instance failed to load diskgroups,ORA-15110: no diskgroups mounted
Today, the grid of oracle11g R2 is installed. After installation, it is found that diskgroups cannot be loaded. The error is as follows:
SQL > startupORA-00099: warning: no parameter file specified for ASM instanceASM instance started
Total System Global Area 283930624 bytesFixed Size 2225792 bytesVariable Size 256539008 bytesASM Cache 25165824 bytesORA-15110: no diskgroups mounted
The main results are as follows: (1) the analysis thinks that it is caused by ORA-00099 and cannot find diskgroup.
(2) the configuration format of asm parameter file obtained by searching on the Internet is as follows:
Asm_diskstring='/dev/oracleasm/disks/DISK*'
Asm_diskgroups='DATA'asm_power_limit=1diagnostic_dest='/opt/oracle'instance_type='asm'large_pool_size=12Mremote_login_passwordfile='EXCLUSIVE'
Generate file: $ORACLE_HOME/dbs/init+ASM.ora
Note that the asm_diskstring must contain "*" to load correctly, otherwise the following error will be reported
SQL > startupASM instance started
Total System Global Area 283930624 bytesFixed Size 2225792 bytesVariable Size 256539008 bytesASM Cache 25165824 bytesORA-15032: not all alterations performedORA-15017: diskgroup "DATA" cannot be mountedORA-15063: ASM discovered an insufficient number of disks for diskgroup "DATA"
(3) Save settings to spfile
SQL > create spfile from pfile;create spfile from pfile*ERROR at line 1:ORA-29786: SIHA attribute GET failed with error [Attribute 'SPFILE' sts] lsts [0]]
The reason for this problem is that ORACLE believes that the ASM instance is created manually and does not register this resource, so first add ASM resources
You need to register asm with the following command, executed under the grid user:
Srvctl add asm-l LISTENER-d'/ dev/oracleasm/disks/DISK*'
Then re-execute the command:
SQL > create spfile from pfile
File created.
(4) restart after shutting down the asm instance, and load successfully:
SQL > startupASM instance started
Total System Global Area 283930624 bytesFixed Size 2225792 bytesVariable Size 256539008 bytesASM Cache 25165824 bytesASM diskgroups mountedASM diskgroups volume enabled
Wrong ORA-27154 ORA-27300 ORA-27301 ORA-27302 in starting DB Times
Wrong ORA-27154 ORA-27300 ORA-27301 ORA-27302 in starting DB Times
This error is a problem with kernel parameter setting, and the test process is as follows. [oracle@gtlions] $sqlplus "/ as sysdba" SQL*Plus: Release 10.2.0.5.0-Production on Sat Feb 4 23:47:02 2012Copyright (c) 1982, 2010, Oracle. All Rights Reserved.Connected to an idle instance.SQL > startupORA-27154: post/wait create failedORA-27300: OS system dependent operation:semget failed with status: 28ORA-27301: OS failure message: No space left on deviceORA-27302: failure occurred at: sskgpsemsperSQL >
[root@gtlions] # / sbin/sysctl-pnet.ipv4.ip_forward = 0net.ipv4.conf.default.rp_filter = 2net.ipv4.conf.default.accept_source_route = 0kernel.sysrq = 0kernel.core_uses_pid = 1net.ipv4.tcp_syncookies = 1kernel.msgmnb = 65536kernel.msgmax = 65536kernel.shmmax = 4294967295kernel.shmall = 268435456fs.aio-max-nr = 1048576fs.file-max = 6815744net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net. Core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048586kernel.sem = 25032000100128 note that the last parameter above, kernel.sem = 25032000100128, seems normal. Actually, there is a problem. I tested the OK after changing it to the following normal value. [root@gtlions ~] # vi / etc/sysctl.conf [root@gtlions ~] # / sbin/sysctl-pnet.ipv4.ip_forward = 0net.ipv4.conf.default.rp_filter = 2net.ipv4.conf.default.accept_source_route = 0kernel.sysrq = 0kernel.core_uses_pid = 1net.ipv4.tcp_syncookies = 1kernel.msgmnb = 65536kernel.msgmax = 65536kernel.shmmax = 4294967295kernel.shmall = 268435456fs.aio-max-nr = 1048576fs.file marked with a space between it -max = 6815744net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048586kernel.sem = 25032000 100128 [root@gtlions] # to see if the database can be started normally. [oracle@gtlions] $sqlplus "/ as sysdba" SQL*Plus: Release 10.2.0.5.0-Production on Sun Feb 5 00:00:39 2012Copyright (c) 1982, 2010, Oracle. All Rights Reserved.Connected to an idle instance.SQL > startupORACLE instance started.Total System Global Area 167772160 bytesFixed Size 1272600 bytesVariable Size 62915816 bytesDatabase Buffers 100663296 bytesRedo Buffers 2920448 bytesDatabase mounted.Database opened.SQL >
ORA-29786: SIHA attribute GET failed
Normal 0 7.8 lb 0 2 false false false EN-US ZH-CN X-NONE
ORA-29786: SIHA attribute GET failed with error [Attribute 'ASM_DISKSTRING' sts] lsts [0]]
If you use an asm instance created by asmca, asm will automatically register to crs. Manual creation of asm instance requires registration.
[10:18:03 oracle (grid) @ test ~] $sql
SQL*Plus: Release 11.2.0.3.0 Production on Tue Sep 10 10:18:04 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production
With the Automatic Storage Management option
10:18:05 idle > show parameter name
NAME TYPE VALUE
-
Db_unique_name string + ASM
Instance_name string + ASM
Lock_name_space string
Service_names string + ASM
10:18:14 idle > create spfile from pfile
Create spfile from pfile
*
ERROR at line 1:
ORA-29786: SIHA attribute GET failed with error [Attribute 'SPFILE' sts] lsts [0]]
Elapsed: 00:00:00.17
10:19:06 idle > exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production
With the Automatic Storage Management option
[10:19:12 oracle (grid) @ test ~] $srvctl add asm-l LISTENER-p / oracle/product/11.2.0/grid/dbs/init+ASM.ora-d 'ASMDISK*'
PRCR-1001: Resource ora.LISTENER.lsnr does not exist
[10:20:19 oracle (grid) @ rmdgl ~] $crs_stat-t
Name Type Target State Host
Ora.cssd ora.cssd.type ONLINE ONLINE rmdgl
Ora.diskmon ora....on.type OFFLINE OFFLINE
Ora.evmd ora.evm.type ONLINE ONLINE rmdgl
Ora.ons ora.ons.type OFFLINE OFFLINE
[10:20:35 oracle (grid) @ test~] $srvctl add asm-p / u01/app/11.2.0/grid/dbs/spfile+ASM.ora-d 'ASMDISK*'
[10:20:56 oracle (grid) @ rmdgl ~] $crs_stat-t
Name Type Target State Host
Ora.asm ora.asm.type OFFLINE OFFLINE
Ora.cssd ora.cssd.type ONLINE ONLINE rmdgl
Ora.diskmon ora....on.type OFFLINE OFFLINE
Ora.evmd ora.evm.type ONLINE ONLINE rmdgl
Ora.ons ora.ons.type OFFLINE OFFLINE
[10:20:58 oracle (grid) @ test ~] $cd / u01/app/11.2.0/grid/dbs/
[10:21:21 oracle (grid) @ test dbs] $ll
Total 20
-rw-rw---- 1 oracle oinstall 1257 Sep 5 02:34 ab_+ASM.dat
-rw-rw---- 1 oracle oinstall 1544 Sep 5 02:34 hc_+ASM.dat
-rw-r- 1 oracle oinstall 169 Aug 30 13:49 init+ASM.ora
-rw-r--r-- 1 oracle oinstall 2851 May 15 2009 init.ora
-rw-r- 1 oracle oinstall 2560 Aug 30 13:50 orapw+ASM
[10:21:22 oracle (grid) @ test dbs] $crs_stat-t
Name Type Target State Host
Ora.asm ora.asm.type OFFLINE OFFLINE
Ora.cssd ora.cssd.type ONLINE ONLINE rmdgl
Ora.diskmon ora....on.type OFFLINE OFFLINE
Ora.evmd ora.evm.type ONLINE ONLINE rmdgl
Ora.ons ora.ons.type OFFLINE OFFLINE
[10:21:40 oracle (grid) @ rmdgl dbs] $crs_stat-t
Name Type Target State Host
Ora.asm ora.asm.type OFFLINE OFFLINE
Ora.cssd ora.cssd.type ONLINE ONLINE rmdgl
Ora.diskmon ora....on.type OFFLINE OFFLINE
Ora.evmd ora.evm.type ONLINE ONLINE rmdgl
Ora.ons ora.ons.type OFFLINE OFFLINE
[10:23:16 oracle (grid) @ rmdgl dbs] $srvctl start asm
[10:23:20 oracle (grid) @ rmdgl dbs] $crs_stat-t
Name Type Target State Host
Ora.asm ora.asm.type ONLINE ONLINE rmdgl
Ora.cssd ora.cssd.type ONLINE ONLINE rmdgl
Ora.diskmon ora....on.type OFFLINE OFFLINE
Ora.evmd ora.evm.type ONLINE ONLINE rmdgl
Ora.ons ora.ons.type OFFLINE OFFLINE
[11:13:50 oracle (grid) @ test dbs] $sql
SQL*Plus: Release 11.2.0.3.0 Production on Tue Sep 10 11:14:39 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production
With the Automatic Storage Management option
11:14:39 idle > create spfile from pfile
File created.
Elapsed: 00:00:00.24
Elapsed: 00:00:00.26
11gR2 manual creation of ASM instance ORA-29786 error solution
Starting with 11gR2, both the graphical installation of Grid Infrastructure and the creation of ASM instances using the ASMCA tool force the use of disk groups as the storage method for ASM instance parameter files. If you want to store the ASM parameter file on the local disk file system, you can only create an ASM instance manually. Manually create an ASM instance and receive the following error when performing CRETAE SPFILE FROM PFILE to convert PFILE to SPFILE: SQL > create spfile from pfile
Create spfile from pfile
*
ERROR at line 1:
ORA-29786: SIHA attribute GET failed with error [Attribute 'SPFILE' sts]
Lsts [0]] here is the solution for METALINK: ORA-29786: SIHA attribute GET failed with Error If 11gR2 ASM instance is created manually [ID 976075.1] Modification time: 2011-8-11 Type: PROBLEM status: PUBLISHED priority: 3
In this Document Symptoms Changes Cause Solution
Symptoms
After creating an initial parameter file init+ASM.ora manually and starting an ASM instance, certain ASM commands fails with ORA-29786 in sqlplus:
Sqlplus / as sysasmSQL > create spfile='$ORACLE_HOME/spfile+ASM.ora' from pfile='$ORACLE_HOME/dbs/init+ASM.ora';create spfile='$ORACLE_HOME/spfile+ASM.ora' from pfile='$ORACLE_HOME/dbs/init+ASM.ora'*ERROR at line 1:ORA-29786: SIHA attribute GET failed with error [Attribute 'SPFILE' sts] lsts [0]]
SQL > create diskgroup dg1 normal redundancy disk'/ opt/oracle/oradata/nobilldb/DG1_dev0' disk'/ opt/oracle/oradata/nobilldb/DG1_dev1';Diskgroup created.SQL > drop diskgroup dg1;drop diskgroup dg1*ERROR at line 1:ORA-15039: diskgroup not droppedORA-29786: SIHA attribute GET failed with error [Attribute 'SPFILE' sts [200] lsts [0]]
Better option to create ASM instance is to run asmca in GUI/Silent mode.
Changes
Starting with 11gR2, ASM instance is a resoure in CRS repository also in single instance installations. Hence, it must be registered to OCR before doing certain operations like create/drop diskgroup, create pfile/spfile, etc.
Cause
ASM instance is created and started manually but it is not registered to cluster repository.
Solution
If ASM instance is created manually, add ASM instance to CRS repository with srvctl add asm:
Srvctl add asm-l LISTENER-p / oracle/product/11.2.0/grid/dbs/init+ASM.ora-d'/ dev/sdc*'srvctl add asm-h-- will give the options
As prompted by the article, execute the following command: # pwd
/ u01/app/11.2.0/grid/bin
#. / srvctl add asm-h
Adds an ASM configuration to be managed by Oracle Restart.
Usage: srvctl add asm [- l] [- p] [- d]
-l Listener name
-p Server parameter file path
-d ASM diskgroup discovery string
-h Print usage
# su-grid $. / srvctl add asm-l LISTENER-p / u01/app/11.2.0/grid/dbs/spfile+ASM.ora-d'/ dev/rhdisk*'
Note: the above srvctl add asm commands must be executed by grid users, not root users. For more information, please refer to the article "solving the problem that ASM instances created manually by 11gR2 cannot be managed by Clusterware" http://space.itpub.net/?uid-23135684-action-viewspace-itemid-743090
$sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Mon Sep 10 11:12:53 2012
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production
With the Automatic Storage Management option
SQL > create spfile from pfile
Create spfile from pfile
*
ERROR at line 1:
ORA-27038: created file already exists
Additional information: 1
SQL > exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production
With the Automatic Storage Management option
$cd $ORACLE_HOME/dbs
$ls
Ab_+ASM.dat hc_+ASM.dat init+ASM.ora init.ora spfile+ASM.ora
Executing the srvctl add asm command automatically adds the SPFILE parameter file to the ASM instance.
$strings spfile*
/ M?
* .asm_power_limit=1
* .diagnostic_dest='/u01/app/grid'
* .instance_type='asm'
* .large_pool_size=12M
* .remote_login_passwordfile='EXCLUSIVE'
$sqlplus / as sysasm
SQL*Plus: Release 11.2.0.3.0 Production on Mon Sep 10 11:13:21 2012
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production
With the Automatic Storage Management option
SQL > shutdown immediate
ORA-15100: invalid or missing diskgroup name
ASM instance shutdown
SQL >
SQL > startup nomount
ASM instance started
Total System Global Area 283930624 bytes
Fixed Size 2220800 bytes
Variable Size 256544000 bytes
ASM Cache 25165824 bytes
SQL > show parameter spfile
NAME TYPE
VALUE
-
Spfile string
/ u01/app/11.2.0/grid/dbs/spfil
E+ASM.ora
-- end--
ORACLE dbca can't find asm disks2012-04-11 14:44:03
ORACLE dbca can't find asm disks.
Oracle version: 11.2.0.1.0
Grid version: 11.2
The previous installation has basically come step by step, of course, it is not so smooth. Fortunately, with the great help of Baidu google, it is finally installed.
Problem phenomenon: "Database file location" from dbca to step 6
Select Storage Type: Automatic Storage management
Then Databse Area: DATA (the name of the asm disk group created)
As shown below:
Click the next prompt: the specified disk group cannot be found.
Misjudgment:
1 execute: / usr/sbin/oracleasm scandisks
/ usr/sbin/oracleasm listdisks
The result is normal, and listdisk can display the disk group normally.
2 switch to grid account and perform data query
Sqlplus / nolog
Conn / as sysdba
Select name from v$asm_disks
It can also be found out.
3 user group judgment
Id oracle
It was found that oracle could not be in the asmdba group, and that's the problem.
Solve the problem
Execute usermod-G oinstall-g dba,asmdba oracle
Select again, the asm disk pack is out.
Postscript
In fact, oracle was added to the asmdba in my initial script to create users and groups, but the script created was influenced by the system's own script orarun.
Oracle 11g dbca cannot find a solution for asm diskgroup
Oracle 11g dbca cannot find a solution for asm diskgroup
Yesterday, when 11G R2 RAC was configured in the virtual machine at home, the GI installation was normal, the db soft installation was normal, and the resource asm disk was also normal. GI is the GRID user and the ASM DISKGROUP configured with ASMLIB. But in the last step, when you use ORACLE user DBCA to build the library, you will not be able to find ASMDISKGROUP when you select ASM for storage.
You can only guess if you can't surf the Internet at home and try to run DBCA with GRID users. Of course, the purpose is to try whether you will find ASM DISKGROUP when you choose storage. At first, you will report errors and ignore them because of environmental variables. When you choose storage, you will find that the ASM disk group created with ASMCA has been found normally. Cancel the installation and start troubleshooting.
The command id oracle looks at the user group of ORACLE, and finds that there is an oinstall,asmdba,dba to check the user group of id grid. It is found that the user group of grid is one more user group of asmadmin than the user group of ORACLE, and then check the user group of ASM device ls-l / dev/oracleasm/diskstotal 0brwgrid asmadmin-1 grid asmadmin 8, 33 Nov 4 15:35 CRDATAbrw-rw-- 1 grid asmadmin 8, 49 Nov 4 15:35 DBDATA
So you can change the group of ASM devices to asmdba, or you can add ORACLE users to asmadmin. I choose the second usermod-a-G asmadmin oracle.
Or: chown grid:asmdba / dev/asm*
Also, check to see if the permissions of the $GRID_HOME/bin/oracle execution file are below [grid@rac1 bin] $ll oracle-rwsr-s-x 1 grid oinstall 152462814 Apr 10 19:51 oracle.
As far as I can remember, it was not s but x. If the following command chmod + s oracles is suid for the execution file, it is told to run as the owner of the file.
After performing a series of investigations above, ASM DISKGROUP. ASM DISKGROUP was finally found in the DBCA of ORACLE users.
1. Incorrect permission setting for oracle user2. ASM instance was not started or diskgroups are not mounted.3. The diskgroup resources are not online.4. The permission setting for the asm devices are incorrect.5. The oracle executable under / bin has incorrect permission settings.6. The file system for grid home was mounted with option 'nosuid'.
Related Posts:
No related posts found!
The reverse installation order of GI (Grid Infrastructure) and RDBMS when installing RAC or Oracle Restart caused dbca not to recognize the ASM disk group problem.
Recently, I have done such a test with a friend, if you install RDBMS Software first and then GI (Grid Infrastructure) when installing RAC or Oracle Restart, will it affect the use of the database or the creation of the database? With this doubt, we carried out the experiment in the test environment. Both the RDBMS Software installation and the GI installation went smoothly, and subsequent ASM disk groups for data files and flashback recovery areas were created through asmca. I thought it was going well, but dbca encountered a problem when building the library, and the asm disk group could not be recognized when choosing the storage mode. As shown below:
Reminder: you have to believe that if the installation order is correct, then you will be able to see the information of the ASM disk group created by you in this step.
The common reasons why the ASM disk group cannot be found are 1) grid home directory or its subdirectory permission error 2) asm disk permission error 3) asm instance is not started or asm disk group is not on mount 4) asm disk group resource is not online 5) oracle user permission error 6) oracle ($ORACLE_HOME/bin) executable permission error
OK, then I will sort them out one by one according to the above analysis results: 1) gi home directory or its subdirectories have incorrect permissions
[root@khm5 ~] # ls-ld / u02/app/11.2.0/grid/
Drwxr-x--- 66 root oinstall 4096 Apr 19 01:36 / u02/app/11.2.0/grid/
I first briefly checked the home directory permissions of GI, which is normal. Here I would like to remind you that some DBA intentionally or unintentionally see such directory permissions, found that the owner is root, think that something is wrong, take it for granted to change through the command, if only change the directory permissions is not a big problem, fallback method is very simple, but once you add the-R parameter recursively to change the permissions of subdirectories and subfiles, then the failure occurs. Therefore, when operating, we should not blindly do things that are not sure, and master the principles behind each operation and its consequences, so that we are fully prepared for fallback methods.
Here I know very well that I have not done any operation to modify the permission, so I think there is no problem with this link, so pass.
2) the permission error of the asm disk. I created the asm disk through the ASMLib driver. Check it with the following command:
[root@khm5 ~] # ls-l / dev/oracleasm/disks/t
Otal 0brw Apr RW ASMDISK1-1 BRW Apr 19 01:22 ASMDISK1-1 BRW 8, 17 BRW 19
Brw-rw---- 1 grid asmadmin 8, 33 Apr 19 01:22 ASMDISK2
Brw-rw---- 1 grid asmadmin 8, 49 Apr 19 01:22 ASMDISK3
If you find that the permission is incorrect, modify it with the following command:
[root@khm5 ~] # oracleasm configure-I or [root@khm5 ~] # / etc/init.d/oracleasm configure
Check out [root@khm5 ~] # oracleasm configureORACLEASM_ENABLED=trueORACLEASM_UID=grid after modification
ORACLEASM_GID=asmadmin
ORACLEASM_SCANBOOT=trueORACLEASM_SCANORDER= "" ORACLEASM_SCANEXCLUDE= ""
3) asm instance is not started or asm disk group is not available on mount. 4) asm disk group resources are not online. You can judge whether there are problems mentioned in 3 and 4 by checking the resources.
[grid@khm5] $crsctl stat res-t
NAME TARGET STATE SERVER STATE_DETAILS
-Local Resources-- -- ora.DATA.dg
ONLINE ONLINE khm5
Ora.FLASH.dg
ONLINE ONLINE khm5
Ora.GRID.dg
ONLINE ONLINE khm5
Ora.LISTENER.lsnr
ONLINE ONLINE khm5
Ora.asm ONLINE ONLINE khm5 Started
Ora.ons
OFFLINE OFFLINE khm5
-Cluster Resources-- -- ora.cssd
1 ONLINE ONLINE khm5
Ora.diskmon
1 OFFLINE OFFLINE
Ora.evmd
1 ONLINE ONLINE khm5
5) the permission error of oracle user
[root@khm5 ~] # id oracle
Uid=1101 (oracle) gid=1000 (oinstall) groups=1000 (oinstall), 1300 (dba), 1301 (oper), 1201 (asmdba)
Oracle users need to join the asmdba group. If they do not join the group, do the following:
[root@khm5 ~] # gpasswd-an oracle asmdba
Adding user oracle to group asmdba
6) permission error of oracle ($ORACLE_HOME/bin) executable file
[root@khm5 ~] # su-oracle
[oracle@khm5 ~] $cd $ORACLE_HOME/bin
[oracle@khm5 bin] $ls-l oracle
-rwsr-s--x 1 oracle oinstall 232399473 Apr 19 07:04 oracle
Well, we found a problem here. The permissions of the oracle executable file are incorrect. In RAC or ORACLE RESTART, the group of oracle executables is asmadmin.
Modify it as follows:
[root@khm5 ~] # cd / u02/app/oracle/product/11.2.0/dbhome_1/bin/
[root@khm5 bin] # chown oracle:asmadmin oracle
[root@khm5 bin] # ls-l oracle
-rwxr-x--x 1 oracle asmadmin 232399473 Apr 19 07:04 oracle
[root@khm5 bin] # chmod + s oracle
[root@khm5 bin] # ls-l oracle
-rwsr-s--x 1 oracle asmadmin 232399473 Apr 19 07:04 oracle
After the modification, the problem is resolved, and we can see the ASM disk group information.
Ora-15077,ASM disk group cannot be mounted
First, phenomenon analysis: 1. Database and instance services cannot be started. As follows: [oracle@rac1 ~] $crs_stat-tName Type Target State Host---ora.CRM.cs application ONLINE OFFLINE rac1ora....cl1.srv application ONLINE OFFLINE rac1ora.orcl.db application ONLINE OFFLINE rac2ora....l1.inst application ONLINE OFFLINE rac1ora....l2.inst application ONLINE OFFLINE rac2ora....SM1.asm application ONLINE ONLINE rac1ora....C1.lsnr application ONLINE ONLINE rac1ora.rac1.gsd application ONLINE ONLINE rac1ora.rac1.ons application ONLINE ONLINE rac1ora.rac1.vip application ONLINE ONLINE rac1ora....SM2.asm application ONLINE ONLINE rac2ora....C2.lsnr application ONLINE ONLINE rac2ora.rac2.gsd application ONLINE ONLINE rac2ora.rac2.ons application ONLINE ONLINE rac2ora.rac2.vip application ONLINE ONLINE rac22 、 It is still not possible to start an application service alone. 3. Start an instance with sqlplus As follows: [oracle@rac1] $export ORACLE_SID=devdb1SQL > startup ORA-01078: failure in processing system parametersORA-01565: error in identifying file'+ DG1/devdb/spfiledevdb.ora'ORA-17503: ksfdopn:2 Failed to open file + DG1/devdb/spfiledevdb.oraORA-15077: could not locate ASM instance serving a required diskgroup can see that diskgroup does not have mount, so put diskgroup mount first
You can also do the following test, and also report that the disk group is not mounted: [oracle@rac1 bdump] $export ORACLE_SID=+ ASM1 [oracle @ rac1 bdump] $sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0-Production on Sat Mar 22 17:59:39 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-ProductionWith the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL > shutdown immediate;ORA-15100: invalid or missing diskgroup name
ASM instance shutdownSQL > startup;ASM instance started
Total System Global Area 92274688 bytesFixed Size 1217884 bytesVariable Size 65890980 bytesASM Cache 25165824 bytesORA-15110: no diskgroups mounted
Solution: 1. Mount ASM disk group [oracle@rac1 bdump] $export ORACLE_SID=+ ASM1 [oracle @ rac1 bdump] $sqlplus / as sysdba first.
SQL*Plus: Release 10.2.0.1.0-Production on Sat Mar 22 17:59:39 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-ProductionWith the Partitioning, Real Application Clusters, OLAP and Data Mining optionsSQL > select name,state from v$asm_diskgroup
NAME STATE---RECOVERYDEST DISMOUNTEDDG1 DISMOUNTED
SQL > alter diskgroup RECOVERYDEST mount
Diskgroup altered.
SQL > alter diskgroup DG1 mount
Diskgroup altered.
SQL > exitDisconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-ProductionWith the Partitioning, Real Application Clusters, OLAP and Data Mining options
2. Start the database instance [oracle@rac1 bdump] $export ORACLE_SID= devdb1 [oracle @ rac1 bdump] $sqlplus / as sysdbaSQL > startup;ORACLE instance started.
Total System Global Area 264241152 bytesFixed Size 1218868 bytesVariable Size 109053644 bytesDatabase Buffers 150994944 bytesRedo Buffers 2973696 bytesDatabase mounted.database open.
Third, the reason: it may be because the $ORACLE_SID environment variable in the .bashrc file under the oracle user is inconsistent with the database name of the actual database, so the instance name corresponding to the environment variable will not be found when the database is started. Bashrc is orcl1 [oracle@rac1~] cat .bashrc.export ORACLE_SID=orcl1.
The instance name of the implementation is devdb1, so modify the ORACLE_SID=devdb1 in .bashrc
About Me
.
● author: wheat seedlings, only focus on the database technology, pay more attention to the application of technology
● article is updated synchronously on itpub (http://blog.itpub.net/26736162), blog Park (http://www.cnblogs.com/lhrbest) and personal Wechat official account (xiaomaimiaolhr).
● article itpub address: http://blog.itpub.net/26736162/abstract/1/
● article blog park address: http://www.cnblogs.com/lhrbest
● pdf version of this article and wheat seedling cloud disk address: http://blog.itpub.net/26736162/viewspace-1624453/
● database written examination interview questions database and answers: http://blog.itpub.net/26736162/viewspace-2134706/
● QQ group: 230161599 WeChat group: private chat
● contact me, please add QQ friend (646634621), indicate the reason for adding
● completed in Mordor from 09:00 on 2017-07-01 to 22:00 on 2017-07-31.
The content of the ● article comes from the study notes of wheat seedlings, and some of it is sorted out from the Internet. Please forgive me if there is any infringement or improper place.
Copyright ● all rights reserved, welcome to share this article, please reserve the source for reprint
.
Pick up your phone and use Wechat client to scan the picture on the left below to follow the Wechat official account of wheat seedlings: xiaomaimiaolhr, scan the QR code on the right to join the QQ group of wheat seedlings, and learn the most practical database technology.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.