最全的CentOS 6.10详细安装Oracle 11G R2图文教程
平台:CentOS 6.10 x64 带图形
配置4G 4核心cpu 200G硬盘
第一步、安装依赖
yum install -y binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libgcc libstdc++ libstdc++-devel libaio libaio-devel make sysstat unixODBC-devel pdksh
卸载openjdk
yum remove -y java-1.8.0-openjdk java-1.8.0-openjdk-headless
下载java rpm包,安装Oracle java
[root@o1 ~]# rpm -ivh jdk-8u121-linux-x64.rpm
Preparing... ########################################### [100%]
1:jdk1.8.0_121 ########################################### [100%]
第二步、创建所需用户和组
创建oracle用户并设置密码
[root@o1 ~]# useradd oracle
[root@o1 ~]# passwd oracle
然后登陆图形界面测试一下oracle用户
测试正常
创建用户组
[root@o1 ~]# groupadd oinstall
[root@o1 ~]# groupadd dba
修改oracle用户组
usermod -g oinstall -G dba oracle
第三步、修改内核参数
追加一段内核参数
[root@o1 ~]# vim /etc/sysctl.conf
........
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
执行生效
[root@o1 ~]# sysctl -p
修改文件打开限制,追加一段
[root@o1 ~]# vim /etc/security/limits.conf
.......
oracle soft nproc 4096
oracle hard nproc 65536
oracle soft nofile 4096
oracle hard nofile 65536
创建oracle安装目录
[root@o1 ~]# mkdir -p /u01/app/
[root@o1 ~]# chown -R oracle:oinstall /u01/app/
[root@o1 ~]# chmod -R 775 /u01/app/
重启服务器,使limit生效
第四步、添加环境变量,准备安装
使用oracle用户登陆
[root@o1 ~]# su - oracle
[oracle@o1 ~]$ vim .bash_profile
#追加下面这段
ORACLE_BASE=/u01/app/oracle
ORACLE_SID=sales
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_BASE ORACLE_SID ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH
检查主机名能访问不
[oracle@o1 ~]$ ping o1
PING o1 (192.168.1.18) 56(84) bytes of data.
64 bytes from o1 (192.168.1.18): icmp_seq=1 ttl=64 time=0.061 ms
检查正常
解压oracle安装包
[oracle@o1 ~]$ unzip linux.x64_11gR2_database_1of2.zip
[oracle@o1 ~]$ unzip linux.x64_11gR2_database_2of2.zip
第五步、开始安装
进入安装目录,开始安装
[oracle@o1 ~]$ cd database/
[oracle@o1 database]$ ./runInstaller
然后弹出安装程序,去掉下面那个勾,点next
再点next
选择server,再点next
再点next
选择高级安装,再点next
再点next
next
next
next
next
next
点击字符集,然后勾选UTF8,然后next
next
next
next
勾选下面的所有账号使用同一个密码,next
next
开始检查依赖包,其实这些包都装了的,只是版本高了,勾选ignore all,然后next
点击save response file可以保存所选择的配置,这个文件可以用来执行静默安装,点finish开始安装
安装中
安装完成后有提示,蓝色的是em控制台访问地址,点ok
然后提示要执行两个脚本,使用root执行
[root@o1 ~]# sh /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oracle.
The execution of the script is complete.
[root@o1 ~]#
[root@o1 ~]# sh /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
执行完成,点ok,安装成功
在本机打开1158端口,可以登陆控制台
运行状态