下载地址
http://happyqing.iteye.com/blog/1797979
准备工作
系统中已经安装了 软件开发,虚拟化,网络服务器 额外功能,这样一会会少安些rpm包
复制安装文件到/opt 下,解压,/opt/oracle11.2.0.3 是解压好的oracle安装文件目录
把linux系统的安装盘中Server文件夹拷贝到/opt下,因为安装oracle需要安装一些rpm包,也可以自己摘出所需的rpm包,考虑到以后还会用到很多包,就都拷过去了,
# cp -r /media/RHEL_5.7\ x86_64\ DVD/Server /opt/Server
你也可以配置yum源,有些可以用yum来安装
[root@dev Server]#ls gcc*
gcc-4.4.6-3.el6.x86_64.rpm
[root@db8 Packages]# yum install gcc-4.4.6 装高了还得卸载
创建用户和组
groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -G dba,oper oracle
#useradd:用户 oracle 已存在
#usermod -g oinstall -G dba,oper oracle
查看当前用户所在的组
#groups
创建oracle主目录,修改权限
mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01
chown -R oracle:oinstall /opt/oracle11.2.0.3
chmod -R 755 /opt/oracle11.2.0.3/
安装
su - oracle
/opt/oracle11.2.0.3/database/runInstaller
若报:无法使用命令 /usr/bin/xdpyinfo 自动检查显示器颜色。请检查是否设置了 DISPLAY 变量。
用root执行 xhost +
not run
/opt/oracle11.2.0.3/database/install/runInstaller.sh
./runInstaller.sh: line 5: ./runInstaller: No such file or directory
please run
/opt/oracle11.2.0.3/database/runInstaller
选是
Oracle 建议输入的口令应该至少长为 8 个字符, 至少包含 1 个大写字符, 1 个小写字符和 1 个数字 [0-9]。
这个可以忽略
19.先决条件检查 可以显示失败项,可以显示成功项,从这可以看出安装oracle需要哪些rpm包
解决不可修复的警告。
安装rpm包,进入准备好的Server目录
[root@weblogic Server]# rpm -q libaio-devel
package libaio-devel is not installed
[root@weblogic Server]# ls libaio-devel*
[root@weblogic Server]# rpm -ivh libaio-devel-0.3.106-5.x86_64.rpm
[root@weblogic Server]# rpm -q sysstat
package sysstat is not installed
[root@weblogic Server]# ls sysstat*
sysstat-7.0.2-11.el5.x86_64.rpm
[root@weblogic Server]# rpm -ivh sysstat-7.0.2-11.el5.x86_64.rpm
rpm要是有依赖,可以像如下方式安装
[root@weblogic Server]# rpm -ivh elfutils-libelf-devel-0.137-3.el5.x86_64.rpm elfutils-libelf-devel-static-0.137-3.el5.x86_64.rpm --force –nodeps
19.2 重新检查,没有不可修复的警告后,点击修补并再次检查,
[root@dev Server]# /u01/app/oraInventory/orainstRoot.sh
更改权限/u01/app/oraInventory.
添加组的读取和写入权限。
删除全局的读取, 写入和执行权限。
更改组名/u01/app/oraInventory 到 oinstall.
脚本的执行已完成。
[root@dev Server]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
控制台:https://localhost:1158/em 添加例外
大功告成
配置环境变量
/home/oracle/.bash_profile 在文件末尾加入
export ORACLE_SID=orcl
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
还可以配置/etc/profile,加入上面的代码
oracle有自己的jdk
[root@dev ~]# /u01/app/oracle/product/11.2.0/dbhome_1/jdk/bin/java -version
java version "1.5.0_30"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_30-b03)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_30-b03, mixed mode)
[root@dev ~]#
启动停止监听
http://happyqing.iteye.com/admin/blogs/1797183
lsnrctl status --查看状态
lsnrctl start --启动
lsnrctl stop --停止
启动停止数据库
http://happyqing.iteye.com/admin/blogs/1798148
sqlplus / as sysdba
SQL>startup
SQL>shutdown immediate
SQL>exit
启动停止EM
http://happyqing.iteye.com/admin/blogs/1798145
查看EM console服务的状态
emctl status dbconsole
启动EM console服务
emctl start dbconsole
停止EM console服务
emctl stop dbconsole