#习惯,创建完进行查看
[root@centos7 tools]# ll /application/ 总用量 0 drwxr-xr-x 2 root root 6 8月 31 11:27 database drwxr-xr-x 2 root root 6 8月 31 11:27 oracle drwxr-xr-x 2 root root 6 8月 31 11:27 oraInventory [root@centos7 tools]# 1.2.4 对创建的目录进行授权
#设置目录所有者为oinstall用户组的oracle用户
[root@centos7 tools]# chown -R oracle:oinstall /application/{database,oracle,oraInventory} #查看是否创建成功 [root@centos7 tools]# ll /application/ 总用量 0 drwxr-xr-x 2 oracle oinstall 6 8月 31 11:27 database drwxr-xr-x 2 oracle oinstall 6 8月 31 11:27 oracle drwxr-xr-x 2 oracle oinstall 6 8月 31 11:27 oraInventory [root@centos7 tools]#
开始部署
1.3.1 安装oracle数据库所需要的软件包
[root@centos7 tools]#yum install gcc* gcc-* gcc-c++-* glibc-devel-* glibc-headers-* compat-libstdc* libstdc* elfutils-libelf-devel* libaio-devel* sysstat* unixODBC-* pdksh-* 6
1.3.2 修改内核参数
[root@centos7 ~]# cat /etc/sysctl.conf # System default settings live in /usr/lib/sysctl.d/00-system.conf. # To override those settings, enter new settings here, or in an /etc/sysctl.d/
1.3.3 对oracle用户设置限制,提高软件运行性能
红色的为添加的内容
[root@centos7 ~]# cat /etc/security/limits.conf # /etc/security/limits.conf # #
# #This file sets the resource limits for the users logged in via PAM. # #It does not affect resource limits of the system services. # #
# #Also note that configuration files in /etc/security/limits.d directory, # #which are read in alphabetical order, override the settings in this # #file in case the domain is the same or more specific.
# #That means for example that setting a limit for wildcard domain here # #can be overriden with a wildcard setting in a config file in the #subdirectory, but a user specific setting here can be overriden only #with a user specific setting in the subdirectory. #
#Each line describes a limit for a user in the form: #
#
#
# - a group name, with @group syntax # - the wildcard *, for default entry
# - the wildcard %, can be also used with %group syntax, # for maxlogin limit
8
#
#
# - \# - \#
#
# - memlock - max locked-in-memory address space (KB) # - nofile - max number of open file descriptors # - rss - max resident set size (KB) # - stack - max 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, 19] # - rtprio - max realtime priority #
#
#* soft core 0
9
#* hard rss 10000 #@student hard nproc 20 #@faculty soft nproc 20 #@faculty hard nproc 50 #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
1.3.4 配置用户的环境变量
[root@centos7 ~]# vim /home/oracle/.bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/.local/bin:$HOME/bin export PATH export ORACLE_BASE=/application/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=en_US.utf8 #防止安装过程出现乱码 export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK #设置Oracle客户端字符集,必须与Ora cle安装时设置的字符集保持一致 10