单实例数据库安装脚本

安装脚本

1、1_preusers.sh

#!/bin/bash
#Purpose:Create 3 groups named ‘oinstall‘,‘dba‘,‘oper‘, plus 1 users named ‘oracle‘.
#Also setting the Environment
#variable for oracle user.
#Usage:Log on as the superuser(‘root‘),and then execute the command:#./1preusers.sh
#Author:Arcer Zhang
echo "Now create 3 groups named ‘oinstall‘,‘dba‘,‘oper‘"
echo "Plus 1 users named ‘oracle‘,Also setting the Environment"
groupadd -g 1100 oinstall
groupadd -g 1200 dba
groupadd -g 1300 oper
useradd -u 1000 -g oinstall -G dba,oper -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle
echo "oracle" | passwd --stdin oracle
echo ‘export PS1="`/bin/hostname -s`-> "‘ >> /home/oracle/.bash_profile
echo "export TMP=/tmp" >> /home/oracle/.bash_profile
echo ‘export TMPDIR=$TMP‘>>/home/oracle/.bash_profile
echo "export ORACLE_HOSTNAME=olap.localdomain">> /home/oracle/.bash_profile
echo "export ORACLE_SID=SOURCEDB">> /home/oracle/.bash_profile
echo "export ORACLE_BASE=/u01/app/oracle">> /home/oracle/.bash_profile
echo ‘export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1‘>> /home/oracle/.bash_profile
echo "export ORACLE_UNQNAME=SOURCEDB">> /home/oracle/.bash_profile
echo ‘export TNS_ADMIN=$ORACLE_HOME/network/admin‘ >> /home/oracle/.bash_profile
echo "export ORACLE_TERM=xterm">> /home/oracle/.bash_profile
echo ‘export PATH=/usr/sbin:$PATH‘>> /home/oracle/.bash_profile
echo ‘export PATH=$ORACLE_HOME/bin:$PATH‘>> /home/oracle/.bash_profile
echo ‘export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib‘>> /home/oracle/.bash_profile
echo ‘export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib‘ >> /home/oracle/.bash_profile
echo "export EDITOR=vi" >> /home/oracle/.bash_profile
echo "export LANG=en_US" >> /home/oracle/.bash_profile
echo "export NLS_LANG=american_america.AL32UTF8" >> /home/oracle/.bash_profile
echo "export NLS_DATE_FORMAT=‘yyyy/mm/dd hh24:mi:ss‘" >> /home/oracle/.bash_profile
echo "export DISPLAY=192.168.56.101:0.0" >> /home/oracle/.bash_profile
echo "umask 022">> /home/oracle/.bash_profile
echo "The Groups and users has been created"
echo "The Environment for oracle also has been set successfully"

2_predir.sh

#!/bin/bash
#Purpose:Create the necessary directory for oracle,grid users and change the authention to oracle,grid users.
#Usage:Log on as the superuser(‘root‘),and then execute the command:#./2predir.sh
#Author:Arcer Zhang
echo "Now create the necessary directory for oracle users and change
the authention to oracle users..."
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01
chmod -R 775 /u01
echo "The necessary directory for oracle,grid users and change the authention to oracle,grid users has been finished"

3_prelimits.sh

#!/bin/bash
#Purpose:Change the /etc/security/limits.conf.
#Usage:Log on as the superuser(‘root‘),and then execute the command:#./3prelimits.sh
#Author:Arcer Zhang
echo "Now modify the /etc/security/limits.conf,but backup it named /etc/security/limits.conf.bak before"
cp /etc/security/limits.conf /etc/security/limits.conf.bak
echo "oracle soft nproc 2047" >>/etc/security/limits.conf
echo "oracle hard nproc 16384" >>/etc/security/limits.conf
echo "oracle soft nofile 1024" >>/etc/security/limits.conf
echo "oracle hard nofile 65536" >>/etc/security/limits.conf
echo "Modifing the /etc/security/limits.conf has been succeed."

