Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2416544
  • 博文数量: 384
  • 博客积分: 10193
  • 博客等级: 上将
  • 技术积分: 3785
  • 用 户 组: 普通用户
  • 注册时间: 2005-06-09 18:02
文章分类

全部博文(384)

文章存档

2011年(10)

2010年(29)

2009年(39)

2008年(36)

2007年(43)

2006年(198)

2005年(29)

分类: Oracle

2006-07-16 12:39:04

在CentOS4.3(x86_64)上安装Oracle9204 for linux(x86_64)

Author:        blue_stone@CU
E-mail:        blue_stone@xinhuanet.com

Host OS:     Debian Gnu/Linux sid(32bit)
Host CPU:     AMD Athlon(tm) 64 Processor 3000+
VMWare:        VMWare Server 1.0.0 build-28343
Guest OS:    CentOS4.3(x86_64)
Oracle:        Oracle9204 for linux(x86_64)

建立虚拟机的过程选择"Custom"方式创建, Guest OS选择"Red Hat Enterprise Linux 4 64-bit", 名称选centos, 内存设置为520m, 虚拟机磁盘大小为8G, 不选择" Allocate all disk space now", 将光驱设置为下载到的镜像文件CentOS-4.3-x86_64-binDVD/CentOS-4.3-x86_64-binDVD.iso, 启动虚拟机. 开始Linux安装过程.

安装类型选择Custom方式进行安装, 设置主机名称为centos.blueice.com ip 10.1.0.35/24 gw:10.1.0.1 dns:202.106.0.20
不设置防火墙, 禁止使用SELinux. 语言选择中增加中文支持.  时区选择Asia/Shanghai. Package Group中增加选择了Development中的6个软件包组.

安装完成后, 为虚拟机增加一块8G的虚拟硬盘, 建立一个分区, 格式化为ext3, 挂载在/u01上.

[root@centos ~]# fdisk -l

Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        1044     8281507+  8e  Linux LVM

Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table
[root@centos ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 1044.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4):
Value out of range.
Partition number (1-4): 1
First cylinder (1-1044, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1044, default 1044):
Using default value 1044

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@centos ~]# mkdir /u01
[root@centos ~]# mkfs.ext3 /dev/sdb1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1048576 inodes, 2096474 blocks
104823 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2147483648
64 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@centos ~]# vi /etc/fstab
[root@centos ~]# more /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /dev/shm                tmpfs   defaults        0 0
none                    /proc                   proc    defaults        0 0
none                    /sys                    sysfs   defaults        0 0
/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0
/dev/hdc                /media/cdrom            auto    pamconsole,exec,noauto,managed 0 0
/dev/fd0                /media/floppy           auto    pamconsole,exec,noauto,managed 0 0
/dev/sdb1               /u01                    ext3    defaults        1 1

检查内存, 要求大于512m

[root@centos ~]# grep MemTotal /proc/meminfo
MemTotal:       517008 kB

检查swap空间, 要求大于1G

[root@centos ~]#  grep SwapTotal /proc/meminfo
SwapTotal:     1048568 kB

检查剩余磁盘空间, /tmp要求大于400m, 安装oracle分区空间不小于3G

[root@centos ~]# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       7063480   4397660   2307012  66% /
/dev/sda1               101086     10182     85685  11% /boot
none                    258504         0    258504   0% /dev/shm
/dev/sdb1              8254240     51228   7783720   1% /u01

检查cpu是否支持x86_64.

[root@centos ~]# grep "model name" /proc/cpuinfo
model name      : AMD Athlon(tm) 64 Processor 3000+

检查需要的软件包, 由于安装中我们选择了Development中的6个包组, 所以不需要安装额外的包, 关于软件包的具体需求, 请参考后面参考资料部分. 下面是软件包的检查过程.

