linux oracle install

-======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!!

 

----------------------------------------------------------------------------------------------------------------------------- 

oracle的安装用的是最简单的方法。只求能装成功,能跑起数据库,能实现基本的的SQL操作。
[root@Enterprise ~]# cat /etc/issue
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
(本人尝试过300多M内存也一样可以装。)
OS参数要求vi /etc/sysctl.conf , 在行末添加以下内容

#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应用以上参数
(因为如果不修改以上一些参数,在oracle安装配置的时候,系统会报warning,某些选享check failed.
不过个人的经验是,遇到这些警告不用管。继续装。再装到一定的百分比的时候,会有窗口弹出,直接点忽略就可以继续装。不过有弹很多窗口,全部点忽略,基本上安装还是可以成功的。)
创建用户/组
[root@Enterprise ~]# groupadd dba
[root@Enterprise ~]# groupadd oinstall
[root@Enterprise ~]# useradd oracle -g oinstall -G dba
[root@Enterprise ~]# passwd oracle
解压安装包
[root@Enterprise ~]# cd /home
[root@Enterprise home]# ls
10201_database_linux32.zip oracle
[root@Enterprise home]# unzip 10201_database_linux32.zip
[root@Enterprise home]# ls
10201_database_linux32.zip  database  oracle
[root@Enterprise home]# cd database/
[root@Enterprise database]# ll
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的环境变量
[root@Enterprise database]# su - oralce
[oracle@Enterprise ~]# vi .bash_profile
添加如下内容
# .bash_profile
ORACLE_BASE=/home/oracle
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
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export ORACLE_BASE ORACLE_HOME LD_ASSUME_KERNEL ORACLE_SID LD_LIBRARY_PATH
export PATH
unset USERNAME
退出保存。
启动图形界面
[oracle@Enterprise ~]# cd ../database/
[oracle@Enterprise database]# ls
doc  install  response  runInstaller  stage  welcome.html
安装
[oracle@Enterprise database]$ ./runInstaller
Starting Oracle Universal Installer...
Checking installer requirements...
Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
                                      Passed
在出现图形界面的第一页,选择默认的Basic Installation,不改路径,
把Create Starter Database前面的勾取消,不要,一会自己手动创建。
第2页是Product-Specific Prequesite Checks
如果有错误,就的仔细看看是什么问题。想办法解决。如果是警告,就可以下一步
再后来的安装过程中,会有窗口弹出,直接点忽略就可以继续装。不过有弹很多窗口,全部点忽略,基本上安装还是可以成功的。
最后一步会提示你,使用root登录,运行两个Shell脚本。按照要求运行完脚本后。安装基本上就成功了。
创建数据库
[oracle@Enterprise database]$ dbca
(果找不到命令,就在/home/oracle目录下执行source .bash_profile)
在弹出的窗口,选择创建create a database->Custom database
->Gobal Database Name输入名字testdb,因为前面.bash_profile里面ORACLE_SID=testdb,要保持一致。接着点next,然后输入密码。接着可以直接next ,finish.
然后就等机器自己装。
启动listener
[oracle@Enterprise database]$ lsnrctl start
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 31-JUL-2007 02:19:16
Copyright (c) 1991, 2005, Oracle.  All rights reserved.
Starting /home/oracle/product/10.2.0/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
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)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521)))
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
启动数据库
[oracle@linux3 database]$ sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jul 31 02:20:18 2007
Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
再输入startup
SQL> startup
ORACLE instance started.
Total System Global Area  176160768 bytes
Fixed Size                  1218364 bytes
Variable Size              75499716 bytes
Database Buffers           96468992 bytes
Redo Buffers                2973696 bytes
Database mounted.
Database opened.
SQL>
这样数据库就安装成功了。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值