4_prelogin.sh

#!/bin/bash
#Purpose:Modify the /etc/pam.d/login.
#Usage:Log on as the superuser(‘root‘),and then execute the command:#./4prelimits.sh
#Author:Arcer Zhang
echo "Now modify the /etc/pam.d/login,but with a backup named /etc/pam.d/login.bak"
cp /etc/pam.d/login /etc/pam.d/login.bak
echo "session required /lib/security/pam_limits.so" >>/etc/pam.d/login
echo "session required pam_limits.so" >>/etc/pam.d/login
echo "Modifing the /etc/pam.d/login has been succeed."

5_preprofile.sh

#!/bin/bash
#Purpose:Modify the /etc/profile.
#Usage:Log on as the superuser(‘root‘),and then execute the command:#./5preprofile.sh
#Author:Arcer Zhang
echo "Now modify the /etc/profile,but with a backup named /etc/profile.bak"
cp /etc/profile /etc/profile.bak
echo ‘if [ $USER = "oracle" ]; then‘ >> /etc/profile
echo ‘if [ $SHELL = "/bin/ksh" ]; then‘ >> /etc/profile
echo ‘ulimit -p 16384‘ >> /etc/profile
echo ‘ulimit -n 65536‘ >> /etc/profile
echo ‘else‘ >> /etc/profile
echo ‘ulimit -u 16384 -n 65536‘ >> /etc/profile
echo ‘fi‘ >> /etc/profile
echo ‘fi‘ >> /etc/profile
echo "Modifing the /etc/profile has been succeed."

6_presysctl.sh

#!/bin/bash
#Purpose:Modify the /etc/sysctl.conf.
#Usage:Log on as the superuser(‘root‘),and then execute the command:#./6presysctl.sh
#Author:Arcer Zhang
echo "Now modify the /etc/sysctl.conf,but with a backup named /etc/sysctl.bak"
cp /etc/sysctl.conf /etc/sysctl.conf.bak
echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf
echo "fs.file-max = 6815744" >> /etc/sysctl.conf
echo "kernel.shmall = 2097152" >> /etc/sysctl.conf
echo "kernel.shmmax = 1054504960" >> /etc/sysctl.conf
echo "kernel.shmmni = 4096" >> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500" >> /etc/sysctl.conf
echo "net.core.rmem_default = 262144" >> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304" >> /etc/sysctl.conf
echo "net.core.wmem_default = 262144" >> /etc/sysctl.conf
echo "net.core.wmem_max = 1048586" >> /etc/sysctl.conf
echo "net.ipv4.tcp_wmem = 262144 262144 262144" >> /etc/sysctl.conf
echo "net.ipv4.tcp_rmem = 4194304 4194304 4194304" >> /etc/sysctl.conf
echo "Modifing the /etc/sysctl.conf has been succeed."
echo "Now make the changes take effect....."
sysctl -p

相关参考文章

1、配置本地YUM源

单实例数据库安装脚本,布布扣,bubuko.com

时间: 2024-10-11 06:40:13

单实例数据库安装脚本的相关文章

Linux平台单实例数据库安装

环境概述: 1.OS [[email protected] ~]# uname -a Linux oggtarget.localdomain 2.6.39-200.24.1.el6uek.x86_64 #1 SMP Sat Jun 23 02:39:07 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux 2.DB 11.2.0.4.0 x86_64 bit 操作步骤 1.上传oracle install packages.并解压 2.配置/etc/hosts 127

VM虚拟机下在LINUX上安装ORACLE 11G单实例数据库

VM虚拟机下在LINUX上安装ORACLE 11G单实例数据库 1.环境及安装前规划:虚拟机及OS如下 环境:VMware Wordstation ACE版 6.0.2 操作系统:OracleLinux-R5-U8-Server-i386-dvd    3.2G 安装操作系统,这里需要注意的是磁盘空间要预留足够. 我的规划是: 虚拟机分配1024M内存,当然如果主机内存足够,安装时内存设置2048M可以更快. 虚拟机分配一块磁盘,30G磁盘空间. /boot 100M ext3 /    20G

