How to Install Oracle Database 12c on CentOS 7

Stella981
• 阅读 633

How to Install Oracle Database 12c on CentOS 7

On this page

  1. Step 1 - Install required Packages
  2. Step 2 - Configure User and System
  3. Step 3 - Configure Desktop
  4. Step 4 - Download Oracle Database
  5. Step 5 - Install Oracle Database 12c
  6. Step 6 - Testing
  7. Reference

Oracle Database is an object-relational database management system (RDBMS) developed by Oracle Corporation. The Oracle Database is available under a Proprietary and OTN Standard License. The supported operating systems are Redhat Enterprise Linux (x86-64), SUSE and Oracle Linux, Microsoft Windows x86-64 and IBM Linux.

In this tutorial, I will show you step-by-step how to install Oracle 12c on a CentOS 7 x86-64 machine. This includes the preparation and configuration of the CentOS 7 machine for the Oracle 12c installation, the Oracle 12c installation and testing the database with the Oracle Database command line utility 'sqlplus' and the web-based Oracle Enterprise Manager.

Prerequisites

  • CentOS 7 64-bit.
  • At least 1 GB RAM Memory.
  • Root Privileges.

Step 1 - Install required Packages

As the first step, we have to install a lot of packages required by Oracle database, like GCC, Binutils, Glibc etc. We will install them from the Centos repository with the yum command.

Install packages required by Oracle database with yum.

yum install -y binutils.x86_64 compat-libcap1.x86_64 gcc.x86_64 gcc-c++.x86_64 glibc.i686 glibc.x86_64 \
glibc-devel.i686 glibc-devel.x86_64 ksh compat-libstdc++-33 libaio.i686 libaio.x86_64 libaio-devel.i686 libaio-devel.x86_64 \
libgcc.i686 libgcc.x86_64 libstdc++.i686 libstdc++.x86_64 libstdc++-devel.i686 libstdc++-devel.x86_64 libXi.i686 libXi.x86_64 \
libXtst.i686 libXtst.x86_64 make.x86_64 sysstat.x86_64

Step 2 - Configure User and System

Oracle Database will run under a normal Linux user and not with root privileges. In this step, we will create a new user and group for Oracle.

Create new groups named 'oinstall' and 'dba', then create a new user 'oracle' and add it to the 'oinstall' group.

groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle
TYPE THE PASSWORD

New user and group are created, now we need to configure our system for the Oracle installation. There are some kernel parameters that we must configure for the Oracle installation.

Edit 'sysctl.conf' file with vim.

vim /etc/sysctl.conf

Paste configuration below.

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

Save the file and exit the editor.

Now run the commands below to display all kernel parameter and apply the new values.

sysctl -p
sysctl -a

Next, we need to configure some limits for the oracle user. Specify the max number process and max number of open files descriptors.

Edit 'limits.conf' file with vim.

vim /etc/security/limits.conf

Paste the configuration below.

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

Save the file and exit vim.

New user and system configuration is finished.

Step 3 - Configure Desktop

The Oracle installation requires GUI access, so the fastest way for this is by installing a X Window System on the server, and then access the GUI app with ssh -X option.

Install X Window System with yum command below.

yum groupinstall -y "X Window System"

When the installation is done, open a new terminal and connect to the server as oracle user with the ssh command option below. Try to run the GUI application and you will get the application screen.

ssh -X oracle@192.168.33.15

Step 4 - Download Oracle Database

If you do not have an Oracle account yet, register one and then log in to download 12c for Linux.

Below are my oracle files.

cd ~/oracle/
ll

How to Install Oracle Database 12c on CentOS 7

Install zip and unzip to extract the archives.

yum -y install zip unzip

Extract the Oracle files to a new directory named 'stage'.

unzip linuxamd64_12102_database_se2_1of2.zip -d /stage/
unzip linuxamd64_12102_database_se2_2of2.zip -d /stage/

Change owner and group of the '/stage/' directory to the oracle user and oinstall group.

chown -R oracle:oinstall /stage/

Next, create new directories for the Oracle installation files and Oracle database files.

Directory 'u01' is for the Oracle installation files and 'u02' for the Oracle database files.

mkdir -p /u01 /u02

Change owner and group of the new directories and set permissions to '755'.

chown -R oracle:oinstall /u01 /u02
chmod -R 775 /u01 /u02
chmod g+s /u01 /u02

Oracle is downloaded and the new directories for the installation are ready.

Step 5 - Install Oracle Database 12c

Open a new terminal and connect to the CentOS 7 server with the ssh command below.

ssh -X oracle@192.168.33.15

Go to the stage database directory and run the installer file.

cd /stage/database/
./runInstaller

The script will check the server, make sure all tests are passed.

How to Install Oracle Database 12c on CentOS 7

And you will see the GUI installation screen below, there click 'Next'.

How to Install Oracle Database 12c on CentOS 7

At 'Installation Options', choose 'Create and configure a database' and click 'Next'.

