Shell programming oracle10g installation preparations before rhel6.4, oracle10grhel6.4

Source: Internet
Author: User

Shell programming oracle10g installation preparations before rhel6.4, oracle10grhel6.4

OS: rhel6.4

Oracle: 10.2.0.1

Because oracle10g has been released for a long time and many packages used for 10g have been updated to a new version, many strange problems may occur during the installation process.

For example, 64 requires many 32-bit packages for the system. For example, after completing the following steps

Bug 8993720: error invoking target 'collector 'OF makefile' $ O_H/SYSMAN/LIB/INS_EMDB.MK'

But you can ignore it directly.

#! /Bin/bash # author: wjf # date: 2015/04/22 # desc: before install oracle 10g on rhel6.3echo "this version is applicable to installing oracle 10g on rhel 6.4 platform" v_install_user = export lev_curr_date = 'date + % Y % m % d % H % m' rpm- binutils-2. * compat-db-4. * control-center-2. * gcc-c ++-* glibc-2. * glibc-common-2. * libstdc ++-devel-* make-3. * pdksh-5. \ * sysstat-* compat-libstdc ++-33-*>/tmp/wjf_rpm.txtrpm-q libXp libXt libXtst glibc-devel | g Rep i686>/tmp/keys = 'cat/tmp/wjf_rpm.txt | grep not | grep installed | cut-d ''-f 2' v _ not_installed_packages = 'echo-ne $ {v_not_installed_packages_tmp} | sed's // g'' if [-n "$ {v_not_installed_packages}"] then echo $ {v_not_installed_packages} echo "Install the above package and reinstall it. program "else #======= user (Group) check create echo "start user (Group) creation ...... "For v_is_group in" dba "" users "" oinstall "do v_is_group_exist = 'cut-d ': '-f 1/etc/group | grep $ {v_is_group}' if [-z "$ {v_is_group_exist}"] then groupadd $ {v_is_group} echo "add $ {v_is_group} group "fi done if [-z 'cat/etc/passwd | grep $ {v_install_user} '] then echo" added to the "else echo" $ {v_is_group} group already exists {v_install_user} "useradd-g oinstall-G dba, started $ {v_install_user} passwd $ {v_install_user} else echo "User $ {v_install_user} already exists" fi #=========== Kernel Parameter Adjustment echo "Start kernel Parameter Adjustment "echo" backup Kernel Parameter file/etc/sysctl. conf to/etc/sysctl. conf. $ {v_curr_date }. bak "cp/etc/sysctl. conf/etc/sysconfig. conf. $ {v_curr_date }. bak echo "Modify kernel parameters to/etc/sysctl. conf "echo-ne" kernel. shmall = 2097152 \ nkernel. shmmax = 2147483648 \ nkernel. shmmni = 4096 \ nkernel. sem = 250 32000 100 128 \ nfs. file-max = 65536 \ nnet. ipv4.ip _ local_port_range = 1024 65000 \ nnet. core. rmem_default = 262144 \ nnet. core. rmem_max= 262144 \ nnet. core. wmem_default = 262144 \ nnet. core. wmem_max = 262144 \ n ">/etc/sysctl. conf sysctl-p> NULL #============ adjust user resource limit echo "start user resource limit adjustment" echo "Back up user resource limit file/etc/ security/limits. conf to/etc/security/limits. conf. $ {v_curr_date }. bak "cp/etc/security/limits. conf/etc/security/limits. conf. $ {v_curr_date }. bak echo "backup/etc/pam. d/login file to/etc/pam. d/login. $ {v_curr_date }. bak "cp/etc/pam. d/login/etc/pam. d/login. $ {v_curr_date }. bak echo "Adjusting user resource limits" echo-ne "oracle soft nproc 16384 \ noracle hard nproc 16384 \ noracle soft nofile 65536 \ noracle hard nofile 65536 \ n">/etc/security /limits. conf echo "session required pam_limits.so">/etc/pam. d/login #============= install directory build echo "Start installation directory change" echo "Enter the oracle installation directory" read v_install_path echo "create Installation directory "mkdir-p $ {v_install_path} echo" Change directory owner (Group) "chown-R $ {v_install_user }: oinstall $ {v_install_path} echo "Change directory permissions to 755" chmod 755 $ {v_install_path }#============= environment variable change echo "start to change USER environment variable "echo-ne" export ORACLE_BASE =$ {v_install_path} \ nexport ORACLE_HOME =\ {ORACLE_BASE}/product/10.2.0/db_1 \ nexport LD_LIBRARY_PATH =\$ {ORACLE_HOME }/ lib \ nexport PATH =\\ {PATH }: \ $ {ORACLE_HOME}/bin \ n ">/home/$ {v_install_user }/. bash_profile echo "all settings are complete. Run the oracle installation script" fi

Output result

[Root @ localhost wjf_scripts] # bash pre-install-oracle.sh this version is suitable for installing oracle 10g on rhel 6.4 platform to start user (Group) setup ...... The dba group already exists. The region group already exists. The oinstall group already exists. The user oracle has started Kernel Parameter Adjustment backup Kernel Parameter file/etc/sysctl. conf to/etc/sysctl. conf.201504231800.bak modify the kernel parameters to/etc/sysctl. conf start user resource limit adjustment backup user resource limit file/etc/security/limits. conf to/etc/security/limits. conf.201504231800.bak backup/etc/pam. d/login file to/etc/pam. d/login.201504231800.bak adjust user resource limit start installation directory adjustment please enter the oracle installation directory/oracle create installation directory Change directory owner (Group) change the directory permission to 755 and start to change all the settings of the user's environment variables. Run the oracle installation script [root @ localhost wjf_scripts] #
Incomplete

1. Change the number of kernel memory and resource limits by changing the file. If the script is repeatedly executed in the same environment, the file content is repeated.


Summarize the knowledge points

1. Use of sed stream Editor

Delete the sed/match content in the matched row/d/tmp/ceshi.txt. It only outputs the result and does not change the original file.

Replace sed s/replaced content/g/tmp/ceshi.txt, which replaces all matching characters, that is, the global

-I stores the content in the file, such as sed/matched content/d-I/tmp/ceshi.txt

2. grep matches multiple conditions.

Grep-E 'a | B | C'

3. The mkdir directory already exists.

If the directory already exists, an error is reported.

If the "-p" parameter is added, no error is reported. However, the "-p" parameter is used to create a parent directory. If this parameter is used, no directory is created again, that is, files in the original directory will not be deleted.

4. cut command review

Cut-d': '-f 2/tmp/123.txt

5. Review of the date command

Date sets the time display format.



Related Article

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.