首页 > 代码库 > day1 oracle12C的安装
day1 oracle12C的安装
1.软件准备
oracle12c.zip 安装包
VMware 虚拟机
redhat7.0 系统
Xmanagement
2. 在VMware下安装redhat7.0系统
注:硬盘80GB
3.配置linux7.0
3.1 IP 网关 配置
[root@localhost ~]# nmcli conn modify eno16777736 ipv4.addresses ‘192.168.144.128/24 192.168.144.1‘ [root@localhost ~]# nmcli conn modify eno16777736 ipv4.method manual [root@localhost ~]# nmcli conn modify eno16777736 connection.autoconnect yes
3.2 配置ssh服务端,停止在链接的ssh的时候启用dns解析
vim /etc/ssh/sshd_config #UseDNS yes UseDNS no
3.3 禁用防火墙
[root@localhost ~]# systemctl stop firewalld [root@localhost ~]# systemctl disable firewalld [root@localhost ~]# systemctl status firewalld firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled) Active: inactive (dead)
3.4 禁用selinux
[root@localhost ~]# getenforce Permissive [root@localhost ~]# [root@localhost ~]# setenforce 0 [root@localhost ~]# [root@localhost ~]# vim /etc/selinux/ SELINUX=permissive
3.5 完成后重启
[root@localhost ~]# reboot
4. 安装前配置
4.1 安装软件包
[root@localhost ~]# vim /etc/yum.repos.d/base.repo [base] name=base baseurl=file:///mnt enable=1 gpgcheck=0
[root@localhost ~]# yum clean all
[root@localhost ~]# mount /dev/sr0 /mnt mount: /dev/sr0 is write-protected, mounting read-only mount: /dev/sr0 is already mounted or /mnt busy /dev/sr0 is already mounted on /mnt [root@localhost ~]# [root@localhost ~]# yum install -y compat-libcap1 glibc-devel ksh libaio-devel libstdc++-devel gcc gcc-c++ uni
4.2系统组和用户
[root@localhost ~]# groupadd oinstall [root@localhost ~]# groupadd dba [root@localhost ~]# useradd -g oinstall -G dba oracle [root@localhost ~]# echo oracle | passwd --stdin oracle Changing password for user oracle. passwd: all authentication tokens updated successfully. [root@localhost ~]# id oracle uid=1001(oracle) gid=1001(oinstall) groups=1001(oinstall),1002(dba)
4.3检查内核参数
1、共享内存 [root@localhost ~]# vim /etc/sysctl.conf fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 429496729 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@localhost ~]# sysctl -p 2、资源限制 [root@localhost ~]# vim /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
4.4 硬盘扩容,开机启动
[root@localhost ~]# fdisk /dev/sda [root@localhost ~]# partprobe [root@localhost ~]# mkfs.xfs /dev/sda5
[root@localhost ~]# mkdir /u01 [root@localhost ~]# [root@localhost ~]# mount /dev/sda5 /u01
[root@localhost ~]# blkid /dev/sda1: UUID="9bed2ed9-71b1-498f-be9c-445d3e20ed62" TYPE="xfs" /dev/sda2: UUID="cf5a1986-223c-46e3-a276-54718b9e21da" TYPE="swap" /dev/sda3: UUID="4f7c87bc-f4f6-4c9f-8bab-e82a423f7382" TYPE="xfs" /dev/sda5: UUID="013ca86b-4062-4ce7-aebb-177823462cb7" TYPE="xfs" /dev/sr0: UUID="2014-05-07-03-58-46-00" LABEL="RHEL-7.0 Server.x86_64" TYPE="iso9660" PTTYPE="dos" [root@localhost ~]# [root@localhost ~]# vim /etc/fstab
[root@localhost ~]# mount -a [root@localhost ~]# [root@localhost ~]# mount
4.5 检查需要的目录,权限
[root@localhost ~]# cd /u01 [root@localhost u01]# mkdir app [root@localhost ~]# chmod 775 /u01/ -R [root@localhost ~]# chown oracle:oinstall /u01/ -R [root@localhost ~]# [root@localhost ~]# ll /u01/ -d drwxrwxr-x. 3 oracle oinstall 16 Aug 7 22:11 /u01/ [root@localhost ~]# ll /u01/app -d drwxrwxr-x. 2 oracle oinstall 6 Aug 7 22:11 /u01/app
注:权限修改不对,安装时会出现错误
4.6 复制安装文件到系统
[root@localhost ~]# cd /home/oracle/ [root@localhost oracle]# [root@localhost oracle]# ll total 3372752 -rw-r--r--. 1 root root 3453696911 Aug 7 22:13 ORACLE12C.zip [root@localhost oracle]# unzip ORACLE12C.zip [root@localhost oracle]# chmod 777 database/ -R [root@localhost oracle]# chown oracle:oinstall database/ -R
4.7执行xhost +
[root@localhost oracle]# xhost + access control disabled, clients can connect from any host [root@localhost oracle]#
4.8 重启
注:没有重启的话,出现错误
5. 安装oracle12C
5.1 oracle用户登录执行
[oracle@localhost ~]$ cd database/ [oracle@localhost database]$ ./runInstaller Starting Oracle Universal Installer... Checking Temp space: must be greater than 500 MB. Actual 9085 MB Passed Checking swap space: must be greater than 150 MB. Actual 1999 MB Passed Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed le@localhost database]$ You can find the log of this install session at: /u01/app/oraInventory/logs/installActions2017-08-07_10-18-09PM.log [oracle@localhost database]$
5.2 安装步骤选项
5.3 安装停下的话,出现以下界面 用root用户登录,执行脚本
[root@localhost ~]# cd /home/oracle/ [root@localhost oracle]# cd database/ [root@localhost database]# /u01/app/oraInventory/orainstRoot.sh [root@localhost database]# /u01/app/oracle/product/12.2.0/dbhome_1/root.sh [root@localhost database]#
注:执行第二个脚本,还要下一步,下一步,不然,无法成功安装数据库命令
6.进入SQL
oracle登录,进入
注: ORACLE_SID = [oracle] ? oracle01 注:oracle01为 数据库名字
[oracle@localhost database]$ . oraenv
ORACLE_SID = [oracle] ? oracle01 The Oracle base has been set to /u01/app/oracle [oracle@localhost database]$ sqlplus / as sysdba
SQL> select instance_name,status from v$instance;
7.大家按照这种方法按照的话,不会的问题可以留言,共同解决
day1 oracle12C的安装
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。