安装依赖
yum install -y compat-libstdc++* elfutils-libelf-* glibc-* gcc-* kernel-headers-* libgcc-* libaio-* libstdc++-* unixODBC-* sysstat-* binutils-* make-* libXp-devel readline*
建用户和组
/usr/sbin/groupadd -g 800 oinstall
/usr/sbin/groupadd -g 801 dba
/usr/sbin/useradd -m -g oinstall -G dba oracle
建目录
mkdir -p /opt/app/oracle/product/10.2.0/db_1
chown -R oracle.oinstall /u01
chmod -R 775 /opt/app
编辑文件/etc/sysctl.conf
kernel.shmmax = 2147483648
kernel.shmall = 2097152
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=4194304
net.core.wmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_max=262144
编辑文件/etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
编辑文件/home/oracle/.bash_profile
# User specific environment and startup programs
export ORACLE_SID=orcl
export ORACLE_BASE=/opt/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export SQL_PATH='/home/oracle'
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
执行静默安装oracle software
/mnt/database/runInstaller -silent -noconfig -ignorePrereq -responseFile /home/oracle/db.rsp
cat /home/oracle/db.rsp |grep -v ^#|grep -v ^$
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_AND_CONFIG
ORACLE_HOSTNAME=localhost
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/opt/app/oraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=/opt/app/oracle/product/11.2.0.1/db_1
ORACLE_BASE=/opt/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.isCustomInstall=false
oracle.install.db.customComponents=
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
oracle.install.db.CLUSTER_NODES=
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=orcl.lgx.com
oracle.install.db.config.starterdb.SID=orcl
oracle.install.db.config.starterdb.characterSet=WE8MSWIN1252
oracle.install.db.config.starterdb.memoryLimit=400
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.installExampleSchemas=true
oracle.install.db.config.starterdb.enableSecuritySettings=false
oracle.install.db.config.starterdb.password.ALL=
oracle.install.db.config.starterdb.password.SYS=sys
oracle.install.db.config.starterdb.password.SYSTEM=system
oracle.install.db.config.starterdb.password.SYSMAN=Sysman1
oracle.install.db.config.starterdb.password.DBSNMP=Dbsnmp1
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false
oracle.install.db.config.starterdb.dbcontrol.emailAddress=
oracle.install.db.config.starterdb.dbcontrol.SMTPServer=
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=FILE_SYSTEM_STORAGE
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/opt/app/oracle/oradata
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=
执行静默安装数据库
dbca -silent -responseFile /mnt/dbca.rsp
$ cat /mnt/dbca.rsp |grep -v ^#|grep -v ^$
[GENERAL]
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "createDatabase"
[CREATEDATABASE]
GDBNAME = "orcl11g.us.oracle.com"
SID = "orcl11g"
TEMPLATENAME = "General_Purpose.dbc"
[createTemplateFromDB]
SOURCEDB = "myhost:1521:orcl"
SYSDBAUSERNAME = "system"
TEMPLATENAME = "My Copy TEMPLATE"
[createCloneTemplate]
SOURCEDB = "orcl"
TEMPLATENAME = "My Clone TEMPLATE"
[DELETEDATABASE]
SOURCEDB = "orcl"
[generateScripts]
TEMPLATENAME = "New Database"
GDBNAME = "orcl11.us.oracle.com"
[CONFIGUREDATABASE]
[ADDINSTANCE]
DB_UNIQUE_NAME = "orcl11g.us.oracle.com"
NODELIST=
SYSDBAUSERNAME = "sys"
[DELETEINSTANCE]
DB_UNIQUE_NAME = "orcl11g.us.oracle.com"
INSTANCENAME = "orcl11g"
SYSDBAUSERNAME = "sys"
[oracle@localhost dbs]$
安装成功后发现启动不了:
SQL> startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/opt/app/oracle/product/11.2.0.1/db_1/dbs/initorcl.ora'
发现没有对于的参数文件,现重建:
$ cat /home/oracle/pfile.ora
*.audit_file_dest='/opt/app/oracle/admin/orcl11g/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/opt/app/oracle/oradata/orcl11g/control001.ctl','/opt/app/oracle/flash_recovery_area/orcl11g/control002.ctl'
*.db_block_size=8192
*.db_domain='us.oracle.com'
*.db_name='orcl11g'
*.db_recovery_file_dest='/opt/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=407057203
*.diagnostic_dest='/opt/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orcl11gXDB)'
*.memory_target=560536985
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
[oracle@localhost dbs]$
SQL> startup nomount pfile='/home/oracle/pfile.ora'
ORACLE instance started.
Total System Global Area 559517696 bytes
Fixed Size 2215304 bytes
Variable Size 335544952 bytes
Database Buffers 213909504 bytes
Redo Buffers 7847936 bytes
SQL> create spfile from pfile='/home/oracle/pfile.ora';
File created.
SQL> alter database mount
2 ;
alter database mount
*
ERROR at line 1:
ORA-00205: error in identifying control file, check alert log for more info
实例终于起来了,开始不能mount数据库 查告警日志:
$ tailf /opt/app/oracle/diag/rdbms/orcl11g/orcl/trace/alert_orcl.log
Tue Jul 15 22:27:59 2014
alter database mount
Tue Jul 15 22:27:59 2014
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/opt/app/oracle/flash_recovery_area/orcl11g/control02.ctl'
ORA-27086: unable to lock file - already in use
Linux-x86_64 Error: 11: Resource temporarily unavailable
Additional information: 8
Additional information: 5814
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/opt/app/oracle/oradata/orcl11g/control01.ctl'
ORA-27086: unable to lock file - already in use
Linux-x86_64 Error: 11: Resource temporarily unavailable
Additional information: 8
Additional information: 5814
ORA-205 signalled during: alter database mount...
中途出现ORA-01102 删除一个文件及解决 rm -fr /opt/app/oracle/product/11.2.0.1/db_1/dbs/lkORCL11G
重启机器后一切正常:
SQL> startup
ORACLE instance started.
Total System Global Area 559517696 bytes
Fixed Size 2215304 bytes
Variable Size 339739256 bytes
Database Buffers 209715200 bytes
Redo Buffers 7847936 bytes
Database mounted.
Database opened.
SQL>
转自:http://blog.csdn.net/u010740597/article/details/37834073