标签:$1 stop its alt file-max 开机启动 libs static 11gr2
mv /home/vsftpd/linux.x64_11gR2_database_* /tmp && cd /tmp
unzip linux.x64_11gR2_database_1of2.zip && unzip linux.x64_11gR2_database_2of2.zip
echo "centos" > /etc/hostanme
echo "192.168.10.13 centos" >> /etc/hosts
yum install yum install gcc make binutils gcc-c++ compat-libstdc++-33 elfutils-libelf-devel elfutils-libelf-devel-static ksh libaio libaio-devel numactl-devel sysstat unixODBC unixODBC-devel pcre-devel –y
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle
id oracle
在/etc/sysctl.conf末尾添加,并执行sysctl -p生效
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1073741824
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
在 /etc/security/limits.conf末尾添加
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
session required /lib64/security/pam_limits.so
session required pam_limits.so
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
mkdir -p /ibmp_data/oracle/product/11.2.0
mkdir /ibmp_data/oracle/oradata
mkdir /ibmp_data/oracle/inventory
mkdir /ibmp_data/oracle/fast_recovery_area
chown -R oracle:oinstall /ibmp_data/oracle
chmod -R 775 /ibmp_data/oracle
su - oracle
vim .bash_profile
添加以下内容,并执行source .bash_profile生效
ORACLE_BASE=/ibmp_data/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.2.0
ORACLE_SID=orcl
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
cp -R /tmp/database/response/ .
sed -i "s%oracle.install.option=%oracle.install.option=INSTALL_DB_SWONLY%g" /home/oracle/response/db_install.rsp
sed -i "s%ORACLE_HOSTNAME=%ORACLE_HOSTNAME=centos%g" /home/oracle/response/db_install.rsp
sed -i "s%UNIX_GROUP_NAME=%UNIX_GROUP_NAME=oinstall%g" /home/oracle/response/db_install.rsp
sed -i "s%INVENTORY_LOCATION=%INVENTORY_LOCATION=/ibmp_data/oracle/inventory%g" /home/oracle/response/db_install.rsp
sed -i "s%SELECTED_LANGUAGES=%SELECTED_LANGUAGES=en,zh_CN%g" /home/oracle/response/db_install.rsp
sed -i "s%ORACLE_HOME=%ORACLE_HOME=/ibmp_data/oracle/product/11.2.0%g" /home/oracle/response/db_install.rsp
sed -i "s%ORACLE_BASE=%ORACLE_BASE=/ibmp_data/oracle%g" /home/oracle/response/db_install.rsp
sed -i "s%oracle.install.db.InstallEdition=%oracle.install.db.InstallEdition=EE%g" /home/oracle/response/db_install.rsp
sed -i "s%oracle.install.db.isCustomInstall=false%oracle.install.db.isCustomInstall=true%g" /home/oracle/response/db_install.rsp
sed -i "s%oracle.install.db.DBA_GROUP=%oracle.install.db.DBA_GROUP=dba%g" /home/oracle/response/db_install.rsp
sed -i "s%oracle.install.db.OPER_GROUP=%oracle.install.db.OPER_GROUP=dba%g" /home/oracle/response/db_install.rsp
sed -i "s%DECLINE_SECURITY_UPDATES=%DECLINE_SECURITY_UPDATES=true%g" /home/oracle/response/db_install.rsp
cd /tmp/database/ && ./runInstaller -silent -responseFile /home/oracle/response/db_install.rsp -ignorePrereq
[root@Centos ~]# sh /ibmp_data/oracle/inventory/orainstRoot.sh
[root@Centos ~]# sh /ibmp_data/oracle/product/11.2.0/root.sh
netca /silent /responsefile /home/oracle/response/netca.rsp
vim /home/oracle/response/dbca.rsp修改如下内容
GDBNAME = "orcl" //数据库名
SID = "orcl" //sid
SYSPASSWORD = "ibmp"
SYSTEMPASSWORD = "ibmp"
SYSMANPASSWORD = "ibmp"
DBSNMPPASSWORD = "ibmp"
DATAFILEDESTINATION =/ibmp_data/oracle/oradata
RECOVERYAREADESTINATION= /ibmp_data/oracle/fast_recovery_area
CHARACTERSET = "AL32UTF8"
TOTALMEMORY = "1638" //物理内存的80%
dbca -silent -responseFile /home/oracle/response/dbca.rsp
1)第一步:写启动关闭数据库脚本
#!/bin/bash
# oracle: Start/Stop Oracle Database 11g R2
# chkconfig: 345 90 10
# description: The Oracle Database is an Object-Relational Database Management System.
#
. /etc/rc.d/init.d/functions
LOCKFILE=/var/lock/subsys/oracle
ORACLE_HOME=/ibmp_data/oracle/product/11.2.0
ORACLE_USER=oracle
case "$1" in
'start')
if [ -f $LOCKFILE ]; then
echo $0 already running.
exit 1
fi
echo -n $"Starting Oracle Database:"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl start"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl start dbconsole"
touch $LOCKFILE
;;
'stop')
if [ ! -f $LOCKFILE ]; then
echo $0 already stopping.
exit 1
fi
echo -n $"Stopping Oracle Database:"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl stop"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbshut"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
rm -f $LOCKFILE
;;
'restart')
$0 stop
$0 start
;;
'status')
if [ -f $LOCKFILE ]; then
echo $0 started.
else
echo $0 stopped.
fi
;;
*)
echo "Usage: $0 [start|stop|status]"
exit 1
esac
exit 0
3)授权脚本
chmod 755 /etc/init.d/oracle
chkconfig oracle on
service oracle start/stop/restart //可用于日常关闭和启动数据库
标签:$1 stop its alt file-max 开机启动 libs static 11gr2
原文地址:https://www.cnblogs.com/reaperhero/p/10258426.html