This chapter will gradually explain the installation of Oracle 11g R2 and some problems encountered during the installation process. My installation environment is as follows:
OS: cent OS 6.2;
Oracle 11g R2;
VMware 7;
1. Create Oracle user
Oracle Installation cannot be performed under the root user. Create a user as the DBA and install Oracle
First, create Oracle requires some usergroups:
Oracle Inventory Group
Root>/usr/sbin/groupadd oinstall
Database Administrators Group
Root>/usr/sbin/groupadd DBA
Database Operation Group
Root>/usr/sbin/groupadd Partition
Create a user and change the password of the user.
Root>/usr/sbin/useradd-G oinstall-G dBA, using Oracle
Root> passwd Oracle
After creating a user, you can run the id command to view the user created just now.
Root> ID Oracle
2. Install Oracle
In this step, you need to first go to the Oracle user:
Root> Su-Oracle
1) decompress the installation file.
If VMware does not install vmtools, it cannot directly share the installation file to the VM. you can install vmtools before copying.
However, if you fail to install vmtools like me, you can use another method, that is, to make the installation file into an ISO file and then load it into the VM's optical drive.
CD to the optical drive location:
Oracle> Cd/Media
Copy the installation file to the home directory:
Oracle> CP./linux_11g_database_1of2.zip ~ /
Oracle> CP./linux_11g_databasesilicate f2.zip ~ /
Decompress:
Oracle> unzip linux_11g_database_1of2.zip
Oracle> unzip linux_11g_database204 f2.zip
Unzip will decompress the installation file to the database folder in the current directory.
Then CD to the decompressed database directory and run runinstaller.
Oracle> Cd./Database
Oracle>./runinstaller
After runinsstaller is executed, if there is no accident, the graphic interface is displayed. Then, the Oracle installation can be completed with the next step.
3. Set Environment Variables
After oracle is installed, the command not found prompt is displayed when any command is executed.
This is because Oracle's environment variables are not set. Linux cannot find the Oracle command from an existing path. Run the following command to set some environment variables required by Oracle.
Root> VI/etc/profile
Add the following content:
Export oracle_base =/myoracle/APP
Export ORACLE_HOME =/myoracle/APP/product/11.2.0/dbhome_1
Export oracle_sid = orcl
Export Path = $ path: $ ORACLE_HOME/bin
After the preceding content is added, check the PATH environment variable (echo $ PATH). The $ ORACLE_HOME/bin directory is already in the PATH variable of Linux, when executing the Oracle command, Linux will also search for this directory to find the command execution file.
Installation Problems:
Before installation, a system check may cause the following problems:
>>> Cocould not execute auto check for display colors using command/usr/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <
Solution:
Run the following command under root to solve the problem: xhost +
'/Lib/ld-linux.so.2: bad elf Interpreter: no such file or directory"
This is because a 32-bit program running 64-bit OS may cause problems. Use Yum to install 32-bit glibc.
Oracle> sudo Yum install glibc. i686
Insufficient VM hard disk space;
Some VM default hard disk space may not meet the requirements of Oracle 11g R2, so we need to manually add a hard disk.
First, add a hard disk with sufficient space in the VM settings.
Start the VM.
First, find the newly added hard disk, format it, and mount it.
Root> fdisk-l view all Linux hard disks and find the hard disk without partitions. The hard disk without partitions in my VM is/dev/HDB.
First, format the New Hard Disk:
Root> fdisk/dev/HDB
Enter n to indicate a new partition.
Select the partition type, primary partition or secondary partition, and select P (primary partition ).
After you select the primary partition, you will be asked to select the partition number, that is, the number following the hard disk name (for example, if you select 1, the partition name is/dev/hdb1)
In the next step, press enter to use the default value.
After partitioning, run the command [root> fdisk-L] to check that the disk/dev/HDB has been partitioned:
After the partition is complete, you need to format the partition. Only the formatted partition can be mounted, and Linux can use it. The command for formatting hard disk partitions is as follows:
Root> mkfs-T ext3/dev/hdb1
After all the above work is completed, you can mount the new hard disk.
First, create a path to mount the New Hard Disk:
Root> mkdir/hdb1
Root> Mount/dev/hdb1/hdb1
Since we will install oracle on this new hard disk, it is necessary that oracle users have the permission to mount the disk,
Root> chown Oracle/hdb1
After the restart, you need to re-mount the disk. If you want to make the mounting valid after the restart, you need to add a record to/etc/fstab.
Root> VI/etc/fstab
Add the following records at the end:
/Dev/sdb1/WWW ext3 defaults 1 2
(Format description:/dev/sdb1 indicates which partition ext3 is the format of this partition. ults is the parameter to be set during mounting (read-only, read/write, and quota enabled ), the input parameters include RW, Dev, exec, auto, nouser, and async. 1 indicates whether to use dump for recording, and 0 indicates whether to use dump for recording. 2 is the check order at boot, the boot system file is 1, and other file systems are 2, if not checked, it is 0)
So far, we have enough space to install Oracle, as long as we choose to install it in the/hdb1 directory during Oracle installation.
The environment variables are all set, but the command not found is still prompted when sqlplus is executed ).
Oracle> sqlplus/nolog
Bash: sqlplus: Command not found
Run the following command to solve the problem:
Root> ln-S $ ORACLE_HOME/bin/sqlplus/usr/bin
[Root @ DG1 ~] # Su-Oracle
[Oracle @ DG1 ~] $ Sqlplus/nolog
SQL * Plus: Release 10.2.0.1.0-production on Mon May 11 12:51:24 2009
Copyright (c) 1982,200 5, Oracle. All rights reserved.
SQL> Conn/As sysdba
Connected to an idle instance.
Oracle can not be started, ORA-00845
An error may be reported when memory_target or sga_target is modified in Oracle 11g Linux:
SQL> shutdown immediate
Database closed.
Database dismounted.
Oracle instance shut down.
SQL> startup
ORA-00845: memory_target not supported on this system
This problem occurs because the size of the SGA exceeds the size of the Operating System/dev/SHM:
[Root @ enterprice64 ~] # DF-k/dev/SHM
Filesystem 1k-blocks used available use % mounted on
Tmpfs 4089416 0 4089416 0%/dev/SHM
Oracle describes this in Metalink documentation: Doc ID: Note: 460506.1. There are only two ways to solve this problem. One is to modify the initialization parameter so that the SGA setting in the initialization parameter is smaller than/dev/SHM, another method is to adjust the size of/dev/SHM.
You can modify the/dev/SHM size by modifying/etc/fstab:
[Root @ enterprice64 ~] # Vi/etc/fstab
Label = // ext3 defaults 1 1
Label =/boot ext3 defaults 1 2
Label =/data/Data ext3 defaults 1 2
Devpts/dev/PTS devpts gid = 5, mode = 620 0 0
# Tmpfs/dev/SHM tmpfs defaults 0 0
Tmpfs/dev/SHM tmpfs ults, size = 10240 M 0 0
Label =/home ext3 defaults 1 2
Label =/opt/OPT ext3 defaults 1 2
Proc/proc defaults 0 0
Sysfs/sys sysfs defaults 0 0
Label =/usr ext3 defaults 1 2
Label =/var ext3 defaults 1 2
Label = SWAP-sda8 swap defaults 0 0
~
~
"/Etc/fstab" 13l, 965c written
[Root @ enterprice64 ~] # Umount/dev/SHM
[Root @ enterprice64 ~] # Mount/dev/SHM
[Root @ enterprice64 ~] # DF-k/dev/SHM
Filesystem 1k-blocks used available use % mounted on
Tmpfs 10485760 0 10485760 0%/dev/SHM
[Root @ enterprice64 ~] # Su-Oracle
[Oracle @ enterprice64 ~] $ Sqlplus "/As sysdba"
SQL * Plus: Release 11.1.0.6.0-production on Tue Oct 23 15:42:42 2007
Copyright (c) 1982,200 7, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
Oracle instance started.
Total system global area 4743446528 bytes
Fixed size 2143824 bytes
Variable Size 3892316592 bytes
Database buffers 805306368 bytes
Redo buffers 43679744 bytes
Database mounted.
Database opened.
Modify/etc/fstab, Mount/dev/SHM again, and then start the database.