CentOS6.332-bit Silent Installation Oracle11gr2 detailed tutorial 1. Install dependency package unzip-libstdc ++-333.2.3elfutils-libelf0.125elfutils-libelf-devel0.125elfutils-libelf-devel-static0.125gcc4.1.2gcc-c ++ 4.1.2glibc2.5-24glibc-common2
Tutorial 1. Install the dependency package binutils ‑compat-libstdc ++-33 3.2.3 elfutils-libelf 0.125 elfutils-libelf-devel 0.125 elfutils-libelf-devel-static 0.125 gcc 4.1.2 gcc-c ++ 4.1.2 glibc 2.5-24 glibc-common 2
CentOS 6.3 32-bit Silent Installation of Oracle 11g r2
1. Install the dependency package
Binutils2.17.50.0.6
Compat-libstdc ++-33 3.2.3
Elfutils-libelf0.125
Elfutils-libelf-devel0.125
Elfutils-libelf-devel-static0.125
Gcc4.1.2
Gcc-c ++ 4.1.2
Glibc2.5-24
Glibc-common2.5
Glibc-devel2.5
Glibc-headers2.5
Kernel-headers2.6.18
Ksh20060214
Libaio0.3.106
Libaio-devel0.3.106
Libgcc4.1.2
Libgomp4.1.2
Libstdc ++ 4.1.2
Libstdc ++-devel4.1.2
Make3.81
Sysstat7.0.2
UnixODBC2.2.11
UnixODBC-devel2.2.11
Yum install binutils compat-libstdc ++-33 elfutils-libelf-devel-static gcc-c ++ glibc-common glibc-devel glibc- headers kernel-headers ksh libaio-devel libgcc libgomp libstdc ++-devel make sysstat unixODBC-devel
Ii. Modify Kernel Parameters
1. Modify the/etc/sysctl. conf file.
(1) Log On As root
(2) edit the file # vim/etc/sysctl. conf and modify the following parameters. If not, add the following parameters by yourself. If the default value is greater than the reference value, no modification is required.
Kernel. shmall = 2097152 // indicates the total amount of shared memory that can be used by the system at one time (in page ). The default value is 2097152, which does not need to be modified.
Kernel. shmmax = 2147483648 // defines the maximum size of the shared memory segment (in bytes ). The default value is 32 M. For oracle, the default value is too low. It is usually set to 2G = 2147483648/1024/1024/1024.
Kernel. shmmni = 4096 // used to set the maximum number of shared memory segments within the system. The default value of this parameter is 4096. Usually no need to change
Kernel. sem = 250 32000 100 128 // indicates the set semaphore
Fs. file-max = 65536 // indicates the maximum number of file handles. File handle indicates the number of files that can be opened in Linux. Actually, it is obtained by "fs. file-max = 512 * PROCESSES". We specify the PROCESSES value as 128, that is, "fs. file-max = 512*128 ".
Fs. aio-max-nr = 1048576 // Number of asynchronous IO requests simultaneously.
Net. ipv4.ip _ local_port_range = 1024 65000 // Ipv4 port range available for applications.
Net. core. rmem_default = 262144 // default Receiving Window Size
Net. core. rmem_max = 4194304 // maximum size of the Receiving Window
Net. core. wmem_default = 262144 // default sending window size
Net. core. wmem_max = 1048586 // maximum size of the sending window
Fs. aio-max-nr = 1048576
Fs. file-max = 6815744
Kernel. shmall = 2097152
Kernel. shmmax = 536870912
Kernel. shmmni = 4096
Kernel. sem = 250 32000 100 128
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 = 1048586
(3) run # sysctl-p to take effect immediately.
(4) run the # sysctl-p command to report an error
Error: "net. bridge. bridge-nf-call-ip6tables" is an unknown key
Error: "net. bridge. bridge-nf-call-iptables" is an unknown key
Error: "net. bridge. bridge-nf-call-arptables" is an unknown key
To solve this problem, run the following command:
# Modprobe bridge
# Lsmod | grep bridge
2. Set Shell restrictions for oracle users
(1) edit the file # vim/etc/security/limits. conf and add the following lines:
Oracle soft nproc 2047
Hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536
(2) edit the file # vim/etc/pam. d/login and add the following lines:
Session required pam_limits.so
(3) view the/etc/selinux/config file to ensure that SELINUX is in the disabled status.
SELINUX = disabled
View SELinux status: getenforce
Disable SELinux:
1. temporarily shut down (no need to restart the machine ):
Setenforce 0 # Set SELinux to permissive Mode
# Setenforce 1 Set SELinux to enforcing Mode
3. edit/etc/profile and add the following Configuration:
If [$ USER = "oracle"]; then
If [$ SHELL = "/bin/ksh"]; then
Ulimit-p 16384
Ulimit-n 65536
Else
Ulimit-u 16384-n 65536
Fi
Fi
4. edit/etc/csh. login and add the following Configuration:
If ($ USER = "oracle") then
Limit maxproc 16384
Limit descriptors 65536
Endif
3. Note: The kernel parameters do not have to be modified. They can be modified based on your actual situation.
3. Create users and groups and install directories
1. Create Oracle users and groups
Only the single host environment is discussed here, regardless of the configuration of the RAC environment.
Run the following command to add the users and groups required for oracle installation.
(1) create a group oinstall
# Groupadd oinstall
(2) create a group dba
# Groupadd oradba
(3) Add the user oracle and add it to the oinstall and dba groups.
# Useradd-g oinstall-G oradba oracle
(4) test whether the oracle account has been created
# Id oracle
(5) Create a New oracle Password
# Passwd oracle
(6) add oracle users to The sudo Group
# Vim/etc/sudoers
Find
Root ALL = (ALL) ALL
This line, and add it below
Oracle ALL = (ALL) ALL
Enter wq! Or x! (Because this is a read-only document, you need to add it !) And press Enter
2. Create the target directory for oracle Installation
(1) Log On As root
(2) create an Oracle System Directory: # mkdir-p/app/oracle
(3) create the Oracle server Home Directory: # mkdir/app/oracle/11g
(4) set the directory owner to oracle: # chown-R oracle: oinstall/app/oracle
(5) edit/etc/profile and append the following content to the end.
Export ORACLE_BASE =/app/oracle
Export ORACLE_HOME =/app/oracle/11g
Export ORACLE_SID = ora11g
Export PATH = $ PATH: $ ORACLE_HOME/bin
Run # source/etc/profile to make it effective immediately
(6) Note: The target directory for installing Oracle can be specified at will, but users who install and run Oracle must have the permission to completely modify this directory.
4. Edit the response file required for Installation
(1) Log On As root
(2) Silent Installation must specify a response file db_install.rsp to complete various parameters required for installation.
(3) EDIT db_install.rsp and modify the values of the following items.
Oracle. install. option = INSTALL_DB_SWONLY
ORACLE_HOSTNAME = localhost
UNIX_GROUP_NAME = oinstall
INVENTORY_LOCATION =/app/oracle/oraInventory
Selected_ages = en, zh_CN
ORACLE_HOME =/app/oracle/11g
ORACLE_BASE =/app/oracle
Oracle. install. db. InstallEdition = EE
Oracle. install. db. DBA_GROUP = oradba
Oracle. install. db. OPER_GROUP = oinstall
Oracle. install. db. config. starterdb. type = GENERAL_PURPOSE
Oracle. install. db. config. starterdb. globalDBName = oracle11g
Oracle. install. db. config. starterdb. SID = ora11g
Oracle. install. db. config. starterdb. characterSet = AL32UTF8
Oracle. install. db. config. starterdb. password. ALL = manager
DECLINE_SECURITY_UPDATES = true
You can use the default values for other projects or modify the values as needed.
(4) Note: If Oracle is installed from a CD, the answer file must be copied to the hard disk before modification.
5. Start Installation
(1) log on with an oracle user and run the command in the Oracle installation directory.
$./RunInstaller-ignoreSysPrereqs-silent-noconfig-responseFile <应答文件的绝对路径>
(2) wait until the installation is complete.
The installation parameters are described as follows:
-IgnoreSysPrereqs allows Oracle to ignore system checks. Because Oracle officially declares that only Linux Server products are supported, this parameter must be specified for installation on non-Server Linux products.
-Silent indicates silent Installation Without any prompt
-Force allows installation to a non-empty directory
-Noconfig indicates that the configuration assistant netca is not run.
-ResponseFile indicates which response file to use and must use an absolute path.
Here I enter:
$./RunInstaller-ignoreSysPrereqs-silent-noconfig-responseFile/mnt/hgfs/tmp/oracle11g/response/db_install.rsp
The current directory is the installation directory. The system returns the following:
Starting Oracle Universal Installer...
Checking installer requirements...
6. system initialization
(1) Log On As A root user
(2) run the following two scripts:
$ ORACLE_BASE/oraInventory/orainstRoot. sh
$ ORACLE_HOME/root. sh
7. Install the network listener
(1) log on to oracle
(2) The client cannot connect to the Oralce server over the network without a network listener. To install the network listener on the command line, you can only use the silent mode.
(3) run:
$ ORACLE_HOME/bin/netca/silent/responseFile <应答文件的绝对路径>
The command I entered here is:
$ ORACLE_HOME/bin/netca/silent/responseFile/mnt/hgfs/tmp/oracle11g/response/netca. rsp
System response:
Parsing command line arguments:
Parameter "silent" = true
Parameter "responsefile" =/mnt/hgfs/tmp/oracle11g/response/netca. rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
Running Listener Control:
/App/oracle/11g/bin/lsnrctl start LISTENER
Listener Control complete.
Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0
(4) view listener status
$ ORACLE_HOME/bin/lsnrctl status
8. Modify dbstart
(1) Log On As an oracle user
(2) Open $ ORACLE_HOME/bin/dbstart and set
ORACLE_HOME_LISTNER =/ade/vikrkuma_new/oracle
Change
ORACLE_HOME_LISTNER = $ ORACLE_HOME
Otherwise, the network listener may not be automatically started.
IX. Installing database instances
(1) Log On As root
(2) edit the response file dbca. rsp under the response subdirectory in the Oracle installation directory and modify the following items:
RESPONSEFILE_VERSION = "11.2.0" // cannot be changed
OPERATION_TYPE = "createDatabase"
GDBNAME = "oracle11g" global database name = SID + host domain name. Here I set it to: oracle11g
SID = "ora11g" indicates the SID of the database. This is very important. I was unable to use this problem during the first installation. Here I changed it to ora11g.
TEMPLATENAME = "General_Purpose.dbc" // template file for database creation
SYSPASSWORD = "manager" SYS user's initial password. I set it to manager.
SYSTEMPASSWORD = "manager" SYSTEM user's initial password, which is set to manager
DATAFILEDESTINATION =/app/oracle/oradata // data file storage directory
RECOVERYAREADESTINATION =/app/oracle/oradata_back // restore the data storage directory
CHARACTERSET = "ZHS16GBK" database character set, important !!!! It cannot be changed after the database is created (the Chinese version is ZHS16GBK)
TOTALMEMORY = "800" // oracle memory 800 MB
(3) log on to oracle to run
$ ORACLE_HOME/bin/dbca-silent-responseFile <应答文件的绝对路径> -CloneTemplate
The command I entered here is:
$ ORACLE_HOME/bin/dbca-silent-responseFile/mnt/hgfs/tmp/oracle11g/response/dbca. rsp-cloneTemplate
(4) system response:
Copying database files
1% complete
3% complete
11% complete
18% complete
26% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
50% complete
55% complete
56% complete
60% complete
62% complete
Completing Database Creation
66% complete
70% complete
73% complete
85% complete
96% complete
100% complete
Look at the log file "/app/oracle/export toollogs/dbca/oracle11g/oracle11.log" for further details.
10. Modify the Oracle STARTUP configuration file:/etc/oratab
(1) Log On As an oracle user
(2) edit/etc/oratab
Set : : N
Change to ora11g:/app/oracle/11g: Y
Enable the database instance to start automatically.
11. Start and close Oracle
Log On As an oracle user
(1) check whether the listener is started.
$ ORACLE_HOME/bin/lsnrctl status
If it is not started, enter:
$ ORACLE_HOME/bin/lsnrctl start
(2) Start an Oracle instance
Log on to the database as sysdba and enter:
$ Sqlplus sys as sysdba
Enter the password. (Show SQL>)
Enter
SQL> startup
You can start the database normally.
Note: You can also use $ ORACLE_HOME/bin/dbstart to start a database instance.
(3) Shut Down database instances
SQL> shutdown immediate
Note: You can also use $ ORACLE_HOME/bin/dbstart to start a database instance.
(4) Disable listening
$ Lsnrctl stop
12. Make Oracle run as a service
(1) Log On As root
(2) Create the file/etc/init. d/oracle and enter the following content:
#! /Bin/sh
# Chkconfig: 35 80 10
# Description: Oracle auto start-stop script.
#
# Set ORACLE_HOME to be equivalent to the $ ORACLE_HOME
# From which you wish to execute dbstart and dbshut;
#
# Set ORACLE_OWNER to the user id of the owner of
# Oracle database in ORACLE_HOME.
ORACLE_HOME =/app/oracle/11g
ORACLE_OWNER = oracle
If [! -F $ ORACLE_HOME/bin/dbstart]
Then
Echo "Oracle startup: cannot start"
Exit
Fi
Case "$1" in
'Start ')
# Start the Oracle databases:
Echo "Starting Oracle Databases ..."
Echo "-----------------------------------------------">/var/log/oracle
Date + "% T % a % D: Starting Oracle Databases as part of system up.">/var/log/oracle
Echo "-----------------------------------------------">/var/log/oracle
Su-$ ORACLE_OWNER-c "$ ORACLE_HOME/bin/dbstart">/var/log/oracle
Echo "Done"
# Start the Listener:
Echo "Starting Oracle Listeners ..."
Echo "-----------------------------------------------">/var/log/oracle
Date + "% T % a % D: Starting Oracle Listeners as part of system up.">/var/log/oracle
Echo "-----------------------------------------------">/var/log/oracle
Su-$ ORACLE_OWNER-c "$ ORACLE_HOME/bin/lsnrctl start">/var/log/oracle
Echo "Done ."
Echo "-----------------------------------------------">/var/log/oracle
Date + "% T % a % D: Finished.">/var/log/oracle
Echo "-----------------------------------------------">/var/log/oracle
Touch/var/lock/subsys/oracle
;;
'Stop ')
# Stop the Oracle Listener:
Echo "Stoping Oracle Listeners ..."
Echo "-----------------------------------------------">/var/log/oracle
Date + "% T % a % D: Stoping Oracle Listener as part of system down.">/var/log/oracle
Echo "-----------------------------------------------">/var/log/oracle
Su-$ ORACLE_OWNER-c "$ ORACLE_HOME/bin/lsnrctl stop">/var/log/oracle
Echo "Done ."
Rm-f/var/lock/subsys/oracle
# Stop the Oracle Database:
Echo "Stoping Oracle Databases ..."
Echo "-----------------------------------------------">/var/log/oracle
Date + "% T % a % D: Stoping Oracle Databases as part of system down.">/var/log/oracle
Echo "-----------------------------------------------">/var/log/oracle
Su-$ ORACLE_OWNER-c "$ ORACLE_HOME/bin/dbshut">/var/log/oracle
Echo "Done ."
Echo ""
Echo "-----------------------------------------------">/var/log/oracle
Date + "% T % a % D: Finished.">/var/log/oracle
Echo "-----------------------------------------------">/var/log/oracle
;;
'Restart ')
$0 stop
$0 start
;;
Esac
(3) then grant the executable permission to the file to run
Chmod a + x/etc/init. d/oracle
(4) Add the Oracle service and set it to run automatically at Linux Startup.
Chkconfig -- level 35 oracle on # Add Oracle services and set the startup level 3 and 5 to automatically start oracle
Chkconfig -- list oracle # view service information
In this way, you can use service oracle start | stop | restart to start, stop, and restart Oracle.