[原创]Install Oracle 10GR2 10.2.0.3 in RedHat Enterprise Linux 4 Update 5

写这个题目的人很多,包括现在OTN上面也有很多的文章(所谓官方的)。我这个版本是在这些版本的基础上结合了实际的工作需要写成的,并且应用于一些网站的后台DB上,具有实际的部署意义。

在Linux下面安装Oracle是实际运用得最广泛的。但是真正能够理解安装过程的人很少,往往都是不理解原理导致出错后不知道该怎么办。因此建议在安装使用前先仔细的阅读Oracle的2本SG:

D46590GC11 - Oracle Database 10g - Managing Oracle on Linux for DBAs

D46592GC11 - Oracle Database 10g - Managing Oracle on Linux for System Administrators

里面介绍了很多的细节问题。

现在就开始了。。。。。。


#===============================================================================
#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/software/products/database/oracle10g/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") 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 hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536EOF

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


For RHEL4, use the following:

cat >> /etc/profile if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022fiEOF

cat >> /etc/csh.login 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

#==============================================================================
#开始安装 Oracle 10g R2

注意!Oracle 10gR2和10gR1的安装过程不太一样。目前网上很多的安装文档都是针对10gR1的,
包括Oracle OTN官方的一些文档。本文是针对10gR2的安装。因此可能和其它文档有不同之处。


Oracle Universal Installer Welcome 窗口出现。 选择Advanced Installation,选择Next 开始安装您的软件

在 UNIX 和 Linux 安装时,Specify Inventory directory and credentials 窗口出现。
输入安装 Oracle 软件的完整目录或接受缺省值。 输入操作系统组名称,此组具有目录写权限。单击 Next。单击 OK。

这个Inventory目录和里面的文件是做什么用的呢?它存放了在安装过程中的日志和的Oracle软件组件的情况。
以后OUI需要利用这些文件进行其它安装,打补丁(Patch Set)和进行文件维护之用。所以千万不要删除或修改。


Select Installation Type 页面出现。 选择企业版。单击 Next。

产品语言在缺省English的基础上加入简体中文。

Specify Home Details

Name:OraDb10g_home1
Path:/data/oracle/product/10.2.0/db_1


Product-Specific PreRequisite Checks

Installer 将确认您的系统符合安装和配置所选产品的最低需求。 在继续前纠正并报告问题。如果一切通过,单击 Next。

- Product-specific Prerequisite Checks:
Verify that all checks have been passed.
Make sure that the status of each Check is set to "Succeeded".
On RHEL AS 4 ignore the warnings for binutils, gcc, and openmotif and proceed.
If a check failed, see Oracle10g Installation Errors on Linux.
Note that the "Retry" button doesn't work after you fixed one of the failed checks.
Click Next


Select Configuration Options 页面出现。

因为安装完Oracle需要安装Oracle的Patch Set,因此选择Install Database Software Only。数据库以后使用DBCA创建。


Privileged OS Groups:保持缺省的

OSDBA Group:oracle
OSOPER Group:oracle

出现Summary窗口,选择Install。开始安装Oracle。

以root身份运行如下配置脚本

注意:如果自动安装Oracle,自动安装脚本说也要运行'/data/oracle/product/10.2.0/db_1/root.sh'这个脚本,
但是实际发现应该是已经运行过这个脚本了。

但是必须运行'/data/oracle/oraInventory/orainstRoot.sh'这个脚本!否则无法安装Patch Set!


WARNING:A new inventory has been created in this session. However, it has not yet been
registered as the central inventory of this system.To register the new inventory please
run the script '/data/oracle/oraInventory/orainstRoot.sh' with root privileges.

If you do not register the inventory, you may not be able to update or patch the products you installed.

The following configuration scripts
/data/oracle/product/10.2.0/db_1/root.sh
need to be executed as root for configuring the system.
If you skip the execution of the configuration tools,
the configuration will not be complete and the product wont function properly.
In order to get the product to function properly,
you will be required to execute the scripts and the configuration tools after exiting the OUI.



