CentOS 7 安装 oracle 12c

[1]


先决环境Install Desktop Environment, refer to here.

[2] Install required packages.
[[email protected] ~]#

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

[3] Edit Kernel parameters.

[[email protected] ~]#

MEMTOTAL=$(free -b | sed -n ‘2p‘ | awk ‘{print $2}‘)

[[email protected] ~]#

SHMMAX=$(expr $MEMTOTAL / 2)

[[email protected] ~]#

SHMMNI=4096

[[email protected] ~]#

PAGESIZE=$(getconf PAGE_SIZE)

[[email protected] ~]#

cat >> /etc/sysctl.conf << EOF
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmax = $SHMMAX
kernel.shmall = `expr $SHMMAX/$PAGESIZE \* $SHMMNI/16`
kernel.shmmni = $SHMMNI
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
EOF

[[email protected] ~]#

sysctl -p

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

[4] Create user and groups for Oracle Database service.
[[email protected] ~]#

i=54321; for group in oinstall dba backupdba oper dgdba kmdba; do
groupadd -g $i $group; i=`expr $i + 1`
done

[[email protected] ~]#

useradd -u 1200 -g oinstall -G dba,oper,backupdba,dgdba,kmdba -d /home/oracle oracle

[[email protected] ~]#

passwd oracle

Changing password for user oracle.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[[email protected] ~]#

mkdir -p /u01/app/oracle

[[email protected] ~]#

chown -R oracle:oinstall /u01/app

[[email protected] ~]#

chmod -R 775 /u01

[[email protected] ~]#

vi /etc/pam.d/login

# near line 14: add

session    required     pam_selinux.so open
session    required     pam_namespace.so
session    required     pam_limits.so
session    optional     pam_keyinit.so force revoke
session    include      system-auth
-session   optional     pam_ck_connector.so

[[email protected] ~]#

vi /etc/security/limits.conf

# add to the end

oracle  soft  nproc   2047
oracle  hard  nproc   16384
oracle  soft  nofile  1024
oracle  hard  nofile  65536
oracle  soft  stack   10240
oracle  hard  stack   32768
[5] 图形化安装Oracle 12C Login with the user "oracle" and set environment variables.

dlp login:

oracle

Password:

[[email protected] ~]$

vi ~/.bash_profile

# add to the end

umask 022
export ORACLE_BASE=/u01/app/oracle

# create a temporary directory for installation

[[email protected] ~]$

mkdir tmp

[1] Login and work with oracle admin user which you create in pre-requirements settings.
[2]
Download Oracle Databse 12c for Linux and upload on your server.
http://www.oracle.com/technology/software/products/database/index.html

[3] After uploading Oracle files, move to a tmp directory and run an Installer like follows.
[[email protected] ~]$

cd tmp

[[email protected] tmp]$

unzip linuxamd64_12102_database_1of2.zip

[[email protected] tmp]$

unzip linuxamd64_12102_database_2of2.zip

[[email protected] tmp]$

./database/runInstaller

[4] Oracle Installer starts like follows. First, Set your email address
and password for receiving some infomation from Oracle like security
issues and so on.
[5] On this example, Select "Install database software only".
[6] On this example, Select "Single Instance Database ***".
[7] Select your language.
[8] Select which edition you install.
[9] Specify the base directory and files for Oracle. On this example, keep default and proceed to next.
[10] Specify the installed directory. On this example, keep default and proceed to next.
[11] Specify the priviledged group. On this example, keep default and proceed to next.
[12] Pre-requirements are checked. If some settings are not configured
for recomendations, notification is displayed like follows.Confirm them
again.
[13] The summary is shown for configuration. Click "Install" if it‘s OK all.
[14] Installation starts.
[15] Following screen is shown, then open a terminal and execute follwong commands with the root user.
[[email protected] ~]#

/u01/app/oraInventory/orainstRoot.sh

Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[[email protected] ~]#

[[email protected] ~]#

/u01/app/oracle/product/12.1.0/dbhome_1/root.sh

Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/12.1.0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:

# Enter

   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.
[16] Installation completed. Click "Close" button.
[17] Set Environment variables for Oracle user.

[[email protected] ~]$

vi ~/.bash_profile

# add to the end

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

[[email protected] ~]$

source ~/.bash_profile

[[email protected]dlp ~]$

rm -rf tmp


创建监听Create Oracle Net Listener that is the network service on Oracle.

[1] Login with the oracle admin user and input a command "netca" like follows.
[[email protected] ~]$ netca
[2] Check a box "Listener Configuration" and go next.
[3] Go next.
[4] Set Listner‘s name. Input any one you like.
[5] This example goes next with keeping default "TCP".
[6] Set a port. This example goes next with keeping default.
[7] If you‘d like to create more Listeners, Answer "Yes". This example selects "No".
[8] Configuration completed.
[9] After creating Listener, tnslsnr listens on the port you configured like follows.

