redhat 6.0 oracle 10.2.0.4安装,在RedHat Enterprise Linux 4 Update 5下安装Oracle 10GR2 10.2.0.3[申请加精]...

#===============================================================================

#Install Oracle 10GR2 10.2.0.3 in RedHat Enterprise Linux 4 Update 5

#Version:        2.0.00

#Update:        2007-07-04

#Author:        Francis Hao

#===============================================================================

RedHat Enterprise Linux AS 4 Update 5                                                Release Time:2007-??-??

Oracle 10GR2 for Linux 10.2.0.1                                                                 Release Time:2006-??-??

Oracle 10GR2 Patch Set 10.2.0.3                                                                 Release Time:2007-??-??

#===============================================================================

#注释

本文主要介绍手工通过XWindow安装Oracle软件,安装Patch Set,创建数据库,配置Oracle Net等。

涉及一些为自动安装Oracle做的准备工作,关于如何自动安装Oracle将另外写文章介绍。

主要可以参考下面网站里面的文章。针对Oracle的有些东西比较老了,Oracle 在10R2里面已经改进了。

著名的Oracle ACE Werner Puschitz [pronounced "Push-its"] 的这些文章涉及面太广,笔者仅介绍

涉及RedHat Enterprise Linux 4 Update 5方面的。

http://www.puschitz.com/

http://www.puschitz.com/InstallingOracle10g.shtml

Installing Oracle Database 10g (32-bit/64-bit) on RHEL, Fedora Core, and Red Hat (x86/x86_64)

Installing Oracle Database 10g Release 1 and 2 (32-bit/64-bit) on Red Hat Enterprise Linux AS 4, 3, 2.1,

Red Hat Fedora Core 4, 3, 1, RH 9 on x86 and x86-64 (AMD64) Architecture

http://www.puschitz.com/TuningLinuxForOracle.shtml

Tuning and Optimizing Red Hat Enterprise Linux for Oracle 9i and 10g Databases

也要看一下Oracle官方的文档:

Oracle Database Release Notes 10g Release 2 (10.2) for Linux x86

Oracle Database Installation Guide 10g Release 2 (10.2) for Linux x86

Oracle OTN里面也有很多安装Oracle for Linux的介绍,都是初中级的,非常不错!

#===============================================================================

# 检查服务器硬件的情况,建议安装Oracle服务器需要如下配置。

CPU:Intel 双核 XEON 3.0 *2

内存:4GB-8GB                 内存越大越好。虽然说SGA有1.7GB/3.6GB的限制。但是剩下的内存Linux可以作为Cache使用,绝对不会浪费的。

硬盘:300GB SCSI *2 + 300GB*1 做RAID1+HotSpare。必要的话再加1块300GB存放备份。关于硬盘的使用根据不同的规模规划不同,

在这里不做详细讨论。

注意:

首先要保证有充足的磁盘空间存放数据文件和归档日志文件。这个要看你的应用得规模了。

在硬盘的冗余性方面,一般小型DB系统不必使用盘阵和SAN的复杂的磁盘解决方案,只需保证做RAID1加热备盘即可。

#===============================================================================

# 检查RedHat Enterprise Linux AS 4 Update 5 的安装情况

安装RedHat Enterprise Linux AS 4 Update 5的时候选择如下软件包:

必须安装的RPM包和组:

@ admin-tools

@ editors

@ emacs

@ system-tools

@ gnome-software-development

@ text-internet

@ x-software-development

@ legacy-network-server

@ dns-server

@ gnome-desktop

@ dialup

@ ftp-server

@ network-server

@ compat-arch-support

@ legacy-software-development

@ smb-server

@ base-x

@ chinese-support

@ kde-software-development

@ kde-desktop

@ mail-server

@ server-cfg

@ sound-and-video

@ development-tools

@ graphical-internet

e2fsprogs

grub

kernel-smp-devel

sysstat

kernel-devel

kernel-smp

vnc

vnc-server

你看看你安装完的的RedHat Enterprise Linux的root的主目录下面的anaconda-ks.cfg就知道自己装了什么Package了。

具体的RedHat Enterprise Linux的安装我将在以后写。

#---------------------------------------------------------------------------------

