从安装Linux到Oracle数据安装详细图解过程

1.安装linux系统

2. 选择版本

3.选择路径

4.磁盘大小设置

5.选择镜像和设置内存大小

6.启动安装linux系统,回车

7. Tab键选择skip 再回车

8.Next继续

9.选择磁盘自定义分区

10.选择标准分区

10.下面是进行的分区

11.选择安装方式

DesktopEnvironments:
GNOMEDesktopEnvironment
Applications:
Editors
Development:
DevelopmentLibraries
DevelopmentTools
GNOMESoftware Development
LegacySoftwareDevelopment
XsoftwareDevelopment
BaseSystem:
AdministrationTools
Base LegacySoftwareSupport
SystemTools
XWindowSystem

 

11安装

12重启

12.镜像安装

13.配置IP地址和关闭防火墙

vi /etc/sysconfig/network-scripts/ifcfg-eth0

service network restart

service ipitables stop

chkconfig iptables off

14.xshell连接安装yum源和依赖包

#!/bin/bash

####################################################################################

#配置本地YUM并安装依赖包

####################################################################################

mount /dev/cdrom /mnt/

cd /etc/yum.repos.d/

rename .repo .repo.bak * 

touch /etc/yum.repos.d/CentOS-Media.repo

cat <<EOF >/etc/yum.repos.d/CentOS-Media.repo

[local]

name=local

baseurl=file:///mnt

gpgcheck=0

enabled=1

EOF

yum clean all       #清理本地缓存

yum clean plugins   #清理插件缓存

echo 'multilib_policy=all' >> /etc/yum.conf

#依赖包安装

yum install -y binutils-*
yum install -y compat-libstdc++-*
yum install -y elfutils-libelf-*
yum install -y elfutils-libelf-*
yum install -y elfutils-libelf-devel-static-*
yum install -y elfutils-libelf-devel
yum install -y gcc-*
yum install -y gcc-c++-*
yum install -y glibc-*
yum install -y glibc-common-*
yum install -y glibc-devel-*
yum install -y glibc-headers-*
yum install -y kernel-headers-*
yum install -y ksh-*
yum install -y libaio-*
yum install -y libaio-devel-*
yum install -y libgcc-*
yum install -y libgomp-*
yum install -y libstdc++-*
yum install -y libstdc++-devel-*
yum install -y make-*
yum install -y sysstat-*
yum install -y compat-libcap*
yum install -y unixODBC
yum install -y unixODBC-devel
yum install -y readline
yum install -y readline-devel
yum install -y libcap
yum install -y xorg-x11-xauth
yum install -y xterm*
yum install -y bind*
yum install -y libXp
yum install -y numactl-devel-*
yum install -y openssh-clients
yum install -y smartmontools
yum install -y bind bind-chroot bind-utils bind-libs
yum install -y unzip zip
yum install -y libXtst
yum install -y libXi
yum install -y net-tools

 

[root@node1 ~]# cat user_group.sh
#!/bin/bash
####################################################################################
#创建oracle用户和用户组
USERID="600"
GROUPID="600"
#检查GROUPID是否被占用
groupnum=`cat /etc/group | sort -t: -g +2 -3 | grep -v nfsnobody | cut -f3 -d":" | t
ail -1`if [ "${groupnum}" -ge "${GROUPID}" ]; then
    GROUPID=`expr $groupnum + 1`
fi
#检查USERID是否被占用
usernum=`cat /etc/passwd | sort -t: -g +2 -3 | grep -v nfsnobody | cut -f3 -d":" | t
ail -1`if [ "${usernum}" -ge "${USERID}" ]; then
    USERID=`expr $usernum + 1`
fi
#创建oinstall组
/bin/grep "^oinstall" /etc/group > /dev/null 2>&1
if [ $? -eq 0 ]; then
    echo "Group oinstall - 已经存在"
else
    echo "Adding group oinstall with gid ${GROUPID}"
    /usr/sbin/groupadd -g ${GROUPID} oinstall
fi
# 创建附属dba组
/bin/grep "^dba" /etc/group > /dev/null 2>&1
if [ $? -eq 0 ]; then
    echo "Group dba - 已经存在"
else
    echo "Adding group dba"
    /usr/sbin/groupadd dba
fi
# 创建oracle账户,如果已有oracle账号,将自动为该账号设置密码。
/bin/grep "^oracle:" /etc/passwd   > /dev/null 2>&1
if [ $? -ne 0 ]; then
    echo "Adding user oracle with user id ${USERID}, initial login group oinstall, s
upplementary group dba and home directory /home/oracle"    /usr/sbin/useradd -u ${USERID} -g oinstall -G dba -d /home/oracle oracle
    if [ "$?" -eq "0" ]; then
        echo "Changing ownership of /home/oracle to oracle:oinstall"
        /bin/chown oracle:oinstall /home/oracle
    else
        echo -e "\033[31m创建oracle用户失败----------Failed\033[0m"
    fi
else
    echo "用户oracle已经存在"
fi
#----------Modify kernel parameters----------
cat  <<EOF >>/etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
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 = 1048576
EOF
sysctl -p
#----------Modify user restrictions----------
cat  <<EOF >>/etc/security/limits.conf
oracle soft   nofile 1024
oracle hard   nofile 65536
oracle soft   nproc 2047
oracle hard   nproc 16384
oracle soft   stack 10240
oracle hard   stack 32768
grid soft   nofile 1024
grid hard   nofile 65536
grid soft   nproc 2047
grid hard   nproc 16384
grid soft   stack 10240
grid hard   stack 32768
EOF
cp /etc/pam.d/login /etc/pam.d/login.bak
cat  <<EOF >>/etc/pam.d/login
session    required     pam_limits.so
EOF
# 为oracle账户设置密码
echo ${oraclePasswd} | passwd --stdin oracle
if [ $? -eq 0 ]
then
    echo "修改oracle密码 - Success"
else
    echo -e "\033[31m修改oracle密码----------Failed\033[0m"
fi

#检查oracle用户所属组是否正确
id oracle | grep dba > /dev/null 2>&1
if [ $? -eq 0 ]
then
    echo "oracle附属组检查通过"
else
    usermod -aG dba oracle
    if [ $? -eq 0 ]
    then
        echo "用oracle用户添加组成功"
    else
        echo -e "\033[31m用oracle用户添加组失败----------Failed\033[0m"
    fi
fi
#----------add oracle user and group----------
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
#为oracle账户设置密码
echo  oracle | passwd --stdin oracle
if [ $? -eq 0 ]
then
    echo "修改oracle密码 - Success"
else
    echo -e "\033[31m修改oracle密码----------Failed\033[0m"
fi
mkdir -p /u01/app/oracle  

make -p /u01/app/oraInventory
chown -R oracle:oinstall /u01
chmod -R 755 /u01/
#-----add oracle bash_profile------
su - oracle -c "
echo export ORACLE_BASE=/u01/app/oracle >> ~/.bash_profile
echo export ORACLE_HOME=\$ORACLE_BASE/product/11.2.0/dbhome_1 >> ~/.bash_profile
echo export ORACLE_SID=orcl >> ~/.bash_profile
echo export LD_LIBRARY_PATH=\$ORACLE_BASE/lib:/lib:/usr/lib >>~/.bash_profile
echo export PATH=\$ORACLE_HOME/bin:\$ORACLE_HOME/jdk/bin:\$PATH >> ~/.bash_profile
echo export NLS_LANG=\'american_AMERICA.UTF-8\' >> ~/.bash_profile
echo export NLS_DATE_FORMAT=\'YYYY-MM-DD HH24:MI:SS\' >> ~/.bash_profile
echo export PATH >>  ~/.bash_profile
"

17.继续执行,创建用户和用户组以及Oracle用户变量

18.检查Oracle用户和信息

19.上传Oracle软件

20.Oracle用户解压安装

unzip linux.x64_11gR2_database_1of2.zip

unzip linux.x64_11gR2_database_2of2.zip

21.可视化安装Oracle

yum groupinstall "GNOME Desktop" "Graphical Administration Tools"    安装图形界面

调不出窗口报错时

./runInstaller -jreLoc /etc/alternatives/jre_1.8.0  防止后面出现小窗口

 

22.执行完脚本点击finished,完成Oracle软件的安装

23.安装Oracle数据库实例

 

24配置监听文件和本地服务 netca

 

©️2020 CSDN 皮肤主题: 游动-白 设计师:上身试试 返回首页