189 8069 5689

如何静默安装数据库oracle11gR2

这篇文章主要为大家展示了“如何静默安装数据库oracle11gR2”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“如何静默安装数据库oracle11gR2”这篇文章吧。

让客户满意是我们工作的目标,不断超越客户的期望值来自于我们对这个行业的热爱。我们立志把好的技术通过有效、简单的方式提供给客户,将通过不懈努力成为客户在信息化领域值得信任、有价值的长期合作伙伴,公司提供的服务项目有:申请域名、虚拟空间、营销软件、网站建设、秀英网站维护、网站推广。

xhost   hdp01.hammer-test-tpl-wh.com
telnet  hdp01.hammer-test-tpl-wh.com

sudo sh

---原本
yum -y install binutils-2.23.52.0.1-12.el7.x86_64  compat-libcap1-1.10-3.el7.x86_64 compat-libstdc++-33-3.2.3-71.el7.i686 compat-libstdc++-33-3.2.3-71.el7.x86_64 gcc-4.8.2-3.el7.x86_64
yum -y install gcc-c++-4.8.2-3.el7.x86_64 glibc-2.17-36.el7.i686 glibc-2.17-36.el7.x86_64  glibc-devel-2.17-36.el7.i686 glibc-devel-2.17-36.el7.x86_64 ksh libaio-0.3.109-9.el7.i686
yum -y install libaio-0.3.109-9.el7.x86_64 libaio-devel-0.3.109-9.el7.i686 libaio-devel-0.3.109-9.el7.x86_64 libgcc-4.8.2-3.el7.i686 libgcc-4.8.2-3.el7.x86_64 libstdc++-4.8.2-3.el7.i686
yum -y install libstdc++-4.8.2-3.el7.x86_64 libstdc++-devel-4.8.2-3.el7.i686 libstdc++-devel-4.8.2-3.el7.x86_64 libXi-1.7.2-1.el7.i686 libXi-1.7.2-1.el7.x86_64 libXtst-1.2.2-1.el7.i686
yum -y install libXtst-1.2.2-1.el7.x86_64 make-3.82-19.el7.x86_64 sysstat-10.1.5-1.el7.x86_64

---实践调整为
yum -y install binutils*  compat-libcap1-* compat-libstdc++-* compat-libstdc++* gcc-*
yum -y install gcc-c++-*  glibc-*    ksh* libaio-*  libaio-*  libgcc-*  libstdc++-*  libXi-*  libXtst-*  make-*  sysstat-*

yum  -y install libaio*  glibc*   compat-libstdc*  elfutils-libelf-devel*  libgcc* libstdc*  unixODBC*  pdksh*

echo inventory_loc=/u01/app/oraInventory >>/etc/oraInst.loc

echo inst_group=oinstall >>/etc/oraInst.loc

/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -g oinstall -G dba oracle

---如果已有oracle账户时,输入    /usr/sbin/usermod -g oinstall -G dba oracle

passwd oracle

--- 手工输入 oracle_123


--/etc/sysctl.conf

--fs.aio-max-nr = 1048576
--fs.file-max = 6815744
--kernel.shmall = 2097152
--kernel.shmmax = 536870912
--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.wmemax = 1048576


echo  kernel.shmmax=206158430208 >>/etc/sysctl.conf
echo  kernel.shmmni=4096 >>/etc/sysctl.conf
echo  kernel.shmall= 67108864 >>/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 = 1048576 >>/etc/sysctl.conf
echo  fs.file-max = 6815744 >>/etc/sysctl.conf
echo  fs.aio-max-nr = 1048576 >>/etc/sysctl.conf

sysctl -p

----SHMALL参数的设置。这个值推荐设置为物理内存大小除以分页大小
getconf PAGE_SIZE    
--计算方法:例如256G内存,page_size为4096时    256*1024*1024*1024/4096

/sbin/sysctl -p

echo "*  soft nofile 1024">> /etc/security/limits.conf
echo "*  hard nofile 65536">> /etc/security/limits.conf
echo "*  soft nproc 2047">> /etc/security/limits.conf
echo "*  hard nproc 16384">> /etc/security/limits.conf
echo "*  soft stack 10240">> /etc/security/limits.conf
echo "*  hard stack 32768">> /etc/security/limits.conf

mkdir -p /tpdata/app/
chown -R oracle:oinstall /tpdata/app/
chmod -R 775 /tpdata/app/

umask 022
echo $SHELL

su  - oracle

./.bash_profile
--export DISPLAY=local_host:0.0
export DISPLAY=:0.0
export DISPLAY=:1

xhost   + hdp01.hammer-test-tpl-wh.com
mkdir /tpdata/tmp
chmod a+wr  /tpdata/tmp
chown oracle:oinstall -R  /tpdata


echo umask 022 >> ./.bash_profile
echo TMP=/tpdata/tmp >> ./.bash_profile
echo TMPDIR=/tpdata/tmp >> ./.bash_profile
echo export TMP TMPDIR >> ./.bash_profile
echo ORACLE_BASE=/tpdata/app/oracle >> ./.bash_profile
echo ORACLE_SID=carthage >> ./.bash_profile
echo export ORACLE_BASE ORACLE_SID >> ./.bash_profile

unset ORACLE_HOME
unset TNS_ADMIN


vi /etc/sysconfig/selinux
SELINUX=disabled

echo "session    required    /lib/security/pam_limits.so">>/etc/pam.d/login

echo "session    required    pam_limits.so">>/etc/pam.d/login


