Chinaunix首页 | 论坛 | 博客
  • 博客访问: 77603
  • 博文数量: 15
  • 博客积分: 1420
  • 博客等级: 上尉
  • 技术积分: 160
  • 用 户 组: 普通用户
  • 注册时间: 2007-07-12 18:50
文章分类

全部博文(15)

文章存档

2010年(2)

2009年(1)

2007年(12)

我的朋友

分类: Oracle

2007-07-30 10:19:10

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>
 
这样数据库就安装成功了。
 
 
 


 
阅读(1888) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

comerwang2008-09-16 14:41:33

cpio -idmv < file