[root@rhel4 ~]# rpm -qa |grep glibc
glibc-devel-2.3.4-2.19
glibc-kernheaders-2.4-9.1.98.EL
compat-glibc-headers-2.3.2-95.30
glibc-2.3.4-2.19
glibc-headers-2.3.4-2.19
compat-glibc-2.3.2-95.30
glibc-2.3.4-2.19
glibc-devel-2.3.4-2.19
glibc-common-2.3.4-2.19
[root@rhel4 ~]# rpm -qa |grep gcc
libgcc-3.4.5-2
compat-gcc-32-3.2.3-47.3
gcc-c++-3.4.5-2
compat-gcc-32-c++-3.2.3-47.3
libgcc-3.4.5-2
gcc-g77-3.4.5-2
gcc-java-3.4.5-2
compat-libgcc-296-2.96-132.7.2
gcc-3.4.5-2
[root@rhel4 ~]# rpm -qa |grep libstdc++
compat-libstdc++-296-2.96-132.7.2
compat-libstdc++-33-3.2.3-47.3
libstdc++-3.4.5-2
libstdc++-devel-3.4.5-2
libstdc++-3.4.5-2
compat-libstdc++-33-3.2.3-47.3
[root@rhel4 ~]# rpm -qa |grep make
automake16-1.6.3-5
automake17-1.7.9-5
automake14-1.4p6-12
automake-1.9.2-3
make-3.80-5
automake15-1.5-13
[root@rhel4 ~]# rpm -qa |grep gnome-libs
gnome-libs-1.4.1.2.90-44.1
[root@rhel4 ~]# rpm -qa |grep ORBit
ORBit2-2.12.0-3
ORBit2-2.12.0-3
ORBit-0.5.17-14
ORBit2-devel-2.12.0-3
[root@rhel4 ~]# rpm -qa |grep audiofile

audiofile-0.2.6-1
audiofile-0.2.6-1
audiofile-devel-0.2.6-1
[root@rhel4 ~]#
[root@rhel4 ~]# rpm -qa |grep esound
esound-0.2.35-2
esound-0.2.35-2
esound-devel-0.2.35-2
[root@rhel4 ~]# rpm -qa |grep gtk+
gtk+-1.2.10-33.centos4
gtk+-1.2.10-33
[root@rhel4 ~]# rpm -qa |grep imlib
imlib-1.9.13-23
imlib-1.9.13-23
[root@rhel4 ~]# rpm -qa |grep libpng
libpng-1.2.7-1.el4.2
libpng10-1.0.16-1
libpng-1.2.7-1.el4.2
libpng-devel-1.2.7-1.el4.2
libpng10-devel-1.0.16-1
libpng10-1.0.16-1
[root@rhel4 ~]# rpm -qa |grep libungif
libungif-4.1.3-1.el4.2
libungif-devel-4.1.3-1.el4.2
libungif-4.1.3-1.el4.2
[root@rhel4 ~]# rpm -qa |grep tcp_wra
tcp_wrappers-7.6-37.2
tcp_wrappers-7.6-37.2
[root@rhel4 ~]# rpm -qa |grep setarch
setarch-1.6-1
[root@rhel4 ~]# rpm -qa |grep libaio
libaio-0.3.105-2

设置编译器, oracle需要使用gcc3.2

[root@centos ~]# cd /usr/bin
[root@centos bin]# ls -al |grep gcc
lrwxrwxrwx   1 root root          3 Jul 16 11:06 cc -> gcc
-rwxr-xr-x   2 root root     100064 Mar  9 05:18 gcc
-rwxr-xr-x   2 root root      90824 Feb 18  2005 gcc32
-rwxr-xr-x   2 root root     100064 Mar  9 05:18 x86_64-redhat-linux-gcc
-rwxr-xr-x   2 root root      90824 Feb 18  2005 x86_64-redhat-linux-gcc32
[root@centos bin]# mv gcc gcc.old
[root@centos bin]# ln -s gcc32 gcc
[root@centos bin]# gcc -v
Reading specs from /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --enable-languages=c,c++ --disable-libgcj --host=x86_64-redhat-linux
Thread model: posix
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-47.3)
[root@centos bin]# mv g++ g++.old
[root@centos bin]# ln -s g++32 g++
[root@centos bin]# g++ -v
Reading specs from /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --enable-languages=c,c++ --disable-libgcj --host=x86_64-redhat-linux
Thread model: posix
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-47.3)

