本文为Oracle Database 12c Release 2的安装文档,参考了官方文档:
Database Installation Guide:http://docs.oracle.com/database/122/LADBI/
在我的环境里,有一台RHEL 7.3的服务器,用来完成本次12cR2的安装,它的主机名为:ora12-1。
创建需要的基础目录(个人习惯)
[root@ora12c-1 ~]# mkdir -p /script/shell [root@ora12c-1 ~]#
安装前检查(Checklist)
运行等级:
[root@ora12c-1 ~]# runlevel N 5 [root@ora12c-1 ~]#
LONG BIT:
[root@ora12c-1 ~]# getconf -a | grep --color LONG_BIT LONG_BIT 64 [root@ora12c-1 ~]#
内核与版本号:
[root@ora12c-1 ~]# uname -a Linux ora12c-1 3.10.0-514.el7.x86_64 #1 SMP Wed Oct 19 11:24:13 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux [root@ora12c-1 ~]# [root@ora12c-1 ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.3 (Maipo) [root@ora12c-1 ~]#
对于【Red Hat Enterprise Linux】,官方需要的是:
RHEL 7.3 【7:3.10.0 ~ 54.0.1】或者更高版本。
内存状态:
[root@ora12c-1 ~]# free -m total used free shared buff/cache available Mem: 3787 584 2057 10 1145 2874 Swap: 3967 0 3967 [root@ora12c-1 ~]# [root@ora12c-1 ~]# swapon -s Filename Type Size Used Priority /dev/dm-1 partition 4063228 264 -1 [root@ora12c-1 ~]# [root@ora12c-1 ~]# sh /script/shell/calc_mem.sh ## SYSTEM is Linux 7 OS Release is: Red Hat Enterprise Linux Server release 7.3 (Maipo) Sign is: [Available] Memory Status: [ Date is: |2017-03-07|13:32:57|] ---------------------------- MEM TOTAL is: 3878292 [KB], 3787.3945 [MB], 3.6986 [GB] MEM AVAILABLE is: 2943180 [KB], 2874.1992 [MB], 2.8068 [GB] Percent - Available = 75.8886 % Percent - Used = 24.1114 % [root@ora12c-1 ~]#
脚本【/script/shell/calc_mem.sh】可以去我的GITHUB代码托管上面获得。
官方在内存方面的要求是:
最低1 GB,如果2 GB更好。
对于Oracle Grid Infrastructure来说,最少需要8 GB。
在我的环境里,有3 GB。
文件系统:设备与挂载情况。
[root@ora12c-1 ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel_ora12c--1-root 50G 14G 37G 28% / devtmpfs 1.9G 0 1.9G 0% /dev tmpfs 1.9G 140K 1.9G 1% /dev/shm tmpfs 1.9G 8.9M 1.9G 1% /run tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup /dev/sda1 1014M 173M 842M 17% /boot /dev/mapper/rhel_ora12c--1-home 106G 33M 106G 1% /home tmpfs 379M 28K 379M 1% /run/user/0 [root@ora12c-1 ~]# [root@ora12c-1 ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT fd0 2:0 1 4K 0 disk sda 8:0 0 160G 0 disk ├─sda1 8:1 0 1G 0 part /boot └─sda2 8:2 0 159G 0 part ├─rhel_ora12c--1-root 253:0 0 50G 0 lvm / ├─rhel_ora12c--1-swap 253:1 0 3.9G 0 lvm [SWAP] └─rhel_ora12c--1-home 253:2 0 105.1G 0 lvm /home sr0 11:0 1 3.5G 0 rom [root@ora12c-1 ~]#
注意:
1. 这里,我装系统的时候没有选择,所以大部分的空就都跑到【/home】里面了,所以接下来的软件的安装都会放在该路径下面。
不过,这种做法是不推荐的,因为目录结构不符合Oracle提出的最有灵活架构,应该是放在【/u01/xxx】这样的目录里面是最好的,但这里重新安装系统比较麻烦,所以就这么配置了。(这不好,不要学)
2. 对于将要安装存放Oracle软件的目录,最少需要8.6 GB的剩余空间。
禁用透明巨页(Transparent HugePages)
Oracle建议禁用THP,因为THP可能导致内存分配的延迟,而引发性能问题。
[root@ora12c-1 khugepaged]# grep -i HugePages_Total /proc/meminfo HugePages_Total: 0 [root@ora12c-1 khugepaged]# cat /proc/sys/vm/nr_hugepages 0 [root@ora12c-1 khugepaged]# [root@ora12c-1 khugepaged]# cat /sys/kernel/mm/transparent_hugepage/enabled [always] madvise never [root@ora12c-1 khugepaged]# echo never > /sys/kernel/mm/transparent_hugepage/enabled [root@ora12c-1 khugepaged]# [root@ora12c-1 khugepaged]# cat /sys/kernel/mm/transparent_hugepage/enabled always madvise [never] [root@ora12c-1 khugepaged]#
Oracle CHECK工具对系统检查:
如果是全新安装,可以使用ORAchk,对当前环境检查一下。
该工具可以从Oracle OMS获得:
https://support.oracle.com/rs?type=doc&id=1268927.2
为了方便,我本地也下载了:
链接:http://pan.baidu.com/s/1cksPie
如果系统检查不通过,你可能会看到这样的结果:
全新安装:
./orachk -profile preinstall
升级:
./orachk -u -o pre
[root@ora12c-1 ~]# cd /software/oracle/ [root@ora12c-1 oracle]# ls Apex5_CollectionManager_App.sql generate_guests_list.sh linuxx64_12201_grid_home.zip orachk.zip user_defined_checks.xsd CollectionManager_App.sql linuxx64_12201_client.zip linuxx64_12201_gsm.zip readme.txt UserGuide.txt collections.dat linuxx64_12201_database.zip linuxx86_12201_client.zip rules.dat doc linuxx64_12201_examples.zip orachk sample_user_defined_checks.xml exadiscover linuxx64_12201_gateways.zip ORAchk_Health_Check_Catalog.html templates [root@ora12c-1 oracle]# [root@ora12c-1 oracle]# [root@ora12c-1 oracle]# ./orachk -profile preinstall This computer is for [S]ingle instance database or part of a [C]luster to run RAC database [S|C] [C]:S orachk did not find the inventory location on ora12c-1 from environment.Does ora12c-1 have Oracle software installed [y/n][n]?n Checking Status of Oracle Software Stack - Clusterware, ASM, RDBMS . . Checking for prompts for root user on all nodes... . . . . . . . ------------------------------------------------------------------------------------------------------- Oracle Stack Status ------------------------------------------------------------------------------------------------------- Host Name CRS Installed ASM HOME RDBMS Installed CRS UP ASM UP RDBMS UP DB Instance Name ------------------------------------------------------------------------------------------------------- ora12c-1 No No No No No No ------------------------------------------------------------------------------------------------------- . . . . . Copying plug-ins . . /root/.orachk/ggdiscovery.sh: line 1: findogghome4: command not found . . . . . . . *** Checking Best Practice Recommendations (PASS/WARNING/FAIL) *** Collections and audit checks log file is /software/oracle/orachk_ora12c-1_030717_142735/log/orachk.log Checking for prompts in /root/.bash_profile on ora12c-1 for root user... . . ============================================================= Node name - ora12c-1 ============================================================= . . . . . Collecting - Kernel parameters Collecting - Maximum number of semaphore sets on system Collecting - Maximum number of semaphores on system Collecting - Maximum number of semaphores per semaphore set Collecting - OS Packages Collecting - number of semaphore operations per semop system call Data collections completed. Checking best practices on ora12c-1. -------------------------------------------------------------------------------------- WARNING => Linux Swap Configuration does NOT meet Recommendation WARNING => Package libaio-devel-0.3.109-12.el7-i686 is recommended but NOT installed WARNING => Package libaio-devel-0.3.109-12.el7-x86_64 is recommended but NOT installed WARNING => Package glibc-devel-2.17-55.el7-i686 is recommended but NOT installed WARNING => Package compat-libcap1-1.10-7.el7-x86_64 is recommended but NOT installed WARNING => Package gcc-4.8.2-16.el7-x86_64 is recommended but NOT installed WARNING => Package libstdc++-devel-4.8.2-16.el7-i686 is recommended but NOT installed WARNING => Package libstdc++-devel-4.8.2-16.el7-x86_64 is recommended but NOT installed WARNING => Package gcc-c++-4.8.2-16.el7-x86_64 is recommended but NOT installed WARNING => Package glibc-devel-2.17-55.el7-x86_64 is recommended but NOT installed WARNING => Package ksh-20120801-19.el7-x86_64 is recommended but NOT installed WARNING => net.core.wmem_default Is NOT Configured According to Recommendation WARNING => net.core.wmem_max Is NOT Configured According to Recommendation WARNING => net.core.rmem_default Is NOT Configured According to Recommendation WARNING => net.core.rmem_max is not configured according to recommendation WARNING => Kernel Parameter kernel.shmall Is lower than the recommended value WARNING => Kernel Parameter SEMOPM Is Lower Than The Recommended Value WARNING => kernel.shmmax parameter is NOT configured according to recommendation WARNING => OSWatcher is not running as is recommended. --------------------------------------------------------------------------------- Detailed report (html) - /software/oracle/orachk_ora12c-1_030717_142735/orachk_ora12c-1_030717_142735.html UPLOAD(if required) - /software/oracle/orachk_ora12c-1_030717_142735.zip [root@ora12c-1 oracle]#
这里暂不处理上面的错误,后面安装完RPM包之后,会再次CHECK。
对上面的事项的一些检查:
[root@ora12c-1 oracle]# grep MemTotal /proc/meminfo MemTotal: 3878292 kB [root@ora12c-1 oracle]# [root@ora12c-1 oracle]# grep SwapTotal /proc/meminfo SwapTotal: 4063228 kB [root@ora12c-1 oracle]# [root@ora12c-1 oracle]# df -h /tmp Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel_ora12c--1-root 50G 14G 37G 28% / [root@ora12c-1 oracle]# [root@ora12c-1 oracle]# free total used free shared buff/cache available Mem: 3878292 582844 2508388 10348 787060 2945804 Swap: 4063228 264 4062964 [root@ora12c-1 oracle]# [root@ora12c-1 oracle]# uname -m x86_64 [root@ora12c-1 oracle]# [root@ora12c-1 oracle]# df -h /dev/shm Filesystem Size Used Avail Use% Mounted on tmpfs 1.9G 140K 1.9G 1% /dev/shm [root@ora12c-1 oracle]#
下载Oracle官方的【oracle-database-server-12cR2-preinstall】包:
https://public-yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-server-12cR2-preinstall-1.0-2.el7.x86_64.rpm
该工具只能在OEL的UEK【Unbreakable Enterprise Kernel】内核下才可以安装。
Unbreakable Linux Nexwork:
https://linux.oracle.com
SHELL:
[root@ora12c-1 oracle]# mkdir uln [root@ora12c-1 oracle]# cd uln [root@ora12c-1 uln]# pwd /software/oracle/uln [root@ora12c-1 uln]# ls [root@ora12c-1 uln]# [root@ora12c-1 uln]# ls -ltr total 72 -rw-r--r--. 1 root root 51904 Mar 7 14:55 oraclelinux-release-7.3-1.0.4.el7.x86_64.rpm -rw-r--r--. 1 root root 18116 Mar 7 14:57 oracle-database-server-12cR2-preinstall-1.0-2.el7.x86_64.rpm [root@ora12c-1 uln]# [root@ora12c-1 uln]# du -sh * 20K oracle-database-server-12cR2-preinstall-1.0-2.el7.x86_64.rpm 52K oraclelinux-release-7.3-1.0.4.el7.x86_64.rpm [root@ora12c-1 uln]#
配置YUM仓库:
[root@ora12c-1 uln]# cat /etc/yum.repos.d/centos73.repo [base] name=CentOS-$releasever - Base baseurl=http://mirrors.163.com/centos/7.3.1611/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/7.3.1611/os/x86_64/RPM-GPG-KEY-CentOS-7 #released updates [updates] name=CentOS-$releasever - Updates baseurl=http://mirrors.163.com/centos/7.3.1611/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/7.3.1611/os/x86_64/RPM-GPG-KEY-CentOS-7 [extras] name=CentOS-$releasever - Extras baseurl=http://mirrors.163.com/centos/7.3.1611/extras//$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/7.3.1611/os/x86_64/RPM-GPG-KEY-CentOS-7 [centosplus] name=CentOS-$releasever - Plus baseurl=http://mirrors.163.com/centos/7.3.1611/centosplus//$basearch/ gpgcheck=1 enabled=0 [root@ora12c-1 uln]# [root@ora12c-1 uln]# yum repolist Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. base | 3.6 kB 00:00:00 extras | 3.4 kB 00:00:00 updates | 3.4 kB 00:00:00 (1/4): base/x86_64/group_gz | 155 kB 00:00:03 (2/4): extras/x86_64/primary_db | 122 kB 00:00:03 (3/4): updates/x86_64/primary_db | 3.8 MB 00:00:14 (4/4): base/x86_64/primary_db | 5.6 MB 00:00:17 repo id repo name status base/x86_64 CentOS-7Server - Base 9,363 extras/x86_64 CentOS-7Server - Extras 266 updates/x86_64 CentOS-7Server - Updates 1,086 repolist: 10,715 [root@ora12c-1 uln]#
安装依赖包:
yum install -y compat-libcap1 compat-libstdc++* glibc-devel* ksh libaio* libstdc++*
配置Oracle 7的YUM仓库:
[root@ora12c-1 oracle]# wget http://public-yum.oracle.com/public-yum-ol7.repo --2017-03-07 16:54:08-- http://public-yum.oracle.com/public-yum-ol7.repo Resolving public-yum.oracle.com (public-yum.oracle.com)... 72.246.190.105, 72.246.190.81 Connecting to public-yum.oracle.com (public-yum.oracle.com)|72.246.190.105|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 5368 (5.2K) [text/plain] Saving to: ‘public-yum-ol7.repo’ 100%[=======================================================================================================================================>] 5,368 14.1KB/s in 0.4s 2017-03-07 16:54:09 (14.1 KB/s) - ‘public-yum-ol7.repo’ saved [5368/5368] [root@ora12c-1 oracle]# cp public-yum-ol7.repo /etc/yum.repos.d/ [root@ora12c-1 oracle]# [root@ora12c-1 oracle]# cat /etc/yum.repos.d/public-yum-ol7.repo [ol7_latest] name=Oracle Linux $releasever Latest ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/latest/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 enabled=1 [ol7_u0_base] name=Oracle Linux $releasever GA installation media copy ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/0/base/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 enabled=0 [ol7_u1_base] name=Oracle Linux $releasever Update 1 installation media copy ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/1/base/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 enabled=0 [ol7_u2_base] name=Oracle Linux $releasever Update 2 installation media copy ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/2/base/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 enabled=0 [ol7_u3_base] name=Oracle Linux $releasever Update 3 installation media copy ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/3/base/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 enabled=0 [ol7_UEKR4] name=Latest Unbreakable Enterprise Kernel Release 4 for Oracle Linux $releasever ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/UEKR4/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 enabled=1 [ol7_UEKR3] name=Latest Unbreakable Enterprise Kernel Release 3 for Oracle Linux $releasever ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/UEKR3/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 enabled=0 [ol7_optional_latest] name=Oracle Linux $releasever Optional Latest ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/optional/latest/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 enabled=0 [ol7_addons] name=Oracle Linux $releasever Add ons ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/addons/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 enabled=0 [ol7_UEKR3_OFED20] name=OFED supporting tool packages for Unbreakable Enterprise Kernel on Oracle Linux 7 ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/UEKR3_OFED20/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 enabled=0 priority=20 [ol7_UEKR4_OFED] name=OFED supporting tool packages for Unbreakable Enterprise Kernel Release 4 on Oracle Linux 7 ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/UEKR4/OFED/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 enabled=0 priority=20 [ol7_MySQL57] name=MySQL 5.7 for Oracle Linux 7 ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/MySQL57_community/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 enabled=0 [ol7_MySQL56] name=MySQL 5.6 for Oracle Linux 7 ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/MySQL56/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 enabled=0 [ol7_MySQL55] name=MySQL 5.5 for Oracle Linux 7 ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/MySQL55/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 enabled=0 [ol7_openstack21] name=OpenStack 2.1 packages for Oracle Linux 7 (x86_64) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/openstack21/x86_64/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 priority=20 enabled=0 [ol7_openstack20] name=OpenStack 2.0 packages for Oracle Linux 7 (x86_64) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/openstack20/x86_64/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 priority=20 enabled=0 [ol7_ceph] name=Ceph Storage for Oracle Linux Release 2.0 - Oracle Linux 7.2 or later ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/ceph/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 enabled=0 [ol7_ceph10] name=Ceph Storage for Oracle Linux Release 1.0 - Oracle Linux 7.1 or later ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/ceph10/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 enabled=0 [ol7_spacewalk22_client] name=Spacewalk Client 2.2 for Oracle Linux 7 ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/spacewalk22/client/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 enabled=0 [ol7_software_collections] name=Software Collection Library release 2.3 packages for Oracle Linux 7 (x86_64) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/SoftwareCollections/x86_64/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 enabled=0 [ol7_spacewalk24_server] name=Spacewalk Server 2.4 for Oracle Linux 4 ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/spacewalk24/server/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 enabled=0 [ol7_spacewalk24_client] name=Spacewalk Client 2.4 for Oracle Linux 4 ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/spacewalk24/client/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 enabled=0 [ol7_MODRHCK] name=Latest RHCK with fixes from Oracle for Oracle Linux $releasever ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/MODRHCK/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=0 priority=20 enabled=0 [root@ora12c-1 oracle]# [root@ora12c-1 oracle]# yum repolist Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. base | 3.6 kB 00:00:00 extras | 3.4 kB 00:00:00 ol7_UEKR4 | 1.2 kB 00:00:00 ol7_latest | 1.4 kB 00:00:00 updates | 3.4 kB 00:00:00 (1/5): ol7_UEKR4/x86_64/updateinfo | 38 kB 00:00:00 (2/5): ol7_latest/x86_64/group | 681 kB 00:00:04 (3/5): ol7_latest/x86_64/updateinfo | 1.2 MB 00:00:17 (4/5): ol7_UEKR4/x86_64/primary | 13 MB 00:05:02 (5/5): ol7_latest/x86_64/primary | 23 MB 00:06:30 ol7_UEKR4 295/295 ol7_latest 18599/18599 repo id repo name status base/x86_64 CentOS-7Server - Base 9,363 extras/x86_64 CentOS-7Server - Extras 266 ol7_UEKR4/x86_64 Latest Unbreakable Enterprise Kernel Release 4 for Oracle Linux 7Server (x86_64) 295 ol7_latest/x86_64 Oracle Linux 7Server Latest (x86_64) 18,599 updates/x86_64 CentOS-7Server - Updates 1,086 repolist: 29,609 [root@ora12c-1 oracle]#
安装KERNEL-UEK:
[root@ora12c-1 oracle]# yum list | grep --color kernel-uek kernel-uek.x86_64 4.1.12-61.1.28.el7uek ol7_UEKR4 kernel-uek-debug.x86_64 4.1.12-61.1.28.el7uek ol7_UEKR4 kernel-uek-debug-devel.x86_64 4.1.12-61.1.28.el7uek ol7_UEKR4 kernel-uek-devel.x86_64 4.1.12-61.1.28.el7uek ol7_UEKR4 kernel-uek-doc.noarch 4.1.12-61.1.28.el7uek ol7_UEKR4 kernel-uek-firmware.noarch 4.1.12-61.1.28.el7uek ol7_UEKR4 [root@ora12c-1 oracle]# [root@ora12c-1 oracle]# yum install kernel-uek Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. ol7_UEKR4 | 1.2 kB 00:00:00 ol7_latest | 1.4 kB 00:00:00 Resolving Dependencies --> Running transaction check ---> Package kernel-uek.x86_64 0:4.1.12-61.1.28.el7uek will be installed --> Processing Dependency: kernel-firmware = 4.1.12-61.1.28.el7uek for package: kernel-uek-4.1.12-61.1.28.el7uek.x86_64 --> Running transaction check ---> Package kernel-uek-firmware.noarch 0:4.1.12-61.1.28.el7uek will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================================================================================= Package Arch Version Repository Size ================================================================================================================================================================================= Installing: kernel-uek x86_64 4.1.12-61.1.28.el7uek ol7_UEKR4 44 M Installing for dependencies: kernel-uek-firmware noarch 4.1.12-61.1.28.el7uek ol7_UEKR4 2.0 M Transaction Summary ================================================================================================================================================================================= Install 1 Package (+1 Dependent package) Total size: 46 M Installed size: 161 M Is this ok [y/d/N]: y Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : kernel-uek-firmware-4.1.12-61.1.28.el7uek.noarch 1/2 Installing : kernel-uek-4.1.12-61.1.28.el7uek.x86_64 2/2 Verifying : kernel-uek-firmware-4.1.12-61.1.28.el7uek.noarch 1/2 Verifying : kernel-uek-4.1.12-61.1.28.el7uek.x86_64 2/2 Installed: kernel-uek.x86_64 0:4.1.12-61.1.28.el7uek Dependency Installed: kernel-uek-firmware.noarch 0:4.1.12-61.1.28.el7uek Complete! [root@ora12c-1 oracle]#
UEK的Kernel包安装了,就可以安装【oracle-database-server-12cR2-preinstall】了:
[root@ora12c-1 uln]# pwd /software/oracle/uln [root@ora12c-1 uln]# [root@ora12c-1 uln]# ls -ltr * -rw-r--r--. 1 root root 51904 Mar 7 14:55 oraclelinux-release-7.3-1.0.4.el7.x86_64.rpm -rw-r--r--. 1 root root 18116 Mar 7 14:57 oracle-database-server-12cR2-preinstall-1.0-2.el7.x86_64.rpm [root@ora12c-1 uln]# [root@ora12c-1 uln]# rpm -ivh oracle-database-server-12cR2-preinstall-1.0-2.el7.x86_64.rpm warning: oracle-database-server-12cR2-preinstall-1.0-2.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY Preparing... ################################# [100%] Updating / installing... 1:oracle-database-server-12cR2-prei################################# [100%] [root@ora12c-1 uln]# [root@ora12c-1 uln]# rpm -qa | grep oracle-database-server oracle-database-server-12cR2-preinstall-1.0-2.el7.x86_64 [root@ora12c-1 uln]# [root@ora12c-1 uln]# rpm -ql oracle-database-server-12cR2-preinstall-1.0-2.el7 /etc/rc.d/init.d/oracle-database-server-12cR2-preinstall-firstboot /etc/security/limits.d/oracle-database-server-12cR2-preinstall.conf /etc/sysconfig/oracle-database-server-12cR2-preinstall /etc/sysconfig/oracle-database-server-12cR2-preinstall/oracle-database-server-12cR2-preinstall-verify /etc/sysconfig/oracle-database-server-12cR2-preinstall/oracle-database-server-12cR2-preinstall.param /usr/bin/oracle-database-server-12cR2-preinstall-verify /var/log/oracle-database-server-12cR2-preinstall /var/log/oracle-database-server-12cR2-preinstall/results [root@ora12c-1 uln]# [root@ora12c-1 uln]#
该软件包,帮你配置了如下内容:
文件:/etc/sysctl.conf
[root@ora12c-1 uln]# cat /etc/sysctl.conf # sysctl settings are defined through files in # /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/. # # Vendors settings live in /usr/lib/sysctl.d/. # To override a whole file, create a new file with the same in # /etc/sysctl.d/ and put new settings there. To override # only specific settings, add a file with a lexically later # name in /etc/sysctl.d/ and put new settings there. # # For more information, see sysctl.conf(5) and sysctl.d(5). # oracle-database-server-12cR2-preinstall setting for fs.file-max is 6815744 fs.file-max = 6815744 # oracle-database-server-12cR2-preinstall setting for kernel.sem is '250 32000 100 128' kernel.sem = 250 32000 100 128 # oracle-database-server-12cR2-preinstall setting for kernel.shmmni is 4096 kernel.shmmni = 4096 # oracle-database-server-12cR2-preinstall setting for kernel.shmall is 1073741824 on x86_64 kernel.shmall = 1073741824 # oracle-database-server-12cR2-preinstall setting for kernel.shmmax is 4398046511104 on x86_64 kernel.shmmax = 4398046511104 # oracle-database-server-12cR2-preinstall setting for kernel.panic_on_oops is 1 per Orabug 19212317 kernel.panic_on_oops = 1 # oracle-database-server-12cR2-preinstall setting for net.core.rmem_default is 262144 net.core.rmem_default = 262144 # oracle-database-server-12cR2-preinstall setting for net.core.rmem_max is 4194304 net.core.rmem_max = 4194304 # oracle-database-server-12cR2-preinstall setting for net.core.wmem_default is 262144 net.core.wmem_default = 262144 # oracle-database-server-12cR2-preinstall setting for net.core.wmem_max is 1048576 net.core.wmem_max = 1048576 # oracle-database-server-12cR2-preinstall setting for net.ipv4.conf.all.rp_filter is 2 net.ipv4.conf.all.rp_filter = 2 # oracle-database-server-12cR2-preinstall setting for net.ipv4.conf.default.rp_filter is 2 net.ipv4.conf.default.rp_filter = 2 # oracle-database-server-12cR2-preinstall setting for fs.aio-max-nr is 1048576 fs.aio-max-nr = 1048576 # oracle-database-server-12cR2-preinstall setting for net.ipv4.ip_local_port_range is 9000 65500 net.ipv4.ip_local_port_range = 9000 65500 [root@ora12c-1 uln]# [root@ora12c-1 uln]# sysctl -p fs.file-max = 6815744 kernel.sem = 250 32000 100 128 kernel.shmmni = 4096 kernel.shmall = 1073741824 kernel.shmmax = 4398046511104 kernel.panic_on_oops = 1 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576 net.ipv4.conf.all.rp_filter = 2 net.ipv4.conf.default.rp_filter = 2 fs.aio-max-nr = 1048576 net.ipv4.ip_local_port_range = 9000 65500 [root@ora12c-1 uln]#
安装Oracle的依赖包:
yum install -y binutils* compat-libcap1* compat-libstdc++* glibc* ksh libaio* libgcc* libstdc++* libxcb* libX11* libXau* libXi* libXtst* make net-tools nfs-utils* smartmontools sysstat unixODBC* gcc gcc-c++
[root@ora12c-1 uln]# yum install -y binutils* compat-libcap1* compat-libstdc++* glibc* ksh libaio* libgcc* libstdc++* libxcb* libX11* libXau* libXi* libXtst* make net-tools nfs-utils* smartmontools sysstat Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Package binutils-2.25.1-22.base.el7.x86_64 already installed and latest version Package compat-libcap1-1.10-7.el7.x86_64 already installed and latest version Package compat-libstdc++-33-3.2.3-72.el7.x86_64 already installed and latest version Package glibc-devel-2.17-157.el7_3.1.x86_64 already installed and latest version Package glibc-2.17-157.el7_3.1.x86_64 already installed and latest version Package glibc-headers-2.17-157.el7_3.1.x86_64 already installed and latest version Package glibc-common-2.17-157.el7_3.1.x86_64 already installed and latest version Package ksh-20120801-26.el7.x86_64 already installed and latest version Package libaio-0.3.109-13.el7.x86_64 already installed and latest version Package libaio-devel-0.3.109-13.el7.x86_64 already installed and latest version Package libgcc-4.8.5-11.el7.x86_64 already installed and latest version Package libstdc++-4.8.5-11.el7.x86_64 already installed and latest version Package libstdc++-docs-4.8.5-11.el7.x86_64 already installed and latest version Package libstdc++-devel-4.8.5-11.el7.x86_64 already installed and latest version Package libstdc++-static-4.8.5-11.el7.x86_64 already installed and latest version Package libxcb-1.11-4.el7.x86_64 already installed and latest version Package libX11-common-1.6.3-3.el7.noarch already installed and latest version Package libX11-1.6.3-3.el7.x86_64 already installed and latest version Package libXau-1.0.8-2.1.el7.x86_64 already installed and latest version Package libXi-1.7.4-2.el7.x86_64 already installed and latest version Package libXinerama-1.1.3-2.1.el7.x86_64 already installed and latest version Package libXtst-1.2.2-2.1.el7.x86_64 already installed and latest version Package 1:make-3.82-23.el7.x86_64 already installed and latest version Package net-tools-2.0-0.17.20131004git.el7.x86_64 already installed and latest version Package 1:smartmontools-6.2-7.el7.x86_64 already installed and latest version Package sysstat-10.1.5-11.el7.x86_64 already installed and latest version Resolving Dependencies --> Running transaction check ---> Package binutils-devel.x86_64 0:2.25.1-22.base.el7 will be installed --> Processing Dependency: zlib-devel for package: binutils-devel-2.25.1-22.base.el7.x86_64 ---> Package glibc-static.x86_64 0:2.17-157.el7_3.1 will be installed ---> Package glibc-utils.x86_64 0:2.17-157.el7_3.1 will be installed ---> Package libX11-devel.x86_64 0:1.6.3-3.el7 will be installed --> Processing Dependency: pkgconfig(xproto) for package: libX11-devel-1.6.3-3.el7.x86_64 --> Processing Dependency: pkgconfig(kbproto) for package: libX11-devel-1.6.3-3.el7.x86_64 ---> Package libXau-devel.x86_64 0:1.0.8-2.1.el7 will be installed ---> Package libXi-devel.x86_64 0:1.7.4-2.el7 will be installed --> Processing Dependency: pkgconfig(xfixes) for package: libXi-devel-1.7.4-2.el7.x86_64 --> Processing Dependency: pkgconfig(xext) for package: libXi-devel-1.7.4-2.el7.x86_64 ---> Package libXinerama-devel.x86_64 0:1.1.3-2.1.el7 will be installed ---> Package libXtst-devel.x86_64 0:1.2.2-2.1.el7 will be installed ---> Package libxcb-devel.x86_64 0:1.11-4.el7 will be installed ---> Package libxcb-doc.noarch 0:1.11-4.el7 will be installed ---> Package nfs-utils.x86_64 1:1.3.0-0.33.el7 will be updated ---> Package nfs-utils.x86_64 1:1.3.0-0.33.0.1.el7_3 will be an update --> Running transaction check ---> Package libXext-devel.x86_64 0:1.3.3-3.el7 will be installed ---> Package libXfixes-devel.x86_64 0:5.0.1-2.1.el7 will be installed ---> Package xorg-x11-proto-devel.noarch 0:7.7-13.el7 will be installed ---> Package zlib-devel.x86_64 0:1.2.7-17.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================================================================================= Package Arch Version Repository Size ================================================================================================================================================================================= Installing: binutils-devel x86_64 2.25.1-22.base.el7 base 844 k glibc-static x86_64 2.17-157.el7_3.1 updates 1.5 M glibc-utils x86_64 2.17-157.el7_3.1 ol7_latest 208 k libX11-devel x86_64 1.6.3-3.el7 base 980 k libXau-devel x86_64 1.0.8-2.1.el7 base 14 k libXi-devel x86_64 1.7.4-2.el7 base 105 k libXinerama-devel x86_64 1.1.3-2.1.el7 base 13 k libXtst-devel x86_64 1.2.2-2.1.el7 base 16 k libxcb-devel x86_64 1.11-4.el7 base 1.1 M libxcb-doc noarch 1.11-4.el7 base 4.7 M Updating: nfs-utils x86_64 1:1.3.0-0.33.0.1.el7_3 ol7_latest 377 k Installing for dependencies: libXext-devel x86_64 1.3.3-3.el7 base 75 k libXfixes-devel x86_64 5.0.1-2.1.el7 base 13 k xorg-x11-proto-devel noarch 7.7-13.el7 base 281 k zlib-devel x86_64 1.2.7-17.el7 base 50 k Transaction Summary ================================================================================================================================================================================= Install 10 Packages (+4 Dependent packages) Upgrade 1 Package Total download size: 10 M Downloading packages: No Presto metadata available for ol7_latest (1/15): binutils-devel-2.25.1-22.base.el7.x86_64.rpm | 844 kB 00:00:01 (2/15): libXau-devel-1.0.8-2.1.el7.x86_64.rpm | 14 kB 00:00:00 (3/15): libXext-devel-1.3.3-3.el7.x86_64.rpm | 75 kB 00:00:00 (4/15): libXfixes-devel-5.0.1-2.1.el7.x86_64.rpm | 13 kB 00:00:00 (5/15): libXi-devel-1.7.4-2.el7.x86_64.rpm | 105 kB 00:00:00 (6/15): glibc-utils-2.17-157.el7_3.1.x86_64.rpm | 208 kB 00:00:02 (7/15): libXinerama-devel-1.1.3-2.1.el7.x86_64.rpm | 13 kB 00:00:00 (8/15): libXtst-devel-1.2.2-2.1.el7.x86_64.rpm | 16 kB 00:00:00 (9/15): libX11-devel-1.6.3-3.el7.x86_64.rpm | 980 kB 00:00:03 (10/15): glibc-static-2.17-157.el7_3.1.x86_64.rpm | 1.5 MB 00:00:03 (11/15): libxcb-devel-1.11-4.el7.x86_64.rpm | 1.1 MB 00:00:01 (12/15): xorg-x11-proto-devel-7.7-13.el7.noarch.rpm | 281 kB 00:00:00 (13/15): zlib-devel-1.2.7-17.el7.x86_64.rpm | 50 kB 00:00:00 (14/15): libxcb-doc-1.11-4.el7.noarch.rpm | 4.7 MB 00:00:07 (15/15): nfs-utils-1.3.0-0.33.0.1.el7_3.x86_64.rpm | 377 kB 00:00:10 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 792 kB/s | 10 MB 00:00:13 Running transaction check Running transaction test Transaction test succeeded Running transaction Warning: RPMDB altered outside of yum. Installing : xorg-x11-proto-devel-7.7-13.el7.noarch 1/16 Installing : libXau-devel-1.0.8-2.1.el7.x86_64 2/16 Installing : libxcb-devel-1.11-4.el7.x86_64 3/16 Installing : libX11-devel-1.6.3-3.el7.x86_64 4/16 Installing : libXext-devel-1.3.3-3.el7.x86_64 5/16 Installing : libXfixes-devel-5.0.1-2.1.el7.x86_64 6/16 Installing : libXi-devel-1.7.4-2.el7.x86_64 7/16 Installing : zlib-devel-1.2.7-17.el7.x86_64 8/16 Installing : binutils-devel-2.25.1-22.base.el7.x86_64 9/16 Installing : libXtst-devel-1.2.2-2.1.el7.x86_64 10/16 Installing : libXinerama-devel-1.1.3-2.1.el7.x86_64 11/16 Installing : glibc-utils-2.17-157.el7_3.1.x86_64 12/16 Updating : 1:nfs-utils-1.3.0-0.33.0.1.el7_3.x86_64 13/16 Installing : glibc-static-2.17-157.el7_3.1.x86_64 14/16 Installing : libxcb-doc-1.11-4.el7.noarch 15/16 Cleanup : 1:nfs-utils-1.3.0-0.33.el7.x86_64 16/16 Verifying : zlib-devel-1.2.7-17.el7.x86_64 1/16 Verifying : xorg-x11-proto-devel-7.7-13.el7.noarch 2/16 Verifying : libxcb-devel-1.11-4.el7.x86_64 3/16 Verifying : binutils-devel-2.25.1-22.base.el7.x86_64 4/16 Verifying : libxcb-doc-1.11-4.el7.noarch 5/16 Verifying : libXi-devel-1.7.4-2.el7.x86_64 6/16 Verifying : glibc-static-2.17-157.el7_3.1.x86_64 7/16 Verifying : libXfixes-devel-5.0.1-2.1.el7.x86_64 8/16 Verifying : libXext-devel-1.3.3-3.el7.x86_64 9/16 Verifying : libXtst-devel-1.2.2-2.1.el7.x86_64 10/16 Verifying : 1:nfs-utils-1.3.0-0.33.0.1.el7_3.x86_64 11/16 Verifying : glibc-utils-2.17-157.el7_3.1.x86_64 12/16 Verifying : libXinerama-devel-1.1.3-2.1.el7.x86_64 13/16 Verifying : libX11-devel-1.6.3-3.el7.x86_64 14/16 Verifying : libXau-devel-1.0.8-2.1.el7.x86_64 15/16 Verifying : 1:nfs-utils-1.3.0-0.33.el7.x86_64 16/16 Installed: binutils-devel.x86_64 0:2.25.1-22.base.el7 glibc-static.x86_64 0:2.17-157.el7_3.1 glibc-utils.x86_64 0:2.17-157.el7_3.1 libX11-devel.x86_64 0:1.6.3-3.el7 libXau-devel.x86_64 0:1.0.8-2.1.el7 libXi-devel.x86_64 0:1.7.4-2.el7 libXinerama-devel.x86_64 0:1.1.3-2.1.el7 libXtst-devel.x86_64 0:1.2.2-2.1.el7 libxcb-devel.x86_64 0:1.11-4.el7 libxcb-doc.noarch 0:1.11-4.el7 Dependency Installed: libXext-devel.x86_64 0:1.3.3-3.el7 libXfixes-devel.x86_64 0:5.0.1-2.1.el7 xorg-x11-proto-devel.noarch 0:7.7-13.el7 zlib-devel.x86_64 0:1.2.7-17.el7 Updated: nfs-utils.x86_64 1:1.3.0-0.33.0.1.el7_3 Complete! [root@ora12c-1 uln]# [root@ora12c-1 uln]# yum install unixODBC* Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Resolving Dependencies --> Running transaction check ---> Package unixODBC.x86_64 0:2.3.1-11.el7 will be installed ---> Package unixODBC-devel.x86_64 0:2.3.1-11.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================================================================================= Package Arch Version Repository Size ================================================================================================================================================================================= Installing: unixODBC x86_64 2.3.1-11.el7 base 413 k unixODBC-devel x86_64 2.3.1-11.el7 base 55 k Transaction Summary ================================================================================================================================================================================= Install 2 Packages Total download size: 467 k Installed size: 1.4 M Is this ok [y/d/N]: y Downloading packages: (1/2): unixODBC-2.3.1-11.el7.x86_64.rpm | 413 kB 00:00:00 (2/2): unixODBC-devel-2.3.1-11.el7.x86_64.rpm | 55 kB 00:00:01 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 368 kB/s | 467 kB 00:00:01 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : unixODBC-2.3.1-11.el7.x86_64 1/2 Installing : unixODBC-devel-2.3.1-11.el7.x86_64 2/2 Verifying : unixODBC-devel-2.3.1-11.el7.x86_64 1/2 Verifying : unixODBC-2.3.1-11.el7.x86_64 2/2 Installed: unixODBC.x86_64 0:2.3.1-11.el7 unixODBC-devel.x86_64 0:2.3.1-11.el7 Complete! [root@ora12c-1 uln]#
安装完成后,再做一次ORAchk检查:
[root@ora12c-1 oracle]# ./orachk -profile preinstall This computer is for [S]ingle instance database or part of a [C]luster to run RAC database [S|C] [C]:s orachk did not find the inventory location on ora12c-1 from environment.Does ora12c-1 have Oracle software installed [y/n][n]? orachk did not find the inventory location on ora12c-1 from environment.Does ora12c-1 have Oracle software installed [y/n][n]?n Checking Status of Oracle Software Stack - Clusterware, ASM, RDBMS . . Checking for prompts for root user on all nodes... . . . . . . . ------------------------------------------------------------------------------------------------------- Oracle Stack Status ------------------------------------------------------------------------------------------------------- Host Name CRS Installed ASM HOME RDBMS Installed CRS UP ASM UP RDBMS UP DB Instance Name ------------------------------------------------------------------------------------------------------- ora12c-1 No No No No No No ------------------------------------------------------------------------------------------------------- . . . . . Copying plug-ins . . . . . . . . . *** Checking Best Practice Recommendations (PASS/WARNING/FAIL) *** Collections and audit checks log file is /software/oracle/orachk_ora12c-1_030717_180607/log/orachk.log Checking for prompts in /root/.bash_profile on ora12c-1 for root user... . . ============================================================= Node name - ora12c-1 ============================================================= . . . . . Collecting - Kernel parameters Collecting - Maximum number of semaphore sets on system Collecting - Maximum number of semaphores on system Collecting - Maximum number of semaphores per semaphore set Collecting - OS Packages Collecting - number of semaphore operations per semop system call Data collections completed. Checking best practices on ora12c-1. -------------------------------------------------------------------------------------- WARNING => Linux Swap Configuration does NOT meet Recommendation WARNING => OSWatcher is not running as is recommended. --------------------------------------------------------------------------------- Detailed report (html) - /software/oracle/orachk_ora12c-1_030717_180607/orachk_ora12c-1_030717_180607.html UPLOAD(if required) - /software/oracle/orachk_ora12c-1_030717_180607.zip [root@ora12c-1 oracle]#
配置用户组与用户:
上面在安装oracle的preinstall软件包的时候,其实就有自动创建oracle用户:
[root@ora12c-1 uln]# id oracle uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba) [root@ora12c-1 uln]# [root@ora12c-1 uln]# grep -E "oracle|oinstall|dba" /etc/group oinstall:x:54321: dba:x:54322:oracle [root@ora12c-1 uln]# [root@ora12c-1 uln]# grep -E "oracle|oinstall|dba" /etc/passwd oracle:x:54321:54321::/home/oracle:/bin/bash [root@ora12c-1 uln]#
文件:/etc/security/limits.conf
[root@ora12c-1 oracle]# cat /etc/security/limits.conf | grep -v '#' oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 oracle hard stack 10240 [root@ora12c-1 oracle]#
创建需要的目录结构:
[root@ora12c-1 oracle]# mkdir -p /home/app/{oracle/12c/release_2/db_1,tmp} [root@ora12c-1 oracle]# [root@ora12c-1 oracle]# chown -R oracle:oinstall /home/app/ [root@ora12c-1 oracle]# [root@ora12c-1 oracle]# chmod -R 755 /home/app/ [root@ora12c-1 oracle]#
设置oracle用户的环境变量:
[root@ora12c-1 oracle]# cat /home/oracle/.bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/.local/bin:$HOME/bin export PATH # for oracle database 12c release 2 export ORACLE_BASE=/home/app/oracle export ORACLE_HOME=$ORACLE_BASE/12c/release_2/db_1 export ORACLE_SID=smo_king export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin export EDITOR=vi export NLS_LANG=AMERICAN_AMERICA_ZHS16GBK [root@ora12c-1 oracle]#
验证一下:
[root@ora12c-1 oracle]# su - oracle [oracle@ora12c-1 ~]$ env | grep HOME HOME=/home/oracle ORACLE_HOME=/home/app/oracle/12c/release_2/db_1 [oracle@ora12c-1 ~]$ cd $ORACLE_HOME [oracle@ora12c-1 db_1]$ pwd /home/app/oracle/12c/release_2/db_1 [oracle@ora12c-1 db_1]$
解压安装介质:
[root@ora12c-1 oracle]# ls -ltrd /software drwxr-xr-x. 3 root root 20 Mar 6 17:13 /software [root@ora12c-1 oracle]# chmod -R 777 /software/ [root@ora12c-1 oracle]# [root@ora12c-1 oracle]# su - oracle Last login: Tue Mar 7 18:20:50 CST 2017 on pts/2 [oracle@ora12c-1 ~]$ cd /software/oracle/ [oracle@ora12c-1 oracle]$ ls -ltr | grep --color database -rwxrwxrwx. 1 root root 3453696911 Mar 3 12:47 linuxx64_12201_database.zip [oracle@ora12c-1 oracle]$ [oracle@ora12c-1 oracle]$ unzip linuxx64_12201_database.zip (... ... 过多的输出) creating: database/stage/Components/oracle.network.listener/12.2.0.1.0/1/DataFiles/ inflating: database/stage/Components/oracle.network.listener/12.2.0.1.0/1/DataFiles/filegroup2.jar creating: database/stage/Components/oracle.rdbms.dv/ creating: database/stage/Components/oracle.rdbms.dv/12.2.0.1.0/ creating: database/stage/Components/oracle.rdbms.dv/12.2.0.1.0/1/ creating: database/stage/Components/oracle.rdbms.dv/12.2.0.1.0/1/DataFiles/ inflating: database/stage/Components/oracle.rdbms.dv/12.2.0.1.0/1/DataFiles/filegroup1.jar creating: database/stage/Components/oracle.blaslapack/ creating: database/stage/Components/oracle.blaslapack/12.2.0.1.0/ creating: database/stage/Components/oracle.blaslapack/12.2.0.1.0/1/ creating: database/stage/Components/oracle.blaslapack/12.2.0.1.0/1/DataFiles/ inflating: database/stage/Components/oracle.blaslapack/12.2.0.1.0/1/DataFiles/filegroup3.jar inflating: database/stage/shiphomeinfo.properties creating: database/stage/globalvariables/ inflating: database/stage/globalvariables/variable.properties inflating: database/stage/globalvariables/globalvar.xml inflating: database/stage/install1.jar inflating: database/runInstaller [oracle@ora12c-1 oracle]$ [oracle@ora12c-1 oracle]$
准备启动OUI:
[oracle@ora12c-1 database]$ pwd /software/oracle/database [oracle@ora12c-1 database]$ ls install response rpm runInstaller sshsetup stage welcome.html [oracle@ora12c-1 database]$
图形化:
然后,执行脚本:
SHELL:
[root@ora12c-1 ~]# sh /home/app/oraInventory/orainstRoot.sh Changing permissions of /home/app/oraInventory. Adding read,write permissions for group. Removing read,write,execute permissions for world. Changing groupname of /home/app/oraInventory to oinstall. The execution of the script is complete. [root@ora12c-1 ~]# [root@ora12c-1 ~]# sh /home/app/oracle/12c/release_2/db_1/root.sh Performing root user operation. The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /home/app/oracle/12c/release_2/db_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 script. Now product-specific root actions will be performed. Do you want to setup Oracle Trace File Analyzer (TFA) now ? yes|[no] : yes Installing Oracle Trace File Analyzer (TFA). Log File: /home/app/oracle/12c/release_2/db_1/install/root_ora12c-1_2017-03-07_23-23-45-789367767.log Finished installing Oracle Trace File Analyzer (TFA) [root@ora12c-1 ~]#
然后就是漫长的OUI建库了。
最后,安装就完成了:
装完后,查看一下数据库的状态:
[oracle@ora12c-1 ~]$ env | grep SID ORACLE_SID=lenka [oracle@ora12c-1 ~]$ [oracle@ora12c-1 ~]$ ps -ef | grep pmon oracle 17957 1 0 14:16 ? 00:00:00 ora_pmon_lenka oracle 19223 18987 0 14:21 pts/3 00:00:00 grep --color=auto pmon [oracle@ora12c-1 ~]$ [oracle@ora12c-1 ~]$ ps -ef | grep ora_ oracle 17957 1 0 14:16 ? 00:00:00 ora_pmon_lenka oracle 17959 1 0 14:16 ? 00:00:00 ora_clmn_lenka oracle 17961 1 0 14:16 ? 00:00:00 ora_psp0_lenka oracle 17970 1 1 14:16 ? 00:00:04 ora_vktm_lenka oracle 17974 1 0 14:16 ? 00:00:00 ora_gen0_lenka oracle 17976 1 0 14:16 ? 00:00:00 ora_mman_lenka oracle 17980 1 0 14:16 ? 00:00:00 ora_gen1_lenka oracle 17984 1 0 14:16 ? 00:00:00 ora_diag_lenka oracle 17986 1 0 14:16 ? 00:00:00 ora_ofsd_lenka oracle 17990 1 0 14:16 ? 00:00:00 ora_dbrm_lenka oracle 17992 1 0 14:16 ? 00:00:00 ora_vkrm_lenka oracle 17994 1 0 14:16 ? 00:00:00 ora_svcb_lenka oracle 17996 1 0 14:16 ? 00:00:00 ora_pman_lenka oracle 17998 1 0 14:16 ? 00:00:00 ora_dia0_lenka oracle 18000 1 0 14:16 ? 00:00:00 ora_dbw0_lenka oracle 18002 1 0 14:16 ? 00:00:00 ora_lgwr_lenka oracle 18004 1 0 14:16 ? 00:00:00 ora_ckpt_lenka oracle 18006 1 0 14:16 ? 00:00:00 ora_lg00_lenka oracle 18008 1 0 14:16 ? 00:00:00 ora_smon_lenka oracle 18010 1 0 14:16 ? 00:00:00 ora_lg01_lenka oracle 18012 1 0 14:16 ? 00:00:00 ora_smco_lenka oracle 18014 1 0 14:16 ? 00:00:00 ora_reco_lenka oracle 18016 1 0 14:16 ? 00:00:00 ora_w000_lenka oracle 18018 1 0 14:16 ? 00:00:00 ora_lreg_lenka oracle 18020 1 0 14:16 ? 00:00:00 ora_w001_lenka oracle 18022 1 0 14:16 ? 00:00:00 ora_pxmn_lenka oracle 18026 1 0 14:16 ? 00:00:02 ora_mmon_lenka oracle 18028 1 0 14:16 ? 00:00:00 ora_mmnl_lenka oracle 18030 1 0 14:16 ? 00:00:00 ora_d000_lenka oracle 18032 1 0 14:16 ? 00:00:00 ora_s000_lenka oracle 18034 1 0 14:16 ? 00:00:00 ora_tmon_lenka oracle 18057 1 0 14:16 ? 00:00:00 ora_tt00_lenka oracle 18059 1 0 14:16 ? 00:00:00 ora_tt01_lenka oracle 18061 1 0 14:16 ? 00:00:00 ora_tt02_lenka oracle 18063 1 0 14:16 ? 00:00:00 ora_aqpc_lenka oracle 18074 1 0 14:16 ? 00:00:00 ora_p000_lenka oracle 18076 1 0 14:16 ? 00:00:00 ora_p001_lenka oracle 18078 1 0 14:16 ? 00:00:00 ora_p002_lenka oracle 18080 1 0 14:16 ? 00:00:00 ora_p003_lenka oracle 18082 1 0 14:16 ? 00:00:00 ora_p004_lenka oracle 18084 1 0 14:16 ? 00:00:00 ora_p005_lenka oracle 18086 1 0 14:16 ? 00:00:00 ora_p006_lenka oracle 18088 1 0 14:16 ? 00:00:00 ora_p007_lenka oracle 18090 1 0 14:16 ? 00:00:00 ora_p008_lenka oracle 18092 1 0 14:16 ? 00:00:00 ora_p009_lenka oracle 18094 1 0 14:16 ? 00:00:00 ora_p00a_lenka oracle 18096 1 0 14:16 ? 00:00:00 ora_p00b_lenka oracle 18098 1 0 14:16 ? 00:00:00 ora_p00c_lenka oracle 18100 1 0 14:16 ? 00:00:00 ora_p00d_lenka oracle 18102 1 0 14:16 ? 00:00:00 ora_p00e_lenka oracle 18104 1 0 14:16 ? 00:00:00 ora_p00f_lenka oracle 18117 1 0 14:16 ? 00:00:01 ora_cjq0_lenka oracle 18275 1 0 14:16 ? 00:00:00 ora_qm02_lenka oracle 18283 1 0 14:16 ? 00:00:00 ora_q002_lenka oracle 18287 1 0 14:16 ? 00:00:00 ora_q003_lenka oracle 18367 1 0 14:16 ? 00:00:00 ora_p00g_lenka oracle 18369 1 0 14:16 ? 00:00:00 ora_p00h_lenka oracle 18371 1 0 14:16 ? 00:00:00 ora_p00i_lenka oracle 18405 1 0 14:17 ? 00:00:00 ora_q004_lenka oracle 18784 1 0 14:18 ? 00:00:00 ora_w002_lenka oracle 19152 1 0 14:20 ? 00:00:00 ora_w003_lenka oracle 19232 18987 0 14:21 pts/3 00:00:00 grep --color=auto ora_ [oracle@ora12c-1 ~]$ [oracle@ora12c-1 ~]$ sqlplus / as sysdba SQL*Plus: Release 12.2.0.1.0 Production on Wed Mar 8 14:21:09 2017 Copyright (c) 1982, 2016, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production SQL> select instance_name,status from v$instance; INSTANCE_NAME STATUS -------------------------------- ------------------------ lenka OPEN SQL> col current_scn for 9999999999999 SQL> SQL> set linesize 400 SQL> select name,database_role,open_mode,current_scn from v$database; NAME DATABASE_ROLE OPEN_MODE CURRENT_SCN ------------------ -------------------------------- ---------------------------------------- -------------- LENKA PRIMARY READ WRITE 1442201 SQL> SQL> archive log list; Database log mode No Archive Mode Automatic archival Disabled Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 1 Current log sequence 2 SQL> SQL> exit; Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production [oracle@ora12c-1 ~]$
——————————————————
Done。