1.Linux Environment Configuration Preparation
Environment: Linux:redhat Enterprise 5.4,db:oracle 11g R2 x64,oracle installed into the/home/oralce_11 directory.
The configuration process is as follows: (mostly online content, individuals also follow the online steps)
1) Check the basic requirements (for the cool server, this must be satisfied with the requirements, can skip)
Memory size
grep memtotal/proc/meminfo
Swap partition size
grep swaptotal/proc/meminfo
Add Swap partition
Create/home/swap such a partition file. The size of the file is 5.12 million blocks, normally 1 blocks are 1 K, so the space here is 5G.
DD If=/dev/zero Of=/home/swap bs=1024 count=5120000
Then turn the partition into a swap partition.
Mkswap/home/swap
and add it to the fstab.
echo "/home/swap swap swap defaults 0 0" >>/etc/fstab
2) Check the software requirements, no Yum install installed
Rpm-q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc-gcc-c++ Lib Aio-devel Libaio libgcc libstdc++ libstdc++-devel make Sysstat unixODBC unixodbc-devel Pdksh
(If there is no installation here, then you need to put the Linux CD into the server folder, find the corresponding RPM package, run the rpm command to install, if you like the graphical interface, the image interface can also be double-click the corresponding RPM package to install. Note that in the installation of Libaio-devel UnixODBC unixodbc-devel These 3 packages, in addition to installing the X64 package thought, but also to install I386 package, not because it is a X64 system, will not install I386 package. )
3) Configure the kernel.
Edit/etc/sysctl.conf.
Add the following to the file
# Kernel paramaters required by Oracle 11gR1
Fs.file-max = 6815744
Fs.aio-max-nr = 1048576
Kernel.shmall = 2097152
Kernel.shmmax = 2147483648
Kernel.shmmni = 4096
Kernel.sem = [32000] Net.ip V4.ip_local_port_range = 9000 65500
Net.core.rmem_default = 4194304
Net.core.rmem_max = 4194304
Net.core.wmem_default = 262144
Net.core.wmem_max = 1048576
4) to make the/etc/sysctl.conf change take effect immediately, execute the following command.
Sysctl–p
5) Edit/etc/security/limits.conf.
Add the following line:
Oracle soft NPROC 2047
Oracle hard nproc 16384
Oracle Soft nofile 1024x768
Oracle hard nofile 65536
6) Edit/etc/pam.d/login.
Add the following line:
Session required/lib/security/pam_limits.so
Session required pam_limits.so
Note: If it is a X64 system, then use/lib64/security/pam_limits.so here, or the system may not be able to log on the server! 】
7) Edit/etc/profile.
Add the following line:
if [$USER = "Oracle"]; Then
if [$SHELL = "/bin/ksh"]; Then
Ulimit-p 16384
Ulimit-n 65536
Else
Ulimit-u 16384-n 65536
Fi
Fi
8) Create the operating system user as the owner of the software installation and Support group.
Groupadd Oinstall
Groupadd dba
USERADD-G oinstall-g dba Oracle
passwd Oracle
9) Create the Software installation directory.
mkdir–p/home/oracle_11/app/
Chown-r oracle.oinstall/home/oracle_11/
Chmod-r 755/home/oracle_11/
10) Edit/home/oracle/.bash_profile.
Add the following line:
Umask 022
Oracle_base=/home/oracle_11/app
Oracle_home= $ORACLE _base/oracle/product/11.2.0/db_1
Oracle_sid=mytest--Instance name, modify as needed
Path= $PATH: $HOME/bin: $ORACLE _home/bin
Ld_library_path= $ORACLE _home/lib:/usr/lib
Lang=c--Set this parameter to avoid garbled installation process
Export oracle_base oracle_home oracle_sid PATH ld_library_path LANG
11) Open another terminal window as root in the graphical interface (either natively or through VNC remote operation)
-This step is critical and does not perform this step when running with Oracle User #./runinstaller will not start the graphical installation interface
#xhost +
#xhost + localhost
12) Extract the downloaded Oracle installation files to Linux and install the database
#su-oracle
CD database/
./runinstaller
13) Next, the Graphical Setup wizard will appear, follow the wizard step-by-step, as with the wizard for installing Oracle under Windows, there is not much difference until the final installation is complete.
2. Confirm the installation is successful
Oracle under Linux is in a running state after installation is complete. Run Top–u Oracle to see the processes running as Oracle users. Under the graphical interface, running $oracle_home/sqldeveloper/sqldeveloper.sh can present Oracle's own free Oracle Management client SQL Developer. Try connecting to the Oracle you just installed, and the connection is successful.
You will need to restart the server to see if Oracle can boot properly after the server restarts. Run the reboot command as root to restart Linux, and by default, Oracle does not register as a service as Oracle in Windows, starts with the machine, and needs to be manually typed into the command to start. Startup mode: Run the following statement as an Oracle user login:
1, enter Sqlplus:
Sqlplus/nolog
2, connect to the database as SYSDBA, and start the Oracle Database engine:
Sql> Conn/as SYSDBA
Sql> Startup
3, Exit Sqlplus, Run listener
Sql> exit
$ lsnrctl Start
So the database TNS also started, you can connect to the database through the network. In general, it is enough to start these two, if you want to use Oracle provided by the EM to manage Oracle, you also need to start the EM console, run the following command:
$ emctl Start Dbconsole
This allows the EM console to be accessed via Https://servername:1158/em/console.
Here I am running in the actual operation Sqlplus error occurred, roughly as follows:
Sqlplus/as SYSDBA
Sqlplus:error while loading shared libraries:/u01/app/oracle/product/11.1.0/db_1/lib/libnnz11.so:cannot restore Segment Prot after Reloc:permission denied
There are many people on the Internet have encountered this problem, the original is selinux in the mischief, I used the solution is to prohibit the SELinux:
Change the contents of the/etc/sysconfig/selinux file to selinux=disabled, and then restart the server.
It seems that this method is not very good, but also the solution is to use the Chcon command
Example: Chcon-t texrel_shlib_t/usr/local/rsi/idl_6.1/bin/bin.linux.x86/*.so
In addition, I started listener when the error Tns-12555:tns:permission denied
Later on-line search, found that Oracle users will not be able to enter the/var/tmp/.oracle folder, the method is very simple, execution: chmod 777/var/tmp/.oracle after the OK.
Also, I encountered an error when I started the EM console:environment variable oracle_unqname not defined. Please set Oracle_unqname to database unique name.
After setting this variable (running the Export oracle_unqname=xxxx instance name), and then starting the EM console, a new error occurred:oc4j Configuration issue./u01/app/oracle/product /11.2.0/db_1/oc4j/j2ee/oc4j_dbconsole_xxxx not found. Don't have this file? To check it out, indeed there is no such a file exists, how to do it? Actually very simple, run:
Emca-config Dbcontrol DB
Reconfigure it according to the wizard.
3. Configure Oracle to boot from
Although Oracle does not often shut down as a server, but occasionally reboots, it is too troublesome to manually start Oracle each time, hopefully, as in Windows, to automatically start Oracle every time you turn on the computer, You only need to configure Oracle as a service for Linux. The operation is as follows:
1, create the/etc/rc.d/init.d/oracle11g script file with the root user, the content is as follows (environment variable setting changes according to the actual situation):
#!/bin/bash
#
# CHKCONFIG:35 95 1
# description:init script to Start/stop Oracle database 11g, TNS Listener, EM
#
#
#
# Match these values to your environment:
Oracle_base=/home/oracle_11/app
Oracle_home= $ORACLE _base/oracle/product/11.2.0/db_1
Oracle_sid=brdwdev
Oracle_unqname=brdwdev
Path= $PATH: $HOME/bin: $ORACLE _home/bin
Ld_library_path= $ORACLE _home/lib:/usr/lib
Lang=c
Export oracle_base oracle_home oracle_sid oracle_unqname PATH ld_library_path LANG
# See how we are called:
Case $ in
Start
Su-oracle<<eoo
Lsnrctl start
Sqlplus/nolog<<eos
Connect/as SYSDBA
Startup
Eos
Emctl Start Dbconsole
Eoo
;;
Stop
Su-oracle<<eoo
Lsnrctl stop
Sqlplus/nolog<<eos
Connect/as SYSDBA
Shutdown immediate
Eos
Emctl Stop Dbconsole
Eoo
;;
*)
echo "Usage: $ {start|stop}"
;;
Esac
2, execute the following command as root user
chmod 755/etc/rc.d/init.d/oracle11g
Chkconfig--add oracle11g
3, restart the service
Service oracle11g Stop
Service oracle11g Start
This allows Oracle to start and stop automatically when switching machines.
In addition, there is a need to modify the/etc/oratab file to change the last N to Y, as follows:
Xxxxtest:/home/oracle_11/app/oracle/product/11.2.0/db_1:y
Finally, we want to test whether this self-launch is really effective, reboot the server bar, after a few minutes, you can see the client can connect to Oracle properly. Oracle environment is configured successfully!
Redhat Enterprise 5.4 Installation configuration Oracle 11g R2 detailed process