//创建Oracle用户组oinstall
[root@localhost file]# groupadd oinstall
//创建Oracle用户组dba
[root@localhost file]# groupadd dba
//将oracle用户加入到新建的2个用户组
[root@localhost file]# useradd -g oinstall -G dba oracle
//修改oracle用户密码
[root@localhost file]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: it is WAY too short
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
//创建oracle安装目录
[root@localhost file]# mkdir -p /usr/oracle
//创建oracle安装文件目录
[root@localhost file]# mkdir -p /opt/oracle/orainstall
//更改oracle安装目录用户组
[root@localhost file]# chown -R oracle:oinstall /usr/oracle/
//更改oracle安装目录权限
[root@localhost file]# chmod -R 775 /usr/oracle/
//更改oracle安装文件目录用户组
[root@localhost file]# chown -R oracle:oinstall /opt/oracle/orainstall/
//更改oracle安装文件目录操作权限
[root@localhost file]# chmod -R 755 /opt/oracle/orainstall/
[root@localhost file]#
5.配置系统参数,root用户修改 ①编辑内核参数:vim /etc/sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
#
# Use '/sbin/sysctl -a' to list all possible parameters.
# Controls IP packet forwarding
net.ipv4.ip_forward = 0
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0
# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1
# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1
# Controls the default maxmimum size of a mesage queue
kernel.msgmnb = 65536
# Controls the maximum size of a message, in bytes
kernel.msgmax = 65536
# Controls the maximum shared segment size, in bytes
kernel.shmmax = 2147483648
# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 2097152
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
fs.file-max = 6815744
# .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
# use for oracle
export ORACLE_BASE=/usr/oracle
export ORACLE_HOME=$ORACLE_BASE/product
export ORACLE_SID=orcl
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
#防止Oracle安装界面乱码,先把语言环境改为英文
export LANG=en_US
if [ $USER = "oracle" ];then
if [ $SHELL = "/bin/ksh" ];then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi