Oracle Installation of Automatic Installation Software Package for the first time
1. install required software packages automatically in Oracle
Configure the yum repository in advance
Define the package.txt package list file: Take the official website RHEL6 as an example. Here, compat-libstdc ++ has two packages. If no * is added, the compat-libstdc ++-33-3.2.3-69.el6.x86_64, compat-libstdc ++-296-2.96-144.el6.i686 these two packages cannot be directly identified. You need to use * to represent the two packages. If a package is missing during installation, you can use the command: yum provides providers' File
Binutils
Compat-libcap1
Compat-libstdc ++ *
Gcc
Gcc-c ++
Glibc
Glibc-devel
Ksh
Libgcc
Libstdc ++
Libstdc ++-devel
Libaio
Libaio-devel
Make
Sysstat
Write the installation script package. sh: Define the Installation log to/root/package. log, and check the installation status after installation.
#! /Bin/bash
For I in 'cat/root/package.txt'
Do
Rpm-q $ I
If [$? -Eq 0]; then
Echo "Package $ I is already intsalled">/root/package. log 2> & 1
Else
Yum install-y $ I
Echo "Package $ I is now installed">/root/package. log 2> & 1
Fi
Done
Ii. automatically add users and user groups
Automatically add user groups, create directories, define oracle passwords, add environment variables, kernel parameters, and set oracle passwords to oracle
#! /Bin/bash
For I in dbaoinstall
Do
Cat/etc/group | grep $ I>/dev/null2> & 1
If [$? -Eq 0]; then
Echo "Group $ I is already exist"
Else
Groupadd-r $ I
Fi
Done
Id oracle>/dev/null 2> & 1 & echo "User Oracle is already exist" | useradd-g oinstall-G dba oracle
# Set password for oracle
Echo "oracle" | passwd -- stdin oracle
# Create dictionary for install
Mkdir-p/u01/app
Chown-R oracle: oinstall/u01/app
Chmod 775-R/u01/app