[oracle部署实施] 基于centos7静默安装oracle 11gr2单实例数据库

基于centos7静默安装oracle 11gr2单实例数据库 1.vmware最小化安装centos7 分配20G硬盘+2G内存+nat网络 400mboot+4Gswap 去除kdump 最小化安装 并配置网络cat /etc/sysconfig/network-scripts/ifcfg-ens32BOOTPROTO="static"DEVICE="ens32"ONBOOT="yes"IPADDR=192.168.188.11NETMASK

【RAC】将RAC备份集恢复为单实例数据库

[RAC]将RAC备份集恢复为单实例数据库 BLOG文档结构图 前言部分 导读 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~: ① rac数据库的备份集是如何恢复到单实例的数据库 ② ASM文件系统到OS文件系统的转换 ③ 一般的备份恢复过程 本文如有错误或不完善的地方请大家多多指正,ITPUB留言或QQ皆可,您的批评指正是我写作的最大动力. 实验环境介绍 源库:11.2.0.1 rac库 2个节点 目标库:11.2.0.1 RHEL6

使用dataguard将单实例数据库转换为rac数据库

我们经常将oracle rac数据库通过dataguard容灾到一个单实例数据库中,当生产库出现故障后可以将生产库切换到dg服务器上.而当生产库rac修复完成后,我们同样可以通过dg将数据回切到生产库中. 此次测试将单实例数据库通过dg转换为rac数据库,这个单实例是刚创建的,并不是由rac通过dg生成的. 在做dg之前需要安装完成grid,不需要创建数据库实例.在日志应用的时候必须只能是一个实例应用. 具体环境如下: 单实例库: 数据库版本:11.2.0.4.0 sid:suq db_uniq

Oracle 11g R2 rac通过rman 恢复到单实例数据库

生产环境是2个节点的rac + dataguard(物理备库也是两个节点的rac),通过rman每天进行备份,现在需要定期对生产库进行恢复操作 恢复步骤如下: 1.      把生产库的备份拷贝到目标端 建立存放备份的目录修改目录属主属组 mkdir /oracle/backup chown oracle:oinstall /oracle/backup 2.      拷贝备份到目标端 scp -P 22 incremental_level*  [email protected]:/oracle

使用rman异地恢复数据库试验(RAC恢复到单实例数据库)

前言 rman在实际应用中用到的不多,很多时候一个项目开始设置好备份策略,后续基本上都用不到了,除非数据库出现异常,可以说,rman是一个不常用但是却非常重要的技能,但是又非常容易忘记.为了不在关键时刻掉链子,做了一个rman异地恢复数据库的试验. 试验环境介绍 操作系统 数据库版本 RAC? 源系统 CentOS 6.3 x64 11.2.0.4 2节点 目标系统 RedHat 6.4 x64 11.2.0.4 单节点 Rman备份: 0级数据库全备 操作步骤 将rman备份文件从源库上面拷贝

在 Oracle Linux 6.5 上安装 Oracle 11g 单实例数据库

Oracle数据库预安装任务 检查硬件要求 系统必须满足下面最小的硬件要求 内存要求 Minimum: 1 GB of RAMRecommended: 2 GB of RAM or more To determine the RAM size, enter the following command: # grep MemTotal /proc/meminfo The following table describes the relationship between the installed

单实例MySQL安装

1.建立账号 [[email protected] ~]# groupadd mysql [[email protected] ~]# useradd -s /sbin/nologin -g mysql -Mmysql useradd参数说明: -s/sbin/nologin 表示禁止该用户登录 -gmysql 指定属于mysql组 -M表示不创建用户家目录 2.配置安装环境 创建目录并授权: [[email protected] ~]# mkdir /home/tools [[email pr