国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > Oracle > 正文

Redhat Linux AS4 安裝Oracle 10g(包括啟動)

2024-08-29 13:53:14
字體:
來源:轉載
供稿:網友

Redhat linux AS4 安裝 Oracle 10g (10.2)

 

1、硬件需求

1)內存>1024M

內存 交換分區

>1024M 2倍內存

<2048M 1.5倍內存

<8192M 1倍內存

>8192M 0.75倍內存

顯示內存命令

2)/tmp > 400M

3)檢測命令

內存

# grep MemTotal /PRoc/meminfo

交換分區

# grep SwapTotal /proc/meminfo

/tmp分區

# df -k /tmp

cpu信息

# grep "model name" /proc/cpuinfo

2、軟件需求

1)操作系統

Red Hat Enterprise Linux AS/ES 3.0 (Update 4 or later)

Red Hat Linux 4.0

SUSE Linux Enterprise Server 9.0

Asianux 1.0

Asianux 2.0

2)內核

Red Hat Enterprise Linux 3.0 and Asianux 1.0

2.4.21-27.EL

Red Hat Enterprise Linux 4.0 and Asianux 2.0

2.6.9-5.EL

SUSE Linux Enterprise Server 9.0

2.6.5-7.201

3)具體組件包

Red Hat Enterprise Linux 3.0 and Asianux 1.0


make-3.79.1

gcc-3.2.3-34

glibc-2.3.2-95.20

compat-db-4.0.14-5

compat-gcc-7.3-2.96.128

compat-gcc-c++-7.3-2.96.128

compat-libstdc++-7.3-2.96.128

compat-libstdc++-devel-7.3-2.96.128

openmotif21-2.1.30-8

setarch-1.3-1


Red Hat Enterprise Linux 4.0 and Asianux 2.0:


binutils-2.15.92.0.2-13.EL4

compat-db-4.1.25-9

compat-libstdc++-296-2.96-132.7.2

control-center-2.8.0-12

gcc-3.4.3-22.1.EL4

gcc-c++-3.4.3-22.1.EL44

glibc-2.3.4-2.9

glibc-common-2.3.4-2.9

gnome-libs-1.4.1.2.90-44.1

libstdc++-3.4.3-22.1

libstdc++-devel-3.4.3-22.1

make-3.80-5

pdksh-5.2.14-30

sysstat-5.0.5-1

xscreensaver-4.18-5.rhel4.2

setarch-1.6-1


SUSE Linux Enterprise Server 9


binutils-2.15.90.0.1.1-32.5

gcc-3.3.3-43.24

gcc-c++-3.3.3-43.24

glibc-2.3.3-98.28

gnome-libs-1.4.1.7-671.1

libstdc++-3.3.3-43.24

libstdc++-devel-3.3.3-43.24

make-3.80-184.1

pdksh-5.2.14-780.1

sysstat-5.0.1-35.1

xscreensaver-4.16-2.6

4)命令

操作系統型號

# cat /etc/issue

內核型號

# uname -r

查詢安裝包

# rpm -q package_name


RL AS4 下查詢腳本

rpm -qa binutils

rpm -qa compat-db

rpm -qa compat-libstdc++-33

rpm -qa control-center

rpm -qa gcc

rpm -qa gcc-c++

rpm -qa glibc

rpm -qa glibc-common

rpm -qa gnome-libs

rpm -qa libstdc++

rpm -qa libstdc++-devel

rpm -qa make

rpm -qa pdksh

rpm -qa sysstat

rpm -qa xscreensaver

rpm -qa setarch

3、安裝

1)環境

內存 2048M,硬盤146G

2)分區

/ 30G

/tmp 2G

/var 3G

/app 20G

/app/oradata 60G

/app/oraBP 20G

3)安裝

選擇所有的管理工具,開發工具,Gnome環境,Web Server,FTP Server

除sysstat包都成功安裝,

sysstat包在4號盤上,rpm -i sysstat-5.0.5-1.i386.rpm

4、安裝Oracle

1)添加用戶組

判斷用戶和組是否存在

grep dba /etc/group

grep oinstall /etc/group

id oracle

id nobody

有則不添加

groupadd oinstall

groupadd dba

useradd -g oinstall -G dba oracle

--oracle 已經存在 但不是 oinstall組,也非dba組成員