设置系统变量, 在/etc/sysctl.conf中添加如下内容, 并运行sysctl -p

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

在/etc/security/limits.conf中添加如下内容

*               soft     nproc     2047
*               hard     nproc     16384
*               soft     nofile    1024
*               hard     nofile    65536

在/etc/pam.d/login中添加如下内容

session     required     /lib/security/pam_limits.so

建立Oracle用户.

[root@centos ~]# groupadd oinstall
[root@centos ~]# groupadd dba
[root@centos ~]# useradd oracle -g oinstall -G dba,oinstall
[root@centos ~]# id oracle
uid=500(oracle) gid=501(oinstall) groups=501(oinstall),502(dba)
[root@centos ~]# 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.

设置oracle用户环境变量文件~/.bash_profile, 增加如下内容

if [ $USER = "oracle" ]; then
          if [ $SHELL = "/bin/ksh" ]; then
                ulimit -p 16384
                ulimit -n 65536
          else
                ulimit -u 16384 -n 65536
          fi
fi
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/9.2.0
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin
export LD_ASSUME_KERNEL=2.4.19

建立oracle安装目录

[root@centos ~]# mkdir -p /u01/app/oracle
[root@centos ~]# chown -R oracle:oinstall /u01/app/oracle

以图形用户界面登入操作系统, 开始Oracle安装.

选择产品时, 增加了对简体中文的支持.
安装时选择以后创建数据库.
安装完毕后发现没有企业管理器, 秀一下安装完毕后的sqlplus

[oracle@centos ~]$ sqlplus /nolog

SQL*Plus: Release 9.2.0.4.0 - Production on Sun Jul 16 12:28:24 2006

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

SQL> conn / as sysdba
Connected.
SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
PL/SQL Release 9.2.0.4.0 - Production
CORE    9.2.0.3.0       Production
TNS for Linux: Version 9.2.0.4.0 - Production
NLSRTL Version 9.2.0.4.0 - Production

SQL> col parameter for a40
SQL> col value for a20
SQL> select * from v$option;

PARAMETER                                VALUE
---------------------------------------- --------------------
Partitioning                             TRUE
Objects                                  TRUE
Real Application Clusters                FALSE
Advanced replication                     TRUE
Bit-mapped indexes                       TRUE
Connection multiplexing                  TRUE
Connection pooling                       TRUE
Database queuing                         TRUE
Incremental backup and recovery          TRUE
Instead-of triggers                      TRUE
Parallel backup and recovery             TRUE

PARAMETER                                VALUE
---------------------------------------- --------------------
Parallel execution                       TRUE
Parallel load                            TRUE
Point-in-time tablespace recovery        TRUE
Fine-grained access control              TRUE
Proxy authentication/authorization       TRUE
Change Data Capture                      TRUE
Plan Stability                           TRUE
Online Index Build                       TRUE
Coalesce Index                           TRUE
Managed Standby                          TRUE
Materialized view rewrite                TRUE

PARAMETER                                VALUE
---------------------------------------- --------------------
Materialized view warehouse refresh      TRUE
Database resource manager                TRUE
Spatial                                  TRUE
Visual Information Retrieval             TRUE
Export transportable tablespaces         TRUE
Transparent Application Failover         TRUE
Fast-Start Fault Recovery                TRUE
Sample Scan                              TRUE
Duplexed backups                         TRUE
Java                                     TRUE
OLAP Window Functions                    TRUE

PARAMETER                                VALUE
---------------------------------------- --------------------
Block Media Recovery                     TRUE
Fine-grained Auditing                    TRUE
Application Role                         TRUE
Enterprise User Security                 TRUE
Oracle Data Guard                        TRUE
Oracle Label Security                    FALSE
OLAP                                     TRUE
Heap segment compression                 TRUE
Join index                               TRUE
Trial Recovery                           TRUE
Oracle Data Mining                       TRUE

PARAMETER                                VALUE
---------------------------------------- --------------------
Online Redefinition                      TRUE
Streams                                  TRUE
File Mapping                             TRUE

47 rows selected.

SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production


阅读(3044) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~