分类: Oracle
2014-03-18 11:11:11
下面的可以直接复制到终端中
(其中 oracle 用户的密码也是oracle)
groupadd oinstall
groupadd dba
useradd -d /home/oracle -g oinstall -G dba -s /bin/bash oracle
chown -R oracle:dba /home/oracle/
echo "oracle" | passwd oracle --stdin
7.oracle 用户环境文件
su - oracle
cat >> .bashrc <
export ORACLE_BASE=/opt/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=test1
export PATH=$ORACLE_HOME/bin/:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
umask 022
EOF
source .bashrc
cat .bashrc
8.创建文件夹
在root 下使用
chown -R oracle:oinstall /opt
在oracle 用户下
mkdir -p $ORACLE_BASE
mkdir -p $ORACLE_HOME
9.Oracle 用户的 shell 限制
以 root 用户执行 使用文本编辑器将下面列出的行添加到
cat >>/etc/security/limits.conf<
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF
10.配置内核参数
在root用户下
使用文本编辑器将下面列出的行添加到 /etc/sysctl.conf
cat >>/etc/sysctl.conf <
kernel.shmall = 4294967296
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
net.core.rmem_default=1048576
net.core.rmem_max=1048576
net.core.wmem_default=262144
net.core.wmem_max=262144
EOF
sysctl -p
使内核参数生效
11.编辑/etc/hosts 文件
ip地址 和主机名根据自己的情况更改
cat >>/etc/hosts<
192.168.30.200 test
WWO
12.上传oracle database软件
用oracle 用户
cd /opt/app/
我使用的是cpio.gz 格式的oracle 软件包
解压方法如下:
gunzip 10201_database_linux_x86_64.cpio.gz
cpio -id < 10201_database_linux_x86_64.cpio
下面要修改/etc/redhat-release
改为Red Hat Enterprise Linux Server release 4.5 (Tikanga)
13.安装依赖包
挂载redhat光盘
cd /media/RHEL_5.5\ x86_64\ DVD/Server/
rpm -ivh make* glibc* libaio* compat-libstdc++* compat-gcc-* compat-gcc-34-c++* gcc* libXp* openmotif22* compat-db* libstdc++44-devel* libgfortran44* libgnat* libgnat* libobjc* libXp-devel-1.0.0-8.1.el5.*
rpm -ivh libXp-devel-1.0.0-8.1.el5.i386.rpm libXp-1.0.0-8.1.el5.i386.rpm
14.安装oracle软件
cd /opt/app/database
sh runInstaller
如果有提示 一路回车
到这里 数据库软件已经安装成功
[root@test ~]# fdisk -l
14.配置RAW
Disk /dev/sda: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 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 1958 15623212+ 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@test ~]# 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): 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.
修改裸设备服务的配置文件: /etc/sysconfig/rawdevices. 添加下面1行。
格式:裸设备名 块设备名
/dev/raw/raw1 /dev/sdb1
15 设置Oracle 用户对裸设备的访问权限。
vim /etc/rc.local
chown -R oracle:dba /dev/raw/raw*
16 确认裸设备服务自启动
chkconfig rawdevices on
17.启动raw devices 服务,确认裸设备创建成功,权限正确:
service rawdevices restart
ls /dev/raw/raw*
18.利用DBCA创建ASM
用root 执行
/opt/app/oracle/product/10.2.0/db_1/bin/localconfig add
/etc/oracle does not exist. Creating it now.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Configuration for local CSS has been initialized
Adding to inittab
Startup will be queued to init within 90 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
test
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)
建库 选择ASM管理
按照提示完成建库