-======20090525自己更新
其实在suse linux上安装oracle 10g非常轻松,但是前期的检查工作需要花费一点功夫。
第一步:检查linux版本
1. 查看内核版本命令:
1) [root@q1test01 ~]# cat /proc/version
2) [root@q1test01 ~]# uname -a
3) [root@q1test01 ~]# uname -r
2) 登录到linux执行cat /etc/issue,例如如下:
[root@q1test01 ~]# cat /etc/issue
第二步:需要查看ORACLE安装需要的软件要求
rpm -qa查询安装的所有包
rpm -qa |grep search-package模糊查询安装的包
rpm -i your-package.rpm安装包
rpm -e your-package.rpm卸载
rpm -qif your-package name查询包信息
第三步:查看系统配置,发现什么交换分区和共享内存的大小没什么关系的,我的才512M SWAP+256M的配置都能装成功,主要是硬盘空间要够
df -hl 查看磁盘剩余空间
du -s dir查看目录大小
3: CPU和内存
top
free
安装前检查系统配置,参数我在安装过程中并没有到达oracle要求的值,也成功安装
grep MemTotal /proc/meminfo:to determine the physical RAM size
grep SwapTotal /proc/meminfo:to determine the size of configured swap space
free:to determine the available RAM and swap space
df -k /tmp:to determine the amount of disk space available in the /tmp dir
df -k:to determine the amount of free disk space on the system
grep "model name" /proc/cpuinfo:to determine whether the system architecture can run the software
cat /proc/swaps,有时候为了到达1G的swap space,可以创建临时交换空间,每次重启后需要重新设置
dd if=/dev/zero of=tmpswap bs=1k count=1000000
chmod 600 tmpswap
mkswap tmpswap
swapon tmpswap 安装完成后可以用swapoff tmpswap; rm tmpswap删除交换空间和临时文件
删除目录下的所有文件:
设置共享内存,重启后需要重新设置
cat /proc/sys/kernel/shmmax
echo 103741824 > /proc/sys/kernel/shmmax
在这一步可能系统需要做比较多的工作,比如说要安装到一个挂载的盘,需要自己配置挂载点
1:查看设备名和状态
fdisk -l
2:
我是放在linux分区,不过是另挂的,挂的时候在fstab里可能没指定exec。把参数设为defaults后,问题便解决了
umount /data1
mount -o rw,exec,nosuid,nodev /dev/sda2 /data1
--sudo umount /dev/cdrom sudo的作用是用另外一个用户执行
--sudo mount -t iso9660 -o ro,exec,nosuid,nodev /dev/cdrom /mnt/cdrom
如何让硬盘自动挂载:编辑/etc/fstab
第四步:现在可以安装ORACLE了
./runInstaller出现:/bin/sh bad interpreter: Permission denied的错误
编译用户环境变量
在用户主目录下,编辑.bash_profile,
显示命令不存在的问题:1:whereis command 2:在PATH=$PATH:/sbin(查找命令的目录)
第五步:如果在虚拟机环境下需要配置网络
1:设置虚拟网络为brige
2:查看windows机器IP
3:设置linux机器ip(可以从图形界面设置)
ifconfig down
ifconfig eho IP address需要和winIP在同一段
4:需要把所有的虚拟网络本地连接打开,在linux下ping winIP
第六步:运行ORACLE
查看oracle服务进程
ps -ef |grep ora_ |grep dbname
创建监听到打开数据库
1:netmgr启动oracle的network admin,配置监听
2:lsnrctl start
3:sqlplus /nolog
enter your name:/ as sysdba;
startup
shutdown immediate
OK!!
-----------------------------------------------------------------------------------------------------------------------------
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
[root@Enterprise ~]# uname -a
Linux Enterprise 2.6.9-42.EL #1 Wed Jul 12 23:16:43 EDT 2006 i686 i686 i386 GNU/Linux
基本的一些补丁就不配置了。感觉这个版本都可以。
所需最小 RAM 为 512MB,而所需最小交换空间为 1GB。
对于 RAM 小于或等于 2GB 的系统,交换空间应为 RAM 数量的两倍;对于 RAM 大于 2GB 的系统,交换空间应为 RAM 数量的一到两倍。
例如:
# grep MemTotal /proc/meminfo
MemTotal:512236 kB
# grep SwapTotal /proc/meminfo
SwapTotal:1574360 kB
#use for oracle
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
再运行sysctl -p应用以上参数
[root@Enterprise ~]# groupadd oinstall
[root@Enterprise ~]# useradd oracle -g oinstall -G dba
[root@Enterprise ~]# passwd oracle
total 28
drwxr-xr-x 9 root root 4096 Jul 2 2005 doc
drwxr-xr-x 5 root root 4096 Jul 2 2005 install
drwxr-xr-x 2 root root 4096 Jul 2 2005 response
-rwxr-xr-x 1 root root 1327 Jul 2 2005 runInstaller
drwxr-xr-x 9 root root 4096 Jul 2 2005 stage
-rwxr-xr-x 1 root root 5213 Jul 2 2005 welcome.html
ORACLE_HOME=$ORACLE_BASE/product/10.2.0
LD_ASSUME_KERNEL=2.4.21
ORACLE_SID=testdb
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib64:/usr/local/lib64:$LD_LIBRARY_PATH
PATH=$PATH:$ORACLE_HOME/bin
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
unset USERNAME
doc install response runInstaller stage welcome.html
安装
Starting Oracle Universal Installer...
Passed
System parameter file is /home/oracle/product/10.2.0/network/admin/listener.ora
Log messages written to /home/oracle/product/10.2.0/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 31-JUL-2007 02:19:16
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/product/10.2.0/network/admin/listener.ora
Listener Log File /home/oracle/product/10.2.0/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
ORACLE instance started.
Fixed Size 1218364 bytes
Variable Size 75499716 bytes
Database Buffers 96468992 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
SQL>