The following articles mainly introduce the specific operation methods of Oracle Installation scripts. If you are a beginner in the practical application of Oracle Installation scripts, you can use the following articles to better understand how to correctly use the Oracle installation script. The following is a detailed description of the article.
After reading the Oracle Installation video from instructor Xiao Bu, I found that Oracle installation was really depressing. There is no difficulty, that is, the preparations in the early stage are messy. Therefore, I compiled an Oracle installation script, including modifying the host name, setting kernel variables, and creating users. In this way, you do not need to repeat the same job. The following is my script and Installation notes.
- #!/bin/bash
- # Oracle
- # 2009/03/12 first twtcom
- # set variable
- # Oracle_BASE=/u1
- echo -n "Please enter HOSTNAME(default Oracle):"
- read HOSTNAME
- if [ -z $HOSTNAME ]
- then
- HOSTNAME=Oracle
- fi
- echo -n "Please enter Oracle_BASE(default /u1):"
- read Oracle_BASE
- if [ -z $Oracle_BASE ]
- then
- Oracle_BASE=/u1
- fi
- # Oracle_HOME=$Oracle_BASE/Oracle
- echo -n "Please enter HOME(default Oracle):"
- read HOME
- if [ -z $HOME ]
- then
- HOME=Oracle
- fi
- Oracle_HOME=$Oracle_BASE/$HOME
- # Oracle_SID=oral
- echo -n "Please enter Oracle_SID(default oral):"
- read Oracle_SID
- if [ -z $Oracle_SID ]
- then
- Oracle_SID=oral
- fi
- USER=Oracle
- SYSCTL=/etc/sysctl.conf
- LIMITS=/etc/security/limits.conf
- PAM=/etc/pam.d/login
- PROFILE=/etc/profile
- BASH_PROFILE=$Oracle_HOME/.bash_profile
- IPADDR=`ifconfig eth0|grep "inet addr"
|cut -d : -f 2|cut -d ' ' -f 1`
- HOSTS=/etc/hosts
- NETWORK=/etc/sysconfig/network
- # hostname
- grep -v "HOSTNAME" $NETWORK > $NETWORK
- echo "HOSTNAME=$HOSTNAME" >> $NETWORK
- echo "$IPADDR $HOSTNAME">> $HOSTS
- # useradd
- mkdir -p $Oracle_BASE
- groupadd oinstall
- groupadd dba
- useradd -g oinstall -G dba -d $Oracle_HOME $USER
- chown -R $USER:oinstall $Oracle_BASE
- cat >> $SYSCTL << EOF
- kernel.shmall = 2097152
- kernel.shmmax = 2147483648
- kernel.shmmni = 4096
- kernel.sem = 250 32000 100 128
- net.ipv4.ip_local_port_range = 1024 65000
- net.core.rmem_default = 262144
- net.core.rmem_max = 4194304
- net.core.wmem_default = 262144
- net.core.wmem_max = 262144
- EOF
- cat >> $LIMITS <<EOF
- Oracle soft nproc 2047
- Oracle hard nproc 16384
- Oracle soft nofile 1024
- Oracle hard nofile 65536
- EOF
- cat >> $PAM <<EOF
- session required pam_limits.so
- EOF
Cat >>$ PROFILE <EOF
- if [ \$USER = "oracle" ]; then
- if [ \$SHELL = "/bin/ksh" ]; then
- ulimit -p 16384
- ulimit -n 65536
- else
- ulimit -u 16384 -n 65536
- fi
- fi
- EOF
- cat >> $BASH_PROFILE <<EOF
- ORACLE_BASE=\$ORACLE_BASE
- ORACLE_HOME=\$ORACLE_BASE/oracle
- ORACLE_SID=twtcom
- PATH=\$ORACLE_HOME/bin:\$PATH
- export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
- EOF
- sleep 1
- /sbin/sysctl -p
- /etc/init.d/network restart
Install b32002.pdf on racle11g
I,
1. Check the Software Package
Install guild P52
2. Create a directory
- mkdir -p /u1
- groupadd oinstall
- groupadd dba
- useradd -g ointall -G dba -d /u1/oracle oracle
- chown -R oracle:oinstall /u1
Id nobody check whether there are nobody users
3. modify the configuration file
- /etc/sysctl.conf
- kernel.shmall = 2097152
- kernel.shmmax = 2147483648
- kernel.shmmni = 4096
- kernel.sem = 250 32000 100 128
- net.ipv4.ip_local_port_range = 1024 65000
- net.core.rmem_default = 262144
- net.core.rmem_max = 4194304
- net.core.wmem_default = 262144
- net.core.wmem_max = 262144
- /etc/security/limits.conf
- oracle soft nproc 2047
- oracle hard nproc 16384
- oracle soft nofile 1024
- oracle hard nofile 65536
- /etc/pam.d/login
- session required pam_limits.so
- /etc/profile
- if [ $USER = "oracle" ]; then
- if [ $SHELL = "/bin/ksh" ]; then
- ulimit -p 16384
- ulimit -n 65536
- else
- ulimit -u 16384 -n 65536
- fi
- fi
- su - oracle
Pwd: the default directory is/u1/oracle.
- vi .bash_profile
- ORACLE_BASE=/u1
- ORACLE_HOME=$ORACLE_BASE/oracle
- ORACLE_SID=twtcom
- PATH=$ORACLE_HOME/bin:$PATH
- export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
- vi /etc/hosts
- 192.168.152.100 oracle
- ping oracle
Chapter 3 oracle database Installation
Oui
Advance install
Do not create a database
New Features of netca 11g
Dbca 11g3 type: 10g4 type
Character set AL32UTF8 recommended types can store many Chinese Characters
$ ORACLE_BASE/oridata Storage Data
Stty erase ^ h
The above content is a description of the Oracle installation script, hoping to help you in this regard.