Linux Oracle 11g installation (PS: annoying ps, due to copy from the Word documents, a lot of can not see, the document address to share with everyone: http://download.csdn.net/detail/lzc3144/4265451) System Requirements
Server Configuration Requirements
At least 3.95 MB memory. Oracle software requires disk space larger than GB (GB required for Oracle 11 GB) and Linux OS kernel version 2.6.9
View system configuration commands:
CAT/etc/issue
Uname-R
Grep memtotal/proc/meminfo
Grep swaptotal/proc/meminfo
Grep "model name"/proc/cpuinfo
Free
DF-k/tmp
DF-K
This installation environment (due to the installation on the virtual machine, the configuration is very limited ):
Operating System: cent Operating System 6.2-i386
Memory: 2 GB
Disk Space: 40 GB
Configuration before installation
1) create users and groups (user/group );
# Groupadd DBA
# Groupadd oinstall
# Useradd Oracle-G oinstall-G DBA
# Passwd Oracle
If the nobody user does not exist (# view the ID nobody command), create:
# Useradd nobody
2) create an Oracle installation folder (sample );
# Mkdir-P/opt/Oracle/product/10g
# Mkdir/opt/Oracle/oradata
# Mkdir/opt/orainventory
# Chown-r oracle. oinstall/opt/Oracle
# Chown oracle. oinstall/opt/orainventory/
# Chmod 755-r/opt/Oracle
# Chmod 755/opt/orainventory/
3) Configure Environment Variables
To use ORACLE products, you must set several environment variables. If you have installed Multiple Oracle products or databases on the same server, the ORACLE_HOME, oracle_sid, and path variables may be changed. The oracle_base variable should not be changed and can be set in your login configuration file as needed. Oracle provides a utility called oraenv to set other variables.
For database servers, we recommend that you set the following environment variables:
Use the username created in step 1 to log on to Oracle:
Su Oracle
VI ~ /. Bash_profile
Modify the following configuration file
Export oracle_base =/opt/Oracle/
Export ORACLE_HOME =/opt/Oracle/product/11g
Export oracle_sid = localorcl (customizable)
Export Path = $ ORACLE_HOME/bin: $ path
ESC (exit the VI editing environment)
: WQ (exit the VI Application and save the changes)
Unmask these environment variable settings after installation
# Export tns_admin = $ ORACLE_HOME/Network/admin
# Export nls_lang = american_america.zhs16gbk
# Export lang = american_america.zhs16gbk
Use the source. bash_profile command to make the configuration take effect.
4) set System Kernel Parameters
The following Kernel Parameter settings are required for Oracle Database 10 GB.
The minimum value is given, so if your system uses a large value, do not change it.
Switch to the root user:
Su Root
A) Modify/etc/sysctl. conf (VI/etc/sysctl. conf) and add:
[Root @ localhost install_file] # vi/etc/sysctl. conf
# Using EL intall add Parameters
# Kernel. shmmax = 2147483648
Kernel. shmmni = 4096
# Kernel. Shmall = 2097152
Kernel. SEM = 250 32000 100 128
FS. File-max = 6815744
FS. AIO-max-Nr = 1048576
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
Run the "/sbin/sysctl-P" command to make the kernel change take effect immediately;
B) Set Oracle file requirements:
Edit the file: VI/etc/security/limits. conf and add the following statement:
Oracle soft nproc 2047
Hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536
Edit the file: VI/etc/PAM. d/login and add the following statement (it may be added before the last rule ):
Session required/lib/security/pam_limits.so
Start Installation
We recommend that you install oracle on a physical machine. If you can only use SSH for Remote Installation, you can use SSH software that supports graphical display for installation.
Decompress the Oracle 11g Installation File
# Unzip linux_11gr2_database_1of2.zip
# Unzip linux_11gr2_databasesilicate f2.zip
# CD database
#./Runinstaller
If the prompt "check if the DISPLAY variable is set." is displayed, run the following command as the root user:
# Xhost +
# Export display =: 1.0
# Su-Oracle switch back to Oracle user to execute again #./runinstaller
If an error occurs, restart the system and log on to the system using an oracle user.
The following page is displayed after installation.
Select the Oracle server type. For simple installation, select 'desktop type'. For formal applications, select 'server type' for installation.
Item 1: single ORACLE Server Installation; Item 2: Oracle cluster Installation
Select language. English is selected by default.
Set the memory size used by Oracle by default.
Set the character set to UTF-8.
Set the path for storing Oracle Database Files
Set the automatic backup function of Oracle as needed
Set passwords for sys, system, and other users. You can set them to the same password or set them separately and configure them as needed. (If the password is too simple, Oracle will give an error message, can be skipped directly)
What is the configuration? I really don't know. The default setting is fine.
The prerequisites for the Oracle check and installation are listed here. All the prerequisites for the check failure must be solved before the installation can continue.
Let's view the specific error message one by one.
All error messages are classified into two categories. The preceding section shows System Kernel configuration errors (basically because some parameters are too small to meet the recommended Oracle parameters ); the following dependency packages for Oracle services are not installed
Step 1:
Install the missing dependency packages (the root user is required). You can find these missing dependency packages in the system installation ISO:
[Root @ localhost ~] # Cd/Media/centos_6.2_final/Packages
[Root @ localhost packages] # rpm-ivhcompat-libstdc ++-33-3.2.3-69.el6.i686.rpm
Warning: compat-libstdc ++-33-3.2.3-69.el6.i686.rpm: Header V3 RSA/sha256 signature, keyid c105b9de: nokey
Preparing... ######################################## ### [100%]
1: compat-libstdc ++-33 ################################# ######### [1, 100%]
Note: In the prompt missing dependency package pdksh-5.2.14 this package cannot be found in centos 6 installation ISO, this dependency package can be downloaded from the Internet, downloaded and uploaded to a directory on the Linux server to run
[Root @ localhost install_file] # rpm-IVH pdksh-5.2.14-36.el5.i386.rpm
Step 2:
Modify the Kernel configuration parameters to support the recommended Oracle parameters in/etc/sysctl. add the following configuration to the conf configuration (if it is already configured in the "pre-installation configuration" step, no configuration is required here)
[Root @ localhost install_file] # vi/etc/sysctl. conf
# Using EL intall add Parameters
Kernel. shmmni = 4096
Kernel. SEM = 250 32000 100 128
FS. File-max = 6815744
FS. AIO-max-Nr = 1048576
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
Run after modification. The Kernel configuration takes effect immediately.
[Root @ localhost install_file] #/sbin/sysctl-P
After the error is fixed, click check again. After checking again, you can see that all problems have been resolved. Click Finish to complete the installation.
Configure Oracle service to start with System
Step 1:
To modify the/etc/oratab file, change localorc:/opt/Oracle/product/11G: n to y.
(If the/etc/oratab file does not exist, run the $ ORACLE_HOME/root. Sh file as the root user.
# Sh/opt/Oracle/product/11g/root. Sh)
[Root @ lzc-centos6 ~] # Cat/etc/oratab
Localorc:/opt/Oracle/product/11G: N
[Root @ lzc-centos6 ~] # Vi/etc/oratab
Localorc:/opt/Oracle/product/11G: Y
Setp 2:
Use the Oracle installer (Oracle) to modify the $ ORACLE_HOME/bin/dbstart file. You 'd better back up the file before modifying the file and run the following command:
[Oracle @ lzc-centos6 bin] $ CP/opt/Oracle/product/11g/bin/dbstart/opt/Oracle/product/11g/bin/dbstart. Bak
Locate oracle_home_listner =... This line is modified
Oracle_home_listner =/opt/Oracle/product/11g
Or directly modify it:
Oracle_home_listner = $ ORACLE_HOME
Step 3:
Test and run dbshut and dbstart
(1) modify the permissions of the log files of dbstart and dbshut (if the two files do not exist, manually touch them first ):
The root user first creates these two files
# Cd $ oracle_hoem/bin
[Root @ lzc-centos6 11g] # Touch startup. Log
[Root @ lzc-centos6 11g] # chownoracle. oinstall startup. Log
[Root @ lzc-centos6 11g] # chmod 755startup. Log
[Root @ lzc-centos6 11g] # Touch shutdown. Log
[Root @ lzc-centos6 11g] # chownoracle. oinstall shutdown. Log
[Root @ lzc-centos6 11g] # chmod 755shutdown. Log
[Root @ lzc-centos6 11g] # ls-l startup. logshutdown. Log
-Rwxr-XR-X. 1 Oracle oinstall 0 Jan 8 13:50 shutdown. Log
-Rwxr-XR-X. 1 Oracle oinstall 0 Jan 8 13:49 startup. Log
(2) execute the corresponding script for testing
[Root @ lzc-centos6 11g] # Su-Oracle
[Oracle @ lzc-centos6 ~] $ CD $ ORACLE_HOME
[Oracle @ lzc-centos6bin] $ dbshut # (or dbstart)
(3) create an oracle Service Startup Script: oradbstart (use the root user)
[Root @ lzc-centos611g] # Touch/home/Oracle/oradbstart
# Chownoracle. oinstall/home/Oracle/oradbstart
# Chmod 775oracle. oinstall/home/Oracle/oradbstart
After copying the content, copy the file to the/etc/rc. d/init. d/directory.
# Cp/home/Oracle/oradbstart/etc/rc. d/init. d/oradbstart
Add oradbstart to the system startup list
# Chkconfig -- add/home/Oracle/oradbstart
[Root@lzc-centos6init.d] # chkconfig -- list oradbstart
Oradbstart 0: off 1: off 2: off 3: On 4: On 5: on 6: Off
Note: If the following error occurs when you use the chkconfig-add command
[Root @ lzc-centos6 init. d] # chkconfig -- add/home/Oracle/oradbstart
Error reading information on serviceoradbstart: no such file or directory
Check whether the/home/Oracle/oradbstart file is correct. If you copy text, you may lose one or two lines in the header, check whether the header of the file to be changed is as follows: (if not, copy it to/etc/rc again. ID/init. d/directory)
#! /Bin/bash
# Chkconfig: 345 99 10
# Description: STARTUP script for oracledatabases
The script content is as follows (remember to modify the script according to your database configuration ):
[Root @ lzc-centos611g] # Cat/home/Oracle/oradbstart
#! /Bin/bash
# Chkconfig: 345 99 10
# Description: STARTUP script for Oracle databases
#/Etc/rc. d/init. d/dbstart
Exportoracle_base =/opt/Oracle/
Exportoracle_home =/opt/Oracle/product/11g/
Exportoracle_sid = localorc
Exportpath = $ path: $ ORACLE_HOME/bin
Ora_ownr = "oracle"
# If theexecutables do not exist -- Display Error
If [! -F $ ORACLE_HOME/bin/dbstart-o! -D $ ORACLE_HOME]
Then
Echo "Oracle startup: cannotstart"
Exit 1
Fi
# Depending onparameter -- startup, shutdown, restart
# Of theinstance and listener or usage display
Case "$1" in
Start)
# Oracle listener and instance startup
Echo-n "Starting ORACLE :"
Su $ ora_ownr-c "$ ORACLE_HOME/bin/LSNRCTL start"
Su $ ora_ownr-c "$ ORACLE_HOME/bin/dbstart"
Touch/var/lock/Oracle
Su $ ora_ownr-c "$ ORACLE_HOME/bin/emctl start dbconsole"
Su $ ora_ownr-c "$ ORACLE_HOME/bin/isqlplusctl start"
Echo "OK"
;;
Stop)
# Oracle listener and instance Shutdown
Echo-n "shutdown ORACLE :"
Su $ ora_ownr-c "$ ORACLE_HOME/bin/emctl stop dbconsole"
Su $ ora_ownr-c "$ ORACLE_HOME/bin/isqlplusctl stop"
Su $ ora_ownr-c "$ ORACLE_HOME/bin/dbshut"
Su $ ora_ownr-c "$ ORACLE_HOME/bin/LSNRCTL stop"
Rm-F/var/lock/Oracle
Echo "OK"
;;
Reload | restart)
$0 stop
$0 start
;;
*)
Echo "Usage: 'basename $ 0' START | stop | restart | reload"
Exit 1
Esac
Exit 0
Test the Quick Start command:
[Root@lzc-centos6init.d] #/etc/rc. d/init. d/oradbstart stop
[Root@lzc-centos6init.d] #/etc/rc. d/init. d/oradbstart start
Restart Linux
# Reboot-n
When Linux is started, you can see an oracle startup Item. When [OK] appears, it indicates that your database is started with the system.
# Su-Oracle
# Pe-Ef | grepora
Solution to errors during installation: database instance installation failed
An error occurred while installing the 'oracle net configuration assistant '. As a result, the Oracle instance cannot continue to be installed.
Solution:
Check the Installation Log and find that the exception is caused by a change error because the port is occupied, but no other program is using port 1521 through the netstat command. Therefore, Google, the reason for Baidu is that the ing configuration of host names and IP addresses in/etc/hosts is incorrect (because the system was set manually during installation, in addition, when the system is installed, the static IP address is not set. Instead, the IP address is obtained through DHCP and the IPv4 and IPv6 addresses are also enabled ), this may cause errors when parsing the Host Name of the local machine during Oracle network configuration. The specific modification method is as follows:
Step 1: # vi/etc/hosts. Add the IP ing between the local IP address and the local host name to remove the IPv6 Configuration.
[Root @ lzc-centos6 ~] # Cat/etc/hosts
127.0.0.1 localhost. localdomain localhost4 localhost4.localdomain4
192.168.1.102 lzc-centos6
Step 2: # vi/etc/host. conf, followed by orderhosts and bind; indicates that the domain name is first searched through the/etc/hosts file and then searched through the Domain Name Server (Domain Name Service address configuration file/etc/resolv. conf)
[Root @ lzc-centos6 ~] # Cat/etc/host. conf
Order hosts, bind
Multi on
Step 3: The Listener is restarted successfully.
# LSNRCTL start listener
Garbled characters on the EM page
Access the https: // 192.168.1.102: 1158/EM page and garbled characters are found.
Note: If the Oracle console has been started and cannot access this page, check the firewall configuration of your Linux server and whether other machines are allowed to access port 1158, configuration of Linux Firewall
Oracle 11g uses jdk1.5. After jdk1.5, a simple solution is provided to solve this problem. You only need to create a fallback directory under $ java_home/JRE/lib/fonts, copy the font you want to use in Java to this directory. In oracle users:
$ Mkdir $ ORACLE_HOME/JDK/JRE/lib/fonts/fallback
Put the font file simsun in windows. copy the TTC file to the $ ORACLE_HOME/JDK/JRE/lib/fonts/fallback directory and rename it simsun. TTF (note that the simsun font of MS is copyrighted, so you can change it to another font for commercial use). The corresponding permissions are available to oracle users.
Then you need to clear the cache and restart EM:
The command is as follows:
[Root @ lzc-centos6 ~] # Chown oracle. oinstall/opt/Oracle/product/11g/JDK/JRE/lib/fonts/fallback/simsunb. TTF
[Root @ lzc-centos6 ~] # Chmod 755/opt/Oracle/product/11g/JDK/JRE/lib/fonts/fallback/simsunb. TTF
[Oracle @ lzc-centos6 ~] $ RM/opt/Oracle/product/11g/Solaris/J2EE/oc4j_applications/applications/EM/Cabo/images/Cache/ZHS/*. gif
[Oracle @ lzc-centos6 ~] $ Emctl startdbconsole
Sorry, this is not the case. It's still garbled! (To be resolved later ...)