How to Install Oracle Database 12c on CentOS 7

Under the 'System Class' section, choose 'Desktop Class' and click 'Next' again.

How to Install Oracle Database 12c on CentOS 7

'Typical Installation' info.

  • Oracle base: '/u01/app/oracle'
  • Software location: /u01/app/oracle/product/12.1.0/dbhome_1
  • Database file location: /u02
  • Database edition: Default
  • Character set: Default
  • OSDBA group: dba
  • Global database name: Type your own name
  • Administrative password: Type your own password
  • Confirm password: Type again
  • Uncheck the 'Create as Container database'

Click Next.

How to Install Oracle Database 12c on CentOS 7

At 'Create Inventory', enter the path below:

Inventory Directory: /u01/app/oraInventory

oraInventory Group Name: use 'oinstall' group.

Click 'Next'.

How to Install Oracle Database 12c on CentOS 7

Make sure all checks completed without an error, then you will see a summary of the Oracle configuration.

Click 'Install'.

How to Install Oracle Database 12c on CentOS 7

Installation process.

How to Install Oracle Database 12c on CentOS 7

During installation process, you will be asked to execute some scripts as root.

How to Install Oracle Database 12c on CentOS 7

Open a new terminal and execute the files.

ssh root@192.168.33.15
/u01/app/oraInventory/orainstRoot.sh
/u01/app/oracle/product/12.1.0/dbhome_1/root.sh

You will get the results below.

How to Install Oracle Database 12c on CentOS 7

Next, you will be shown a new pop-up from the database configuration assistant, please wait, it takes a time.

How to Install Oracle Database 12c on CentOS 7

When the 'Database Configuration Assistant' is finished, you will see the info below:

How to Install Oracle Database 12c on CentOS 7

Click 'Ok' and the Oracle database installation is done.

Click 'Close'.

How to Install Oracle Database 12c on CentOS 7

Step 6 - Testing

The Oracle installation is finished and ready for testing. I will try to access Oracle from the command line first.

Log in to the server and access the oracle user.

ssh root@192.168.33.15
TYPE YOUR PASSWORD

Login to the oracle user.

su - oracle

Execute the commands below to set the oracle environment.

export ORACLE_SID=orcl
export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1/
export PATH=$PATH:$ORACLE_HOME/bin

Access the oracle database utility 'sqlplus', log in as 'sysdba' privileges.

sqlplus / as sysdba

Oracle comes with some default users. Run the query below if you want to change the default user named 'sys'.

alter user sys identified by yourpassword;

How to Install Oracle Database 12c on CentOS 7

Sqlplus is working fine.

Next, try to access the web-based 'Oracle Enterprise Manager'. Open your web browser and type the https URL below on port 5500. Use the IP of your server!

https://192.168.33.55:5500/em/

Login with user 'system', and the password you have setup as 'Administrative Password' in step 5. Or you can use the 'sys' user and your password.

How to Install Oracle Database 12c on CentOS 7

After login, you will see the 'Oracle Enterprise Manager' dashboard below.

How to Install Oracle Database 12c on CentOS 7

The Oracle Database 12c installation and configuration is done.

Oracle database utility and Oracle Enterprise manager are working.

Reference

点赞
收藏
评论区
推荐文章
blmius blmius
2年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Wesley13 Wesley13
2年前
java将前端的json数组字符串转换为列表
记录下在前端通过ajax提交了一个json数组的字符串,在后端如何转换为列表。前端数据转化与请求varcontracts{id:'1',name:'yanggb合同1'},{id:'2',name:'yanggb合同2'},{id:'3',name:'yang
Jacquelyn38 Jacquelyn38
2年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
Wesley13 Wesley13
2年前
Java获得今日零时零分零秒的时间(Date型)
publicDatezeroTime()throwsParseException{    DatetimenewDate();    SimpleDateFormatsimpnewSimpleDateFormat("yyyyMMdd00:00:00");    SimpleDateFormatsimp2newS
Stella981 Stella981
2年前
KVM调整cpu和内存
一.修改kvm虚拟机的配置1、virsheditcentos7找到“memory”和“vcpu”标签,将<namecentos7</name<uuid2220a6d1a36a4fbb8523e078b3dfe795</uuid
Wesley13 Wesley13
2年前
mysql设置时区
mysql设置时区mysql\_query("SETtime\_zone'8:00'")ordie('时区设置失败,请联系管理员!');中国在东8区所以加8方法二:selectcount(user\_id)asdevice,CONVERT\_TZ(FROM\_UNIXTIME(reg\_time),'08:00','0
Wesley13 Wesley13
2年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Stella981 Stella981
2年前
Django中Admin中的一些参数配置
设置在列表中显示的字段,id为django模型默认的主键list_display('id','name','sex','profession','email','qq','phone','status','create_time')设置在列表可编辑字段list_editable
Wesley13 Wesley13
2年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
3个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这