您好,登錄后才能下訂單哦!
1、安裝RPM包
# yum install binutils \
compat-libstdc++-33 \
elfutils-libelf \
elfutils-libelf-devel \
expat \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
make \
pdksh \
sysstat \
unixODBC \
unixODBC-devel
備注:部分機器 估計 libaio的32和64包都需要,沒有還不行。
2、固定IP地址,hostname,hosts記錄
[root@localhost ~]
# vim /etc/sysconfig/network
hostname=oracle11g.example.com
[root@oracle11g ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:0C:29:1E:68:68
ONBOOT=yes
IPADDR=192.168.1.16
NETMASK=255.255.255.0
GATEWAY=192.168.1.254
[root@oracle11g ~]
# ifconfig eth0 | head -n 2
eth0 Link encap:Ethernet HWaddr 00:0C:29:9F:DF:4A
inet addr:192.168.1.16 Bcast:192.168.1.255 Mask:255.255.255.0
[root@oracle11g ~]
# grep -v '^#' /etc/hosts
127.0.0.1localhost.localdomain localhost
192.168.1.16 oracle11g.example.com
3、設置系統的操作資源
[root@oracle11g ~]
#vim /etc/sysctl.conf 添加到文件底端
kernel.shmall = 2097152
kernel.shmmax = 2147483648
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 = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
[root@oracle11g ~]
#sysctl -p
shell限制
[root@oracle11g ~]
# grep -v '^#' /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
[root@oracle11g ~]
# grep 'limit' /etc/pam.d/system-auth
session required pam_limits.so
4、設置oracle用戶
建議指定GID和UID方式(尤其集群環境)
[root@oracle11g ~]
# groupadd -g 1000 oinstall
[root@oracle11g ~]
# groupadd -g 1001 dba
[root@oracle11g ~]
# useradd -u 1000 -g oinstall -G dba oracle
[root@oracle11g ~]
# passwd oracle
建立oracle軟件安裝文件目錄
[root@oracle11g ~]
# mkdir -p /u01/oracle
[root@oracle11g ~]
# chown -R oracle:oinstall /u01/
設置oracle環境變量
[root@oracle11g ~]
vi ~oracle/.bash_profile
umask 022
export ORACLE_BASE=/u01/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0
export ORACLE_SID=oracle11g
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
加載配置
oracle用戶注銷重新登錄 或 #
#su - oracle
#source .bash_profile
5、解壓安裝文件
#unzip linux.x64_11gR2_database_1of2.zip -d /mnt
#unzip linux.x64_11gR2_database_2of2.zip -d /mnt
6、修改配置文件
[root@oracle11g ~]# grep -v '^#' /mnt/database/response/db_install.rsp (參考 靜默安裝----配置文件 說明)
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=oracle11g.example.com
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/oracle
SELECTED_LANGUAGES=en,zh_CN,zh_TW (選擇要支持的語言)
ORACLE_HOME=/u01/oracle/product/11.2.0
ORACLE_BASE=/u01/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.isCustomInstall=true
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oinstall
oracle.install.db.config.starterdb.characterSet=AL32UTF8 (根據生產環境中的需要,進行修改字符集)
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.automatedBackup.enable=false
DECLINE_SECURITY_UPDATES=true (要家上,要不然會報錯 【server】
email address 錯誤
)
7、靜默安裝數據庫
[root@oracle11g ~]#cd /mnt/database/response
[root@oracle11g response]$ chown -R oracle:oinstall /mnt/database/response/db_install.rsp
[root@oracle11g response]$chmod 700 db_install.rsp
#su - oracle
#cd /mnt/database/
$ ./runInstaller -silent -force -responseFile /mnt/database/response/db_install.rsp (注意要寫絕對路徑)
如報 ins-13014 錯誤 不需要理會 報 ins-07001 配置文件中的有些文件找不到,對安裝沒有
多大影響
(日志文件 看安裝進度 )
#tail -100f /u01/oracle/logs/installActions2013-06-10_04-01-32PM.log
帶出現以下內容,說明安裝成功
#!/bin/sh
#Root scripts to run
/u01/oracle/orainstRoot.sh
/u01/oracle/product/11.2.0/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.
注意:必須用root用戶跑一下腳本
#/u01/oracle/orainstRoot.sh
#/u01/oracle/product/11.2.0/root.sh
[root@oracle11g 11.2.0]# su - oracle
[oracle@oracle11g ~]$ ps aux |grep ora_
oracle 18649 0.0 0.0 61188 744 pts/2 S+ 16:31 0:00 grep ora_ (說明沒有數據庫) 只安裝了實例
[oracle@oracle11g ~]$ sql
sqlite3 sqlldr sqlldrO sqlplus
[oracle@oracle11g ~]$ sqlplus / as sysdba (出現錯誤,但實例已安裝完成)
sqlplus: error while loading shared libraries: /u01/oracle/product/11.2.0/lib/libclntsh.so.11.1: cannot restore segment prot after reloc: Permission denied
(關閉防火墻與sensetforce )
[root@oracle11g ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
[root@oracle11g ~]# getenforce
Enforcing
[root@oracle11g ~]# setenforce 0
[root@oracle11g ~]# getenforce
Permissive
[oracle@oracle11g ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 10 16:40:29 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL>
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。