ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 实习日志第27天、28天---Installation Guide

实习日志第27天、28天---Installation Guide

原创 Linux操作系统 作者:大米嗵嗵 时间:2011-03-09 08:30:59 0 删除 编辑

Overview of Oracle Database Installation

Planning Your Installation
Installing the Linux Operating System
Oracle建议在安装linux时默认安装RPM包,而不要自定义安装RPM
After installation, start system-config-packages and add all of the Legacy Software Development packages
# up2date --nox --show-channels
You should see output indicating that you have subscribed to the Oracle Software
for Enterprise Linux channel. For example:
el4_i386_latest
el4_i386_oracle

Open a terminal session as root, and install the Oracle Validated Configurations
Setup RPM with up2date, using the following command:
# up2date --install oracle-validated

Installation Considerations
You must install this product into a new Oracle home directory
Oracle Database Installation Methods
Interactive Installation Methods
Automated Installation Methods Using Response Files
Oracle Database Installation Types
■ Enterprise Edition
■ Standard Edition
■ Custom
Database Configuration Options
安装目的:一般用途/事务用途/数据仓库?
安装模式:交互/非交互?
安装时是否建库?
Database Storage Options
File System / Automatic Storage Management / Raw Devices
Installation Guide—P33页
Database Management Options
■ Use Grid Control for central database management
■ Use Database Control for local database management

Oracle Database Preinstallation Requirements
Logging In to the System as root
1.必须使用安装的目标系统的root用户登录
2.必须在X window system(图形界面)下安装  xhost +
如果是远程安装的话,$ xhost fully_qualified_remote_host_name命令启动
3.如果是远程安装的话,使用 ssh, rlogin, or telnet 命令连接到安装数据库的系统
如:$ telnet fully_qualified_remote_host_name
远程安装的具体过程:
1. Start the X server software.  $ xhost fully_qualified_remote_host_name
2. Configure the security settings of the X server software to permit remote hosts to display X applications on the local system.    $ telnet fully_qualified_remote_host_name
3. Connect to the remote system where you want to install the software and start a terminal session on that system, for example, an X terminal (xterm).
4. If you are not logged in as the root user on the remote system, then enter the following command to switch user to root:
$ sudo sh
password:
#
Checking the Hardware Requirements
Memory Requirements
■At least 1 GB of physical RAM
# grep MemTotal /proc/meminfo

 
# grep SwapTotal /proc/meminfo
?也可使用#free命令来同时查看memory和swap大小
# free

Automatic Memory Management  
如果启动自动存储管理,shared memory (/dev/shm)必须 >=  MEMORY_MAX_TARGET和
MEMORY_TARGET,否则在startup时会出现ORA-00845错误
# df -k /dev/shm/
Notes:【Automatic Memory Management (SGA and PGA)
Automatic Shared Memory Management (SGA)】
Disk Space Requirements
■ Between 150 and 200 MB of disk space in the /tmp directory
# df -k /tmp
■ Between 1.5 GB and 3.5 GB of disk space for the Oracle software, depending on the installation type
软件所需的大小
# df -k
 
■ Enterprise Edition and Standard Edition require 1.6 GB of disk space for datafiles.
However, Custom DB requires 1.81 GB.
数据文件要求的至少所需的大小。当然,如果设置flash recovery area还需额外的空间
SQL Developer的要求
 

Checking the Software Requirements
Operating System Requirements
?Asianux 2.0   红旗
?Asianux 3.0
?Oracle Enterprise Linux 4.0 
?Oracle Enterprise Linux 5.0
?Red Hat Enterprise Linux 4.0 
?Red Hat Enterprise Linux 5.0
?SUSE Enterprise Linux 10.0  德国的一个linux发行版本
查看linux版本:
# cat /proc/version
Linux version 2.6.9-78.ELsmp (brewbuilder@hs20-bc2-3.build.redhat.com) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)) #1 SMP Wed Jul 9 15:39:47 EDT 2008  (内核版本、gcc编译器版本、linux版本)
也可以使用:
#cat /etc/redhat-release
或者#cat /etc/issue     这两个准确,显示出发行版本号(Red Hat Enterprise Linux AS release 4)
# rpm -q redhat-release   同上(redhat-release-4AS-8)
Kernel Requirements
 
# uname -r
如果内核版本不满足要求,升级内核
Package Requirements
    
