首頁 > 網際網路

如何在linux suse中安裝Oracle 11g(一)安裝準備

2019-12-01 07:21:29

在linux suse 11 中安裝Oracle 11g 資料庫 之 安裝準備

1

檢測所要安裝的封包

linux-udly:~ #  rpm -qa | grep binutils

binutils-2.20.0-0.7.9

linux-udly:~ #  rpm -qa | grep gcc

gcc-4.3-62.198

gcc43-c++-4.3.4_20091019-0.7.35

linux-udly:~ #  rpm -qa | grep glibc

glibc-2.11.1-0.17.4

linux-udly:~ #  rpm -qa | grep libaio

libaio-0.3.109-0.1.46

libaio-devel-0.3.109-0.1.46

linux-udly:~ #  rpm -qa | grep libgcc

libgcc43-4.3.4_20091019-0.7.35

linux-udly:~ #  rpm -qa | grep libstdc

libstdc++-devel-4.3-62.198

libstdc++43-4.3.4_20091019-0.7.35

libstdc++43-32bit-4.3.4_20091019-0.7.35

libstdc++43-devel-4.3.4_20091019-0.7.35

libstdc++43-devel-32bit-4.3.4_20091019-0.7.35

linux-udly:~ #  rpm -qa | grep make

make-3.81-128.20

linux-udly:~ #  rpm -qa | grep sysstat

sysstat-8.1.5-7.9.56

以上沒有的安裝包,都需要進行安裝

linux-udly:~ # rpm –ivh  xxx


2

建立使用者組

linux-udly:~ # groupadd oinstall

linux-udly:~ # groupadd dba


3

建立oracle使用者

linux-udly:~ #mkdir /home/oracle

linux-udly:~ # useradd -g oinstall -G dba -d /home/oracle oracle

linux-udly:~ # passwd oracle   

linux-udly:~ # chown -R oracle:oinstall /home/oracle/


4

建立oracle資料庫安裝目錄

linux-udly:/opt # pwd

/opt

linux-udly:/opt # mkdir -p oracle

linux-udly:/opt # chown -R oracle:oinstall /opt/oracle


5

1、  驗證某些引數是否正確

linux-udly:/opt # cat /etc/nsswitch.conf | grep hosts

hosts:          files mdns4_minimal [NOTFOUND=return] dns

linux-udly:/opt # hostname

linux-udly

linux-udly:/opt # cat /etc/hosts

127.0.0.1       localhost


6

設定/etc/sysctl.conf檔案,加入以下內容,儲存之後執行  sysctl -p

linux-udly:/opt #  vi /etc/sysctl.conf

 

kernel.shmall = 2097152

kernel.shmmax = 536870912

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

net.core.rmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

 

fs.file-max = 6815744

net.ipv4.ip_local_port_range = 9000 65500

net.core.wmem_max = 1048576

fs.aio-max-nr = 1048576 


7

設定/etc/security/limits.conf檔案,加入以下內容linux-udly:/opt #vi /etc/security/limits.conf?oracle?????????? soft??? nproc?????????? 2047oracle?????????? hard??? nproc?????????? 16384oracle?????????? soft??? nofile????????? 1024oracle?????????? hard??? nofile??? ??????65536

8

設定/etc/profile檔案,加入以下內容,然後執行 source  /etc/profile

linux-udly:/opt #vi /etc/profile

 

if [ $USER = "oracle" ]; then

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

              ulimit -p 16384

              ulimit -n 65536

        else

              ulimit -u 16384 -n 65536

        fi

fi


9

切換使用者:

linux-udly:/opt # su - oracle

oracle@linux-udly:~> pwd

/home/oracle

oracle@linux-udly:~> 

設定環境變數:修改/home/oracle/.bash_profile檔案,加入以下內容

export PATH

ORACLE_BASE=/opt/oracle

ORACLE_HOME=$ORACLE_BASE/oracle

ORACLE_SID=dbbha

PATH=$ORACLE_HOME/bin:$PATH

export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH


10

解壓資料庫檔案oracle@linux-udly:~> su - root ? ? ?切換到root使用者??: ?linux-udly:~ # unzip linux.x64_11gR2_database_2of2.zip ?(此檔案已上傳到此目錄,下同)linux-udly:~ #?unzip linux.x64_11gR2_database_1of2.ziplinux-utdu:~ # mv -f database/ /opt/oracle/? (database移至/opt/oracle/)linux-utdu:~ # cd ?/opt/oracle/linux-utdu:/oracle # chown -R
oracle:oinstall database/致此準備工作已完成!

IT145.com E-mail:sddin#qq.com