在Linux虚拟机下安装Oracle 10g

一.在虚拟机上安装红帽5系统
虚拟机版本:vmware workstation 7.11 build-282343
红帽5版本:[红帽Linux.5.5.for.x86.服务器版].rhel-server-5.5-i386-dvd
(1)工具栏file→new→viutual machine来创建新的虚拟机
1.选择Typical(Recommend)选项→next
2.选择I will install the operating system later→next
3.在Guest operating system项选择Linux;在Version项选择Red Hat Enterprise Linux 5→next
4.虚拟机的名称默认即可;放置位置自己可以另选择→next
5.此页的项默认即可→next
6.点击“Customize Hardware”按钮;在“Device”列选择“New CD/DVD(IDE)”;在右侧的“Connection”里选择“Use ISO image file”,然后浏览到自己的红帽镜像所放置的位置即可→ok→finish。
(2)正式安装系统
1.Power _disibledevent=>
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.整个数据库配置完成
Tags: 

延伸阅读

最新评论

发表评论