Linux版本不同,要求不同的最低package版本,但要求装的几种包都是相同
对linux AS4来说,需要的包最低版本如下:
binutils-2.15.92.0.2-18
compat-libstdc++-33.2.3-47.3
elfutils-libelf-0.97-5
elfutils-libelf-devel-0.97-5
glibc-2.3.9.4-2.19
glibc-common-2.3.9.4-2.19
glibc-devel-2.3.9.4-2.19
gcc-3.4.5-2
gcc-c++-3.4.5-2
libaio-devel-0.3.105-2
libaio-0.3.105-2
libgcc-3.4.5
libstdc++-3.4.5-2
libstdc++-devel-3.4.5-2
make-3.80-5
sysstat-5.0.5
unixODBC-2.2.11
unixODBC-devel-2.2.11
后两类linux版本所需要的包版本更高点,SUSE少装个gcc-c++包,具体见文档
# rpm -q package_name  查询是否安装了该包,若没有,从介质或网上下载安装
Compiler Requirements
Intel Compiler v9.1 can be used only with gcc 3.4.5 or gcc 4.0 or gcc 4.1
Additional Software Requirements  (具体根据所选的组件来安装)

Checking the Network Setup
#cat /etc/hosts
#hostname
#domainname    确保domain不是动态的,返回空结果
如果Installing on Multihomed Computers,多重地址的,设置ORACLE_HOSTNAME环境变量
 

Creating Required Operating System Groups and Users
在首次安装数据库软件时,必须创建需要的DBA组和用户

Creating the Oracle Inventory Group
1.Determining Whether the Oracle Inventory Group Exists
在装数据库时,OUI会创建一个oraInst.loc文件,里面记录了inventory的相关信息
#more /etc/oraInst.loc
inventory_loc=/u01/app/oraInventory
inst_group=oinstall  (一般是oinstall)
2.Creating the Oracle Inventory Group
如果oraInst.loc不存在,创建Oracle Inventory group
# /usr/sbin/groupadd oinstall 
或者直接  #groupadd oinstall
oraInventory目录存放内容:/u01/app/oracle/oraInventory
– A registry of the Oracle home directories (Oracle Clusterware, Oracle
Database, and Automatic Storage Management) on the system.
– Installation logs and trace files from installations of Oracle software. These
files are also copied to the respective Oracle homes for future reference.
Creating the OSDBA Group
查找所需要的DBA组是否存在
# grep OSDBA_group_name /etc/group
创建
# /usr/sbin/groupadd dba
Creating an OSOPER Group (Optional)
# /usr/sbin/groupadd oper
Creating an OSASM Group
如果想到SYSASM的权限和SYSTEM分离,创建一个OSASM组
# grep OSASM_group_name /etc/group   查找是否已存在
# /usr/sbin/groupadd asmadmin    创建
Creating the Oracle Software Owner User
Determining Whether an Oracle Software Owner User Exists
# id oracle(用户名)
Creating an Oracle Software Owner User
# /usr/sbin/useradd -g oinstall -G dba[,oper] oracle
   -g必须包括inventory group,-G必须包括OSDBA group、以及其它必要的组
# passwd oracle
Modifying an Oracle Software Owner User
# /usr/sbin/usermod -g oinstall -G dba[,oper] oracle
Verifying that the User nobody Exists
Verify that the unprivileged user nobody exists on the system. The nobody user must own the external jobs (extjob) executable after the installation.
# id nobody   
# /usr/sbin/useradd -g nobody

Configuring Kernel Parameters
查看文件参数是否大于等于下表值,但这些文件一般是只读格式的
 
也可以通过# /sbin/sysctl -a | grep ***  查看以上参数值,这个文件vi看不了
如果参数不符合要求,在/etc/sysctl.conf编辑加入下一段话:
fs.file-max = 512 * PROCESSES    (这句话会有错误?删掉试试。。。)
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
编辑完后运行一下命令使改变的参数生效:
# /sbin/sysctl –p   或 #sysctl –p

Setting Shell Limits for the oracle User
更改shell limit的目的是为了提高软件在linux系统上的性能
 
