Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1298157
  • 博文数量: 127
  • 博客积分: 2286
  • 博客等级: 大尉
  • 技术积分: 1943
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-10 10:37
文章分类

全部博文(127)

文章存档

2018年(1)

2015年(2)

2014年(1)

2013年(30)

2012年(88)

2011年(5)

分类: Oracle

2014-07-19 17:02:41

step 1 准备工作

groupadd -g 888 dba
useradd -u888 -g 888 -s /bin/bash oracle

mkdir -p /u01/base
chown oracle.dba /u01/base

mkdir /share
mount.vboxsf 11gR2 /share -o uid=888,gid=888

vi .bash_profile
export ORACLE_BASE=/u01/base
export ORACLE_HOME=$ORACLE_BASE/prod/11g
export ORACLE_SID=demo
export PATH=$ORACLE_HOME/bin:$PATH

step 2 系统检查

sh /share/runInstaller -silent  -executeSysPrereqs
sh /share/runInstaller -silent  -executePrereqs

检查错误
grep _FAILED /tmp/OraInstall2014-07-19_11-20-07AM/installActions2014-07-19_11-20-07AM.log

1 安装缺失的linux包, 这一步非常重要, 软件安装必须的
yum install compat-libstdc++-33-3.2.3
yum -y install libaio-devel
yum -y install sysstat
yum -y install unixODBC
yum -y install unixODBC-devel


2. 修改内存参数, 这是建立数据库必须的
vi /etc/sysctl.conf
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576

/sbin/sysctl -p

3 修改开开的文件数目
echo "oracle soft nofile 65536" >> /etc/security/limits.conf
echo "oracle hard nofile 65536" >> /etc/security/limits.conf
echo "oracle soft nproc 16384" >> /etc/security/limits.conf
echo "oracle hard nproc 16384" >> /etc/security/limits.conf


4 最后剩下1个错误
swap不够,现在内存够大,swap不需要那么大

这两个错误可以忽略,用这两个参数来忽略

-ignoreDiskWarning 
-ignoreSysPrereqs 
-ignorePrereq


step3 静默安装oracle数据库
1
cp /share/response/db_install.rsp $ORACLE_BASE

2
cd $ORACLE_BASE
cat > oraInst.loc <
inventory_loc=/u01/base/oraInventory
inst_group=dba
EOF

3 vi db_install.rsp
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=dba
INVENTORY_LOCATION=/u01/base/oraInventory
SELECTED_LANGUAGES=en
ORACLE_BASE=/u01/base
ORACLE_HOME=/u01/base/prod/11g
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=true

如果同时建立数据库(oracle.install.option=INSTALL_DB_AND_CONFIG),加上下面的参数
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=demo.test.com
oracle.install.db.config.starterdb.SID=demo
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.memoryLimit=800
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.password.ALL=Welcome1
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/u01/base/oradata
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=/u01/base/flash_recovery



4
sh /share/runInstaller -silent -invPtrLoc $ORACLE_BASE/oraInst.loc -responseFile $ORACLE_BASE/db_install.rsp 
sh /share/runInstaller -silent -invPtrLoc $ORACLE_BASE/oraInst.loc -responseFile $ORACLE_BASE/db_install.rsp -ignorePrereq

-ignoreDiskWarning 
-ignoreSysPrereqs 

-ignorePrereq


5 stop dbconsole
emctl stop dbconsole

notes: silent deinstall
runInstaller –silent –deinstall –removeallfiles –removeAllPatches REMOVE_HOMES=$ORACLE_HOME


step4 静默建立数据库
1
cp /share/response/dbca.rsp $ORACLE_BASE

2 delete the database
dbca  -silent  -deleteDatabase -sourceDB $ORACLE_SID



3 create the database
cat  >   dbca_crt_DB.rsp  <
[GENERAL]
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "createDatabase"
[CREATEDATABASE]
GDBNAME = "hwz.test.com"
SID = "hwz"
TEMPLATENAME = "General_Purpose.dbc"
STORAGETYPE=FS
DATAFILEDESTINATION =$ORACLE_BASE/oradata
RECOVERYAREADESTINATION=$ORACLE_BASE/flash_recovery_area
CHARACTERSET = "AL32UTF8"
NATIONALCHARACTERSET= "AL16UTF16"
LISTENERS=LISTENER
TOTALMEMORY = "700"
SYSPASSWORD = "Welcome1"
SYSTEMPASSWORD = "Welcome1"
EOF

dbca  -silent  -createDatabase -responseFile   $ORACLE_BASE/dbca_crt_DB.rsp

3 create the tabase silently use command only
dbca -silent -createDatabase -templateName General_Purpose.dbc \
  -gdbName demo.test.com -sid demo \
  -sysPassword Welcome1 \
  -systemPassword Welcome1 \
  -emConfiguration NONE \
  -datafileDestination $ORACLE_BASE/oradata \
  -redoLogFileSize 50 \
  -recoveryAreaDestination $ORACLE_BASE/flash_recovery_area \
  -storageType FS \
  -characterSet AL32UTF8 -nationalCharacterSet AL16UTF16 \
  -listeners LISTENER \
  -totalMemory 700 \
  -databaseType OLTP

阅读(5621) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~