- Pre-Installation Preparation
-
- Download Oracle version
- Address: http://docs.oracle.com/cd/E21901_01/index.html, download 2 files are linux.x64_11gr2_database_1of2.zip,linux.x64_11gr2_ Database_2of2.zip
- Pre-Installation Instructions:
- The minimum memory (RAM) requirement is 1GB, which is recommended for 2GB and above.
- Virtual Memory Swap recommendations: The recommended swap size is 1.5 times times the memory size when the memory is 1GB~2GB, the swap size is recommended when the memory is 2GB~16GB, and the swap remains 16GB when the memory is over 16GB.
- Requires a temporary file directory, such as/tmp, at least 1GB of disk space.
- Disk space requirements: The Enterprise version of the installation space of 4.35GB and more than 1.7GB of data file space, the standard version of 4.22GB installation space and more than 1.5GB of data file space.
- An X window graphical interface is required.
- Requires root user rights
- This article installs the environment:
- Operating system CentOS 6.4 2.6.32-358.el6.x86_64 (Desktop), 2GB RAM,80GB hard disk space (4GB swap, 100mb/boot, 40GB/)
- Host name Mophee, IP 192.168.80.19 (Static)
- Environment: VMware Workstation 9.0
- Installation of necessary installation packages
-
-
- or below (recommended)
#提前安装好需要的rpm包 Yum Install GCC gcc-c++ compat-libstdc++- UnixODBC unixodbc-devel
There is a RPM package that needs to be downloaded separately pdksh-5.2.14-37.el5_8.1.x86_64 and then RPM-IVH installed.
Create a Oinstall Group
Groupadd Oinstall
Create a DBA Group
Groupadd dba
Create an Oracle User
USERADD-G oinstall-g dba Oracle
To modify the password for an Oracle user
passwd Oracle
VI/etc/sysctl.conf# Add the following at the end of the file Fs.aio-MAX-NR =1048576FS.file-max =6815744Kernel.shmall=2097152Kernel.shmmax=536870912Kernel.shmmni=4096Kernel.sem= - 32000 - -Net.ipv4.ip_local_port_range=9000 65500Net.core.rmem_default=262144Net.core.rmem_max=4194304Net.core.wmem_default=262144Net.core.wmem_max=1048586#刷新参数sysctl-PVI/etc/security/limits.conf #在文件末尾添加以下内容oracle Soft Nproc2047Oracle Hard Nproc16384Oracle Soft Nofile1024x768Oracle Hard Nofile65536Oracle Soft Stack10240#创建安装Oracle软件所需要的目录mkdir-p/u01/ORACLE_11G_R2Chown-R oracle:oinstall/u01/ORACLE_11G_R2chmod-R775/u01/oracle_11g_r2 #日志目录mkdir/u01/oralnventoryChown-R oracle:oinstall/u01/oralnventory/chmod-R775/u01/oralnventory/VI/home/oracle/. Bash_profile #在文件末尾添加以下内容umask022Export Oracle_base=/u01/Oracle_11g_r2export Oracle_home= $ORACLE _base/oracle/product/11.2.0/Db_1export Oracle_sid=Orclexport PATH= $PATH: home/bin: $ORACLE _home/binVI/etc/pam.d/Login#在文件末尾添加以下内容session Required/lib/security/pam_limits.sosession Required Pam_limits.soVI/etc/profile# Add the following at the end of the fileif[$USER ="Oracle"]; Then if[$SHELL ="/bin/ksh"]; ThenUlimit-P16384Ulimit-N65536 ElseUlimit-U16384-N65536 fifi#刷新参数source/etc/profile
View Code
- Installation
Turn off SELinux (operate under root account):
To edit the SELinux profile Vi/etc/selinux/config, set the SELinux value to Disabled, as follows:
Modifying the file causes SELinux to not start after rebooting the system. To close the currently open SELinux, use the following command:
Modify the/etc/hosts file (operation under root account):
Edit the file vi/etc/hosts and add a line:
This modification is recommended if you do not do this to eject a warning during installation and may affect the proper functioning of the listener.
Create the desired directory (operating under the root account):
Install Oracle in the/opt/oracle directory, so you need to create this directory:
123 |
mkdir /opt/oracle ; chown oracle:oinstall /opt/oracle ; chmod 755 /opt/oracle ; |
You also need to set up the Inventory directory at installation, so you need to create the directory:
123 |
mkdir /opt/oraInventory ; chown oracle:oinstall /opt/oraInventory ; chmod 755 /opt/oraInventory ; |
installation package Related:
The Oracle 11g R2 installation package is compressed into two files: Linux.x64_11gR2_database_1of2.zip, Linux.x64_11gR2_database_2of2.zip, uploading them to the installation machine and using Unzip Linux.x64_11gR2_database_1of2.zip; Unzip Linux.x64_11gR2_database_2of2.zip; is decompressed, a directory named database is obtained. I put it in the/home/oracle/database.
Because the installation process is performed as Oracle, you need to make sure that the Oracle account has execute permissions on/home/oracle/database, and you can use the following command to assign the directory to the Oracle account and have Execute permissions:
12 |
chmod -R 700 /home/oracle/database ; chown -R oracle:oinstall /home/oracle/database ; |
———————— exit root and log in as Oracle ———————————-
Set the Oracle Account logon environment (log in as Oracle):
To edit the file Vi/home/oracle/.bash_profile, add the following line:
123456 |
oracle_base= /opt/oracle ; # installation directory oracle_home= $ORACLE _base /11g ; #oracle家目录 oracle_sid=orcl; #实例名 ld_library_path = $ORACLE _home /lib path= $PATH: $ORACLE _home /bin : $HOME /bin export oracle_base oracle_home oracle_sid ld_library_path PATH; |
After you save the exit, execute the following command to make the above settings effective immediately:
1 |
source /home/oracle/ .bash_profile |
To start the installation (log in as Oracle):
12 |
export LANG=en_US; ## /home/oracle/database/runInstaller ; ##执行该程序开始安装 |
- Installation closure
The last perfect work
Vi/etc/oratab
Orcl:/u01/oracle_11g_r2/oracle/product/11.2.0/db_1:y (change N to Y)
Edit each of the following two files
Vi/u01/oracle_11g_r2/oracle/product/11.2.0/db_1/bin/dbstart
Vi/u01/oracle_11g_r2/oracle/product/11.2.0/db_1/bin/dbshut
Find Oracle_home_listner=$1
Change into oracle_home_listner= $ORACLE _home
The startup script is as follows
- #!/bin/bash
- # chkconfig:2345 90 10
- Export oracle_base=/u01/oracle_11g_r2
- Export oracle_home=$ORACLE _base/ORACLE/product/11.2. 0/db_1
- Export oracle_sid=ORCL
- Export PATH=$PATH:$ORACLE _home/bin
- Orcl_own="Oracle"
- # If the executables does not exist--display error
- If [ ! -F $ORACLE _home/bin/dbstart -o ! -D $ORACLE _home ]
- Then
- echo "Oracle startup:cannot start"
- exit 1
- Fi
- # depending on parameter--start, stop, restart
- # of the instance and listener or usage display
- Case "$" in
- Start)
- # Oracle Listener and instance startup
- Echo -n "starting Oracle:"
- Su - $ORCL _own -c "$ORACLE _home/bin/dbstart"
- Touch /var/Lock/subsys/oradb
- Su - $ORCL _own -c "$ORACLE _home/bin/emctl start Dbconsole"
- echo "OK"
- ;;
- Stop)
- # Oracle Listener and instance shutdown
- Echo -n "Shutdown Oracle:"
- Su - $ORCL _own -c "$ORACLE _home/bin/emctl stop Dbconsole"
- Su - $ORCL _own -c "$ORACLE _home/bin/dbshut"
- RM -F /var/Lock/subsys/oradb
- echo "OK"
- ;;
- Reload| Restart)
- $ stop
- $ start
- ;;
- *)
- Echo "Usage: ' basename ' Start|stop|restart|reload"
- Exit 1
- Esac
- Exit 0
Copy the above script content, create a file named Oracle in the/ETC/INIT.D directory, then paste it in, save the exit, and then chmod +x give it permission to execute, don't forget to chkconfig add boot and firewall rules add, to this database installation is complete.
Main process of installing ORACLE_11GR2 version under Centos6.8