service iptables stop
---------------------------------------以上为OS环境配置----------------------------------------
参考文章
http://www.oracle.com/technetwork/cn/articles/wininst-otn-096093-zhs.html

http://blog.itpub.net/27042095/viewspace-766965


10.2 创建响应文件

# su - oracle

仅安装Oracle软件的响应文件UPRR_INSTALL_DB_SWONLY.rsp

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0

oracle.install.option=INSTALL_DB_SWONLY

ORACLE_HOSTNAME=hdp01.hammer-test-tpl-wh.com

UNIX_GROUP_NAME=oinstall

INVENTORY_LOCATION=/tpdata/app/oracle/oraInventory

SELECTED_LANGUAGES=en,zh_CN,zh_TW

ORACLE_HOME=/tpdata/app/oracle/product/11.2.0/dbhome_1

ORACLE_BASE=/tpdata/app/oracle

oracle.install.db.InstallEdition=EE

oracle.install.db.isCustomInstall=false

oracle.install.db.DBA_GROUP=dba

oracle.install.db.OPER_GROUP=dba

DECLINE_SECURITY_UPDATES=false

创建数据库的响应文件UPRR_DBCA.rsp

[GENERAL]

RESPONSEFILE_VERSION = "11.2.0"

OPERATION_TYPE = "createDatabase"

[CREATEDATABASE]

GDBNAME = "hammer"

SID = "hammer"

TEMPLATENAME = "General_Purpose.dbc"

SYSPASSWORD = "oracle_123"
SYSTEMPASSWORD = "oracle_123"


DATAFILEDESTINATION = "/tpdata/app/oracle/oradata"

RECOVERYAREADESTINATION= "/tpdata/app/oracle/flash_recovery_area"

CHARACTERSET = "AL32UTF8"

NATIONALCHARACTERSET= "UTF8"
LISTENERS = "listener1"
 

NET配置的响应文件使用Oracle默认即可,无需修改,该文件在Oracle安装包的路径:

$cp database/response/netca.rsp /home/oracle/UPRR_NETCA.rsp

$ su - root

# chmod 700 /home/oracle/UPRR_INSTALL_DB_SWONLY.rsp

10.3 安装Oracle

安装:

# su - oracle

$ cd database

$ mkdir -p  /u01/app/oracle/oraInventory

-- $ ./runInstaller -silent -debug -force -responseFile /home/oracle/UPRR_INSTALL_DB_SWONLY.rsp
$ ./runInstaller -silent  -responseFile /home/oracle/UPRR_INSTALL_DB_SWONLY.rsp
 

备注:(可选参数-noconfig -IgnoreSysPreReqs)

出现类似如下提示表示安装完成:

#-------------------------------------------------------------------

...

/tpdata/app/oracle/oraInventory/orainstRoot.sh

/tpdata/app/oracle/product/11.2.0/dbhome_1/root.sh

To execute the configuration scripts:

         1. Open a terminal window

         2. Log in as "root"

         3. Run the scripts

         4. Return to this window and hit "Enter" key to continue 

Successfully Setup Software.

#-------------------------------------------------------------------

安装期间查看安装日志信息了解安装进度

$ cd $ORACLE_BASE/oraInventory/logs

$ tail -100f installActions*.log

root执行$ORACLE_HOME下的root.sh来建立oratab,dbhome,oraenv,coraenv文件, 如果提示则一直回车:

$ su - root

# /tpdata/app/oracle/product/11.2.0/dbhome_1/root.sh

# more /etc/oratab

设置环境变量

vi  /home/oracle/.bash_profile


export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

export TNS_ADMIN=$ORACLE_HOME/network/admin

export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin

export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/lib

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib

export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/JRE

export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/JRE/lib

export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib

export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib

export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib

export LIBPATH=${CLASSPATH}:$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib

export ORACLE_OWNER=oracle

export SPFILE_PATH=$ORACLE_HOME/dbs

export ORA_NLS10=$ORACLE_HOME/nls/data

source /home/oracle/.bash_profile

Sqlplus测试

$ sqlplus /nolog

11 静默配置网络

$ $ORACLE_HOME/bin/netca /silent /responseFile /home/oracle/UPRR_NETCA.rsp

/tpdata/app/oracle/product/11.2.0/dbhome_6/srvm/admin/getcrshome   没有可执行权限?

12 静默安装数据库

# su - oracle

$ $ORACLE_HOME/bin/dbca -silent -responseFile /home/oracle/UPRR_DBCA.rsp

安装期间查看日志信息了解进度:

$ tail -100f $ORACLE_BASE/cfgtoollogs/dbca/$ORACLE_SID/$ORACLE_SID.log

建库后实例检查

$ ps -ef | grep ora_ | grep -v grep | wc -l

$ ps -ef | grep ora_ | grep -v grep

建库后监听检查

$ lsnrctl status

如果使用归档日志

$ sqlplus / as sysdba

SQL> shutdown immediate;

SQL> startup mount;

SQL> alter database archivelog;

SQL> alter database flashback on; (如果要启用数据库闪回功能则执行)

SQL> alter database open;

SQL> execute utl_recomp.recomp_serial(); (重新编译所有可能失效对象)

SQL> alter system archive log current; (手工归档测试)

默认安装的数据库用户检查

SQL> set lines 256 pages 500

SQL> select USER_ID,USERNAME,ACCOUNT_STATUS,DEFAULT_TABLESPACE from dba_users order by 1;

以上是“如何静默安装数据库oracle11gR2”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注创新互联行业资讯频道!


标题名称:如何静默安装数据库oracle11gR2
URL网址:http://cdxtjz.com/article/iipjhj.html

其他资讯