Example of the actual application code of the Oracle installation script

Source: Internet
Author: User

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.

 
 
  1. #!/bin/bash  
  2. # Oracle  
  3. # 2009/03/12 first twtcom  
  4. # set variable  
  5. # Oracle_BASE=/u1  
  6. echo -n "Please enter HOSTNAME(default Oracle):"  
  7. read HOSTNAME  
  8. if [ -z $HOSTNAME ]  
  9. then  
  10. HOSTNAME=Oracle 
  11. fi  
  12. echo -n "Please enter Oracle_BASE(default /u1):"  
  13. read Oracle_BASE  
  14. if [ -z $Oracle_BASE ]  
  15. then  
  16. Oracle_BASE=/u1  
  17. fi  
  18. # Oracle_HOME=$Oracle_BASE/Oracle  
  19. echo -n "Please enter HOME(default Oracle):"  
  20. read HOME  
  21. if [ -z $HOME ]  
  22. then  
  23. HOME=Oracle 
  24. fi  
  25. Oracle_HOME=$Oracle_BASE/$HOME  
  26. # Oracle_SID=oral 
  27. echo -n "Please enter Oracle_SID(default oral):"  
  28. read Oracle_SID  
  29. if [ -z $Oracle_SID ]  
  30. then  
  31. Oracle_SID=oral 
  32. fi  
  33. USER=Oracle 
  34. SYSCTL=/etc/sysctl.conf  
  35. LIMITS=/etc/security/limits.conf  
  36. PAM=/etc/pam.d/login  
  37. PROFILE=/etc/profile  
  38. BASH_PROFILE=$Oracle_HOME/.bash_profile  
  39. IPADDR=`ifconfig eth0|grep "inet addr"
    |cut -d : -f 2|cut -d ' ' -f 1`  
  40. HOSTS=/etc/hosts  
  41. NETWORK=/etc/sysconfig/network  
  42. # hostname  
  43. grep -v "HOSTNAME" $NETWORK > $NETWORK  
  44. echo "HOSTNAME=$HOSTNAME" >> $NETWORK  
  45. echo "$IPADDR $HOSTNAME">> $HOSTS  
  46. # useradd  
  47. mkdir -p $Oracle_BASE  
  48. groupadd oinstall  
  49. groupadd dba  
  50. useradd -g oinstall -G dba -d $Oracle_HOME $USER  
  51. chown -R $USER:oinstall $Oracle_BASE  
  52. cat >> $SYSCTL << EOF 
  53. kernel.shmall = 2097152 
  54. kernel.shmmax = 2147483648 
  55. kernel.shmmni = 4096 
  56. kernel.sem = 250 32000 100 128  
  57. net.ipv4.ip_local_port_range = 1024 65000  
  58. net.core.rmem_default = 262144 
  59. net.core.rmem_max = 4194304 
  60. net.core.wmem_default = 262144 
  61. net.core.wmem_max = 262144 
  62. EOF  
  63. cat >> $LIMITS <<EOF 
  64. Oracle soft nproc 2047  
  65. Oracle hard nproc 16384  
  66. Oracle soft nofile 1024  
  67. Oracle hard nofile 65536  
  68. EOF  
  69. cat >> $PAM <<EOF 
  70. session required pam_limits.so  
  71. EOF  

Cat >>$ PROFILE <EOF

 
 
  1. if [ \$USER = "oracle" ]; then  
  2. if [ \$SHELL = "/bin/ksh" ]; then  
  3. ulimit -p 16384  
  4. ulimit -n 65536  
  5. else  
  6. ulimit -u 16384 -n 65536  
  7. fi  
  8. fi  
  9. EOF  
  10. cat >> $BASH_PROFILE <<EOF 
  11. ORACLE_BASE=\$ORACLE_BASE  
  12. ORACLE_HOME=\$ORACLE_BASE/oracle  
  13. ORACLE_SID=twtcom 
  14. PATH=\$ORACLE_HOME/bin:\$PATH  
  15. export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH  
  16. EOF  
  17. sleep 1  
  18. /sbin/sysctl -p  
  19. /etc/init.d/network restart  

Install b32002.pdf on racle11g

I,

1. Check the Software Package

Install guild P52

2. Create a directory

 
 
  1. mkdir -p /u1  
  2. groupadd oinstall  
  3. groupadd dba  
  4. useradd -g ointall -G dba -d /u1/oracle oracle  
  5. chown -R oracle:oinstall /u1  

Id nobody check whether there are nobody users

3. modify the configuration file

 
 
  1. /etc/sysctl.conf  
  2. kernel.shmall = 2097152 
  3. kernel.shmmax = 2147483648 
  4. kernel.shmmni = 4096 
  5. kernel.sem = 250 32000 100 128  
  6. net.ipv4.ip_local_port_range = 1024 65000  
  7. net.core.rmem_default = 262144 
  8. net.core.rmem_max = 4194304 
  9. net.core.wmem_default = 262144 
  10. net.core.wmem_max = 262144 
  11. /etc/security/limits.conf  
  12. oracle soft nproc 2047  
  13. oracle hard nproc 16384  
  14. oracle soft nofile 1024  
  15. oracle hard nofile 65536  
  16. /etc/pam.d/login  
  17. session required pam_limits.so  
  18. /etc/profile  
  19. if [ $USER = "oracle" ]; then  
  20. if [ $SHELL = "/bin/ksh" ]; then  
  21. ulimit -p 16384  
  22. ulimit -n 65536  
  23. else  
  24. ulimit -u 16384 -n 65536  
  25. fi  
  26. fi  
  27. su - oracle  

Pwd: the default directory is/u1/oracle.

 
 
  1. vi .bash_profile  
  2. ORACLE_BASE=/u1  
  3. ORACLE_HOME=$ORACLE_BASE/oracle  
  4. ORACLE_SID=twtcom 
  5. PATH=$ORACLE_HOME/bin:$PATH  
  6. export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH  
  7. vi /etc/hosts  
  8. 192.168.152.100 oracle  
  9. 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.