#安装Linux的注意事项

#主要注意的是SWAP分区的设置,Oracle 10G需要的SAWP分区和内存大小有关,如果你有4GB内存,则至少需要4GB的SWAP分区。

如果磁盘充足,建议划分2个4096MB的SWAP分区。

#一定要安装配置 XWindow(Gnome或者KDE都可以)

#一定要关闭防火墙和SELINUX

#一定要安装相关的compat包。

#别看我基本上装了很多的Linux RPM Package,但是不该启动的服务一定要停止。具体的方法详见我以后发表的Linux安装文档。

#============================================================================================

#下载和解压缩Oracle 10.2.0.1的安装文件

#------------------------------------------------------------------------------

#创建相应的用户和目录

useradd oracle

passwd oracle

把Oracle的安装文件放到oracle用户的主目录中。

注意:由于安装Oracle需要以Oracle用户进行安装,因此存放Oracle安装文件的位置一定要让Oracle用户可以访问到。

#------------------------------------------------------------------------------

#下载:

http://www.oracle.com/technology ... racle10g/index.html

Oracle Database 10g Release 2

Standard Edition, Standard Edition One, and Enterprise Edition

*All Release 2 download pages contain Oracle Companion, Client, Clusterware, Gateways, and Application Express standalone downloads

Oracle Database 10g Release 2 (10.2.0.2) for HP OpenVMS Alpha New! (5-Dec-06)

Oracle Database 10g Release 2 (10.2.0.2) for OpenVMS Itanium

Oracle Database 10g Release 2 (10.2.0.2) for Solaris Operating System (x86)

Oracle Database 10g Release 2 (10.2.0.2) for HP Tru64 UNIX

Oracle Database 10g Release 2 (10.2.0.2) for z/Linux

Oracle Database 10g Release 2 (10.2.0.2) for z/OS (OS/390)

Oracle Database 10g Release 2 (10.2.0.1.0) for Solaris Operating System (x86-64)

Oracle Database 10g Release 2 (10.2.0.1.0) for HP-UX Itanium

Oracle Database 10g Release 2 (10.2.0.1.0) for Linux Itanium

Oracle Database 10g Release 2 (10.2.0.1.0) for Linux on Power

Oracle Database 10g Release 2 (10.2.0.1.0) for Microsoft Windows (x64)

Oracle Database 10g Release 2 (10.2.0.1.0) for Microsoft Windows (64-bit Itanium)

Oracle Database 10g Release 2 (10.2.0.1.0) for Linux x86-64

Oracle Database 10g Release 2 (10.2.0.1.0) for Microsoft Windows

Oracle Database 10g Release 2 (10.2.0.1.0) for Linux x86

Oracle Database 10g Release 2 (10.2.0.1.0) for Solaris Operating System (SPARC) (64-bit)

Oracle Database 10g Release 2 (10.2.0.1.0) for AIX5L

Oracle Database 10g Release 2 (10.2.0.1.0) for HP-UX PA-RISC

下载for Linux X86的

Oracle Database 10g Release 2 (10.2.0.1.0)

Enterprise/Standard Edition for Linux x86

Download the Complete Files

10201_database_linux32.zip (668,734,007 bytes) (cksum - 2737423041)

Directions

1. All files are in the .zip format. There is an unzip utility for this platform here if you need one.

2. Installation guides and general Oracle Database 10g documentation can be found here.

3. Review the certification matrix for this product here.

Oracle Database 10g Companion CD Release 2 (10.2.0.1.0) for Linux x86

10201_companion_linux32.zip (705,274,421 bytes) (cksum - 1240689190)

Oracle Application Express v2.2.1 (63,586,968 bytes) (cksum - 1517929630) - released 14-SEP-2006

Oracle Application Express (formerly HTML DB) v2.0 (56,104,916 bytes) (cksum - 1271554465) - released 21-SEP-2005

Oracle Database 10g Client Release 2 (10.2.0.1.0) for Linux x86

10201_client_linux32.zip (478,343,213 bytes) (cksum - 579193942)

Oracle Clusterware Release 2 (10.2.0.1.0) for Linux x86

10201_clusterware_linux32.zip (228,239,016 bytes) (cksum - 2639036338)