/data/oracle/oraInventory/orainstRoot.sh

/data/oracle/product/10.2.0/db_1/root.sh


#/data/oracle/oraInventory/orainstRoot.sh

Changing permissions of /data/oracle/oraInventory to 770.
Changing groupname of /data/oracle/oraInventory to oracle.
The execution of the script is complete


#/data/oracle/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= /data/oracle/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.


运行完毕后选择OK!


出现End of Installation


并提示如下信息:

The following J2EE Applications have been deployed and are accessible at the URLs listed below.

iSQL*Plus URL:
http://RHEL-45:5560/isqlplus

iSQL*Plus DBA URL:
http://RHEL-45:5560/isqlplus/dba

选择Exit退出安装。

#==============================================================================
#安装完后,安装Oracle Patch Set 10.2.0.3

Oracle 10gR2目前最新的Patch Set为Patch Set 2,这个Patch Set需要在Oracle的MetaLink下载。
而MetaLink是需要用户名和密码的,只有购买了正式版的Oracle才能得到这个用户名和密码。

安装完Patch Set后Oracle版本号变为:10.2.0.3

进入安装目录运行:

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


进入Welcome界面,选择Next


进入Specify Home Details


注意这里一定要选择已经安装好的Oracle的Name和Patch,而不是缺省的。

Name:OraDb10g_home1
Path:/data/oracle/product/10.2.0/db_1

进入Summary界面,选择Install。开始安装。


以root身份运行脚本:

/data/oracle/oracle/product/10.2.0/db_1/root.sh


注意,由于安装Oracle的时候已经运行过root.sh了。因此会提示是否覆盖原有文件,选择Yes覆盖即可。

# /data/oracle/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= /data/oracle/oracle/product/10.2.0/db_1

