This blog post focuses on installing Oracle 11g in a CentOS environment. The system environment is CentOS7.2.
Pre-installation Environment preparation
To install the required packages:
Yum install binutils compat-libcap1 compat-libstdc++ gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel LIBGCC Libs tdc++ libstdc++-devel libxi libxtst make Sysstat unixodbc-devel-y
Yum install binutils* compat-libcap1* compat-libstdc++* gcc gcc-c++ glibc glibc-devel* ksh libaio* libaio-devel LIBGCC libstdc++* libstdc++-devel libxi* libxtst make sysstat* unixodbc-devel-y
Create user groups and users:
Groupadd-g 502 Dbagroupadd oinstallgroupadd-g 504 asmadmingroupadd-g 506 asmdbauseradd-u 502-g oinstall-g dba,asmdba Oracle
Set User password:
passwd Oracle
To modify the kernel resource limits, add the following in/etc/security/limits.conf:
* Soft nofile 4096* hard nofile 65536oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard Nofil E 65536
Add a line to the file/etc/pam.d/login file to configure the authentication login limit:
Session Required Pam_limits.so
To modify the kernel parameters, add the following in the/etc/sysctl.conf file:
FS.AIO-MAX-NR = 1048576fs.file-max = 6815744kernel.shmall = 2097152kernel.shmmax = 536870912kernel.shmmni = 4096kernel.sem = 32000 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_ max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576net.ipv4.tcp_wmem = 262144 262144 262144net.ipv4.tcp_wmem = 4194304 4194304 4194304
Settings to take effect:
Sysctl-p
To create an Oracle base directory:
Mkdir-p/data/app/oraclechown-r oracle:oinstall/data/app/oraclechmod-r 775/data/app/oracle
Create a database file directory and a quick recovery area directory:
Data Files Directory
Mkdir/data/app/oracle/oradatachown Oracle:oinstall/data/app/oracle/oradatachmod 775/data/app/oracle/oradata/
Quick Recovery Area file directory
Mkdir/data/app/oracle/recovery_areachown Oracle:oinstall/data/app/oracle/recovery_area/chmod 775/data/app/oracle /recovery_area
Installing the Library Software
Download oracle11g from the official website, is two zip compressed files, after downloading in the same directory to extract the two files, will generate a database directory. Here, using the graphical installation method, you need to configure the Xserver,windows client configuration locally to refer to this link: http://tryingstuff.blog.51cto.com/4603492/1958772
To switch to an Oracle user, add an environment variable:
Export Oracle_base=/data/app/oracle
Configure x:
Export display=192.168.20.171:0.0
Xhost +
Access control disabled, clients can connect from any host
Execute the following command to install:
# CD database/#./runinstaller
650) this.width=650; "src=" https://s5.51cto.com/oss/201711/02/1b108ba35033391a95888c9c8ea8a980.jpg "title=" 11.jpg "alt=" 1b108ba35033391a95888c9c8ea8a980.jpg "/>
Here you can choose to install the application before you create the database, or you can create a database at once, where you first install:
650) this.width=650; "src=" https://s2.51cto.com/oss/201711/02/86efa04ab5b0a843ded1240dc07cbe73.jpg "title=" 11.jpg "alt=" 86efa04ab5b0a843ded1240dc07cbe73.jpg "/>
After selecting the single instance, and the enterprise version, we will find the corresponding installation directory according to the environment variables we added:
650) this.width=650; "src=" https://s2.51cto.com/oss/201711/02/8b252ce8d8f3d5fb5da81b5b93c07957.jpg "title=" 11.jpg "alt=" 8b252ce8d8f3d5fb5da81b5b93c07957.jpg "/>
If this error occurs in the installation, you need to modify the directory permissions:
650) this.width=650; "src=" https://s5.51cto.com/oss/201711/02/77a9ef5da59fd8214383e8dd7127fbee.jpg "title=" 11.jpg "alt=" 77a9ef5da59fd8214383e8dd7127fbee.jpg "/>
Chown-r Oracle:oinstall/data/app
You can modify permissions.
If you install a package that does not meet the requirements, you will be prompted to install it by downloading these packages.
650) this.width=650; "src=" https://s4.51cto.com/oss/201711/02/e91b5db5ea5e857b32e2a4d34fca9250.jpg "title=" 11.jpg "alt=" E91b5db5ea5e857b32e2a4d34fca9250.jpg "/>
To install the missing packages, you can download the missing packages here: http://down.51cto.com/data/2339840
If you want to resolve a dependency, you can force the installation by using the following command:
RPM-IVH--nodeps--force packagename.rpm
If this error occurs, you can first ignore:
Prvf-7543:os Kernel parameter "Semmni" does not has proper value on node "hostname" [expected = "128"; Found = "0"]. –cause:kernel parameter value does not meet the requirement. –action:modify the kernel parameter value to meet the requirement.
Generally in link binaries This step error is, most of the situation is because some of the system package is not installed successfully, need to reinstall the required package, you can use the following script to detect whether the package is loaded:
#!/bin/sh count=0 arr= ( binutils-2* compat-libstdc++-33* elfutils-libelf-0.* elfutils-libelf-devel-0.* elfutils-libelf-devel-static-0.* gcc-4.* gcc-c++-4* glibc-2.* glibc-common-2.* glibc-devel-2.* glibc-headers-2* kernel-headers-* ksh-* libaio-0.* libaio-devel-0.* libgcc-4.* libgomp-4.* libstdc++-4.* libstdc++-devel-* make-* numactl-devel-* sysstat-* ) len=${#arr [@]} for (i=0;i<len;i++); do char=${arr[$i]} rpm -qa | grep "^ $char" if [ $? != 0 ] ; then error[$count]=${arr[$i]} count=$ (($count + 1)) echo "+++++++++++++++the ${arr[$i]}^is not installed++++++++++++++++++ " fi done if [ $count -lt "0" ];then echo "you have $count patchs are not installed." echo "the not installed patch is: " len1=${#error [@]} for ((ii=0;ii<len1;ii++)); do echo "${error[$ii]}^" done echo -e "Are you sure to install the patch[yes or no]:\c " read select if [ $select == "yes" ]; Then for ( (is=0;is<len1;is++)); do var=${error[$is]} rpm -ivh ./patch/$var .rpm done fi else echo "++++++++++++++++++++++check pass!+++++++++++++++++++++++++++" fi count=0rpm -q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel expat gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers libaio libaio-devel libgcc libstdc++ libstdc++-devel make pdksh sysstat unixodbc unixodbc-devel | grep "Not installed"
Continue to click Next until the installation is complete.
After the installation is complete, follow the prompts using root to execute the script given by the system:
650) this.width=650; "src=" https://s4.51cto.com/oss/201711/02/baf6399160d79ea56b22cea20c97c054.jpg "title=" 11.jpg "alt=" Baf6399160d79ea56b22cea20c97c054.jpg "/>
To add an environment variable for Oracle:
Modified under Oracle user. Bash_profile:
Export Oracle_base=/data/app/oracleexport oracle_home=/data/app/oracle/product/11.2.0/dbhome_1path= $PATH: $HOME/. Local/bin: $HOME/bin: $ORACLE _home/bin
So far, the software installation of the Orace database is complete.
Start monitoring
Start the listening configuration interface using the NETCA command under Oracle User:
[[email protected] ~]$ export Display=192.168.20.171:0.0[[email protected] ~]$ xhost +access control disabled, clients can Connect from any Host[[email protected] ~]$ netca Oracle Net Services Configuration:
650) this.width=650; "src=" https://s5.51cto.com/oss/201711/02/58e5cce48fa7cacf5da65403f59e393e.jpg "title=" 11.jpg "alt=" 58e5cce48fa7cacf5da65403f59e393e.jpg "/>
Then you use the default configuration to listen on port 1521.
$ netstat-lntp|grep 1521tcp6 0 0::: 1521:::* LISTEN 22939/tnslsnr
Show Listening Status:
[[email protected] ~]$ lsnrctl statuslsnrctl for linux: version 11.2.0.1.0 - production on 02-nov-2017 18:27:02copyright (c) 1991, 2009, oracle. all rights reserved. connecting to (description= (address= (protocol=tcp) (host=temp-test) (port=1521)) STATUS of The listener------------------------alias LISTENERVersion tnslsnr for Linux: Version 11.2.0.1.0 - ProductionStart Date 02-NOV-2017 18:20:27Uptime 0 days 0 hr. 6 min. 38 sectrace level offSecurity on: local OS AuthenticationSNMP offlistener parameter file / data/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.oralistener log file /data/app/oracle/diag/tnslsnr/temp-test/listener/alert/ log.xmllistening endpoints summary... (description= (address= (PROTOCOL=tcp) (HOST=temp-test ) (port=1521)) the listener supports no servicesthe command completed Successfully
Creating a database using the DBCA tool
DBCA is the database configuration Assistant, which can help us to create the database easily, delete the database, and configure the database.
Execute the DBCA command:
[Email protected] ~]$ DBCA
650) this.width=650; "src=" https://s4.51cto.com/oss/201711/02/7c098eabdb0384deabf4b3c0a97db642.jpg "title=" 11.jpg "alt=" 7c098eabdb0384deabf4b3c0a97db642.jpg "/>
Select Create DATABASE and select database type:
650) this.width=650; "src=" https://s1.51cto.com/oss/201711/02/1db73960b1a4f1172b470dd7be6f1ec3.jpg "title=" 11.jpg "alt=" 1db73960b1a4f1172b470dd7be6f1ec3.jpg "/>
Set the database name and SID to "ORCL", set all databases to use the same password, set the password to meet the password complexity requirements:
650) this.width=650; "src=" https://s2.51cto.com/oss/201711/02/9dd25350bc89102423c60106bd0141c8.jpg "title=" 11.jpg "alt=" 9dd25350bc89102423c60106bd0141c8.jpg "/>
Select the data storage directory:
650) this.width=650; "src=" https://s3.51cto.com/oss/201711/02/2759458a6dc2ddf22aa36b71e471a75f.jpg "title=" 11.jpg "alt=" 2759458a6dc2ddf22aa36b71e471a75f.jpg "/>
Select the Flashback recovery Area directory:
650) this.width=650; "src=" https://s1.51cto.com/oss/201711/02/4bc8e60f97ddddced72909a60bbc6e77.jpg "title=" 11.jpg "alt=" 4bc8e60f97ddddced72909a60bbc6e77.jpg "/>
Select Sample Schemas, the system will automatically configure the resource parameters, can also be dynamically adjusted according to their needs, the character set to UTF-8:
650) this.width=650; "src=" https://s2.51cto.com/oss/201711/02/31f64b1ab9791f2e8668217a961d0dd4.jpg "title=" 11.jpg "alt=" 31f64b1ab9791f2e8668217a961d0dd4.jpg "/>
The default configuration is then done until the installation is complete:
650) this.width=650; "src=" https://s5.51cto.com/oss/201711/02/21c9744ee49f3045c93fb1aca94f56c5.jpg "title=" 11.jpg "alt=" 21c9744ee49f3045c93fb1aca94f56c5.jpg "/>
In the final installation Completion screen, the database will display detailed database information:
650) this.width=650; "src=" https://s3.51cto.com/oss/201711/02/261587e97e83c1a1c4314461fc0f63df.jpg "title=" 11.jpg "alt=" 261587e97e83c1a1c4314461fc0f63df.jpg "/>
Test the connection to the database
To add an environment variable in a configuration file:
Vim ~/.bash_profile Export Oracle_sid=orclsource ~/.bash_profile
Log in to the database:
[Email protected] ~]$ sqlplus sys/oracle as Sysdbasql*plus:release 11.2.0.1.0 Production on Thu Nov 2 19:40:58 2017Copyr Ight (c) 1982, Oracle. All rights reserved. Connected to:oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit productionwith The partitioning, OLAP, Data Mining and Real Application testing optionssql>
View data:
Sql> Select Name,created,log_mode,open_mode from v$database;name created Log_mode open_mode----------------------- ---------------------------ORCL 02-nov-17 noarchivelog READ WRITE
This article is from the "Trying" blog, make sure to keep this source http://tryingstuff.blog.51cto.com/4603492/1978526
Linux Installation Oracle 11g