RHEL5.5 64位部署ORACLE 10G 10204

stonebox1122發表於2015-08-15

1.      系統資訊

1.1 主機資訊

1.2 網路資訊

2.      安裝虛擬機器

3.      配置安裝環境

3.1 建立使用者、組及目錄

3.2 建立環境變數

3.3 安裝依賴包

3.4 修改系統版本

3.5 修改核心引數

3.6 修改使用者限制

3.7 修改登入驗證

4.      安裝資料庫

5.      升級資料庫

6.      建立資料庫

7.      配置監聽

 

 

1.         系統資訊

1.1 主機資訊

序號

作業系統

版本

記憶體

Swap

磁碟

防火牆

SELinux

1

RHEL

5.5-x86_64

2G

2G

40G

關閉

禁用

[root@oracle10g ~]# cat /etc/redhat-release

Red Hat Enterprise Linux Server release 5.5 (Tikanga)

 

[root@oracle10g ~]# grep MemTotal /proc/meminfo

MemTotal:      2057360 kB

 

[root@oracle10g ~]# grep SwapTotal /proc/meminfo

SwapTotal:     2048276 kB

 

[root@oracle10g ~]# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/sda3              37G  2.6G   33G   8% /

/dev/sda1              99M   12M   82M  13% /boot

tmpfs                1005M     0 1005M   0% /dev/shm

.host:/                98G   62G   37G  63% /mnt/hgfs

 

[root@oracle10g ~]# /etc/init.d/iptables status

Firewall is stopped.

 

[root@oracle10g ~]# getenforce

Disabled

 

1.2 網路資訊

序號

主機名

IP

掩碼

閘道器

1

oracle10g

192.168.230.180

255.255.255.0

192.168.230.2

[root@oracle10g ~]# cat /etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1               localhost.localdomain localhost

::1             localhost6.localdomain6 localhost6

192.168.230.180         oracle10g

 

[root@oracle10g ~]# cat /etc/sysconfig/network

NETWORKING=yes

NETWORKING_IPV6=no

HOSTNAME=oracle10g

 

[root@oracle10g ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0

# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)

DEVICE=eth0

BOOTPROTO=none

ONBOOT=yes

HWADDR=00:0c:29:d3:a0:ef

IPADDR=192.168.230.180

NETMASK=255.255.255.0

GATEWAY=192.168.230.2

 

 

 

2.         安裝虛擬機器

參考http://blog.itpub.net/28536251/viewspace-1455365/安裝Linux系統。

 

3.         配置安裝環境

3.1 建立使用者、組及目錄

建立使用者、組及目錄指令碼,並執行指令碼。

[root@oracle10g ~]# cat ora_user_dir.sh

#!/bin/bash

groupadd oinstall

groupadd dba

useradd -g oinstall -G dba oracle

echo "123456" | passwd --stdin oracle

mkdir -p /u01/oraInventory

chown -R oracle:oinstall /u01/

chmod -R 775 /u01/

 

[root@oracle10g ~]# sh ora_user_dir.sh

Changing password for user oracle.

passwd: all authentication tokens updated successfully.

 

3.2 建立環境變數

建立環境變數列表檔案,並增加環境變數到配置檔案。

[root@oracle10g ~]# cat ora_env.txt

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME

LD_LIBRARY_PATH=$ORACLE_HOME/lib; export LD_LIBRARY_PATH

ORACLE_SID=stone; export ORACLE_SID

PATH=$ORACLE_HOME/bin:$PATH; export PATH

 

if [ $USER = "oracle" ]; then

        if [ $SHELL = "/bin/ksh" ]; then

                ulimit -p 16384

                ulimit -n 65536

        else

                ulimit -u 16384 -n 65536

        fi

fi

 

[root@oracle10g ~]# cat ora_env.txt >> /home/oracle/.bash_profile

 

3.3 安裝依賴包

建立依賴包列表檔案,並安裝依賴包

[root@oracle10g ~]# cat ora_software1.txt

binutils*

compat-libstdc++*

elfutils-libelf*

elfutils-libelf-devel*

elfutils-libelf-devel-static*

gcc*

gcc-c++*

glibc*

glibc-common*

glibc-devel*

glibc-headers*

kernel-headers*

ksh*

libaio*

libaio*

libgcc*

libgomp*

libstdc++*

libstdc++-devel*

libXp*

libXt*

make*

sysstat*

unixODBC*

unixODBC-devel*

 

[root@oracle10g ~]# cat ora_software1.txt | xargs yum install –y

 

3.4 修改系統版本

因為Oracle 10g官方只支援到RHEL4為止,所以需要更改版本說明,編輯/etc/redhat-release檔案,刪除Red Hat Enterprise Linux Server release 5 (Tikanga),增加redhat-4

[root@oracle10g ~]# cat /etc/redhat-release

redhat-4

 

3.5 修改核心引數

建立記憶體引數列表檔案,將內容增加到/etc/sysctl.conf檔案中。

[root@oracle10g ~]# cat sysctl.txt

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

fs.file-max = 65536

net.ipv4.ip_local_port_range = 1024 65000

net.core.rmem_default = 262144

net.core.rmem_max = 262144

net.core.wmem_default = 262144

net.core.wmem_max = 262144

 

[root@oracle10g ~]# cat sysctl.txt >> /etc/sysctl.conf

 

[root@oracle10g ~]# sysctl -p

net.ipv4.ip_forward = 0

net.ipv4.conf.default.rp_filter = 1

net.ipv4.conf.default.accept_source_route = 0

kernel.sysrq = 0

kernel.core_uses_pid = 1

net.ipv4.tcp_syncookies = 1

kernel.msgmnb = 65536

kernel.msgmax = 65536

kernel.shmmax = 68719476736

kernel.shmall = 4294967296

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

fs.file-max = 65536

net.ipv4.ip_local_port_range = 1024 65000

net.core.rmem_default = 262144

net.core.rmem_max = 262144

net.core.wmem_default = 262144

net.core.wmem_max = 262144

 

[root@oracle10g ~]# id oracle

uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)

