CentOS6.9 安装Oracle 11G 版本11.2.0.1.0

时间:2022-02-17 23:15:25

安装实例与数据库

CentOS6.9 安装Oracle 11G 版本11.2.0.1.0

一、检查系统类别。

查看 系统的类别,这里是 64位系统:
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-514.16.1.el7.x86_64 #1 SMP Wed Apr 12 15:04:24 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

1. 关闭防火墙
在rac1 和rac2 2个节点上分别执行如下语句:

[root@rac01 ~]# service iptables stop
[root@rac01 ~]# chkconfig iptables off
[root@rac01 ~]# chkconfig iptables --list
iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off

-------------------------------------------
service iptables stop
chkconfig iptables off
chkconfig iptables --list

-------------------------------------------
2. 修改主机名

#vi /etc/sysconfig/network
HOSTNAME=rac1

# hostname rac1

并且添加 hosts 记录
vi /etc/hosts

-------------------------------------------------
3. 关闭 security
[root@DB-Server ~]# setenforce 0
[root@DB-Server ~]# getenforce
Permissive
[root@DB-Server ~]# setenforce 1
[root@DB-Server ~]# getenforce;
Enforcing

编辑文件 ,关闭 security
vi /etc/selinux/config

二、建立用户组,赋予权限——添加用户及相关目录
增加用户组与用户:

----------------------------
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle

增加目录,分配相应的权限

mkdir -p /u01/app/oracle/product/11.2.0/db_1
mkdir -p /u01/app/oraInventory
chown -R oracle:oinstall /u01/app
chmod -R 775 /u01/app
mkdir -p /home/oracle/software
chown -R oracle:oinstall /home/oracle
chmod -R 775 /home/oracle

三、环境变量如下 。oracle用户

#add by juwenyu date 20170926

ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
ORACLE_SID=sdnxdb
ORACLE_HOSTNAME=sdnx
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_PATH ORACLE_HOSTNAME NLS_LANG

四、修改内核参数文件:
vi /etc/sysctl.conf 添加以下内容 执行 sysctl -p 生效

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
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

七、检查安装的包与报错信息修改

yum install gcc -y
yum install compat-libstdc++-33 -y
yum install elfutils-libelf-devel -y
yum install gcc-c++ -y
yum install sysstat -y
yum install libaio-devel -y
yum install -y gcc;

--------------------------------------------------
内核限制:(设置)
在“/etc/security/limits.conf”文件,添加以下行:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

==================================================================================

listener.ora

LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = nxpx)(PORT = 1521))
)

====================================================================================
接下来就是建库。这里是图形界面建库。

网络配置:netca 简单直接下一步即可。

数据库配置:dbca 内容有截图

===================================================================================
SQL> startup
ORACLE instance started.

Total System Global Area 8284340224 bytes
Fixed Size 2244832 bytes
Variable Size 4261416736 bytes
Database Buffers 4009754624 bytes
Redo Buffers 10924032 bytes
Database mounted.
Database opened.
SQL>
SQL> show parameter target;

NAME TYPE VALUE
---------------------------- -------- -----------
archive_lag_target integer 0
db_flashback_retention_target integer 1440
fast_start_io_target integer 0
fast_start_mttr_target integer 0
memory_max_target big integer 7936M
memory_target big integer 7936M
parallel_servers_target integer 384
pga_aggregate_target big integer 0
sga_target big integer 0

========================================================================================