During setup oracle in RHEL4, issue waw resolved as follow:
========mount windows share files to linux
smbmount //192.168.1.100/oracle /mnt/share -o username=db2admin
========
RHEL5,centos5的smbmount命令没了,已用mount.cifs代替
mount.cifs //192.168.1.1/Kernel /mnt -o user=domain/tom%tom
========add new partition from disk
fdisk /dev/sda
Command (m for help): n 创建新分区
Command action
e extended 扩展的分区
p primary partition (1-4) 主分区
p 创建主分区
Partition number (1-4): 1
First cylinder (1-17366, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-17366, default 17366): +10000M 选择分区大小
Command (m for help): w 保存退出
[root@linux /]# mkfs -t ext3 /dev/sdb1 将我创建的第一个分区 sdb1 格式化
[root@linux /]# mkdir /new 创建一个根目录
[root@linux /]# mount /dev/sdb1 /new 将 sdb1 分区 mount to /new
[root@linux /]# fdisk -l 查看分区信息
[root@linux /]# df 查看分区信息
=================显示挂载的文件系统===============
mount
#cat /etc/fstab 开机自动加载的FS
#cat /etc/mtab 当前已经加载的FS
1、首先要了解/etc/fstab(系统启动自动挂载分区的分区文件)
fstab中存放了与分区有关的重要信息,其中每一行为一个分区记录,每一行又可分为六个部份,下面以/dev/hda7 / ext2 defaults 1 1为例逐个说明:
1. 第一项是您想要mount的储存装置的实体位置,如hdb或/dev/hda6。
2. 第二项就是您想要将其加入至哪个目录位置,如/home或/,这其实就是在安装时提示的挂入点。
3. 第三项就是所谓的local filesystem,其包含了以下格式:如ext、ext2、msdos、iso9660、nfs、swap等,或如ext2,可以参见/prco/filesystems说明。
4. 第四项就是您mount时,所要设定的状态,如ro(只读)或defaults(包括了其它参数如rw、suid、exec、auto、nouser、async),可以参见「mount nfs」。
5. 第五项是提供DUMP功能,在系统DUMP时是否需要BACKUP的标志位,其内定值是0。
6. 第六项是设定此filesystem是否要在开机时做check的动作,除了root的filesystem其必要的check为1之外,其它皆可视需要设定,内定值是0。
我这次 在fstab里面填入的是/dev/sdb1 /oradata ext3 default 1 1(dump是backup,系统启动自动check)
/dev/sdb2 /oracle ext3 default 1 1
2、如何分区(当然分区已经分好的就不必须分区了)
分区程序使用fdisk
首先使用fdisk -l 查看硬盘是否有未分区
如果没有分区可以使用fdisk /dev/sdb 然后在comman后面敲入命令分区
然后格式化使用mkfs.ext3 /dev/sdb1 mkfs..ext3 /dev/sdb2 格式化完成
最后编辑/etc/fstab在最后加入/dev/sdb1 /oradata ext3 default 1 1 (oradata,oracle目录事先建好)
/dev/sdb2 /oracle ext3 default 1 1 俩行,重启即OK
============enlarge swapfile================
1.查看系统Swap空间使用
[root@jumper usr]# free
total used free shared buffers cached
Mem: 513980 493640 20340 0 143808 271780
-/+ buffers/cache: 78052 435928
Swap: 1052248 21256 1030992
2.在空间合适处创建swap文件
[root@jumper usr]# mkdir swap
[root@jumper usr]# cd swap
[root@jumper swap]# dd if=/dev/zero of=swapfile bs=1024 count=10000
10000+0 records in
10000+0 records out
[root@jumper swap]# ls -al
total 10024
drwxr-xr-x 2 root root 4096 7月 28 14:58 .
drwxr-xr-x 19 root root 4096 7月 28 14:57 ..
-rw-r--r-- 1 root root 10240000 7月6 28 14:58 swapfile
[root@jumper swap]# mkswap swapfile
Setting up swapspace version 1, size = 9996 KiB
3.激活swap文件
[root@jumper swap]# swapon swapfile
[root@jumper swap]# ls -l
total 10016
-rw-r--r-- 1 root root 10240000 7月 28 14:58 swapfile
[root@jumper swap]# free
total used free shared buffers cached
Mem: 513980 505052 8928 0 143900 282288
-/+ buffers/cache: 78864 435116
Swap: 1062240 21256 1040984
[root@jumper swap]#
========install oracle 10g in RHEL==========
1.check RAM and Swap
#grep MemTotal /proc/meminfo
#grep SwapTotal /proc/meminfo
# grep MemTotal /proc/meminfo
MemTotal:512236 kB
# grep SwapTotal /proc/meminfo
SwapTotal:1574360 kB
2.install gcc
#rpm -q gcc
3.add group and user account
#groupadd oinstall
#groupadd dba
#useradd -m -g oinstall -G dba oracle
#id oracle
#passwd oracle
4.chown & chmod
#chown -R oracle:oinstall /oracle
#chmod -R 755 /oracle
5. linux core parameter(large than follow values)
kernel.shmall = 2097152
kernel.shmmax = 2147483648 (1024MB) or: 536870912 (512MB)
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
======
#cat >> /etc/sysctl.conf <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=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144
EOF
#/sbin/sysctl -p
======
以 root 用户身份运行以下命令来验证您的设置:
/sbin/sysctl -a | grep shm
/sbin/sysctl -a | grep sem
/sbin/sysctl -a | grep file-max
/sbin/sysctl -a | grep ip_local_port_range
======
如果系统的参数设置的比上述参数值小,则编辑 /etc/sysctl.conf 文件,添加或更改这些参数。完成后,运行以下命令激活更改:
/sbin/sysctl -p
============setup env=============
vi /home/Oracle/.bash_profile
===add===
export ORACLE_BASE=/oracle
export ORACLE_HOME=$ORACLE_BASE/10.2.0/db_1
export ORACLE_SID=LGX
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export CLASSPATH
unset USERNAME
<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>
!create folder:oracle_base/oraInventory
usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -g oinstall -G dba Oracle
passwd oracle
mkdir /opt/oracle
mkdir /opt/oracle/product
mkdir /opt/oracle/product/10.1.0
chown -R oracle.oinstall /opt/oracle
mkdir /opt/oracle/oradata
chown -R oracle.oinstall /opt/oracle/oradata
mkdir /var/opt/oracle
chown oracle.dba /var/opt/oracle
chmod 755 /var/opt/oracle
vi /etc/sysctl.conf
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
vi /etc/security/limits.conf
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536
vi /etc/profile
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
vi .bach_profile
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/product/10.1.0
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH
export ORACLE_OWNER=oracle
export ORACLE_SID=URPDB
export ORACLE_TERM=vt100
export LD_ASSUME_KERNEL=2.4.1
export THREADS_FLAG=native
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
export PATH=$PATH:$ORACLE_HOME/bin
export NLS_LANG=AMERICAN_AMERICA.UTF8
export LANG=en_US
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export CLASSPATH
确认并是修改生效
$ source .bash_profile
检查 env
<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>
6.install rpm
4、查看、安装如下文件包:
# From RedHat AS4 Disk 2
cd /media/cdrom/RedHat/RPMS
rpm -Uvh setarch-1.6-1.i386.rpm
rpm -Uvh compat-libstdc++-33-3.2.3-47.3.i386.rpm +
rpm -Uvh make-3.80-5.i386.rpm
rpm -Uvh glibc-2.3.4-2.i386.rpm
# From RedHat AS4 Disk 3
cd /media/cdrom/RedHat/RPMS
rpm -Uvh openmotif-2.2.3-6.RHEL4.2.i386.rpm
rpm -Uvh compat-db-4.1.25-9.i386.rpm
rpm -Uvh libaio-0.3.102-1.i386.rpm
rpm -Uvh gcc-3.4.3-9.EL4.i386.rpm
# From RedHat AS4 Disk 4
cd /media/cdrom/RedHat/RPMS
rpm -Uvh compat-gcc-32-3.2.3-47.3.i386.rpm
rpm -Uvh compat-gcc-32-c++-3.2.3-47.3.i386.rpm
<<<<<<<<>>>>>>>>>
binutils-2.15.92.0.2-10.EL4
compat-db-4.1.25-9
control-center-2.8.0-12
gcc-3.4.3-9.EL4
gcc-c++-3.4.3-9.EL4
glibc-2.3.4-2
glibc-common-2.3.4-2
gnome-libs-1.4.1.2.90-44.1
libstdc++-3.4.3-9.EL4
libstdc++-devel-3.4.3-9.EL4
make-3.80-5
pdksh-5.2.14-30
sysstat-5.0.5-1
xscreensaver-4.18-5.rhel4.2
libaio-0.3.96
openmotif21-2.1.30-11.RHEL4.2 (Required only to install Oracle demos. Installation of Oracle demos is not covered by this guide.)
<<<<<<<>>>>>>>>>>
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
Error: Can't open display: :0.0
这是老问题了,但是这次对我来说却有些不同。想在自己的本本ubuntu上安装oracle10,结果新增加的用户oracle不能运行X程式。
查了查资料和手册,以日常工作用的那个用户登录,在shell中运行
xhost local:oracle
non-network local connections being added to access control list
然后oracle身份就能够运行X程式了。
xhost local:oracle non-network local connections being added to access control list
<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>
X connection to localhost:10.0 broken (explicit kill or server shutdown).
[root@linux5-130 ~]# export DISPLAY=localhost:10.0
[root@linux5-130 ~]# xhost +
access control disabled, clients can connect from any host
这样就可以用ORACLE用户来安装数据库了
[root@linux5-130 ~]# su - oracle
[oracle@linux5-130 ~]$ export DISPLAY=192.168.118.1:0.0
[oracle@linux5-130 ~]$ cd /u01/source/p5337014_10203_LINUX/Disk1/
[oracle@linux5-130 Disk1]$ ./runInstaller