[root@oracle10g ~]# echo "501" >/proc/sys/vm/hugetlb_shm_group

[root@oracle10g ~]# cat /proc/sys/vm/hugetlb_shm_group

501

 

3.6 修改使用者限制

建立使用者列表檔案,將內容增加到/etc/security/limits.conf檔案中。

[root@oracle10g ~]# cat oraclelimit.txt

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

 

[root@oracle10g ~]# cat oraclelimit.txt >> /etc/security/limits.conf

 

[root@oracle10g ~]# tail -4 /etc/security/limits.conf

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

 

3.7 修改登入驗證

更改/etc/pam.d/login檔案,新增下面的內容,使使用者限制生效。

[root@oracle10g ~]# tail -1 /etc/pam.d/login

session    required     pam_limits.so

 

4.         安裝資料庫

[root@oracle10g ~]# su - oracle

[oracle@oracle10g ~]$ cpio -idmv < /mnt/hgfs/data/oracle/software/10204/10201_database_linux_x86_64.cpio

[oracle@oracle10g ~]$ ls

database

[oracle@oracle10g ~]$ cd database/

[oracle@oracle10g database]$ ls

doc  install  response  runInstaller  stage  welcome.html

[oracle@oracle10g database]$ export DISPLAY=192.168.230.1:0.0

[oracle@oracle10g database]$ ./runInstaller

選擇高階模式。

clip_image002

指定庫存目錄和安裝組。

clip_image004

選擇企業版。

clip_image006

增加簡體中文語言。

clip_image008

指定安裝目錄。

clip_image010

安裝環境檢查。

clip_image012

如果提示swap不夠,可以使用以下方式增加swap

[root@oracle10g ~]# dd if=/dev/zero of=/tmp/swap bs=1M count=2000

2000+0 records in

2000+0 records out

2097152000 bytes (2.1 GB) copied, 52.036 seconds, 40.3 MB/s

[root@oracle10g ~]# ll -h /tmp/swap

-rw-r--r-- 1 root root 2.0G Aug 13 18:28 /tmp/swap

[root@oracle10g ~]# mkswap /tmp/swap

Setting up swapspace version 1, size = 2097147 kB

[root@oracle10g ~]# swapon -s

Filename                                Type            Size    Used    Priority