Oracle Gateways 10g Release 2 (10.2.0.1.0) for Linux x86

10201_gateways_linux32.zip (244,229,816 bytes) (cksum - 1793856454)

注意:Patch Set 2 只有在MetaLink里面才有下载。

#------------------------------------------------------------------------------

#计算一下CRC码,保证下载的包是好的。

Compute a cyclic redundancy check (CRC) checksum for the downloaded files and

compare the checksum numbers against the numbers posted on OTN's website. For example:

cksum 10201_database_linux32.zip

#------------------------------------------------------------------------------

#解压缩zip包。

su - oracle

cd ~oracle

unzip 10201_database_linux32.zip

解包和解压过程中,自动创建了1个包含安装文件的目录:

database

这些文件的属主一定要是oracle

#=============================================================================

#安装Oracle前的检查和准备工作;

#-----------------------------------------------------------------------------

为什么会需要很大的swap分区呢?你的内存越大,需要的swap就越大。如果你有4GB内存,Oracle就需要4GB以上的swap。

Oracle says that the system must have at least 512MB of RAM and 1GB of swap space or twice the size of RAM.

And for systems with more than 2 GB of RAM, the swap space can be between one and two times the size of RAM

#-----------------------------------------------------------------------------

#查看这些RPM包是否已安装;如果按照上面的要求安装Linux。那么就不用检查这些包的情况了。

#-----------------------------------------------------------------------------

#安装J2SDK,如果只是为了安装Oracle,那就不需要安装JDK包。Oracle自己带了个JRE的包用于OUI。

#-----------------------------------------------------------------------------

#创建数据库安装的准备工作;

1,创建user/group;

实际上作为小规模应用部署,没必要建立其它组,我只建了oracle用户,默认组就是oracle

useradd oracle

2,建立oracle安装文件夹;

实际上作为小规模应用部署,没必要建立那么复杂的目录结构。

只需要建立/data/oracle目录。

oracle会安装在/data/oracle/product/10.2.0下面。不用创建这个目录。oraInstaller会自动创建.

mkdir /data/oracle

#-----------------------------------------------------------------------------

#配置环境变量;

以root用户登录,设置/etc/profile文件将如下内容加入:

export ORACLE_BASE=/data/oracle

#export ORACLE_HOME=$ORACLE_BASE/product/10.2.0

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

export ORACLE_OWNER=oracle

export ORACLE_SID=orcl

#export TNS_ADMIN=$ORACLE_HOME/network/admin

export LANG=en_US

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib

export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib

#export NLS_LANG=American_america.zhs16gbk

注意:ORACLE_HOME和NLS_LANG在安装前先要注释掉,等安装好后再去掉注释。

对于LD_LIBRARY_PATH和CLASSPATH,应该是给编程者提供装入LIB的路径,不写也可以安装。

NOTE: If ORACLE_BASE is used, then Oracle recommends that you don't set the ORACLE_HOME environment

variable but that you choose the default path suggested by the OUI. You can set and use ORACLE_HOME after you finished running OUI.

Also, the environment variables ORACLE_HOME and TNS_ADMIN should not be set. If you've already set these

environment variables, you can unset them by running the following commands:

unset ORACLE_HOME

unset TNS_ADMIN

#export TNS_ADMIN=$ORACLE_HOME/network/admin                        #这个可以不设置,使用缺省值即可

#------------------------------------------------------------------------------

#设置系统核心和网络参数:修改/etc/sysctl.conf文件。

vi /etc/sysctl.conf

加入如下信息:

#Kernel Parameters for Oracle

kernel.shmmax=2147483648

kernel.sem=250 32000 100 128

fs.file-max=65536

#Network Parameters for Oracle

net.ipv4.ip_local_port_range = 1024 65000

net.core.rmem_default=262144

net.core.wmem_default=262144

net.core.rmem_max=262144

net.core.wmem_max=262144

注意:在32位Linux下Oracle的SGA最多只能用到1.7GB。具体的原因和解决方法网上都有介绍。

如果想简单的让Oracle支持SGA到3.6GB左右,需要使用64位的Linux。

kernel.shmmax=2147483648(2GB)

