oracle安装步骤

阅读: 评论:0

2024年2月6日发(作者:)

oracle安装步骤

1. 建议完全方式安装Linux

2.视窗方式运行Linux,如果不是视窗,可以更改一下配置使启动的时候变为图形方式,配置如下

#vi /etc/inittab

[root@localhost ~]# vi /etc/inittab

#

# inittab This file describes how the INIT process should set up

# the system in a certain run-level.

#

# Author: Miquel van Smoorenburg,

# Modified for RHS Linux by Marc Ewing and Donnie Barnes

#

# Default runlevel. The runlevels used by RHS are:

# 0 - halt (Do NOT set initdefault to this)

# 1 - Single user mode

# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)

# 3 - Full multiuser mode

# 4 - unused

# 5 - X11

# 6 - reboot (Do NOT set initdefault to this)

#

id:5:initdefault: #将此处改为 id:3:initdefault:

# System initialization.

si::sysinit:/etc/rc.d/t

l0:0:wait:/etc/rc.d/rc 0

3.

新建一个oracle用户,新建用户密码为oracle。

[root@localhost ~]# useradd oracle

[root@localhost ~]# passwd oracle

Changing password for user oracle.

New UNIX password:

BAD PASSWORD: it is based on a dictionary word

Retype new UNIX password:

passwd: all authentication tokens updated successfully.

4.新建一个dba组

[root@localhost ~]# groupadd dba

5.将oracle用户加入dba组

[root@localhost ~]# usermod -G dba oracle

------说明:此步如果写为 usermod -G oracle dba将会导致如下错误循环

[oracle@localhost oracle10files]$ ./runInstaller

Starting Oracle

Checking

Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0,

asianux-1 or asianux-2

Passed

All installer requirements met.

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2011-09-08_01-21-44PM.

Please wait ...sh: /tmp/oracle10files/install/unzip: Permission denied

Error in writing to directory /tmp/OraInstall2011-09-08_01-21-44PM. Please ensure that this

directory is writable and has atleast 60 MB of disk space. Installation cannot continue.

: Success

6.建立oracle安装目录/oracle,和数据库安装目录/oradata

[root@localhost ~]# mkdir /oracle

[root@localhost ~]# mkdir /oradata

7.修改目录权限,仅属于dba组下的oracle用户

[root@localhost ~]# chown -R oracle:dba /oracle

[root@localhost ~]# chown -R oracle:dba /oradata

8.进入oracle安装源文件目录,本人放在/tmp/oracle10files

[root@localhost tmp]# cd /tmp/oracle10files

[root@localhost oracle10files]#

9.更换用户oracle进行安装

[root@localhost oracle10files]# su oracle

[oracle@localhost oracle10files]$

10.运行./runInstall

[oracle@localhost oracle10files]$ ./runInstaller

bash: ./runInstaller: Permission denied

----说明oracle用户没有权限运行此文件

[oracle@localhost oracle10files]$ ls -l

total 28

drwxr-xr-x 9 root root 4096 Aug 15 13:11 doc

drwxr-xr-x 5 root root 4096 Aug 15 13:11 install

drwxr-xr-x 2 root root 4096 Aug 15 13:11 response

-rw-r--r-- 1 root root 1327 Jul 2 2005 runInstaller

drwxr-xr-x 9 root root 4096 Aug 15 13:11 stage

-rw-r--r-- 1 root root 5100 Jul 2 2005

[oracle@localhost oracle10files]$

-----runInstaller缺少x权限

11.给runInstaller加上x权限

[oracle@localhost oracle10files]$ exit

exit

[root@localhost oracle10files]# chmod +x runInstaller

[root@localhost oracle10files]#

12. 更换用户oracle进行安装

[root@localhost oracle10files]# su oracle

[oracle@localhost oracle10files]$

[oracle@localhost oracle10files]$ ./runInstaller

./runInstaller: line 54: /tmp/oracle10files/install/.oui: Permission denied

-----说明/tmp/oracle10files/install/.oui权限不够

13. 给/tmp/oracle10files/install/.oui加上x权限

[oracle@localhost oracle10files]$ exit

exit

[root@localhost oracle10files]# chmod +x /tmp/oracle10files/install/.oui

14. 更换用户oracle进行安装

[root@localhost oracle10files]# su oracle

[oracle@localhost oracle10files]$

[oracle@localhost oracle10files]$ ./runInstaller

Starting Oracle

Checking

Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0,

asianux-1 or asianux-2

Passed