/dev/sda2                               partition       2048276 12      -1

[root@oracle10g ~]# swapon /tmp/swap

[root@oracle10g ~]# swapon -s

Filename                                Type            Size    Used    Priority

/dev/sda2                               partition       2048276 12      -1

/tmp/swap                               file            2047992 0       -2

 

clip_image014

clip_image016

clip_image018

clip_image020

[root@oracle10g ~]#/u01/app/oracle/oraInventory/orainstRoot.sh

Changing permissions of /u01/app/oracle/oraInventory to 770.

Changing groupname of /u01/app/oracle/oraInventory to oinstall.

The execution of the script is complete

 

[root@oracle10g ~]# /u01/app/oracle/product/10.2.0/db_1/root.sh

Running Oracle10 root.sh script...

 

The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/app/oracle/product/10.2.0/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.sh script.

Now product-specific root actions will be performed.

 

clip_image022

 

 

5.         升級資料庫

[root@oracle10g ~]# yum install java-1.6.0-openjdk*

[root@oracle10g ~]# su - oracle

[oracle@oracle10g ~]$ jar xvf /mnt/hgfs/data/oracle/software/10204/p6810189_10204_Linux-x86-64.zip

[oracle@oracle10g ~]$ ls

database  Disk1  README.html

[oracle@oracle10g ~]$ cd Disk1/

[oracle@oracle10g Disk1]$ ls

10204_buglist.htm  install  patch_note.htm  response  runInstaller  stage

[oracle@oracle10g Disk1]$ export DISPLAY=192.168.230.1:0.0

[oracle@oracle10g Disk1]$ chmod 755 runInstaller

[oracle@oracle10g Disk1]$ chmod 755 /home/oracle/Disk1/install/.oui

[oracle@oracle10g Disk1]$ chmod 755 /home/oracle/Disk1/install/unzip

[oracle@oracle10g Disk1]$ ./runInstaller –ignoresysprereqs

需要加上–ignoresysprereqs引數,不然會報版本不對的錯誤。

clip_image024

clip_image026

clip_image028

clip_image030

clip_image032

clip_image034

clip_image036

[root@oracle10g ~]# /u01/app/oracle/product/10.2.0/db_1/root.sh

Running Oracle10 root.sh script...

 

The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/app/oracle/product/10.2.0/db_1

 

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

The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]: y

   Copying dbhome to /usr/local/bin ...

The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]: y

   Copying oraenv to /usr/local/bin ...

The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]: y

   Copying coraenv to /usr/local/bin ...

 

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.sh script.

Now product-specific root actions will be performed.

 

clip_image038

6.         建立資料庫

[oracle@oracle10g ~]$ dbca

clip_image040

clip_image042

clip_image044

clip_image046

clip_image048

clip_image050

clip_image052

clip_image054

clip_image056

clip_image058

clip_image060

clip_image062

clip_image064

clip_image066

clip_image068

clip_image070

clip_image072

clip_image074

clip_image076

clip_image078

clip_image080

clip_image082

[oracle@oracle10g ~]$ sqlplus / as sysdba

 

SQL*Plus: Release 10.2.0.4.0 - Production on Thu Aug 13 19:38:59 2015

 

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

 

 

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

 

 

7.         配置監聽

[root@oracle10g ~]# su - oracle

[oracle@oracle10g ~]$ export DISPLAY=192.168.230.1:0.0

[oracle@oracle10g ~]$ netmgr

clip_image084

clip_image086

 

[oracle@oracle10g ~]$ lsnrctl start

 

LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 14-AUG-2015 09:09:58

 

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

 

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

 

TNSLSNR for Linux: Version 10.2.0.4.0 - Production

System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora

Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.230.180)(PORT=1521)))

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.230.180)(PORT=1521)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 10.2.0.4.0 - Production

Start Date                14-AUG-2015 09:09:58

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/10.2.0/db_1/network/admin/listener.ora

Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.230.180)(PORT=1521)))

Services Summary...

Service "stone" has 1 instance(s).

  Instance "stone", status UNKNOWN, has 1 handler(s) for this service...

The command completed successfully

 

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28536251/viewspace-1772729/,如需轉載,請註明出處,否則將追究法律責任。

相關文章