Enter the full pathname of the local bin directory: [/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.


运行完毕后选OK推出。


选择Exit推出安装程序。


Patch Set安装完毕。

#==============================================================================
#执行dbca 创建oracle数据库


dbca

进入欢迎界面,选择Next


选择:Create a Database

选择数据库的类型General Purpose、 Transaction Processing 或 Data Warehouse。
一般选择General Purpose即可,如果你想调整具体的各项参数,可以选择Custom。
建议选择Custom。因为一些参数只有在选择Custom安装时才允许你修改。单击 Next。

Specify Database Configuration Options 页面出现。
在 Database Naming 部分输入 Global Database Name 和 SID。 都为orcl。要和你在ORACLE_SID一致。

Select Database Management Option 页面出现。
选择 Use Database Control for Database Management。单击 Next。


Specify Database Schema Passwords 页面出现。
选择 Use the same passwords for all accounts,并输入密码。单击 Next。

Specify Database File Storage Option 页面出现。
选择适合您的环境的 File System、Automatic Storage Management 或Raw Devices 。
我们选择File System。
单击 Next。


Specify locations for the DB file to create页面出现。选择缺省"Use DB files locations for Template"。

注意:如果你想支持redo log和控制文件的多元化,就要使用Oracle-Managed Files(OMF)。Oracle 推荐使用OMF。具体的原因就不介绍了。


Specify Flash Recovery Area,选取缺省值。

对于重要的生产数据库一定要选中"Enable Archiving"。这样才能使用RMAN进行在线备份工作。
同时要配置Archiving的参数,如果不配置的话,Archiving Log会存放到给Flash Recovery Area保留的磁盘空间中。
需要单独为Archiving配置磁盘空间!

cd ~oracle

mkdir Archiving_Log

配置Archiving Log Destinations为:

/data/oracle/Archiving_Log

选择Next。


DataBase Content界面的DataBase Components选择DB支持的功能。除了Enterprise Manager Repositort以外,一般这些功能都用不上。
对于小型DB你可以保持缺省选项即可。

选择Next

进入配置初始化参数界面。这些参数在以后都可以修改,但要注意如下几点:

在内存选项中,选择Typical。如果服务器专门用于Oracle数据库,百分比可以选择到80%。

在Sizing选项中,Block Size缺省为8K,对于OLAP可以选择的大一些,对于OLTP可以选择的小一些,但是Oracle推荐不要小于2K。
具体的选择要看实际的应用了。对于一般的应用选择默认即可。注意:这个值以后就不能修改了,要修改必须删除DB重新创建。
还要注意,一个DataFile在Block Size为8K时才能达到最大32GB。如果Block Size为4K,最大单个DataFile就是16GB。

Process缺省150个,对于专用服务器模式可以保持缺省值。以后可以修改。


在字符集选项中,如果你运行的Linux环境是英文或者UTF8的中文环境的话,需要手工选择ZHS16GBK为字符集。这也是一般情况。具体的要看你的应用。
今后的趋势应该是统一到UTF8甚至UTF16/UTF32。

国家字符集保持缺省的AL16UTF16即可。关于国家字符集和字符集的区别,大家可以看看文档或者去培训一下Oracle的课程。

缺省语言和缺省日期格式使用:American和United States。

注意:这些参数关系到今后的EXP/IMP和EM显示等问题,并且和OS的语言环境密切相关,因此请大家仔细的学习。

在连接模式选项中,选择专用服务器模式。关于专用服务器模式和共享服务器模式的选择原则。我结合Oracle的课程和文档总结如下:

如果你资金雄厚,尽量使用专用服务器模式

如果你没有充足的资金去购买高内存和多CPU的服务器,又要有大量的用户连接,选择共享服务器模式。

如果用户进程占用比较大的内存,使用专用服务器模式。Oracle的建议是如果用户进程占用的用户数据达到16K以上就要使用专用服务器模式。

在此我们选用专用服务器模式。

注意:对于初始化参数的调整是Oracle调优的很关键的因素,因此要好好学习!


选择Next。


出现Database Storage屏幕:

在这里你可以修改Oracle的各种文件的数量和存放位置。一般使用缺省值即可。对于大型的DB你可能要考虑的因素如下:

控制文件的数量和存放位置:控制文件很小,但是对于Oracle很重要,因此尽量把控制文件放在不同的磁盘上保存。

最大数据文件,最大redo log文件和最大redo log组成员的数量。对于大型DB可能缺省值是不够的。

表空间和数据文件的大小等参数,根据你的要求修改即可。

Redo Log Groups:一般采用缺省即可。具体的配置根据很多的因素有不同的配制方法,这里不详细介绍了。

选择Next


选择数据库创建选项窗口出现:

选择创建数据库即可。


选择Finish。


出现确认对话框,选择OK!

开始创建数据库。


创建数据库完毕后,Exit退出DBCA。


生成的数据库创建脚本放在:/data/oracle/admin/orcl/scripts,你可以看看,我在Oracle培训的时候
就是不用DBCA生成DB,而是生成创建DB的Scripts,然后再在命令行窗口里面创建DB。

#==============================================================================
#在profile里面打开ORACLE_HOME环境变量


export ORACLE_HOME=$ORACLE_BASE/product/10.2.0


Updates after Running Oracle Universal Installer

After Oracle10g has been installed, make sure that ORACLE_HOME, PATH, and LD_LIBRARY_PATH are set for the oracle account.

Note that the path for ORACLE_HOME might be different on your system!
Also note that LD_LIBRARY_PATH is needed for some Oracle binaries such as sysresv!

For 10g R2 (10.2.0.1.0) I added the following lines to the ~oracle/.bash_profile file:

export ORACLE_HOME=$ORACLE_BASE/oracle/product/10.2.0/db_1
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib

After that run the following command to set all environment variables in ~oracle/.bash_profile:
$ . ~oracle/.bash_profile
This commmand will add the environment variables to the ~oracle/.profile and source in the file for the current shell by
executing ". ~oracle/.bash_profile".

NOTE: Do not add a trailing "/" on the ORACLE_HOME environment variable.
Otherwise you will get the error "ORACLE not available" when you try to connect to sys, see Oracle10g/Linux Errors and Problems for more information.


#==============================================================================
#执行netca 创建Oracle Listener

Oracle 10gR2 支持动态注册Listener。PMON进程会自动的把新的Oracle Server注册进Listener,而不必执行NETCA。
当然了你也可以执行NETCA进行静态注册。

只需要启动listener服务即可。


[oracle@RHEL-45 bin]$ lsnrctl start

LSNRCTL for Linux: Version 10.2.0.3.0 - Production on 04-JUL-2007 14:58:26

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

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

TNSLSNR for Linux: Version 10.2.0.3.0 - Production
Log messages written to /data/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=RHEL-45)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.3.0 - Production
Start Date 04-JUL-2007 14:58:26
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /data/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=RHEL-45)(PORT=1521)))
The listener supports no services
The command completed successfully