All installer requirements met.

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2011-09-08_01-21-44PM.

Please wait ...sh: /tmp/oracle10files/install/unzip: Permission denied

Error in writing to directory /tmp/OraInstall2011-09-08_01-21-44PM. Please ensure that this

directory is writable and has atleast 60 MB of disk space. Installation cannot continue.

: Success

[oracle@localhost oracle10files]$

-----------说明/tmp/OraInstall2011-09-08_01-21-44PM和/tmp/oracle10files/install/unzip 权限不够

15.给上述2个文件加上x权限

[oracle@localhost oracle10files]$ exit

exit

[root@localhost oracle10files]#

[root@localhost oracle10files]# chmod +x /tmp/oracle10files/install/unzip

[root@localhost oracle10files]# chmod +x /tmp/OraInstall2011-09-08_01-21-44PM

16. 更换用户oracle进行安装

[root@localhost oracle10files]# su oracle

[oracle@localhost oracle10files]$ ./runInstaller

Starting Oracle

Checking

Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0,

asianux-1 or asianux-2

Passed

All installer requirements met.

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2011-09-08_04-26-33PM.

Please wait ...

DISPLAY not set. Please set the DISPLAY and try again.

Depending on the Unix Shell, you can use one of the following commands as examples to set the

DISPLAY environment variable:

- For csh: % setenv DISPLAY 192.168.1.128:0.0

- For sh, ksh and bash: $ DISPLAY=192.168.1.128:0.0; export DISPLAY

Use the following command to see what shell is being used:

echo $SHELL

Use the following command to view the current DISPLAY environment variable setting:

echo $DISPLAY

- Make sure that client users are authorized to connect to the X Server.

To enable client users to access the X Server, open an xterm, dtterm or xconsole as the user that

started the session and type the following command:

% xhost +

To test that the DISPLAY environment variable is set correctly, run a X11 based program that

comes with the native operating system such as 'xclock':

%

If you are not able to run xclock successfully, please refer to your PC-X Server or OS vendor for

further assistance.

Typical path for xclock: /usr/X11R6/bin/xclock

[oracle@localhost oracle10files]$

17. 无法看到安装界面,请使用root帐户执行如下命令后再运行安装程序:

# export DISPLAY=:0.0

# xhost +

$ ./runInstaller

如果报错信息:Exception :sfiedLinkError:/usr/java/j2sdk1.4.2_06/jre/lib/i386/:

.6: cannot open shared object file: No such file or directory 是因为RedHat AS 5中缺少包,安装下就行了在光盘的server目录下。

再运行

$ ./runInstaller

如果出现界面乱码现象,执行以下命令:

$ export LANG=en

18. 更换用户oracle进行安装

[root@localhost oracle10files]# su oracle

[oracle@localhost oracle10files]$ ./runInstaller

Starting Oracle

19.接下来启动安装界面

登录运行脚本

[root@localhost oracle]# cd oraInventory

[root@localhost oraInventory]# ls

Contents logs

ContentsXML ties oui

rm

[root@localhost oraInventory]# ./

Changing permissions of /oracle/oraInventory to 770.

Changing groupname of /oracle/oraInventory to dba.

The execution of the script is complete

[root@localhost oraInventory]# cd ..

[root@localhost oracle]# cd product/10.2.0

[root@localhost 10.2.0]# ./

Running Oracle10

The following environment variables are set as:

ORACLE_OWNER= oracle

ORACLE_HOME= /oracle/product/10.2.0

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/

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

Now product-specific root actions will be performed.

[root@localhost 10.2.0]#

21.安装结束

22. [root@localhost 10.2.0]# ps –A

5410 ? 00:00:00 oracle

5412 ? 00:00:00 oracle

5414 ? 00:00:00 oracle

5416 ? 00:00:00 oracle

5418 ? 00:00:00 oracle

5422 ? 00:00:00 oracle

5734 ? 00:00:00 oracle

5747 ? 00:00:00 oracle

6418 pts/0 00:00:00 perl

6443 pts/0 00:00:17 java

6534 ? 00:00:00 oracle

6541 ? 00:00:02 oracle

6545 ? 00:00:00 oracle

6547 ? 00:00:00 oracle

8540 pts/0 00:00:00 emagent

8559 ? 00:00:02 oracle

8607 ? 00:00:01 oracle

8642 ? 00:00:01 oracle

8968 pts/0 00:00:02 java

8986 ? 00:00:00 oracle

8990 ? 00:00:00 sshd

8996 pts/1 00:00:00 bash

