RedFlag的版本是Redflag Asianux Workstation 3 for x86
Oralce的版本是10201_database_linux32.zip
因为oracle只支持如下版本:
检查操作系统版本: 必须是redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
而Redflag Asianux是redhat-5,所以,要更改版本信息:
[root@localhost ~]# vi /etc/redhat-release
Red Hat Enterprise Linux Server release 3 (Tikanga)
这里改为release 3。
还要更改内核信息:
[root@localhost ~]# vi /etc/security/limits.conf
添加如下内容:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
有人还说需要更改:/etc/sysctl.conf,根据我的测试,似乎并不需要。
然后要创建用户和用户组:
[root@localhost ~]# groupadd dba
[root@localhost ~]# groupadd oinstall
[root@localhost ~]# useradd -g oinstall -G dba oracle
[root@localhost ~]# passwd oracle
Changing password for user oracle.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[oracle@localhost database]$ ls
doc install response runInstaller stage welcome.html
[oracle@localhost database]$ ./runInstaller
bash: ./runInstaller: 权限不够
需要给oracle用户分配权限
[root@localhost database]# chown -R oracle:oinstall /home/upload
[root@localhost database]# chmod -R 775 /home/upload
切换用户,再次运行:
[root@localhost database]# su oracle
[oracle@localhost database]$ ./runInstaller
出现如下错误信息:
准备从以下地址启动 Oracle Universal Installer /tmp/OraInstall2009-06-09_04-23-46PM. 请稍候...[oracle@localhost database]$ Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Unknown Source)
at java.awt.Window.init(Unknown Source)
at java.awt.Window.<init>(Unknown Source)
at java.awt.Frame.<init>(Unknown Source)
at oracle.ewt.popup.PopupFrame.<init>(Unknown Source)
at oracle.ewt.lwAWT.BufferedFrame.<init>(Unknown Source)
at oracle.sysman.oio.oioc.OiocOneClickInstaller.<init>(OiocOneClickInstaller.java:378)
at oracle.sysman.oio.oioc.OiocOneClickInstaller.main(OiocOneClickInstaller.java:2091)
执行如下:
[oracle@localhost database]$ xhost 127.0.0.1 0.0
再次启动:
[oracle@localhost database]$ ./runInstaller
此时会成功启动gui界面进行安装。安装完成时,会提示用root执行两个脚本,执行完后,再点完成完成安装,这两个脚本事:
/home/oracle/oralnventory/orainstRoot.sh
/home/oracle/product/10.1.0/Db_1/root.sh
接着设置一些变量: /home/oracle/.bash_profile仅仅对oracle用户有效,/etc/profile 对所有用户有效
export ORACLE_HOME=/home/oracle/product/10.1.0/Db_1
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_OWNER=oracle
export ORACLE_SID=tmp
export ORACLE_TERM=xterm
然后,就可以启动进入oracle了。
启动监听器:
[root@localhost database]# lsnrctl
LSNRCTL> start
LSNRCTL> stop
sqlplus 登陆:
[root@localhost database]# sqlplus sys/passwod as sysdba
启动数据库:
SQL> startup
SQL> shutdown