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] ~]$

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-07-30 06:48:55

Centos 7 Oracle 12C 超详细安装的相关文章

Centos 6 Oracle 12C 超详细安装

  Install Oracle Database 12c. Before Installing, Change some settings for requirements of installing Oracle database. [1] Install Desktop Environment, refer to here. [2] Install some packages first. [[email protected] ~]# yum -y install binutils com

Centos 6 Oracle 11G 超详细安装

Desktop Environment is not neccessary for Server usage, though. But Sometimes installation or using an application requires Desktop Environment, then build Desktop Environment as follwos. [[email protected] ~]#yum -y groupinstall "X Window System&quo

Centos 5 Oracle 11G 超详细安装

  Install Oracle Database 11g R2. Desktop Environment is required because installation proceeds on GUI. Before Installing, Change some settings for requirement of installing Oracle. [1] Install some packages [[email protected] ~]# yum -y install binu

Oracle 11g超详细安装步骤

一.首先是Oracle的安装 软件请自行到网上下载 18.等待,出现选择项时点击next 二.打开服务 三.验证数据库是否安装成功 原文地址:https://www.cnblogs.com/zhanzhuang/p/9100802.html

安装64位Oracle 10g超详细教程

安装64位Oracle 10g超详细教程 1. 安装准备阶段 1.1 安装Oracle环境 经过上一篇博文的过程,已经完成了对Linux系统的安装,本例使用X-Manager来实现与Linux系统的连接,本例使用的所有命令和操作都是在X-Manager下进行.X-Manager安装完成后的配置方法如下: 1.  打开X-Manager的X-Shell 2. 点击New,新建一个连接地址,设置完成后,点击OK3.  使用用户名,密码进行登录,登录完成后,进入如下图所示画面即成功连接到Linux系统

Oracle11超详细安装教程和配置

这篇博客主要是介绍一下Oracle数据的安装过程和简单的配置,帮助大家可以简单的让Oracle运行起来,只是一个基础的教程. 准备工作: 如果你以前装过Oracle数据库,而且安装目录要改变请先打开注册表编辑器里的: HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\和HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Oracle11和它下面的几个.如果你没安装过Oracle产品的话在注册表里面的与Oracle有关的注册

oracle 12c grid db 安装的的checklist

oracle 12c 安装 checklist 关闭 iptables NetworkManager selinux service iptables stop chkconfig iptables off service NetworkManager stop chkconfig NetworkManager off 修改/etc/selinux/config 文件 将SELINUX=enforcing改为SELINUX=disabled 重启机器即可 创建oracle用户 groupadd

linux 6.4 平台下 Oracle 12c 单实例 安装手册

一.准备工作 1.1 安装需要的RPM 包 binutils-2.20.51.0.2-5.11.el6 (x86_64) glibc-2.12-1.7.el6 (x86_64) libgcc-4.4.4-13.el6 (x86_64) libstdc++-4.4.4-13.el6 (x86_64) libaio-0.3.107-10.el6 (x86_64) libXext-1.1 (x86_64) libXtst-1.0.99.2 (x86_64) libX11-1.3 (x86_64) li

Oracle 12c 的windows 安装

方法/步骤 1下载oracle 12c R2 forWindows的版本 下载地址: http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html其中包括两个压缩包:winx64_12c_database_1of2.zip,winx64_12c_database_2of2.zip 解压oracle 12c R2 for Windows的版本 将两个压缩包解压到同一个目录下,即"database