[[email protected] ~]$

ss -napt

State      Recv-Q Send-Q          Local Address:Port       Peer Address:Port
LISTEN     0      128                         *:22                    *:*
LISTEN     0      128                 127.0.0.1:631                   *:*
LISTEN     0      100                 127.0.0.1:25                    *:*
ESTAB      0      52                  10.0.0.30:22             10.0.0.5:50113
LISTEN     0      128                        :::1521                 :::*      users:(("tnslsnr",3988,9))
LISTEN     0      128                        :::22                   :::*
LISTEN     0      128                       ::1:631                  :::*
LISTEN     0      100                       ::1:25                   :::*

[[email protected] ~]$

tnsping localhost

TNS Ping Utility for Linux: Version 12.1.0.2.0 - Production on 04-JUL-2015 01:03:07

Copyright (c) 1997, 2014, Oracle.  All rights reserved.

Used parameter files:

Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)
(PORT=1521)))
OK (0 msec)

创建数据库 Create a Database.

[1] Login with the oracle admin user and input a command "dbca" like follows.
[[email protected] ~]$ dbc
[2] Select "Create Database" and go next.
[3] On this example, select "Advanced Mode" and go next.
[4] This example selects "General Purpose ***" and go next.
[5] Set Grobal Database name and SID like follows. Input any one you like.
[6] This example goes next with keeping default.
[7] Set passwords. Please set a password for a user for security.
[8] Configure Listener. On this example, keep default and go next.
[9] Configure Storage settings. On this example, keep default and go next.
[10] Configure sample schema and scripts. If you‘d like to add them, Set them.
[11] Configure memory settings. After setting, go to next tab.
[12] Specify max processes.
[13] Set Character setting.
[14] Select a connection mode. If your server does not have many clients,
Select Dedicated server mode. If your server has many clients, Select
Shared server mode.
[15] Go next.
[16] Configuration completed. Click "Finish" button to finish.
[17] Database creation starts.
[18] After completing to create a database, Click "Close" to finish.
[19] Add Database SID to the environment variables.

[[email protected] ~]$

vi /etc/oratab

# change like follows

dlp:/u01/app/oracle/product/12.1.0/dbhome_1:

Y

[[email protected] ~]$

vi ~/.bash_profile

# add to the end

export ORACLE_SID=dlp


To access to the Enterprise Manager, it‘s possible to manage Database on Web GUI.

[1] After creating database, database service is running and it‘s possible to access to Enterprise Manager, too. Access to the URL which was displayed
when database creation finished, then Login form is shown and it‘s possible to login with a database user.
[2] Just logined. It‘s possible to manage Database on here.


Create Systemd file for Oracle Database services.

[1] Login as root user and create Systemd files.

[[email protected] ~]#

vi /etc/sysconfig/dlp.oracledb

# create new : define environment variables

ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
ORACLE_SID=dlp

# configure listener service

[[email protected] ~]#

vi /usr/lib/systemd/system/[email protected]

# this is an example, modify for free

[Unit]
Description=oracle net listener
After=network.target

[Service]
Type=forking
EnvironmentFile=/etc/sysconfig/dlp.oracledb
ExecStart=/u01/app/oracle/product/12.1.0/dbhome_1/bin/lsnrctl start
ExecStop=/u01/app/oracle/product/12.1.0/dbhome_1/bin/lsnrctl stop
User=oracle

[Install]
WantedBy=multi-user.target

# configure database service

[[email protected] ~]#

vi /usr/lib/systemd/system/[email protected]

# this is an example, modify for free

[Unit]
Description=oracle net listener
After=network.target lsnrctl.service

[Service]
Type=forking
EnvironmentFile=/etc/sysconfig/dlp.oracledb
ExecStart=/u01/app/oracle/product/12.1.0/dbhome_1/bin/dbstart /u01/app/oracle/product/12.1.0/dbhome_1
ExecStop=/u01/app/oracle/product/12.1.0/dbhome_1/bin/dbshut /u01/app/oracle/product/12.1.0/dbhome_1
User=oracle

[Install]
WantedBy=multi-user.target

[[email protected] ~]#

systemctl daemon-reload

[[email protected] ~]#

systemctl enable [email protected] [email protected]

时间: 2024-09-29 04:39:47

CentOS 7 安装 oracle 12c的相关文章

CentOS 7部署Oracle 12c企业版数据库

