oracle slient install



silient install database
1)download database version package
can download the file from oracle


[root@localhost oracle]#groupadd dba
[root@localhost oracle]#groupadd oinstall
[root@localhost oracle]#useradd -g oinstall -G dba oracle
[root@localhost oracle]#passwd oracle
Changing password for user oracle.
New UNIX password: [在此键入密码]
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password: [在此再次键入密码]
passwd: all authentication tokens updated successfully.

以下命令将oracle安装目录(/opt/oracle)赋予oracle用户oinstall用户组
[root@localhost oracle]#chown –R oracle:oinstall /opt/oracle


2)backup the database needed
 expdp
 rman
connect target
run{
allocate channel c1 device type disk format '/ora/backup/rman/wminve3/%d_c1_INCR_0_s%s_p%p';
allocate channel c2 device type disk format '/ora/backup/rman/wminve3/%d_c2_INCR_0_s%s_p%p';
allocate channel c3 device type disk format '/ora/backup/rman/wminve3/%d_c3_INCR_0_s%s_p%p';
allocate channel c4 device type disk format '/ora/backup/rman/wminve3/%d_c4_INCR_0_s%s_p%p';
backup as compressed backupset
  incremental level = 0
  tag incr_lvl_0_20121206
    filesperset=1
    (database);
 
 
 
  sql 'alter system archive log current';
 
  backup
    format '/ora/backup/rman/wminve3/%d_CTL_s%s_p%p'
    (current controlfile for standby);
 
  sql 'alter system archive log current';
 
  backup archivelog
       from time 'SYSDATE-1' until time 'SYSDATE';

 
}


3)install rpm package

rpm -ivh kernel-headers-2.6.18-164.el5.i386.rpm
rpm -ivh glibc-headers-2.5-42.i386.rpm
rpm -ivh glibc-devel-2.5-42.i386.rpm
rpm -ivh libgomp-4.4.0-6.el5.i386.rpm
rpm -ivh sysstat-7.0.2-3.el5.i386.rpm
rpm -ivh libaio-devel-0.3.106-3.2.i386.rpm
rpm -ivh libstdc++-devel-4.1.2-46.el5.i386.rpm
rpm -ivh unixODBC-2.2.11-7.1.i386.rpm
rpm -ivh unixODBC-devel-2.2.11-7.1.i386.rpm
rpm -ivh gcc-4.1.2-46.el5.i386.rpm
rpm -ivh gcc-c++-4.1.2-46.el5.i386.rpm
rpm -ivh elfutils-libelf-devel-0.137-3.el5.i386.rpm elfutils-libelf-devel-static-0.137-3.el5.i386.rpm

4)change parameter in linux
修改 /etc/security/limits.conf,加入内容
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

打开修改/etc/sysctl.conf,在最后加入以下内容
#kernel.shmall = 2097152
#kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576

/sbin/sysctl –p

修改环境变量/etc/profile,加入以下内容
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi


cat >> /etc/pam.d/login <<EOF
session required /lib/security/pam_limits.so

5)env
export ORACLE_SID=orcl (注意这个值要和下面创建的数据库实例名称相同)
export ORACLE_BASE=/opt/oracle/app
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

6)silent install the rdbms
Vi  oracle10g.rsp

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=Ndc-tdb2
UNIX_GROUP_NAME=dba
INVENTORY_LOCATION=/app/oracle/oraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=/app/oracle/product/1120
ORACLE_BASE=/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.EEOptionsSelection=false
oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.3.0,oracle.oraolap:11.2.0.3.0,oracle.rdbms.dm:11.2.0.3.0,oracle.rdbms.dv:11.2.0.3.0,oracle.rdbms.lbac:11.2.0.3.0,oracle.rdbms.rat:11.2.0.3.0
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
oracle.install.db.CLUSTER_NODES=
oracle.install.db.isRACOneInstall=
oracle.install.db.racOneServiceName=
oracle.install.db.config.starterdb.type=
oracle.install.db.config.starterdb.globalDBName=
oracle.install.db.config.starterdb.SID=
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.memoryLimit=
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.SYSMAN=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.automatedBackup.osuid=
oracle.install.db.config.starterdb.automatedBackup.ospwd=
oracle.install.db.config.starterdb.storageType=
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
PROXY_REALM=
COLLECTOR_SUPPORTHUB_URL=
oracle.installer.autoupdates.option=
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=

/app/oracle/software/database/runInstaller  -silent -ignorePrereq -responseFile /app/oracle/software/database/response/11g.rsp


7)install databse as request

startup nomount pfile='/tmp/ukomsp1.ora';---change the file as your request

rman target /
restore standby controlfile from '/u01/app/ggtrail/ctl_UKOMSP1';
alter database mount;
catalog start with '';

connect target
run
{
  allocate channel c1 device type disk format '/u01/app/ggtrail/%d_c1_INCR_0_s%s_p%p';
  allocate channel c2 device type disk format '/u01/app/ggtrail/%d_c2_INCR_0_s%s_p%p';
  allocate channel c3 device type disk format '/u01/app/ggtrail/%d_c3_INCR_0_s%s_p%p';
  allocate channel c4 device type disk format '/u01/app/ggtrail/%d_c4_INCR_0_s%s_p%p';
  set newname for datafile to '';
  restore database;
  switch datafile;
}


alter database open resetlog;


/u01/app/oracle/product/11.2.0/db_1/bin/orapwd file=/u01/app/oracle/product/11.2.0/db_1/bin/dbs/orapwgytms force=y

listener
tnsnames
NLS_CHARACTERSET
AL32UTF8

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值