Centos6 安装 oracle11g
1、安装依赖:
yum -y 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
2、检查依赖:
rpm -q 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 | grep "not installed"
3、安装 pdksh :
wget -O /tmp/pdksh-5.2.14-37.el5_8.1.x86_64.rpm http://vault.centos.org/5.11/os/x86_64/CentOS/pdksh-5.2.14-37.el5_8.1.x86_64.rpm
rpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm
4、创建用户和组:
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle -d /home/oracle
passwd oracle
id oracle
5、配置hostname:
vim /etc/hosts
192.168.14.107 oracle
ping -c 2 oracle
6、创建 Oracle 安装目录
mkdir -p /u01/oracle/oracle/product/11.2.0.4
mkdir /u01/oracle/oracle/oradata
mkdir /u01/inventory
mkdir /u01/oracle/oracle/fast_recovery_area
# 修改文件夹从属
chown -R oracle:oinstall /u01/oracle/oracle/
# 修改权限
chmod -R 775 /u01/oracle/oracle/
chown -R oracle:oinstall /u01/inventory
chmod -R 775 /u01/inventory
7、配置oracle用户环境变量
su - oracle
vim .bash_profile
添加:
umask 022
export ORACLE_HOSTNAME=oracle
export ORACLE_BASE=/u01/oracle/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0.4/
export ORACLE_SID=ORCL
export PATH=.:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$ORACLE_HOME/jdk/bin:$PATH
export LC_ALL="en_US"
export LANG="en_US"
export NLS_LANG="AMERICAN_AMERICA.ZHS16GBK"
export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
source .bash_profile
8、解压 oracle
cd /u01
unzip p13390677_112040_Linux-x86-64_1of7.zip -d /u01/oracle/
unzip p13390677_112040_Linux-x86-64_2of7.zip -d /u01/oracle/
mkdir /u01/oracle/etc
cp /u01/oracle/database/response/* /u01/oracle/etc/
vim /u01/oracle/etc/db_install.rsp
oracle.install.option=INSTALL_DB_SWONLY
DECLINE_SECURITY_UPDATES=true
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/inventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOSTNAME=oracle
ORACLE_HOME=/u01/oracle/oracle/product/11.2.0.4
ORACLE_BASE=/u01/oracle/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.isCustomInstall=true
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
9、静默安装
su - oracle
cd /u01/oracle/database
./runInstaller -silent -ignorePrereq -responseFile /u01/oracle/etc/db_install.rsp
tail -f /data/oracle/oracle/inventory/logs/installActions2019-01-25_10-41-53AM.log
根据提示执行两个 sh
10、静默监听配置
新建会话窗口
su - oracle
netca /silent /responsefile /u01/oracle/etc/netca.rsp
11、静默创建数据库
vim /u01/oracle/etc/dbca.rsp
# 修改如下配置
GDBNAME = "orcl"
SID = "orcl"
SYSPASSWORD = "oracle"
SYSTEMPASSWORD = "oracle"
SYSMANPASSWORD = "oracle"
DBSNMPPASSWORD = "oracle"
DATAFILEDESTINATION =/u01/oracle/oracle/oradata
RECOVERYAREADESTINATION=/u01/oracle/oracle/fast_recovery_area
CHARACTERSET = "AL32UTF8"
TOTALMEMORY = "" # 物理内存的一半
执行:dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbName ORCL -sysPassword oracle -systemPassword oracle
12、查看监听状态
lsnrctl status
13、sqlplus >>EOF startup EOF