一、安装依赖包

下面是Oracle数据库需要依赖的软件,依次执行下面命令,不存在则安装。



yum install binutils

yum install compat-libstdc++-33

yum install elfutils-libelf

yum install elfutils-libelf-devel

yum install elfutils-libelf-devel-static

yum install gcc

yum install gcc-c++

yum install glibc

yum install glibc-common

yum install glibc-devel

yum install glibc-headers

yum install kernel-headers

yum install ksh

yum install libaio

yum install libaio-devel

yum install libgcc

yum install libgomp

yum install libstdc++

yum install libstdc++-devel

yum install make

yum install sysstat

yum install unixODBC

yum install unixODBC-devel



二、创建用户和组

1、创建oinstall用户组



groupadd oinstall



2、创建dba用户组



groupadd dba



3、创建oracle用户,并添加到oinstall(主组)和dba(其他组)



useradd -g oinstall -G dba oracle



4、设置oracle用户密码



passwd oracle



三、修改内核参数

修改 /etc/sysctl.conf 文件



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 = 1048586



使配置生效



/sbin/sysctl –p



四、修改用户限制

修改/etc/security/limits.conf 文件



vim /etc/security/limits.conf



添加如下参数:



oracle           soft    nproc   2047
oracle           hard    nproc   16384
oracle           soft    nofile  1024
oracle           hard    nofile  65536



五、修改用户验证

修改 /etc/pam.d/login文件



vim /etc/pam.d/login



加上如下参数:



session required pam_limits.so



六、修改用户配置文件

修改/etc/profile文件



vim /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



七、修改hosts文件

格式为:  本机的ip地址   主机名



vim /etc/hosts



red hat怎么安装python低版 red hat 6.5安装_开发工具

八、创建安装目录



mkdir -p /u01/oraInventory
chown -R oracle:oinstall /u01/
chmod -R 775 /u01/



九、修改oracle用户环境配置

切换到oracle用户



su - oracle



执行命令:



vim .bash_profile



增加以下内容:



export PATH

export ORACLE_BASE=/u01/oracle/
export ORACLE_HOME=$ORACLE_BASE/product/
export ORACLE_SID=orcl
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
NLS_LANG=AMERICAN_AMERICA.AL32UTF8 export NLS_LANG
umask 022



 保存并执行如下命令



source .bash_profile



十、安装

1、在root用户下解压安装包

2、切换到oracle用户

如果是通过xshell远程连接服务器的话,需执行如下命令:



export DISPLAY=172.30.80.1:0.0



172.30.80.1 为自己PC远程端的IP地址

 3、进入到解压目录下的database目录,运行安装文件runInstaller



./runInstaller



十一、图形化安装步骤

1、将图中红框内的选项上的勾去掉,然后Next

red hat怎么安装python低版 red hat 6.5安装_数据库_02

2、点击警告框中的YES

red hat怎么安装python低版 red hat 6.5安装_开发工具_03

3、选择Skip software updates,点击next

red hat怎么安装python低版 red hat 6.5安装_数据库_04

4、这里选择仅安装数据库软件(Install database software only),点击Next

red hat怎么安装python低版 red hat 6.5安装_red hat怎么安装python低版_05

5、默认第一个选项,点击Next

red hat怎么安装python低版 red hat 6.5安装_oracle_06

 

 6、选择语言,默认Englisgh,点击Next

red hat怎么安装python低版 red hat 6.5安装_数据库_07

7、这里选择企业版,Next

red hat怎么安装python低版 red hat 6.5安装_red hat怎么安装python低版_08

8、默认安装路径,与前面配置的路径一致,Next

 

red hat怎么安装python低版 red hat 6.5安装_数据库_09

 

9、Next

red hat怎么安装python低版 red hat 6.5安装_oracle_10

 

10、全部选择dba, Next

red hat怎么安装python低版 red hat 6.5安装_开发工具_11

11、检查安装环境,没有ERROR级别的错误就全部忽略吧

red hat怎么安装python低版 red hat 6.5安装_red hat怎么安装python低版_12

 

 12、选择Yes  

red hat怎么安装python低版 red hat 6.5安装_开发工具_13

13、点击Install,开始安装

red hat怎么安装python低版 red hat 6.5安装_数据库_14

14、开始安装

red hat怎么安装python低版 red hat 6.5安装_数据库_15

15、这里提示在root用户下执行图中的脚本,按照提示去相应路径下执行脚本

red hat怎么安装python低版 red hat 6.5安装_运维_16

执行orainstRoot.sh 脚本

red hat怎么安装python低版 red hat 6.5安装_运维_17

执行root.sh脚本

red hat怎么安装python低版 red hat 6.5安装_red hat怎么安装python低版_18

执行完后,点击OK

16、安装结束,点击Close

red hat怎么安装python低版 red hat 6.5安装_开发工具_19

十二、配置监听

1、oracle用户下执行netca命令

red hat怎么安装python低版 red hat 6.5安装_oracle_20

2、默认 Next

red hat怎么安装python低版 red hat 6.5安装_开发工具_21

3、Next

red hat怎么安装python低版 red hat 6.5安装_数据库_22

4、Next

red hat怎么安装python低版 red hat 6.5安装_数据库_23

5、Next

red hat怎么安装python低版 red hat 6.5安装_red hat怎么安装python低版_24

 

 6、Next

red hat怎么安装python低版 red hat 6.5安装_开发工具_25

7、Next

red hat怎么安装python低版 red hat 6.5安装_数据库_26

8、Next

red hat怎么安装python低版 red hat 6.5安装_开发工具_27

red hat怎么安装python低版 red hat 6.5安装_运维_28

9、点击Finish

red hat怎么安装python低版 red hat 6.5安装_开发工具_29

 

 十三、创建数据库

1、oracle用户执行dbca

red hat怎么安装python低版 red hat 6.5安装_oracle_30

2、Next

red hat怎么安装python低版 red hat 6.5安装_oracle_31

3、选择创建一个数据库(Create a Database),Next

red hat怎么安装python低版 red hat 6.5安装_red hat怎么安装python低版_32

4、默认第一项,Next

red hat怎么安装python低版 red hat 6.5安装_oracle_33

5、输入SID

red hat怎么安装python低版 red hat 6.5安装_数据库_34

6、默认,Next

red hat怎么安装python低版 red hat 6.5安装_red hat怎么安装python低版_35

7、设置系统账户密码

red hat怎么安装python低版 red hat 6.5安装_red hat怎么安装python低版_36

8、默认,Next

red hat怎么安装python低版 red hat 6.5安装_oracle_37

9、默认,Next

red hat怎么安装python低版 red hat 6.5安装_运维_38

10、Next

red hat怎么安装python低版 red hat 6.5安装_数据库_39

11、配置内存大小

red hat怎么安装python低版 red hat 6.5安装_数据库_40

12、配置连接数

red hat怎么安装python低版 red hat 6.5安装_red hat怎么安装python低版_41

 

 13、设置编码

red hat怎么安装python低版 red hat 6.5安装_开发工具_42

14、点击Finish

red hat怎么安装python低版 red hat 6.5安装_red hat怎么安装python低版_43

15、点击OK

red hat怎么安装python低版 red hat 6.5安装_red hat怎么安装python低版_44

 

 16、开始创建数据库

red hat怎么安装python低版 red hat 6.5安装_oracle_45

17、数据库创建完成,数据库详细信息如下,点击Exit

red hat怎么安装python低版 red hat 6.5安装_开发工具_46