[oracle@RHEL-45 bin]$ lsnrctl status

LSNRCTL for Linux: Version 10.2.0.3.0 - Production on 04-JUL-2007 14:58:44

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.3.0 - Production
Start Date 04-JUL-2007 14:58:26
Uptime 0 days 0 hr. 0 min. 17 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /data/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=RHEL-45)(PORT=1521)))
Services Summary...
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orcl_XPT" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@RHEL-45 bin]$ pstree


你会发现orcl这个实例已经被listener监听了。

Instance "orcl", status READY, has 1 handler(s) for this service...


测试一下连接

[oracle@RHEL-45 bin]$ ./sqlplus sys/system as sysdba

SQL*Plus: Release 10.2.0.3.0 - Production on Wed Jul 4 15:02:35 2007

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> show parameter

如果能显示出来初始化参数即可。


#------------------------------------------------------------------------------
#手工配置静态listener

cd $ORACHE_HOME/bin

./netca

从略了。。。。。


#==============================================================================
#启动和维护DBConsole和iSQL*Plus

安装完成后,可以通过访问http://ADA:1158/em来使用EM,可以通过访问http://ADA:5560/isqlplus来使用isqlplus,
还可以通过访问http://ADA:5560/isqlplus/dba来使用DBA工具。那么可以执行如下命令:

查询状态
$ emctl status dbconsole

启动程序
$ emctl start dbconsole

停止程序
$ emctl stop dbconsole

只有这个“监听”启动了,我们才可以顺利地访问http://ADA:1158/em这个东东。


启动isqlplus
$ isqlplusctl start

停止isqlplus
$ isqlplusctl stop

同理,只有这个“监听”起来了,我们才可以顺利地访问http://ADA:5560/isqlplushttp://ADA:5560/isqlplus/dba的。


#------------------------------------------------------------------------------
#启动EM DBConsole

[oracle@RHEL-45 ~]$ emctl start dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.3.0
Copyright (c) 1996, 2006 Oracle Corporation. All rights reserved.
http://RHEL-45:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control ....................... started.
------------------------------------------------------------------
Logs are generated in directory /data/oracle/product/10.2.0/db_1/RHEL-45_orcl/sysman/log


#------------------------------------------------------------------------------
#启动iSQL*Plus

[oracle@RHEL-45 ~]$ isqlplusctl start
iSQL*Plus 10.2.0.3.0
Copyright (c) 2003, 2006, Oracle. All Rights Reserved.
Starting iSQL*Plus ...
iSQL*Plus started.


#==============================================================================
#数据库维护的操作。


使用SQLPlus启动数据库:

[oracle@RHEL-45 bin]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.3.0 - Production on Wed Jul 4 15:22:37 2007

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 1241513984 bytes
Fixed Size 1261516 bytes
Variable Size 318767156 bytes
Database Buffers 905969664 bytes
Redo Buffers 15515648 bytes
Database mounted.
Database opened.