kernel.shmmax=4294967296(4GB)

检查所有Kernel Parameters,执行。

su - root

sysctl -a

一般情况下可以设置最大共享内存为物理内存的一半,如果物理内存是 2G,则可以设置最大共享内存为 1073741824。

如上;如物理内存是 1G,则可以设置最大共享内存为 512 * 1024 * 1024 = 536870912;以此类推。

建议永久地增加 shmmax 设置。Shmmax 最大共享内存,官方文档建议是内存的1/2,Shmmni 最小共享内存 4096KB.Shmall 所有内存大小(以4K块计算的)。

sem 4个参数依次为SEMMSL(每个用户拥有信号量最大数);SEMMNS(系统信号量最大数);

SEMOPM(每次semopm系统调用操作数);SEMMNI(系统辛苦量集数最大数).

修改后运行sysctl –p命令使得内核改变立即生效;

su - root

sysctl -p

调整网络参数设置:

Starting with 10g R2 some network settings must be adjusted as well which is checked by OUI.

For more information on setting these parameters, see Changing Network Kernel Settings.

Changing Network Kernel Settings

Oracle now uses UDP as the default protocol on Linux for interprocess communication,

such as cache fusion buffer transfers between the instances. But starting with

Oracle 10g network settings should be adjusted for standalone databases as well.

Oracle recommends the default and maximum send buffer size (SO_SNDBUF socket option) and

receive buffer size (SO_RCVBUF socket option) to be set to 256 KB. The receive buffers are used

by TCP and UDP to hold received data until it is read by the application. The receive buffer

cannot overflow because the peer is not allowed to send data beyond the buffer size window.

This means that datagrams will be discarded if they don't fit in the socket receive buffer.

This could cause the sender to overwhelm the receiver.

The default and maximum window size can be changed in the proc file system without reboot:

# sysctl -w net.core.rmem_default=262144  # Default setting in bytes of the socket receive buffer

# sysctl -w net.core.wmem_default=262144  # Default setting in bytes of the socket send buffer

# sysctl -w net.core.rmem_max=262144      # Maximum socket receive buffer size which may be set by using the SO_RCVBUF socket option

# sysctl -w net.core.wmem_max=262144      # Maximum socket send buffer size which may be set by using the SO_SNDBUF socket option

To make the change permanent, add the following lines to the /etc/sysctl.conf file, which is used during the boot process:

net.core.rmem_default=262144

net.core.wmem_default=262144

net.core.rmem_max=262144

net.core.wmem_max=262144

To improve failover performance in a RAC cluster, consider changing the following IP kernel parameters as well:

net.ipv4.tcp_keepalive_time

net.ipv4.tcp_keepalive_intvl

net.ipv4.tcp_retries2

net.ipv4.tcp_syn_retries

Changing these settings may be highly dependent on your system, network, and other applications.

For suggestions, see Metalink Note:249213.1 and Note:265194.1.

On RHEL systems the default range of IP port numbers that are allowed for TCP and UDP traffic

on the server is too low for 9i and 10g systems. Oracle recommends the following port range:

# sysctl -w net.ipv4.ip_local_port_range="1024 65000"

To make the change permanent, add the following line to the /etc/sysctl.conf file, which is used during the boot process:

net.ipv4.ip_local_port_range=1024 65000

The first number is the first local port allowed for TCP and UDP traffic, and the second number is the last port number.

#------------------------------------------------------------------------------

#设置oracle对文件的要求:

vi /etc/security/limits.conf

加入以下语句:

#File Parameter for Oracle 10gR2

oracle        soft        nofile        65536

oracle        hard        nofile        65536

#oracle        soft        nproc                32768

#oracle        hard        nproc                32768

注意:

Redhat Enterprise 4 Update 5缺省的nproc已经设置为32768,因此不必修改这个选项。

加入上面的语句后需要使用sysctl -p生效,如果不生效的话,以oracle用户执行ulimit的时候不会成功的。

sysctl -p

在Oracle用户的profile里面加入如下语句:

vi ~oracle/.bash_profile

#ulimit -n:Limiting Maximum Number of Open File Descriptors

#ulimit -u:maximum number of processes

ulimit -n 65536

