I. Environmental preparedness
Install package:
1.vmware-workstation-full-11.1.0-2496824.exe
2.centos-7-x86_64-dvd-1511.iso
3.linux.x64_11gr2_database _1of2.zip
Linux.x64_11gR2_database_2of2.zip
The above feel is not the key, not to download the address, does not describe the installation process, installed CentOS 7, screenshot as follows:
The first time you install the pit, before you do anything, create a snapshot of the virtual machine in VMware, and later get depressed, you can return to the snapshot version. Special or not trust, and the virtual machine completely cloned a (obsessive-compulsive disorder).
Second, prepare Oracle before installation
1. Create system users and user groups that run Oracle databases
[Sonny@localhost ~]$ su root #切换到root
Password:
[root@localhost sonny]# groupadd oinstall # Create a user group Oinstall
[root@localhost sonny]# groupadd dba #创建用户组dba
[root@localhost sonny]# useradd-g Oinstall-g dba-m Oracle #创建oracle用户 and joined the Oinstall and DBA user group
[root@localhost sonny]# passwd Oracle #设置用户o Racle login password, do not set password, in the CentOS graphics landing interface can not login
changing password for user Oracle.
New password: # password bad
password:the password is shorter than 8 characters retype
new password: c15># Confirm Password
passwd:all authentication tokens updated successfully.
# View New Oracle Users
UID=1001 (Oracle) gid=1002 (DBA) groups=1002 (DBA)
Why to create Oinstall user groups and DBA groups. Reference: HTTP://WWW.ORACLE.COM/TECHNETWORK/CN/ARTICLES/HUNTER-RAC11GR2-ISCSI-2-092412-ZHS.HTML#13
Theoretically, a single example of 3 groups of users, the actual construction of only two oinstall and DBAs, and then install the Oracle database after the Osoper group also set the DBA group.
A.oracle List group (typically Oinstall):
members of the Oinstall group are considered "owners" of Oracle software and have write access to the Oracle Central manifest (orainventory). When Oracle software is first installed on a Linux system,
OUI creates/etc/orainst.loc files. This file specifies the name of the Oracle manifest group (default is Oinstall) and the path to the Oracle Central Inventory directory.
B. Database administrator (OSDBA, General DBA):
Members of the OSDBA group can use SQL to connect to an Oracle instance SYSDBA identity through operating system authentication. Members of this group perform key database management tasks, such as creating databases, starting and closing
instances. The default name for this group is DBA. SYSDBA system permissions allow access to database instances even when the database is not open. The control of this permission is completely beyond the scope of the database itself. Do not confuse SYSDBA
system permissions with database role DBAs. The DBA role does not include SYSDBA or sysoper system permissions.
c. Database Operators group (Osoper, generally oper):
Members of the Osoper group can use SQL to connect to an Oracle instance Sysoper identity through operating system authentication. Members of this optional group have a limited set of database administration permissions, such as managing and running backups. The
default name for this group is Oper. Sysoper system permissions allow access to database instances even when the database is not open. The control of this permission is completely beyond the scope of the database itself. To use this group, select the Advanced installation type to install the Oracle database software.
2. Create an Oracle Database installation directory
[Sonny@localhost ~]$ su root
Password:
[root@localhost sonny]# mkdir-p/data/oracle #oracle数据库安装目录 C3/>[root@localhost sonny]# mkdir-p/data/orainventory #oracle数据库配置文件目录
[root@localhost sonny]# mkdir-p /data/database #oracle数据库软件包解压目录
[root@localhost sonny]# cd/data
[root@localhost data]# ls # Create complete check out (obsessive-compulsive disorder)
database Oracle orainventory
[root@localhost data]# chown-r Oracle:o Install/data/oracle #设置目录所有者为oinstall用户组的oracle用户
[root@localhost data]# chown-r Oracle:oinstall/ Data/orainventory
[root@localhost data]# chown-r oracle:oinstall/data/database
[root@localhost data]#
3. Modify OS System identity
Oracle does not support CentOS system installation by default, Oracle Database 11g Release 2 OS requirements reference: https://docs.oracle.com/cd/E11882_01/install.112/e47689 /pre_install.htm#ladbi1106
I am installing a 64-bit database, on Linux x86-64:red Hat Enterprise Linux 7 (RHEL 7)
In addition, CentOS7.0.1511 is based on RHEL7.2 reference: http://www.linuxidc.com/Linux/2015-12/126283.htm
Modify File/etc/redhat-release
[Sonny@localhost data]$ su root
Password:
[root@localhost data]# cat/proc/version
Linux version 3.10.0-327.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (gcc) #1 SMP Thu N OV 22:10:57 UTC 2015
[root@localhost data]# cat/etc/redhat-release CentOS
Linux release 7.2.1511 (Core)
[Root@localhost data]# vi/etc/redhat-release
root@localhost data]# cat/etc/redhat-release redhat-7
[ Root@localhost data]#
4. Software packages required to install Oracle databases
Again, I install Oracle database 11g Release 2 64-bit databases.
Oracle Database Package Requirements for Linux x86-64 is as follows: (Reference: https://docs.oracle.com/cd/E11882_01/install.112/e47689/ PRE_INSTALL.HTM#BABCFJFG)
rpm-qa binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static gcc gcc-c + + glibc Glibc-common glibc-devel glibc-headers glibc-static kernel-headers pdksh libaio libaio-devel libgcc libgomp libst dc++ libstdc++-devel libstdc++-static make numactl-devel sysstat unixodbc//Authentication command 26 Packages
kernel-headers-3.10.0-123.el7.x86_64 gcc-c++-4.8.2-16.el7.x86_64 numactl-devel-2.0.9-2.el7.x86_64 glibc-headers-2.17-55.el7.x86_64 glibc-common-2.17-55.el7.x86_64 binutils-2.23.52.0.1-16.el7.x86_64 unixodbc-devel-2.3.1-10.el7.x86_64 libaio-0.3.109-12.el7.x86_64 make-3.82-21.el7.x86_64 elfutils-libelf-0.158-3.el7.x86_64 elfutils-libelf-devel-0.158-3.el7.x86_64 sysstat-10.1.5-4.el7.x86_64 glibc-static-2.17-55.el7.x86_64 glibc-devel-2.17-55.el7.x86_64 glibc-2.17-55.el7.x86_64 elfutils-libelf-devel-static-0.158-3.el7.x86_64 libaio-0.3.109-12.el7.i686 gcc-4.8.2-16.el7.x86_64 libgcc-4.8.2-16.el7.i686 libstdc++-static-4.8.2-16.el7.x86_64 libaio-devel-0.3.109-12.el7.x86_64 libstdc++- 4.8.2-16.el7.x86_64 libaio-devel-0.3.109-12.el7.i686 unixodbc-2.3.1-10.el7.x86_64 libstdc++- devel-4.8.2-16.el7.x86_64 compat-libstdc++-33-3.2.3-71.el7.x86_64 libgcc-4.8.2-16.el7.x86_64 Libgomp-4.8.2-16.el7.x86_64
Candide, for the first time, the installation of one, the command is also very simple, anyway the document requires a high version can also:
[Sonny@localhost data]$ su root
Password:
[root@localhost data]# yum install binutils
omitted ...
5. Shutdown Firewall CentOS 7.2 Use firewall as a firewall by default
[Sonny@localhost/]$ su root Password: [root@localhost/]# systemctl status Firewalld.service#查看防火墙状态, running infirewalld.service-firewalld-dynamic Firewall daemon loaded:loaded (/usr/lib/systemd/system/firewalld.service; en abled; Vendor preset:enabled) active:active (running) since Thu-2016-04-07 PDT; 2h 20min ago Main pid:802 (FIREWALLD) Cgroup:/system.slice/firewalld.service└─802/usr/bin/python-es/u Sr/sbin/firewalld--nofork--nopid Apr 18:54:25 localhost.localdomain systemd[1]: Starting firewalld-dynamic
L Daemon ...
APR modified 18:54:29 Localhost.localdomain systemd[1]: Started firewalld-dynamic firewall. [Root@localhost/]# Systemctl Stop Firewalld.service#关闭防火墙[Root@localhost/]# systemctl status Firewalld.service #再次查看防火墙状态, found closed firewalld.service-firewalld-dynamic Firewal L Daemon loaded:loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset:enabled) Active:inactiv E (dead) since Thu 2016-04-07 21:15:34 PDT; 9s ago Main pid:802 (code=exited, status=0/success) Apr 18:54:25 Localhost.localdomain systemd[1]: Starting firewall
d-dynamic Firewall daemon ...
APR modified 18:54:29 Localhost.localdomain systemd[1]: Started firewalld-dynamic firewall.
APR modified 21:15:33 localhost systemd[1]: stopping firewalld-dynamic firewall daemon ...
APR modified 21:15:34 localhost systemd[1]: Stopped firewalld-dynamic firewall. [root@localhost/]# systemctl Disable Firewalld.service#禁止使用防火墙 (restart is also prohibited)Removed symlink/etc/systemd/system/dbus-org.
Fedoraproject.FirewallD1.service. Removed Symlink/etc/systemd/system/basic.target.wants/firewalld.service. [Root@localhost/]#
firewall first disabled, do a good job after the configuration, personal virtual machine, to wool firewall ~ ~
6. Close the SELinux (need to restart effective)
[Root@localhost/]# vi/etc/selinux/config
[root@localhost/]# cat/etc/selinux/config
# This file controls the s Tate of SELinux on the system.
# selinux= can take one of these three values:
# Enforcing-selinux The security policy is enforced.
# Permissive-selinux Prints warnings instead of enforcing.
# Disabled-no SELinux policy is loaded.
selinux=disabled #此处修改为disabled
# selinuxtype= can take one of three two values:
# Targeted-targeted processes are protected,
# Minimum-modification of targeted policy. Only selected processes are protected.
# Mls-multi level security protection.
selinuxtype=targeted
Why do you want to close SELinux? Because SELinux is too advanced, not professional people do not understand ~ ~
7. Modify Kernel Parameters
Red section for adding code
[Sonny@localhost/]$ su root
Password:
[root@localhost/]# vi/etc/sysctl.conf]
[root@localhost/]# cat/etc /sysct.conf
Cat:/etc/sysct.conf:no such file or directory
[root@localhost/]# cat/etc/sysctl.conf
# System default Settings Live in/usr/lib/sysctl.d/00-system.conf.
# to override those settings, enter new settings where, or in an/etc/sysctl.d/<name>.conf file
#
Information, sysctl.conf (5) and SYSCTL.D (5).
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.rp_filter = 1
fs.file-max = 6815744 #设置最大打开文件数
Fs.aio-max-nr = 1048576
kernel.shmall = 2097152 #共享内存的总量, 8G memory settings: 2097152*4k/1024/1024
Kernel.shmmax = 2147483648 #最大共享内存的段大小
Kernel.shmmni = 4096 #整个系统共享内存端的最大数
Kernel.sem = 32000 128
Local_port_range = 9000 65500 #可使用的IPv4端口范围
net.core.rmem_default = 262144
net.core.rmem_max= 4194304 net.core.wmem_default= 262144
net.core.wmem_max= 1048576
Make configuration parameters Effective
[Root@localhost/]# sysctl-p
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.rp_filter = 1
Sysctl:setting key "Fs.file-max": Invalid argument
fs.file-max = 6815744 #设置最大打开文件数
fs.aio-max-nr = 1048576
sysctl:setting Key "Kernel.shmall": Invalid argument
kernel.shmall = 2097152 #共享内存的总量, 8G memory settings: 2097152*4k/1024 /1024
sysctl:setting Key "Kernel.shmmax": Invalid argument kernel.shmmax
= 2147483648 #最大共享内存的段大小
sysctl: Setting key "Kernel.shmmni": Invalid argument
Kernel.shmmni = 4096 #整个系统共享内存端的最大数
Kernel.sem = 250 32000 100 128
sysctl:setting Key "Net.ipv4.ip_local_port_range": Invalid argument
net.ipv4.ip_local_port_range = 9000 65500 #可使用的IPv4端口范围
net.core.rmem_default = 262144
Net.core.rmem_max = 4194304
net.core.wmem_default = 262144
Net.core.wmem_max = 1048576
[root@localhost/]#
8. Set limits on Oracle users to improve software performance (red is added)
[Sonny@localhost/]$ su root Password: [root@localhost/]# vi/etc/security/limits.conf] [root@localhost/]# cat/etc/sec urity/limits.conf #/etc/security/limits.conf # #This file sets the resource limits for the users logged in via PAM. #It D
OES not affect resource limits of the system services. # #Also Note This configuration files IN/ETC/SECURITY/LIMITS.D directory, #which are read in alphabetical order, override
The settings in this #file the "domain is" the same or more specific. #That means for example so setting a limit for wildcard domain here #can is overriden with a wildcard setting in a confi g file in the #subdirectory, but a user specific setting the can is overriden only #with a user specific setting in the S
Ubdirectory.
# #Each Line describes a limit to a user in the form: # #<domain> <type> <item> <value> # #Where: #<domain> can: #-a user name #-a group name, with @group syntax #-the WILDCA Rd *, for default entry #-the wildcard%, can is also used with%group syntax, # for Maxlogin Limi t # #<type> can have the two values: #-"soft" for enforcing the soft limits #-"hard" for enforcing Hard Limits # #<item> can be one of the following: #-core-limits The core file size (KB) #-Data -Max data Size (KB) #-fsize-maximum FileSize (KB) #-Memlock-max locked-in-memory address spaces (kb #-Nofile-max Number of open file descriptors #-Rss-max resident set Size (KB) #-Stack-m Ax stack size (KB) #-Cpu-max CPU Time (MIN) #-Nproc-max Number of processes #-as-address Space Limit (KB) #-Maxlogins-max number of logins for this user #-Maxsyslogins-max number of logins On the system #-Priority-the priority to run user process with #-Locks-max number of file locks the User can hold #- Sigpending-max number of pending signals #-Msgqueue-max memory used by POSIX message queues (bytes) # -Nice-max nice priority allowed to raise to values: [ -20] #-Rtprio-max Realtime the Priority # #<domain& Gt <type> <item> <value> # #* Soft core 0 #* hard RS S 10000 # @student hard nproc @faculty soft Nproc @faculty Hard Nproc #ftp hard Nproc 0 # @student-maxlogins 4 Oracle Soft nproc 2047 Oracle hard nproc 16384 Oracle Soft nofile 1024 Oracle hard nofile 65536 # end of file [root@localhost/ ]#
9. Configure the user's environment variable (the red section is add code)
[Root@localhost/]# vi/home/oracle/.bash_profile
[root@localhost/]# cat/home/oracle/.bash_profile
#. Bash_ Profile
# Get the aliases and functions
if [-f ~/.BASHRC]; then
. ~/.bashrc
fi
# User specific envir Onment and startup Programs
path= $PATH: $HOME/.local/bin: $HOME/bin
export PATH
export oracle_base=/data/ Oracle #oracle数据库安装目录
Export oracle_home= $ORACLE _base/product/11.2.0/db_1 #oracle数据库路径
export Oracle_sid =ORCL #oracle启动数据库实例名
export oracle_term=xterm #xterm窗口模式安装
export path= $ORACLE _home/bin:/usr/sbin: $PATH #添加系统环境变量
export ld_library_path= $ORACLE _home/lib:/lib:/usr/lib #添加系统环境变量
export lang=c #防止安装过程出现乱码
export Nls_lang=american_america. ZHS16GBK #设置Oracle客户端字符集, must be consistent with the set of Oracle settings, such as: ZHS16GBK, otherwise there will be data import export Chinese garbled problem
[root@localhost/]#
Make this configuration effective immediately:
[Oracle@localhost/]$ su root
Password:
[root@localhost/]# Source/home/oracle/.bash_profile
10. Above all done, upload installation package I like XFTP, the Oracle installation package upload to/USR/LOCAL/SRC
11. Unpack the installation package
[Oracle@localhost/]$ cd/usr/local/src #进入/usr/local/src directory
[oracle@localhost src]$ ls
linux.x64_ 11gr2_database_1of2.zip linux.x64_11gR2_database_2of2.zip
[oracle@localhost src]$ unzip linux.x64_11gr2_ database_1of2.zip-d/data/database/ #解压
(omitted ...)
[Oracle@localhost src]$ unzip linux.x64_11gr2_database_2of2.zip-d/data/database/ #解压
(omitted ...)
[Oracle@localhost src]$ su root
Password:
[root@localhost src]# chown-r database/
[Root@localhost src]#
Third,Oracle installation
1. Graphical interface Landing Oracle User:
2. Start Oralce installation, go to/data/database/database/directory, execute Runinstaller
3. Remove the hook, lazy fill, personal use environment does not need to automatically receive Oracle security updates.
4. Next, only install the database software, this step seems to be a bit of a problem, reinstall several times have problems, the proposal to choose the first ...