你好,游客 登录 注册 搜索
背景:
阅读新闻

在Linux虚拟机下安装Oracle 10g

[日期:2011-06-26] 来源:Linux社区  作者:yushangfu [字体:大 中 小]

3.创建用户和组
   #groupadd oinstall
   #groupadd dba
   #useradd -g Oinstall -G dba Oracle
   #passwd oracle
4.编辑文件
> # cat /etc/hosts | grep `eval hostname`(查看是否已经正确编辑)
   Vi 命令添加主机IP地址和主机名
   192.168.0.40    highgo      --(此IP和名称只是个示例)
   保存退出。
> 修改内核参数  在/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 = 1048576
   net.core.rmem_max = 1048576
   net.core.wmem_default = 262144
   net.core.wmem_max = 262144
   执行 sysctl –p使文件生效
> 修改/etc/security/limits.conf 添加以下内容
   oracle              soft    nproc   2047
   oracle              hard    nproc   16384
   oracle              soft    nofile  1024
   oracle              hard    nofile  65536
> 修改/etc/pam.d/login 编辑并添加以下内容
   session    required     /lib/security/pam_limits.so
   session    required     pam_limits.so
> 修改 /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
5.创建目录,授予权限
   # mkdir -p /u01/app/oracle
   # chown -R oracle:oinstall /u01/app/oracle
   # chmod 775 /u01/app/oracle
6.设置环境变量(以oracle用户登录)
   Vi .bash_profile
   export ORACLE_SID=orcl
   export ORACLE_BASE=/u01/app/oracle
   export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
   export PATH=$PATH:$ORACLE_HOME/bin:$HOME/BIN
   执行 source .bash_profile 使生效
7. unset ORACLE_HOME
   unset TNS_ADMIN
8. export DISPLAY=:0.0         xhost +
(2)正式安装oracle数据库
用SSH软件把oracle软件上传到opt目录下,解压。同时在/etc/RedHat-release下修改一下系统的版本

用oracle用户切换到相应的目录,执行 ./runInstaller 命令开始安装

因为在前面我们并没有安装相应的包,所以此时肯定会出错误
1. Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/OraInstall2010-11-04_09-24-31AM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(Unknown Source)
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at sun.security.action.LoadLibraryAction.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.awt.NativeLibLoader.loadLibraries(Unknown Source)
        at sun.awt.DebugHelper.<clinit>(Unknown Source)
        at java.awt.Component.<clinit>(Unknown Source)
这是因为没有安装libXp包,所以不能显示图形化安装界面。安装libXp包, rpm -ivh libXp-1.0.0-8.1.el5.i386.rpm
----如果在安装包的过程中出错。如:warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID*****。执行rpm --import /etc/pki/rpm-gpg/RPM*  (只需执行一遍),然后在安装包即可

此时会弹出图形化安装界面,第一步的时候不要选中“create starter database”这个选项,等安装完软件后再人工创建数据库

2.安装过程中在执行例行检查的时候,由于一些包没有安装,此时会出现警告,
checking operating system package requirements...
checking for make-3.79;found make-1:3.81-3.el5.   Passed
checking for binutils-2.14;found binutils-2.17.50.0.6-14.el5.   Passed
checking for gcc-3.2;found Not found.   Failed<<<<
checking for libaio-0.3.96;found libaio-0.3.106-5.Passed
check complete.the overall result of this check is: Failed<<<<
Problem:Some packsges required for the Oracle Database 10g to function properly are missing (see above).
Recommendation:Install the required packages before continuting with the installation
安装gcc包,rpm -ivh gcc-4.1.2-48.el5.i386.rpm
error: Failed dependencies:
        glibc-devel >= 2.2.90-12 is needed by gcc-4.1.2-48.el5.i386
        libgomp >= 4.1.2-48.el5 is needed by gcc-4.1.2-48.el5.i386   由此可见gcc包需要glibc-devel包和libgomp包,首先安装上这两个包。如果不想这样办的话,加上--nodeps --force 可以解除包的依赖关系强行安装包  rpm -ivh gcc-4.1.2-48.el5.i386.rpm --nodeps --force。(不建议)
----glibc-devel还会依赖glibc-headers,glibc-headers还会依赖kernel-headers,依次安装上即可,如果强行安装单个包的话,第3步的错误会始终存在

3.图形化安装过程中出现错误,
Error in invoking terget 'ntcontab.o' of makefile
'/u01/app/oracle/product/10.20.0/db_1/network/lib/ins_net_client.mk'.
See'u01/app/oracle/oraInventory/logs/installActions2010-11-04_09-32-59AM.log' for details.
这是因为没有安装gcc-c++包,rpm -ivh gcc-c++-4.1.2-48.el5.i386.rpm
error: Failed dependencies:
        libstdc++-devel = 4.1.2-48.el5 is needed by gcc-c++-4.1.2-48.el5.i386, 首先安装上libstdc++-devel包再安装gcc-c++包。
点击“retry”接着进行数据库的安装

4.安装数据库软件完毕

(3)创建数据库以及监听程序
(3.1)用DBCA创建数据库
1.在终端输入DBCA命令,回车即可启动DBCA来创建数据库。第一个页面是欢迎页面→next
2.在此页面选择"Create a Database"→next
3.在此页面选择"General Purpose"→next
4.此页面要求输入数据库的全局名,输入orcl即可,要注意的是SID一定要和先前环境变量里的SID一样
5.此页默认→next
6.此页要求输入密码,给它们使用相同的密码即可,输入oracle  →next
7.此页默认(File System)→next
8.此页默认→next
9.在此页勾选上"Enable Archiving"  →next
10.在此页勾选上"Sample Schemas"  →next
11.此页以及子标签页默认即可→next
12.→next
13.finish
14.开始库的创建......
(3.2)用NETCA创建监听程序
1.在终端输入NETCA命令,回车即可创建监听程序。第一个页面选择"Listener configuration"  →next
2.默认→next
3.默认→next
4.默认→next
5.默认→next
6.不需要配置另外一个,选择'No'
7.next
8.finish
9.整个数据库配置完成

linux
相关资讯       Oracle教程 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款