第一步:到oracle官网上下载oracle12c的镜像文件
第二步:添加用户和组
用普通用户登录后,打开命令行工具(terminal)
转到root用户
[vmtest@localhost ~]$ su root
Password:
添加组
[root@localhost vmtest]# groupadd dba
添加用户
[root@localhost vmtest]# useradd oracle
将oracle用户分配给dba组
[root@localhost vmtest]# usermod -g dba oracle
为oracle用户设置密码
[root@localhost vmtest]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.
检查刚才创建的用户和密码
[root@localhost vmtest]# tail /etc/group
gdm:x:42:
gnome-initial-setup:x:983:
avahi:x:70:
slocate:x:21:
sshd:x:74:
tcpdump:x:72:
oprofile:x:16:
vmtest:x:1000:vmtest
dba:x:1001:
oracle:x:1002:
[root@localhost vmtest]# tail /etc/passwd
nfsnobody:x:65534:65534:Anonymous NFSUser:/var/lib/nfs:/sbin/nologin
pulse:x:171:171:PulseAudio SystemDaemon:/var/run/pulse:/sbin/nologin
gdm:x:42:42::/var/lib/gdm:/sbin/nologin
gnome-initial-setup:x:988:983::/run/gnome-initial-setup/:/sbin/nologin
avahi:x:70:70:Avahi mDNS/DNS-SDStack:/var/run/avahi-daemon:/sbin/nologin
sshd:x:74:74:Privilege-separatedSSH:/var/empty/sshd:/sbin/nologin
tcpdump:x:72:72::/:/sbin/nologin
oprofile:x:16:16:Special user account to be used byOProfile:/var/lib/oprofile:/sbin/nologin
vmtest:x:1000:1000:vmtest:/home/vmtest:/bin/bash
oracle:x:1001:1001::/home/oracle:/bin/bash
第三步:创建安装目录
新建文件夹(软件目录)
[root@localhost vmtest]# mkdir -p /u01/app/oracle
将文件夹分配给用户oracle
[root@localhost vmtest]# chown oracle:dba /u01/app/oracle
设置文件夹权限
[root@localhost vmtest]# chmod 777 /u01/app/oracle
新建附属文件夹
[root@localhost vmtest]# mkdir /u01/app/oraInventory
[root@localhost vmtest]# chown oracle:dba /u01/app/oraInventory
[root@localhost vmtest]# chmod 775 /u01/app/oraInventory
验证刚才的操作
[root@localhost vmtest]# ls -l /u01/app
total 0
drwxrwxrwx. 2 oracle dba 6 Aug 2 07:52 oracle
drwxrwxr-x. 2 oracle dba 6 Aug 2 07:55 oraInventory
第四步:修改linux内核文件
打开/etc/sysctl.conf,
[root@localhost vmtest]# vi /etc/sysctl.conf
按键盘上i,进入插入模式,将红色那一段文字添加到文件末尾,按esc,然后输入:wq保存
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
kernel.shmmax = 68719476736
kernel.shmall = 6029312
kernel.shmmni = 4096
kernel.sem =250 32000 100 128
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
net.ipv4.ip_local_port_range =9000 65500
fs.file-max=65536
fs.aio-max-nr=1048576
~
~
"/etc/sysctl.conf" 55L, 794C written
修改limits文件
[root@localhost vmtest]# vi /etc/security/limits.conf
# /etc/security/limits.conf
#
#This file sets the resource limits for the users logged in viaPAM.
#It does not affect resource limits of the system services.
#
#Also note that configuration files in /etc/security/limits.ddirectory,
#which are read in alphabetical order, override the settings inthis
#file in case the domain is the same or more specific.
#That means for example that setting a limit for wildcard domainhere
#can be overriden with a wildcard setting in a config file inthe
#subdirectory, but a user specific setting here can be overridenonly
#with a user specific setting in the subdirectory.
#
#Each line describes a limit for a user in the form:
#
#<domain> <type> <item> <value>
#
#Where:
#<domain> can be:
# - a user name
# - a group name,with @group syntax
# - the wildcard *,for default entry
# - the wildcard %,can be also used with %group syntax,
# formaxlogin limit
#
#<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 - limitsthe core file size (KB)
# - data - max data size (KB)
# - fsize - maximumfilesize (KB)
# - memlock - maxlocked-in-memory address space (KB)
# - nofile - maxnumber of open file descriptors
# - rss - maxresident set size (KB)
# - stack - maxstack size (KB)
# - cpu - max CPUtime (MIN)
# - nproc - maxnumber of processes
# - as - addressspace limit (KB)
# - maxlogins - maxnumber of logins for this user
# - maxsyslogins -max number of logins on the system
# - priority - thepriority to run user process with
# - locks - maxnumber of file locks the user can hold
# - sigpending -max number of pending signals
# - msgqueue - maxmemory used by POSIX message queues (