一.安装Oracle 12c 1.安装CentOS 7操作系统的注意事项 由于本次安装Oracle 12c软件是在CentOS 7系统上实现的,那么首先安装CentOS 7操作系统,安装要求如下: 防火墙的配置选项设置为禁用: SELinux设置为禁用: 默认安装设置为软件开发: 内核选择3.10.0-862.el7.x86_64及以上版本: 2.前置条件的准备 Oracle数据库是一个相对庞大的应用软件,对服务器的系统类型.内存和交换分区.硬盘空阿金.内核参数.软件环境.用户环境等都有相应的要

CentOS 7 安装 Oracle 11.2.0.4

一.安装环境 CentOS Linux release 7.2.1511 (Core) Oracle Database 11g Release 2 (11.2.0.4) 二.安装前准备 2.1 修改主机名 修改/etc/sysconfig/network配置文件中的HOSTNAME变量 [[email protected] ~]# hostnamectl set-hostname oracledb ####永久性修改 [[email protected] ~]#vi /etc/sysconfig

Oracle Linux6下安装Oracle 12c实战

经过N次安装尝试吐血总结,希望对大家有所帮助,同时做下记录备忘: 总结:安装前的准备工作是关键!!!Check and recheck! 参考:http://docs.oracle.com/cd/E16655_01/install.121/e17741/toc.htm#CEGHFFGG ***********************ORACLE 12C 安装步骤******************************************** 0.准备软件:Oracle Linux 6.4

Windows 下安装 Oracle 12c 教程

原文 Windows 下安装 Oracle 12c 教程 申明:本文原作者:Jmq   本文给大家带来的是 Oracle 12C 的安装教程. 1.准备 1.1 下载 Oracle 12c 安装程序 下载地址可参考:http://www.wxzzz.com/1231.html 文章可顺利下载. 1.2 解压下载好的两个压缩文件 将两个压缩包解压到同一个目录下,即“database”,然后单击解压目录下的“setup.exe”文件: 2.安装过程 2.1.双击”setup.exe”进行安装 软件会

在Fedora20上安装Oracle 12c

本文将引导大家在Fedora20的环境下成功安装Oracle12c. 安装前的准备 编辑/etc/hosts文件,添加本机名称 编辑/etc/selinux/config文件 编辑/etc/redhat-release 做如下查询,以确定要修改的项目 sysctl -a | grep fs.file-max sysctl -a | grep kernel.sem sysctl -a | grep kernel.shmmni sysctl -a | grep kernel.shmall sysct

CentOS上安装Oracle XE指南

引言: 在Centos上安装oracle XE主要用来解决学习和测试的用处,虽然简单,但也是涉及到了诸多的步骤和细节问题. 1.  下载Oracle XE 访问http://www.oracle.com/technetwork/cn/database/database-technologies/express-edition/downloads/index.html, 根据操作系统,选择版本下载即可. 2.  解压缩Oracle XE安装程序 unzip oracle-xe-11.2.0-1.0

CentOS 7 安装oracle 11.2.0.4 Error in invoking target &#39;agent nmhs&#39; of makefile

%86时出现报错   Error in invoking target 'agent nmhs' of makefile 解决方案在makefile中添加链接libnnz11库的参数修改$ORACLE_HOME/sysman/lib/ins_emagent.mk,将$(MK_EMAGENT_NMECTL)修改为:$(MK_EMAGENT_NMECTL) -lnnz11建议修改前备份原始文件[[email protected] ~]$ cd $ORACLE_HOME/sysman/lib[[ema

[oracle]centos 7 安装oracle

换了好几个系统终于还是利用centos安装oralce成功了,这里我也参考了网上的好多资料以及oracle的官方文档 1.下载oracle,我这里选择的是11gr2版本,下载下来后有两个文件,利用unzip命令解压到相同目录 2.在磁盘中建立oracle的安装目录 mkdir -p /oracle/oraclebase #这是oracle的安装基目录 mkdir -p /oracle/oraInventory #这是一些文件日志的目录 3.创建oracle用户和组 这里说以下为什么要建立用户和组

阿里云centos 静默安装oracle

Package安装检查 yum -y install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++ libaio-devel libaio libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel pdksh numactl-devel gli

RedHat 7 静默安装Oracle 12c

之前在网上看了很多Oracle的静默安装教程,感觉有些乱,经过自己查阅Oracle官网英文手册,结合在虚拟机中安装测试,整理出了这篇RedHat 7 静默安装Oracle 12c.redhat 6静默安装Oracle 11g R2也已基本整理好了,等有时间了再发出来. 本文原始出处:江健龙的技术博客http://jiangjianlong.blog.51cto.com/3735273/1792451 一.环境要求与准备 1.硬件要求 (1)磁盘空间 EnterpriseEdition : 6.4