usermod -g oinstall -G dba oracle

useradd nobody

2)內核參數

Parameter Value File

semmsl 250 /proc/sys/kernel/sem


semmns 32000


semopm 100


semmni 128

shmall 2097152 /proc/sys/kernel/shmall

shmmax Half the size of physical memory (in bytes) /proc/sys/kernel/shmmax

shmmni 4096 /proc/sys/kernel/shmmni

file-max 65536 /proc/sys/fs/file-max

ip_local_port_range Minimum: 1024 /proc/sys/net/ipv4/ip_local_port_range


Maximum: 65000

rmem_default 1048576 /proc/sys/net/core/rmem_default

rmem_max 1048576 /proc/sys/net/core/rmem_max

wmem_default 262144 /proc/sys/net/core/wmem_default

wmem_max 262144 /proc/sys/net/core/wmem_max

命令

semmsl, semmns, semopm, and semmni # /sbin/sysctl -a | grep sem

shmall, shmmax, and shmmni # /sbin/sysctl -a | grep shm

file-max # /sbin/sysctl -a | grep file-max

ip_local_port_range # /sbin/sysctl -a | grep ip_local_port_range

rmem_default # /sbin/sysctl -a | grep rmem_default

rmem_max # /sbin/sysctl -a | grep rmem_max

wmem_default # /sbin/sysctl -a | grep wmem_default

wmem_max # /sbin/sysctl -a | grep wmem_max

修改配置文件/etc/sysctl.conf,增加或修改

kernel.shmall = 2097152

kernel.shmmax = 2147483648

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 = 1048576

net.core.rmem_max = 1048576

net.core.wmem_default = 262144

net.core.wmem_max = 262144

重新啟動

3)設置oracle用戶的shell

a)增加如下行到/etc/security/limits.conf

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

b)增加下列行到/etc/pam.d/login

session required /lib/security/pam_limits.so

session required pam_limits.so

c)修改Shell默認啟動文件

Bourne,Bash,Korm shell下增加下列行到/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


C shell下,增加下列行到/etc/csh.login

if ( $USER == "oracle" ) then

limit maxproc 16384

limit descriptors 65536

endif

4)創建需要的目錄

mkdir /app/oracle

chown -R oracle:oinstall /app/oracle

chmod -R 775 /app/oracle

chown -R oracle:oinstall /app/oradata

chmod -R 775 /app/oradata

chown -R oracle:oinstall /app/orabp

chmod -R 775 /app/orabp

這里只有一塊硬盤,如果有多塊硬盤,你需要將其建立一個掛接點,如u01,

則目錄為/u01/app/oracle,這里只有一個硬盤,掛接點就是/

5)設置oracle用戶環境

a)如果在遠程系統上安裝oracle,在本地的X-Windows里顯示,要設置

xhost host_name

b)用oracle登陸X-windows系統,或su - oracle

c)查看默認Shell

echo $SHELL

d)bash

vi .bash_profile

如果設置了ORACLE_SID,ORACLE_HOME,ORACLE_BASE,刪除相應行

e)umask 022

f)保存文件,執行

. .bash_profile

g)設置顯示變量

DISPLAY=localhost:0.0 ; export DISPLAY

如果在遠程顯示界面,localhost就改成遠程主機

h)如果/tmp空間不夠,需要設置TMP,TMPDIR變量

$ su - root

# mkdir /mount_point/tmp

# chmod a+wr /mount_point/tmp

# exit

bash下

$ TMP=/mount_point/tmp

$ TMPDIR=/mount_point/tmp

$ export TMP TMPDIR

i)確定ORACLE_HOME,TNS_ADMIN沒有設置

$ unset ORACLE_HOME

$ unset TNS_ADMIN

j)檢驗是否設置正確

$ umask

$ env | more

6)安裝Oracle

a)取得Oracle安裝件

從Oracle網站上下載,是免費的,只需要一個簡單的注冊即可,得到的是zip文件

unzip 10201_database_linux32.zip

如果是安裝光盤,mount上介質

b)運行

runInstaller

c)安裝過程和Windows非常類似,要注意的是

在選擇dba組的時候選擇oinstall

修改一下默認目錄,如安裝目錄,Inventory目錄

安裝之前程序會檢查一下系統配置,如果按照上面的設置,不會有任何問題,

