Shell Programming oracle10g pre-installation in rhel6.4 preparation work

Source: Internet
Author: User
Tags dba parent directory

os:rhel6.4

oracle:10.2.0.1

Because the oracle10g comes out for a long time, many 10g packages have been updated to the new version, so there are a lot of strange problems during the installation process.

For example, 64 requires a lot of 32-bit packages for the system, such as following the steps to complete the installation of the software process will still have

Bug 8993720:error invoking TARGET ' COLLECTOR ' of MAKEFILE ' $O _h/sysman/lib/ins_emdb.mk '

appear, but can be directly continue ignored.

#!/bin/bash#author:wjf#date:2015/04/22#desc:before Install Oracle 10g on Rhel6.3echo "This version is for installing Oracle 10g on the Rhel 6.4 platform" v_ Install_user=oraclev_curr_date= ' Date +%y%m%d%h%m ' rpm-q binutils-2.* compat-db-4.* control-center-2.* gcc-* gcc-c++-* glibc-2.* glibc-common-2.* libstdc++-* libstdc++-devel-* make-3.* pdksh-5.\* sysstat-* compat-libstdc++-33-* >/tmp/ Wjf_rpm.txtrpm-q libxp libxt libxtst glibc-devel |grep i686 >>/tmp/wjf_rpm.txtv_not_installed_packages_tmp= ' 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 "Please re-run Setup after installing the above package" else#======= User (group) Check build echo "Start User (group) build ..." for V_is_group in "DBA" "Oper" "O                        Install "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 complete" Else echo "${v_is_group} Group already exists" fi done if [-Z ' cat/etc/passwd |grep ${ V_install_user} ' then echo ' Add user ${v_install_user} ' UserA                        Dd-g oinstall-g dba,oper ${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 128\nfs.file-max = 65536\nnet.ipv4.ip_local_port_range = 1024x768 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 limits echo "Start user resource limit adjustment" echo "Backup 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 E Cho "Backing up/etc/pam.d/login files to/etc/pam.d/login.${v_curr_date}.bak" Cp/etc/pam.d/login/etc/pam.d/login.${v_curr_dat E}.bak echo "Adjust user resource Limits" echo-ne "Oracle soft Nproc 16384\noracle Hard n Proc 16384\noracle soft Nofile 65536\noracle hard nofile 65536\n ">>/etc/securit Y/limits.conf echo "Session required pam_limits.so" >>/etc/pam.d/login#=========== installation directory build echo "Start installation Catalog Adjustment "echo" Please enter the Oracle installationDirectory "read V_install_path echo" Set up 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 changing user environment variables" echo-ne "Export Oracle_base=${v_install_path}\nexport Oracle_home=\${orac Le_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 complete, run the Oracle installation script directly "fi

Output results

[[email protected] wjf_scripts]# Bash pre-install-oracle.sh This release applies to the installation of Oracle 10g starting User (group)   on the Rhel 6.4 platform ... DBA group already exists   Oper group already exists   Oinstall group already exists   user Oracle already exists start kernel parameter tuning   backup kernel parameter file/etc/sysctl.conf to/etc/ Sysctl.conf.201504231800.bak   Modify kernel parameters to/etc/sysctl.conf start user resource limit adjust   Backup user resource limit file/etc/security/limits.conf to/ Etc/security/limits.conf.201504231800.bak   backing up/etc/pam.d/login files to/etc/pam.d/login.201504231800.bak   Adjust user resource limits to start the installation directory adjustment   Please enter the installation directory of Oracle/oracle   set up the installation directory   Change directory owner (group)   Change directory permissions to 755  
A Place not perfect

1, changing the way the file changes the kernel memory and resource limits, if the same environment in the repeated execution of this script, the contents of the file is duplicated.


Summarize the points of knowledge

1, the use of the SED flow editor

Delete match line sed/match content/d/tmp/ceshi.txt it only outputs the result and does not change the original file.

Replace the contents of the SED s/replaced content/replaced content/g/tmp/ceshi.txt it will replace all matching words nonalphanumeric, that is, the default global

-I saves the content in a file, such as sed/match content/d-i/tmp/ceshi.txt

2. grep matches multiple conditions

Grep-e ' a| b| C

3, mkdir already exists directory

If the directory already exists, the error will be directly.

Plus the parameter "-P" will not error, but the-p parameter to create the parent directory, using this parameter will not recreate the directory, that is, the files in the original directory will not be deleted.

4. Cut Command Review

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

5. Date Command Review

Date sets the time display format.



Shell Programming oracle10g pre-installation in rhel6.4 preparation work

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.