1.在/etc/security/limits.conf内加入以下参数
oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  1024
oracle              hard    nofile  65536
2. 在/etc/pam.d/login内加入以下参数:
session    required     /lib/security/pam_limits.so
session    required     pam_limits.so
3.为oracle用户的默认shell设立启动文件
在/etc/profile{(.local)-SUSE}加入以下语句:  (如果所用的shell是C shell,具体修改见文档)
if [ $USER = "oracle" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
              ulimit -p 16384
              ulimit -n 65536
        else
              ulimit -u 16384 -n 65536
        fi
fi

Identifying Required Software Directories
Oracle Base Directory
Optimal Flexible Architecture (OFA)  oracle的最佳灵活体系建议路径格式如下:
/mount_point/app/oracle_sw_owner     包括软件的目录/app/软件的拥有者
例如:/u01/app/oracle      
/u01/app/orauser
/opt/oracle/app/oracle
Oracle Inventory Directory
oraInventory用于存放系统安装的软件清单
/u01/app/oraInventory
Oracle Home Directory
oracle_base/product/11.1.0/db_1
OUI在创建时会在指定路径后自动创建这个目录并设置好相应的权限
Identifying an Existing Oracle Base Directory
■ Identifying an existing Oracle Inventory directory
# more /etc/oraInst.loc  查看Inventory directory(如果存在的话)
inventory_loc=/u01/app/oraInventory
inst_group=oinstall
■ Identifying an existing Oracle home directory
# more /etc/oratab
*:/u03/app/oracle/product/11.1.0/db_1:N
*:/opt/orauser/infra_904:N
*:/oracle/9.2.0:N
■ Identifying an existing Oracle base directory
cat inventory/ContentsXML/oraclehomeproperties.xml
oracle base目录大小3G,包括数据文件的话5.4G(这个不推荐,建议数据文件和软件分开)
# df -k oracle_base_path
创建base目录
# mkdir -p /mount_point/app
# chown -R oracle:oinstall /mount_point/app
# chmod -R 775 /mount_point/app/
(之后会在设置oracle用户环境变量的时候设置ORACLE_BASE变量)
Choosing a Storage Option for Oracle Database and Recovery Files
■ Database file directory:  
# mkdir /mount_point/oradata   (这里由于空间不足,建在/home/oradata下)
# chown oracle:oinstall /mount_point/oradata
# chmod 775 /mount_point/oradata
The default location for Database file directory is $ORACLE_BASE/oradata.
■ Recovery file directory (flash recovery area):
# mkdir /mount_point/flash_recovery_area
# chown oracle:oinstall /mount_point/flash_recovery_area
# chmod 775 /mount_point/flash_recovery_area
 
Preparing Disk Groups for an Automatic Storage Management Installation
稍后回来看
Stopping Existing Oracle Processes
假如已有oracle软件了,还想在存在着的oracle home下再装一个,这里关系到Oracle Net listener的设置。
Configuring the oracle User’s Environment
1.新开启一个端口,或者命令startx启动图形界面
2.启动图形界面# xhost +
#  xhost fully_qualified_remote_host_name
3.切换到oracle用户
  # su - oracle
4.可用$ echo $SHELL查看当前所用的shell
5. Open the oracle user’s shell startup file打开shell启动文件(因系统不同而异)
?Bash shell (bash) on SUSE:
$ vi .profile
?Bourne shell (sh), Bash shell on Red Hat (bash), or Korn shell (ksh):
$ vi .bash_profile
?C shell (csh or tcsh):
% vi .login
6.在文件中加入umask 022,(用来指定默认文件创建模式)
7.如果存在ORACLE_SID, ORACLE_HOME, or ORACLE_BASE,先移去
8.执行:$ . ./.bash_profile
9. 若在远程安装,需执行如下命令;就在本机安装的话则不用。
 
10.如果/tmp目录空间不足400MB的话,选择合适的挂载点上创建目录并改变环境变量
$ sudo mkdir。。。, $ sudo chmod。。。$ exit
$ TMP=/挂载点/tmp
$ TMPDIR=/挂载点/tmp
$ export TMP TMPDIR
11. 设置ORACLE_BASE,ORACLE_SID环境变量
$ ORACLE_BASE=/u01/app/oracle
$ ORACLE_SID=sales
$ export ORACLE_BASE ORACLE_SID
12.确保ORACLE_HOME,TNS_ADMIN没有被设置
$ unset ORACLE_HOME
$ unset TNS_ADMIN
13. 再次确定以上设置正确
$ umask           (22,022或者0022)
$ env | more

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

下一篇: 关于scn的理解
请登录后发表评论 登录
全部评论

注册时间:2010-07-31

  • 博文量
    75
  • 访问量
    134907