目錄
reference: http://www.oracle.com/technology/pub/articles/smiley_10gdb_install.html
To make these changes, cut and paste the following commands as root:
過程 83.1. Configure linux step by step
Verifying Your Installation
rpm -q binutils compat-db control-center gcc gcc-c++ glibc glibc-common \ gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio openmotif21
installing package
yum install compat-gcc-32 compat-gcc-32-c++ compat-gcc-32-g77 compat-libf2c-32 compat-libstdc++-296 compat-libstdc++-33 compat-db compat-readline43
Verifying System Requirements
grep MemTotal /proc/meminfo grep SwapTotal /proc/meminfo
Swap = mem * 2
Create the Oracle Groups and User Account
groupadd oinstall groupadd dba useradd -m -g oinstall -G dba oracle passwd oracle id oracle
Create Directories
mkdir -p /u01/app/oracle chown -R oracle:oinstall /u01/app/oracle chmod -R 775 /u01/app/oracle
Configuring the Linux Kernel Parameters
cat >> /etc/sysctl.conf <<EOF kernel.shmall = 2097152 kernel.shmmax = 536870912 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.file-max = 65536 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 EOF /sbin/sysctl -p
Run the following commands as root to verify your settings:
/sbin/sysctl -a | grep shm /sbin/sysctl -a | grep sem /sbin/sysctl -a | grep file-max /sbin/sysctl -a | grep ip_local_port_range /sbin/sysctl -a | grep rmem_default /sbin/sysctl -a | grep rmem_max /sbin/sysctl -a | grep wmem_default /sbin/sysctl -a | grep wmem_max
Setting Shell Limits for the oracle User
cat >> /etc/security/limits.conf <<EOF oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 EOF
/etc/profile
cat >> /etc/profile <<EOF if [ \$USER = "oracle" ]; then if [ \$SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi umask 022 fi EOF cat >> /etc/csh.login <<EOF if ( \$USER == "oracle" ) then limit maxproc 16384 limit descriptors 65536 umask 022 endif EOF
.bash_profile
# su - oracle $ vim .bash_profile export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/10.2.0.1 export ORACLE_SID=orcl export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
過程 83.2. Installing Oracle
編輯 /10201_database_linux32/database/install/oraparam.ini 添加
vim 10201_database_linux32/database/install/oraparam.ini ### #[Certified Versions] Linux=redhat-3,SuSE-9,redhat-4,centos-5,UnitedLinux-1.0,asianux-1,asianux-2 [Linux-centos-5.1-optional] TEMP_SPACE=80 SWAP_SPACE=150 MIN_DISPLAY_COLORS=256
install
gunzip xxxx.cpio.gz cpio -idmv < xxxx.cpio export LANG=en_US ./runInstaller
dbstart
# su - oracle # dbstart 提示打開 /ade/vikrkuma_new/oracle/bin/tnslsnr 失敗
編輯 /u01/app/oracle/product/10.2.0.1/bin/dbstart
# Set this to bring up Oracle Net Listener ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle 應該是在78行,將其改為: # Set this to bring up Oracle Net Listener ORACLE_HOME_LISTNER=$ORACLE_HOME
/etc/oratable 將最後一行的最後一個字元由 “N” 改為 “Y”
orcl: /u01/app/oracle/product/10.2.0.1:Y
過程 83.3. Configuring Storage
Partition the Disks
fdisk -l /dev/sdb
Filesystems
ZFS or btrfs
Create the Mount Point
mkdir /u02
Add the New Filesystem to /etc/fstab
/dev/sdb1 /u02 xfs defaults 1 1
Mount the New Filesystem
mount /u02 df -h /u02
Create Oracle Directories and Set Permissions
mkdir -p /u02/oradata/demo1 chown -R oracle:oinstall /u02/oradata chmod -R 775 /u02/oradata
Create a New Tablespace in the New Filesystem
Ex: $ sqlplus SQL*Plus: Release 10.2.0.1.0 - Production on Sun Nov 27 15:50:50 2005 Copyright (c) 1982, 2005, Oracle. All rights reserved. Enter user-name: system Enter password: Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options SQL> create tablespace data1 2 datafile '/u02/oradata/demo1/data1_01.dbf' size 100m 3 extent management local 4 segment space management auto; Tablespace created. Now you can use the new tablespace to store database objects such as tables and indexes. Ex: SQL> create table demotab (id number(5) not null primary key, 2 name varchar2(50) not null, 3 amount number(9,2)) 4 tablespace data1; Table created.