#ulimit -u 32768

进入oracle用户运行这些命令:

su - oracle

ulimit -n 65536

#ulimit -u 32768

检查shell的限制:

# ulimit -a

core file size          (blocks, -c) 0

data seg size           (kbytes, -d) unlimited

file size               (blocks, -f) unlimited

pending signals                 (-i) 1024

max locked memory       (kbytes, -l) 32

max memory size         (kbytes, -m) unlimited

open files                      (-n) 65536

pipe size            (512 bytes, -p) 8

POSIX message queues     (bytes, -q) 819200

stack size              (kbytes, -s) 10240

cpu time               (seconds, -t) unlimited

max user processes              (-u) 32768

virtual memory          (kbytes, -v) unlimited

file locks                      (-x) unlimited

你会发现

open files                      (-n) 65536

max user processes              (-u) 32768

已经修改成你需要的值了。

参考资料:摘自Oracle官方安装文档

Setting Shell Limits for the Oracle User

Most shells like Bash provide control over various resources like the maximum allowable number of open file

descriptors or the maximum number of processes available to a user.

To see all shell limits, run:

ulimit -a

For more information on ulimit for the Bash shell, see man bash and search for ulimit.

NOTE:

On some Linux systems setting "hard" and "soft" limits in the following examples might not work properly when you login as oracle via SSH.

It might work if you log in as root and su to oracle.

If you have this problem try to set UsePrivilegeSeparation to "no" in /etc/ssh/sshd_config and restart the SSH daemon by executing service sshd restart.

The privilege separation does not work properly with PAM on some Linux systems.

Make sure to talk to the Unix and/or security teams before disabling the SSH security feature "Privilege Separation".

Limiting Maximum Number of Open File Descriptors for the Oracle User

After /proc/sys/fs/file-max has been changed, see Setting File Handles, there is still a per user limit of maximum open file descriptors:

$ su - oracle

$ ulimit -n

1024

$

To change this limit, edit the /etc/security/limits.conf file as root

and make the following changes or add the following lines, respectively:

oracle           soft    nofile          4096

oracle           hard    nofile          63536

The "soft limit" in the first line defines the number of file handles or open files that the Oracle user will have after login.

If the Oracle user gets error messages about running out of file handles, then the Oracle user can increase the number of file