install即可

這樣安裝的oracle的數據文件在默認目錄下,如果要放到不同的盤上,

可以刪除數據庫重建,或者安裝的時候選擇高級安裝

安裝Net 8時,系統提示以root用戶執行兩個腳本,照做就可以了

5、點滴

1)注意ORACLE_HOME變量,如果不存在,需要手工設置

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

2)建庫命令為/app/oracle/product/10.2.0/db_1/bin/dbca &

注意設置字符集,因為安裝界面用中文沒法安裝,所以使用英文環境安裝,

所以不能使用默認配置,要修改默認字符集及默認語言

3)Net 8 命令為/app/oracle/product/10.2.0/db_1/bin/netca &

4)在其它機器上遠程用Net8連接Oracle,需要打開Linux上的1521端口

配置如下

applications->System Setting->Secuity Level 其它端口增加1521:tcp即可

5)讓oracle隨機器啟動而啟動

在.bash_profile里設置

ORACLE_SID=orcl

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

export ORACLE_SID

export ORACLE_HOME

PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

export PATH

修改/etc/oratab,

orcl:/app/oracle/product/10.2.0/db_1:Y

最后一個字母默認是N,修改為Y,否則dbstart,dbshut都不會起作用

修改/app/oracle/product/10.2.0/db_1/dbstart中的相關行為

ORACLE_HOME_LISTNER=/app/oracle/product/10.2.0/db_1

然后修改/etc/rc.local,增加這樣的一行

su - oracle -c dbstart

這樣就可以了,但不能關機的時候自動關閉,所以需要手工處理

su - oracle -c dbshut

如果是oracle用戶可以直接dbshut


注:我曾經嘗試過網上找到的如下方法,但系統沒法啟動,需要用恢復模式刪掉腳本才可以,

不知道是不是我的配置問題,如果看出我的錯誤請告訴我

開機時讓 RedHat Linux 自動啟動Oracle,需要完成以下步驟:


運行 $ORACLE_HOME 下的 root.sh,會生成一個文件 /etc/oratab 。


編輯 /etc/oratab ,把所有的 instance 的重啟動標志設置成 'Y',如:

ora10g:/home/oracle/OraHome_1:Y


做一個啟動腳本 /etc/init.d/dbora ,如下所示:


#!/bin/sh

# description: Oracle auto start-stop script.

# chkconfig: - 20 80

#

# Set ORA_HOME to be equivalent to the $ORACLE_HOME

# from which you wish to execute dbstart and dbshut;

#

# Set ORA_OWNER to the user id of the owner of the

# Oracle database in ORA_HOME.

ORA_HOME=/app/oracle/product/10.2.0/db_1

ORA_OWNER=oracle

if [ ! -f $ORA_HOME/bin/dbstart ]

then

echo "Oracle startup: cannot start"

exit

fi

case "$1" in

'start')

# Start the Oracle databases:

# The following command assumes that the oracle login

# will not prompt the user for any values

su - $ORA_OWNER -c $ORA_HOME/bin/dbstart

su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"

;;

'stop')

# Stop the Oracle databases:

# The following command assumes that the oracle login

# will not prompt the user for any values

su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"

su - $ORA_OWNER -c $ORA_HOME/bin/dbshut

;;

'restart')

$0 stop

$0 start

;;

esac

 


賦予執行權限

chmod 750 /etc/init.d/dbora


作成以下鏈接:

ln -s /etc/init.d/dbora /etc/rc0.d/K10dbora

ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora


執行以下命令:

chkconfig --level 345 dbora on


這樣就OK了。下次開關機的時候,Oracle也會隨之啟動/停止


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 广安市| 玛多县| 罗平县| 长岛县| 东乌| 瓦房店市| 博湖县| 隆尧县| 精河县| 江都市| 泰来县| 黑龙江省| 加查县| 灌云县| 育儿| 衡山县| 高唐县| 文登市| 罗田县| 南投市| 万安县| 永修县| 合阳县| 龙江县| 天津市| 温州市| 土默特左旗| 邵阳市| 新乡县| 本溪市| 永川市| 德州市| 武山县| 苏尼特右旗| 道孚县| 凭祥市| 双辽市| 鄂托克旗| 汽车| 上思县| 芮城县|