9161 pts/1 00:00:00 ps

[root@localhost 10.2.0]#

---表明oralce安装成功

23. 修改如下文件,将oracle加入自启动。

1. oracle用户登录,修改/home/oracle下的.bash_profile (必须要以oracle用户)

-----这步非常重要,配置文件不正确会直接导致oracle启动失败。

# Oracle Settings

# Oracle Settings

TMP=/tmp; export TMP

TMPDIR=$TMP; export TMPDIR

ORACLE_BASE=/oracle; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/10.2.0; export ORACLE_HOME

ORACLE_SID=oracle; export ORACLE_SID

ORACLE_TERM=xterm; export ORACLE_TERM

PATH=/usr/sbin:$PATH; export PATH

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

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;

export CLASSPATH

#LD_ASSUME_KERNEL=2.4.1; export LD_ASSUME_KERNEL

#if [ $USER = "oracle" ]; then

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

# ulimit -p 16384

# ulimit -n 65536

# else

# ulimit -u 16384 -n 65536

# fi

#fi

2.在/etc/init.d下建立oracled脚本,内容如下

#!/bin/bash

#

# Oracle 9i Database Startup/Shutdown script

#

# Written by Frank Yang

#

# Copyright (c) 2003 Polylink Inc.

#

# chkconfig: - 60 40

# description: Oracle 9i Database Startup/Shutdown script, using command: service oracled

(start|stop|restart)

# Source function library.

. /etc/init.d/functions

INITLOG_ARGS=""

progpath=/oracle/product/10.2.0/bin

startprog=dbstart

shutprog=dbshut

RETVAL=0

start() {

echo -n "Starting "

su - oracle -c "$progpath/$startprog" >/dev/null 2>&1 && sleep 10 && su - oracle -c

"$progpath/lsnrctl start" >/dev/null 2>&1 && success || failure

return $RETVAL

echo

}

stop() {

echo -n $"Stopping "

su - oracle -c "$progpath/$shutprog" >/dev/null 2>&1 &&sleep 10 && su - oracle -c

"$progpath/lsnrctl stop" >/dev/null 2>&1 && success || failure

echo

return $RETVAL

}

case "$1" in

start)

start

;;

stop)

stop

;;

status)

ps -ef|grep ora_ > /dev/null

ret=$?

if [ $ret = 0 ]; then

echo "IPCAM database "

else echo "IPCAM database is "

fi

RETVAL=$?

;;

restart)

stop

start

;;

*)

echo $"Usage: service prepaidradd {start|stop|restart|status}"

exit 1

esac

3. 将oracled脚本加入“System Services”列表。

[root@localhost 10.2.0]# cd /etc/init.d

[root@localhost init.d]# ls

acpid dnsmasq killall nscd

anacron dund krb524 ntpd

apmd firstboot kudzu oracled

atd functions lvm2-monitor pand

auditd gpm mcstrans pcscd

sendmail

setroubleshoot

single

smartd

squid

autofs haldaemon mdmonitor portmap sshd

avahi-daemon halt mdmpd psacct syslog

avahi-dnsconfd hidd messagebus rawdevices tux

bluetooth hplip microcode_ctl rdisc vncserver

capi httpd multipathd readahead_early wdaemon

conman ip6tables netconsole readahead_later winbind

cpuspeed ipmi netfs restorecond wpa_supplicant

crond iptables netplugd rhnsd xfs

cups irda network rpcgssd xinetd

cups-config-daemon irqbalance NetworkManager rpcidmapd

dc_client isdn nfs rpcsvcgssd

dc_server kdump nfslock saslauthd

[root@localhost init.d]# ls oracled -l

-rw-r--r-- 1 root root 1363 Sep 7 23:42 oracled

[root@localhost init.d]# chmod +x oracled

[root@localhost init.d]# chkconfig --add oracled

[root@localhost init.d]# chkconfig -level 2345 oracled on

-level: unknown option

[root@localhost init.d]# chkconfig --level 2345 oracled on

[root@localhost init.d]#

4. [root@localhost init.d]#vi /etc/oratab

5. [root@localhost init.d]#vi /oracle/product/10.2.0/install/oratab

6. 修改/etc/rc.d/

-------说明:

需要配置的一共为5个文件

ypbind

yum-updatesd

oracle安装步骤

本文发布于:2024-02-06 23:21:29,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170723288962775.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:安装   用户   权限   进行   更换   启动   界面
留言与评论(共有 0 条评论)
   
验证码:
排行榜

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23