handles like in this example up to 63536 ("hard limit&quot

9f7588d3b12cd5d674b5f81c0b8fc6cb.gif by executing the following command:

ulimit -n 63536

You can set the "soft" and "hard" limits higher if necessary.

NOTE:

I do not recommend to set the "hard" limit for nofile for the oracle user equal to /proc/sys/fs/file-max.

If you do that and the user uses up all the file handles, then the entire system will run out of file handles.

This could mean that you won't be able to initiate new logins any more since the system won't be able to open any PAM modules that

are required for the login process. That's why I set the hard limit to 63536 and not 65536.

That these limits work you also need to ensure that pam_limits is configured in the /etc/pam.d/system-auth file,

or in /etc/pam.d/sshd for ssh, /etc/pam.d/su for su, or /etc/pam.d/login for local logins and telnet

if you don't want to enable it for all login methods. Here are the two session entries I have in my /etc/pam.d/system-auth file:

session     required      /lib/security/$ISA/pam_limits.so

session     required      /lib/security/$ISA/pam_unix.so

Now login to the oracle user account since the changes will become effective for new login sessions only.

Note the ulimit options are different for other shells.

$ su - oracle

$ ulimit -n

4096

$

The default limit for oracle is now 4096 and the oracle user can increase the number of file handles up to 63536:

$ su - oracle

$ ulimit -n

4096

$ ulimit -n 63536

$ ulimit -n

63536

$

To make this change permanent, you could add "ulimit -n 63536" (for bash) to the ~oracle/.bash_profile file which is the user startup

file for the bash shell on Red Hat Linux (to verify your shell execute echo $SHELL).

To do this you could simply copy/paste the following commands for oracle's bash shell:

su - oracle

cat >> ~oracle/.bash_profile << EOF

ulimit -n 63536

EOF

To make the above changes permanent, you could also set the soft limit equal to the hard limit in /etc/security/limits.conf which I prefer:

oracle           soft    nofile          63536

oracle           hard    nofile          63536

Limiting Maximum Number of Processes for the Oracle User

After reading the procedure at Limiting Maximum Number of Open File Descriptors for the Oracle User you should now have an understanding of "soft" and "hard" limits and how to change shell limits.

To see the current limit of the maximum number of processes for the oracle user, run:

$ su - oracle

$ ulimit -u

Note the ulimit options are different for other shells.

To change the "soft" and "hard" limits for the maximum number of processes for the oracle user, add the following lines to the /etc/security/limits.conf file:

oracle           soft    nproc          2047

oracle           hard    nproc          16384

To make this change permanent, you could add "ulimit -u 16384" (for bash) to the ~oracle/.bash_profile file which is the user startup file for the bash shell on Red Hat Linux (to verify your shell execute echo $SHELL). To do this you could simply copy/paste the following commands for oracle's bash shell:

su - oracle

cat >> ~oracle/.bash_profile << EOF

ulimit -u 16384

EOF

To make the above changes permanent, you could also set the soft limit equal to the hard limit in /etc/security/limits.conf which I prefer:

oracle           soft    nproc          16384

oracle           hard    nproc          16384

参考资料:摘自oracle官方安装文档

Setting Shell Limits for the oracle User

Oracle recommends setting limits on the number of processes and open files each Linux account may use.

To make these changes, cut and paste the following commands as root:

cat >> /etc/security/limits.conf <

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536EOF

cat >> /etc/pam.d/login <

session required /lib/security/pam_limits.so

EOF

For RHEL4, use the following:

cat >> /etc/profile <

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

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

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

umask 022fiEOF

cat >> /etc/csh.login <

if ( \$USER == "oracle" )

then

limit maxproc 16384

limit descriptors 65536

umask 022

endif

EOF

#==============================================================================

#在远程安装Oracle(设置 SSH X forward)(可选)

一般远程安装Oracle 10个R2的话,简单的可以使用VNC来做。具体的VNC的用法网上都有介绍。

官方这个推荐的方法我没有使用过。

Installing Oracle10g on a Remote Linux Server

If you don't install Oracle on your local system but on a remote server, then you need to relink X to your local desktop.

The easiest way to do this is to use the "X11 forwarding" feature of ssh.

This means that you don't have to run xhost and set the DISPLAY environment variable.

Here is an example how to make use of the "X11 forward" feature of ssh. Simply run the following command from your local desktop:

$ ssh -X oracle@oracle_remote_server_name

Now when you try to run any GUI tool on the remote server, it will automatically be relinked to your local desktop.

If this is not working, verify that the ForwardX11 setting is not set to "no" in /etc/ssh/ssh_config on the remote server:

su - root

# grep ForwardX11 /etc/ssh/ssh_config | grep -v "^#"

ForwardX11 yes

#

If you are using telnet, however, you will have to set DISPLAY manually, see my other article Starting runInstaller for more information.

#==============================================================================

#运行OUI的一些准备工作:

#------------------------------------------------------------------------------

#开始安装:

以oracle用户登录系统,进入Xwindow,打开一个图形终端窗口,进入Oracle安装目录,执行runInstaller。

$ ./runInstaller

可以在安装过程中记录响应文件,以后可以自动安装Oracle。

$ ./runInstaller -record -destinationFile ~oracle/recorded_10201_20070704.rsp

如果有Respone文件的话,可以进行自动安装。自动安装不需要XWindow,在字符界面下就可以完成。全程无需人为干预。

$ ./runInstaller -silent -responseFile ~oracle/recorded_10201_20070704.rsp

过一会儿就会出现Oracle的安装界面

参考资料:

可以使用./runInstaller -help察看安装选项,常用的主要有:

./runInstaller -help

-ignoreSysPrereqs

不让Oracle执行检查OS版本的工作。

[Certified Versions]

Linux=redhat-3,SuSE-9,redhat-4,UnitedLinux-1.0,asianux-1,asianux-2

如果你的Linux OS不是这些的话就要用到这个参数。

#------------------------------------------------------------------------------

参考资料:纪录Oracle的安装过程,为以后的自动安装做准备:

Oracle Universal Installer 拥有很多自动化过程中可以利用的特性。

它采用一个基于 XML 的中央信息库,允许第三方应用程序识别安装了那些产品。

除了简单安装之外,它还允许将现有 Oracle 主目录复制到新的位置。

有关该产品的更多信息,请参见 Oracle Universal Installer 概念指南。

Oracle 关于软件安装和配置甚至数据库本身的自动化解决方案涉及到一个响应文件的使用。

该文件的用途与 Red Hat 的 kickstart 文件相似。用户不是对交互式对话所提出的问题进行

交互式回答,而是将回答存储在一个文本文件中,随后 Oracle Universal Installer (OUI)

在运行安装程序时使用该文件。这样的安装称为“静默安装”。

OUI 用于安装各种应用程序,因此响应文件不限于安装数据库。

可以通过在记录模式中运行软件或通过手动编辑示例响应文件来创建响应文件。以下是一个基本演示:

用此命令启动 OUI 来创建响应文件:

./runInstaller -record -destinationFile ~oracle/recorded.rsp

选择您需要的所有部分(源目标目录、主目录、主目录名、产品)。

当您看到 Summary 屏幕时,不要单击 Install,而是单击 Cancel。

仔细查看在 tmp/recorded.rsp 中创建的结果响应文件。如果需要,可以手动编辑该文件,

只要您遵守使用规定的格式即可(请参见文档)。

现在如下执行静默安装:

./runInstaller -silent -responseFile /tmp/recorded.rsp

在运行脚本时将会报告安装的进度。

如果您由于响应文件中的条目不正确而遇到安装故障,安装将失败并显示一条诊断消息。

详细信息可在 oraInventory/logs 目录中找到。在每次使用响应文件运行 OUI 时,会

创建具有 installActions-.log 和 silentInstall.log 格式名称的日志。

#------------------------------------------------------------------------------

#关于安装时使用的语言环境

关于安装时的字符集。为方便统一名称,我选择了英文的安装方式。如果把Linux的语言

环境设置为LANG=zh_CN.UTF-8,则Oracle会以中文模式启动OUI。如果设置为LANG=en_US,

则以英文方式安装。

你可以设置Linux使用英文显示或者中文(注意是UTF8)显示。

vi /etc/sysconfig/i18n

LANG="en_US"

#LANG="zh_CN.UTF-8"

SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en"

SYSFONT="latarcyrheb-sun16"

关于OUI乱码的问题:如果设置成上面两种语言不会出现乱码。

#------------------------------------------------------------------------------

#检查以前是否安装了Oracle。

如果以前安装过Oracle而没有删除干净的话,会给后续的安装工作带来很大的麻烦,

甚至安装好的Oracle无法正常启动。因此在安装Oracle之前一定要确认相关的Oracle

程序和数据文件等是否删除干净或者迁移到别的地方。

参考资料:

如何完全删除Oracle for Linux

1.用oracle用户登录

如果要再次安装, 最好先做一些备份工作。

包括用户的登录脚本,数据库自动启动关闭的脚本,和Listener自动启动的脚本。

要是有可能连创建数据库的脚本也保存下来

2.使用SQL*PLUS停止数据库

$ sqlplus / as sysdba

SQL> shutdown immediate

SQL> exit

3.停止Listener

$ lsnrctl stop

4.停止HTTP服务(如果有的话)

$ $ORACLE_HOME/Apache/Apache/bin/apachectl stop

5.停止DB Console

$ emctl stop dbconsole

6.停止isqlplus

$ isqlplusctl stop

7.用su或者重新登录到root(如想重新安装可以保留oracle用户,省得输入环境变量了)

8.将安装目录删除

cd ~oracle

# rm -rf product

# rm -rf oraInventory

9.将/usr/bin下的文件删除

# cd /usr/bin

# rm /usr/bin/dbhome

# rm /usr/bin/oraenv

# rm /usr/bin/coraenv

10.将/etc/oratab删除

# rm /etc/oratab

11.将/etc/oraInst.loc删除

# rm /etc/oraInst.loc

12.将oracle用户和组删除删除(若要重新安装,可以不删除)

# userdel oracle

# groupdel oracle

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值