Linux-Oracle-Install

1、关闭iptables,selinux,NetworkManager(可选)

1:永久关闭防火墙
chkconfig iptables off
2:永久关闭SELinux 
编辑/etc/selinux/config文件,将SELINUX的值设置为disabled。下次开机SELinux就不会启动了。
vim /etc/selinux/config
SELINUX=disabled
3:将NetworkManager 服务设置开机不启动
chkconfig NetworkManager off

2、配置网络和主机名

参考这篇文章:Linux-Network-Configuration

3、配置hosts文件,将本地地址及服务器名加进去

[root@Boss ~]# vim /etc/hosts
[root@Boss ~]# tail -1 /etc/hosts
172.17.100.235 Boss

4、安装oracle依赖包

[root@Boss mail]# yum -y install gcc gcc-c++ make binutils compat-libstdc++-33 glibc glbic-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel unixODBC-devel sysstat ksh unzip

5、创建用户、组和密码

[root@Boss mail]# groupadd -g 1000 oinstall     
[root@Boss mail]# groupadd -g 1001 dba     
[root@Boss mail]# groupadd -g 1002 oper
[root@Boss mail]# useradd -u 1000 -g 1000 -G 1001,1002 oracle
Creating mailbox file: File exists
[root@Boss ~]# cp /etc/skel/.bash_logout /home/oracle
cp: overwrite `/home/oracle/.bash_logout'? 
[root@Boss ~]# cp /etc/skel/.bashrc /home/oracle
cp: overwrite `/home/oracle/.bashrc'? 
[root@Boss ~]# id oracle
uid=1000(oracle) gid=1000(oinstall) groups=1000(oinstall),1001(dba),1002(oper)
[root@Boss ~]# echo "orcl@123"|passwd --stdin oracle
Changing password for user oracle.
passwd: all authentication tokens updated successfully.

6、添加oracle的环境变量并验证(.bash_profile)

[root@Boss ~]# su - oracle
[oracle@Boss ~]$ vim .bash_profile 
[oracle@Boss ~]$ tail -7 .bash_profile 
export PATH
export ORACLE_SID=ora12c
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/12C
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
[oracle@Boss ~]$ source .bash_profile 
[oracle@Boss ~]$ echo $ORACLE_HOME
/u01/app/oracle/12C
[oracle@Boss ~]$ echo $ORACLE_SID
ora12c

7、创建安装目录并赋予相应权限

[oracle@Boss ~]$ logout
[root@Boss ~]# mkdir -p /u01/app/oracle
[root@Boss ~]# chmod 775 -R /u01/
[root@Boss ~]# chown oracle:oinstall -R /u01/
[root@Boss ~]# ll -d /u01/
drwxrwxr-x 3 oracle oinstall 4096 Jul 23 09:48 /u01/

8、给oracle设置空间限制条件(内存和磁盘空间)

[root@Boss ~]# vim /etc/security/limits.conf 
[root@Boss ~]# tail -6 /etc/security/limits.conf 
oracle      soft    nproc       2047
oracle      hard    nproc       16384
oracle      soft    nofile      1024
oracle      hard    nofile      65536
oracle      soft    stack       10240
oracle      hard    stack       10240   

9、内核参数的更改(/etc/sysctl.conf)

[oracle@Boss ~]$ tail -13 /etc/sysctl.conf 
kernel.shmall = 4294967296
fs.aio-max-nr = 1048576    //这个参数是11g有的
fs.file-max = 6815744
kernel.shmmax = 4175929344
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 1048576
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
vm.hugetlb_shm_group = 1000

10、给其他用户图形化的权限(临时更改的)

[root@server network-scripts]# xhost +
access control disabled, clients can connect from any host

11、解压并安装oracle

[root@Boss ~]# ll -d /database/
drwxrwxr-x 7 3000 2000 4096 Jul  7  2014 /database/
[root@Boss ~]# chown oracle:oinstall -R /database/
[root@Boss ~]# ll -d /database/
drwxrwxr-x 7 oracle oinstall 4096 Jul  7  2014 /database/
---此处最好重开窗口,用oracle用户登陆安装
[oracle@Boss database]$ ./runInstaller 
正在启动 Oracle Universal Installer...
检查临时空间: 必须大于 500 MB。   实际为 71726 MB    通过
检查交换空间: 必须大于 150 MB。   实际为 15999 MB    通过
检查监视器: 监视器配置至少必须显示 256 种颜色。    实际为 16777216    通过
准备从以下地址启动 Oracle Universal Installer /tmp/OraInstall2018-07-23_01-45-37PM. 请稍候...[oracle@Boss databa
se]$ 可以在以下位置找到本次安装会话的日志: /u01/app/oraInventory/logs/installActions2018-07-23_01-45-37PM.log

12、使用netca命令,配置监听程序

[oracle@Boss database]$ netca
Oracle Net Services 配置:
停止 Oracle Net 监听程序:
    正在运行监听程序控制: 
      /u01/app/oracle/12C/bin/lsnrctl stop LISTENER
    监听程序控制完成。
    监听程序已成功停止。
已删除的监听程序: LISTENER
正在配置监听程序:LISTENER
监听程序配置完成。
Oracle Net 监听程序启动:
    正在运行监听程序控制: 
      /u01/app/oracle/12C/bin/lsnrctl start LISTENER
    监听程序控制完成。
    监听程序已成功启动。
成功完成 Oracle Net Services 配置。退出代码是0

附录:

1、关闭EM可以对数据库进行优化处理,,但是看客户的要求,也许EM被要求建立。
[oracle@server ~]$ emctl stop dbconsole  //关闭EM
2、yum源配置
[更换阿里Yum源](https://blog.csdn.net/zero_gg/article/details/78254453)
3、数据库启动、关闭、退出
vm.hugetlb_shm_group = 1000
[oracle@Boss ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Mon Jul 23 15:37:00 2018
Copyright (c) 1982, 2014, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup     
ORACLE instance started.
Total System Global Area 1610612736 bytes
Fixed Size          2924928 bytes
Variable Size        1040191104 bytes
Database Buffers      553648128 bytes
Redo Buffers           13848576 bytes
Database mounted.
Database opened.
SQL> exit
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值