SQL> show instance;
instance "local"
SQL>


使用SQLPlus停止数据库:


SQL> shutdown immediate;

Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> quit


#------------------------------------------------------------------------------
#Oracle 10gR2提供一个简单的启动/关闭Oracle实例的脚本。

在使用这个脚本前需要修改/etc/oratab,把那一行最后的N改成Y。
改成Y的目的是可以使用dbstart/dbshut脚本启动/关闭数据库。

# This file is used by ORACLE utilities. It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.

# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME::
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
orcl:/data/oracle/product/10.2.0/db_1:Y

这时候使用dbstart $ORACLE_HOME可以自动的启动Listener和DB。

[oracle@RHEL-45 ~]$ dbstart
ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener
Usage: /data/oracle/product/10.2.0/db_1/bin/dbstart ORACLE_HOME
Processing Database instance "orcl": log file /data/oracle/product/10.2.0/db_1/startup.log

注意:dbstart/dbshut 命令后面要添加一个ORACLE_HOME_LISTNER参数,否则Listener无法自动启动/关闭。


[oracle@RHEL-45 ~]$ dbstart $ORACLE_HOME
Processing Database instance "orcl": log file /data/oracle/product/10.2.0/db_1/startup.log

[oracle@RHEL-45 ~]$ dbshut $ORACLE_HOME
Processing Database instance "orcl": log file /data/oracle/product/10.2.0/db_1/shutdown.log


#==============================================================================
#Oracle 开机自动运行。


注意!安装完Oracle后不要轻易的修改主机名和IP地址。如果修改了,需要重新运行netca来reconfigure Listener!!!

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

数据库创建完成后,修改/etc/oratab,把那一行最后的N改成Y。
改成Y的目的是可以使用dbstart/dbshut脚本启动/关闭数据库。

# This file is used by ORACLE utilities. It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.

# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME::
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
orcl:/data/oracle/product/10.2.0/db_1:Y

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

vi /etc/rc.d/rc.local

添加:


su - oracle -c "/data/oracle/product/10.2.0/db_1/bin/dbstart $ORACLE_HOME"


注意:如果你没有在oracle用户的.bash_profile里面设置$ORACLE_HOME环境变量的话,就要这么写了:

su - oracle -c "/data/oracle/product/10.2.0/db_1/bin/dbstart /data/oracle/product/10.2.0/db_1"

#==============================================================================
#关于表空间和数据文件的大小


Internally, the data object number needs 32 bits, the relative file number needs 10 bits,the block number needs 22 bits,
and the row number needs 16 bits, adding up to a total of 80 bits or 10 bytes.

ROWID is displayed using a base-64 encoding scheme, which uses six positions for the data object number,
three positions for the relative file number, six positions for the block number, and three positions for the row number.

这就是说,每个数据库最多有1024-2=1022个文件(2个文件预留),每个文件最多有4M个 块,如果用默认的oracle block,即8192byte,
那么每个datafile最大为:4M×8K=32GB;所以,每个表空间最大就是32GB×1022=32704GB=32TB。


#==============================================================================
#关于Response文件的例子:

   这一步骤是字符界面装oracle的关键步骤
   到oracle 10g的安装目录下编辑response文件
   $cd /home/share/Oracle/Oracle10g_64bit/database/response/
   可以看到oracle准备了6个response文件,实际上这些文件就是用来安装和配置oracle时的模板,
分别是 custom.rsp dbca.rsp emca.rsp enterprise.rsp netca.rsp standard.rsp在这里挑了一个简
单的response文件 enterprise.rsp,也可以根据实际情况去选用编辑其他几个response文件。

$cp custom.rsp myinst.rsp
   $vi myinst.rsp

修改几个地方,有几个不会改的.

#==============================================================================
#End。
#==============================================================================

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8295/viewspace-195717/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/8295/viewspace-195717/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值