瞭解 Oracle Linux Install Using LVM 與 LVM (Logical Volume Mamager) on Linux 動態放大檔案系統 的基本概念後,接下來就可以來安裝 Oracle Database 12c Release 1 (12.1),所需要的檔案有 linuxamd64_12c_database_1of2.zip & linuxamd64_12c_database_2of2.zip 可以從下列兩個網址取得:

實作環境說明:

host name : oradb12clinux.globeunion.com
ip address : 192.168.0.210


DB 安裝在 /u01 目錄下

以下均以帳號 root 執行

Step00: 建立資料庫相關帳號與群組

groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
#groupadd -g 54324 backupdba
#groupadd -g 54325 dgdba
#groupadd -g 54326 kmdba
#groupadd -g 54327 asmdba
#groupadd -g 54328 asmoper
#groupadd -g 54329 asmadmin

useradd -u 54321 -g oinstall -G dba,oper oracle

再設定 oracle 帳號的密碼:
passwd oracle

 

Step 01: Unpack Files 解壓檔案

unzip linuxamd64_12c_database_1of2.zip
unzip linuxamd64_12c_database_2of2.zip

 

Step 02: 編輯 /etc/hosts

127.0.0.1       localhost.localdomain  localhost
192.168.0.210   oradb12clinux.globeunion.com    oradb12clinux

 

Step03: 修改檔案 /etc/sysctl.conf 增加下列內容

fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500

然後執行指令 /sbin/sysctl -p 讓它生效

 

Step04: 修改檔案 /etc/security/limits.conf 增加下列內容

oracle   soft   nofile    1024
oracle   hard   nofile    65536
oracle   soft   nproc    2047
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768

 

Step05: 若安裝 Oracle Linux Install Using LVM 時沒選相關的套件,則請以 root 的帳號來裝下列套件

# From Public Yum or ULN
yum install binutils -y
yum install compat-libcap1 -y
yum install compat-libstdc++-33 -y
yum install compat-libstdc++-33.i686 -y
yum install gcc -y
yum install gcc-c++ -y
yum install glibc -y
yum install glibc.i686 -y
yum install glibc-devel -y
yum install glibc-devel.i686 -y
yum install ksh -y
yum install libgcc -y
yum install libgcc.i686 -y
yum install libstdc++ -y
yum install libstdc++.i686 -y
yum install libstdc++-devel -y
yum install libstdc++-devel.i686 -y
yum install libaio -y
yum install libaio.i686 -y
yum install libaio-devel -y
yum install libaio-devel.i686 -y
yum install libXext -y
yum install libXext.i686 -y
yum install libXtst -y
yum install libXtst.i686 -y
yum install libX11 -y
yum install libX11.i686 -y
yum install libXau -y
yum install libXau.i686 -y
yum install libxcb -y
yum install libxcb.i686 -y
yum install libXi -y
yum install libXi.i686 -y
yum install make -y
yum install sysstat -y
yum install unixODBC -y
yum install unixODBC-devel -y

 

Step06: 修改檔案 /etc/security/limits.d/90-nproc.conf

# Change this
*          soft    nproc    1024

# To this
* - nproc 16384

 

Step07: 修改檔案 /etc/selinux/config

SELINUX=permissive

然後執行指令 setenforce Permissive 讓它生效

 

Step08: 關閉防火牆

# service iptables stop 
# chkconfig iptables off

 

Step09: 建立目錄及設定權限

mkdir -p /u01/app/oracle/product/12.1.0/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01

 

Step10: 編輯帳號:oracle ,目錄下的 /home/oracle/.bash_profile

# Oracle Settings
export TMP=/tmp
export TMPDIR=$TMP

export ORACLE_HOSTNAME=oradb12clinux.globeunion.com
export ORACLE_UNQNAME=orcl
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1
export ORACLE_SID=orcl

export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

最後,以帳號 oracle 登入執行 ./runInstaller 執行資料庫 Oracle DB 12c 安裝即可。

 

註: 在安裝過程中,會要求您切換帳帳,以 root 的權限執行兩個檔案 orainstRoot.sh & root.sh

[oracle@oradb12clinux database]$ su -
[root@oradb12clinux ~]# /u01/app/oraInventory/orainstRoot.sh
[root@oradb12clinux ~]# /u01/app/oracle/product/12.1.0/db_1/root.sh

安裝完成後的資訊

oradb12c-configuration  

可以用WEB進入管理

oradb12c-em  

若是沒有辦法顯示此登錄劃面,可以用下列指令檢查 EM (Enterprise Manager Database Express) 的 port 是否為 5500,若不是則更改之。

SQL> SELECT dbms_xdb_config.gethttpsport FROM dual;

GETHTTPSPORT
------------
        5500

SQL> EXEC dbms_xdb_config.sethttpsport(5500);

PL/SQL procedure successfully completed.

SQL>

 

資料庫的啟動與關閉

[oracle@oradb12clinux ~]$ sqlplus /nolog

SQL> connect /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area 1653518336 bytes
Fixed Size            2289016 bytes
Variable Size         1073742472 bytes
Database Buffers      570425344 bytes
Redo Buffers            7061504 bytes
Database mounted.
Database opened.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

TNS Listenser 的啟動與關閉lsnrctl start/stop 及 TNS 測試:tnsping

[oracle@oradb12clinux ~]$ lsnrctl start

LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 24-OCT-2013 13:18:14

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Starting /u01/app/oracle/product/12.1.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 12.1.0.1.0 - Production
System parameter file is /u01/app/oracle/product/12.1.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/oradb12clinux/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oradb12clinux)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date                24-OCT-2013 13:18:14
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.1.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/oradb12clinux/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oradb12clinux)(PORT=1521)))
The listener supports no services
The command completed successfully

[oracle@oradb12clinux ~]$ tnsping orcl

TNS Ping Utility for Linux: Version 12.1.0.1.0 - Production on 24-OCT-2013 13:20:19

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

Used parameter files:
/u01/app/oracle/product/12.1.0/db_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oradb12clinux.globeunion.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))
OK (0 msec)

 

註:若要建立另一個資料庫(SID),可以使用指令 dbca 來建.

參考文件:

http://www.oracle-base.com/articles/12c/oracle-db-12cr1-installation-on-oracle-linux-6.php

http://figaro.neo-info.net/?cat=218

arrow
arrow
    文章標籤
    oracle
    全站熱搜
    創作者介紹
    創作者 MIS 的頭像
    MIS

    MISTECH 技術手抄本

    MIS 發表在 痞客邦 留言(0) 人氣()