Oracle安装前的环境准备
前面讲了虚拟机的设置和OracleLinux的安装,接下来我们来说下Oracle安装前的准备工作。
如有问题请联系QQ:562050054 1、系统信息查看 系统信息查看 首先服务器ip:192.168.8.120 服务器系统:Oracle Linux Server release 6.5 服务器主机名:oracle-learn 查看磁盘空间情况: [[email?protected] ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 32G 4.8G 26G 17% / tmpfs 3.9G 224K 3.9G 1% /dev/shm /dev/sdc1 197G 60M 187G 1% /oracle /dev/sdb1 40G 48M 38G 1% /soft /oracle目录用于安置oracle [[email?protected] ~]# mount /dev/cdrom /mnt mount: block device /dev/sr0 is write-protected,mounting read-only 检查是否挂载成功 [[email?protected] ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 32G 4.8G 26G 17% / tmpfs 3.9G 224K 3.9G 1% /dev/shm /dev/sdc1 197G 60M 187G 1% /oracle /dev/sdb1 40G 48M 38G 1% /soft /dev/sr0 3.7G 3.7G 0 100% /mnt 1、设置yum配置 [[email?protected] ~]# cd /etc/yum.repos.d/ [[email?protected] yum.repos.d]# mv public-yum-ol6.repo public-yum-ol6.repofuben [[email?protected] yum.repos.d]# ll 总用量 4 -rw-r--r--. 1 root root 2545 10月 29 2018 public-yum-ol6.repofuben [[email?protected] yum.repos.d]# 2、设置yum的配置 [[email?protected] yum.repos.d]# vim /etc/yum.conf 添加如下内容: [EL] name =Oracle Linux 6.5 baseurl=file:///mnt/Server/ gpgcheck=0 enabled=1 保存并退出 3、安装Oracle需要的软件包 yum install binutils -y yum install compat-libcap1 -y yum install compat-libstdc++-33 -y yum install gcc -y yum install gcc-c++ -y yum install glibc -y yum install glibc-devel -y yum install ksh -y yum install libgcc -y yum install libstdc++ -y yum install libstdc++-devel -y yum install libaio -y yum install libaio-devel -y yum install libXext -y yum install libXtst -y yum install libX11 -y yum install libXau -y yum install libxcb -y yum install libXi -y yum install make -y yum install sysstat -y yum install unixODBC -y yum install unixODBC-devel –y 4、hosts文件配置 [[email?protected] /]# vi /etc/hosts 在最后添加如下内容: [[email?protected] ~]# /usr/sbin/groupadd -g 60001 oinstall /usr/sbin/groupadd -g 60002 dba [[email?protected] ~]# /usr/sbin/groupadd -g 60002 dba /usr/sbin/groupadd -g 60003 oper [[email?protected] ~]# /usr/sbin/groupadd -g 60003 oper [[email?protected] ~]#/usr/sbin/useradd -u 61002 -g oinstall -G dba oracle [[email?protected] ~]# /usr/sbin/useradd -u 61002 -g oinstall -G dba oracle 查看oracle用户 [[email?protected] ~]# id oracle uid=61002(oracle) gid=60001(oinstall) 组=60001(oinstall),60002(dba) [[email?protected] ~]# 设置Oracle密码 [[email?protected] ~]# passwd oracle 更改用户 oracle 的密码 。 新的 密码: 无效的密码: 它基于字典单词 无效的密码: 过于简单 重新输入新的 密码: passwd: 所有的身份验证令牌已经成功更新。 [[email?protected] ~]# 我这里为了方便,oracle用户的密码是oracle。 [[email?protected] ~]# cd /oracle [[email?protected] oracle]# mkdir -p /oracle/app/oracle/product/11.2.0/db_1 [[email?protected] oracle]# chown -R oracle:oinstall /oracle [[email?protected] oracle]# chmod -R 775 /oracle/ [[email?protected] oracle]# 7、修改操作系统参数 [[email?protected] oracle]# vi /etc/security/limits.conf #ORACLE SETTING oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 oracle hard stack 32768 7.2修改/etc/security/limits.d/90-nproc.conf文件内容 [[email?protected] oracle]# vi /etc/security/limits.d/90-nproc.conf 注释掉 [[email?protected] oracle]# cat /etc/security/limits.d/90-nproc.conf # Default limit for number of user‘s processes to prevent # accidental fork bombs. # See rhbz #432903 for reasoning. #* soft nproc 1024 * - nproc 16384 root soft nproc unlimited [[email?protected] oracle]# 7.3禁用SELINUX [[email?protected] oracle]# vi /etc/selinux/config SELINUX=enforcing [[email?protected] oracle]# setenforce 0 7.4关闭iptables防火墙 [[email?protected] oracle]# service iptables stop iptables:将链设置为政策 ACCEPT:filter [确定] iptables:清除防火墙规则: [确定] iptables:正在卸载模块: [确定] [[email?protected] oracle]# 也可以设置永久关闭防火墙 [[email?protected] oracle]# chkconfig iptables off [[email?protected] oracle]# 7.5修改/etc/pam.d/login文件 [[email?protected] oracle]# vi /etc/pam.d/login 添加 #ORACLE SETTING session required pam_limits.so 7.6修改sysctl.conf配置文件 [[email?protected] ~]# vi /etc/sysctl.conf 注释 #ORACLE SETTING fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmmax = 8589934592 kernel.shmall = 2097152 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 kernel.shmmax和kernel.shmall的计算方法: 让配置生效: [[email?protected] ~]# sysctl -p 8、环境变量设置 [[email?protected] ~]# su - oracle [[email?protected] ~]$ 修改环境变量 [[email?protected] ~]$ vi ~/.bash_profile 添加如下: #Oracle Settings oracle TMP=/tmp; export TMP TMPDIR=$TMP; export TMPDIR #export LANG=en_US ORACLE_BASE=/oracle/app/oracle; export ORACLE_BASE ORACLE_HOME=$ORACLE_BASE/product/11.2.0; export ORACLE_HOME ORACLE_SID=orcl; export ORACLE_SID ORACLE_TERM=xterm; export ORACLE_TERM PATH=/usr/sbin:$PATH; export PATH PATH=$ORACLE_HOME/bin:$PATH; export PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG if [ $USER = "oracle" ] || [ $USER = "grid" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi umask 022 fi 其中ORACLE_SID=orcl;可以自定义数据库的sid [[email?protected] ~]$ exit logout [[email?protected] ~]# 在登录oracle用户检查环境变量参数 [[email?protected] ~]# su - oracle [[email?protected] ~]$ env |grep ORACLE ORACLE_SID=orcl ORACLE_BASE=/oracle/app/oracle ORACLE_TERM=xterm ORACLE_HOME=/oracle/app/oracle/product/11.2.0 [[email?protected] ~]$ 至此,Oracle安装前的准备完毕。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |