Oracle XE Installation in Linux CentOS
2014-12-23 13:54
190 查看
在Linux CentOS 6.3环境下安装Oracle XE 11,有点折腾,特意记下来供大家参考。
1. Preparation
下载所需的安装文件,其中,oracle xe可以到oracle官网免费下载,速度还算可以(需要在oracle注册一个账号)。
oracle-xe-11.2.0-1.0.x86_64.rpm.zip
安装前还需准备一些必备包,如:
libaio-0.3.107-10.el6.x86_64.rpm
bc-1.06.95-1.el6.x86_64.rpm
RPM包可以通过yum install拿下来,或通过以下途径获取:
http://www.rpmseek.com/index.html http://www.filewatcher.com/d/CentOS/x86_64-0.htm
检查虚拟内存和磁盘空间,建议参考以下文章,我就两个都改了才可以继续安装。
http://www.linuxidc.com/Linux/2012-08/66974.htm http://www.linuxidc.com/Linux/2012-08/66973.htm
2. Installation
2. Configuration 1
(这里不使用另一个方法 - 更改~/.bashrc 是考虑配置要在oracle账号下生效)
检验:
Update 以下文件:
/u01/app/oracle/product/11.2.0/xe/network/admin/tnsnames.ora
/u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
/u01/app/oracle/product/11.2.0/xe/network/admin/sqlnet.ora (XE安装后默认没有此文件,暂不需创建)
3. TNS
Expect: 看到 OK 的字样
4. Permission
Expect: e.g. uid=503(oracle) gid=503(dba) groups=503(dba)
有dba 就可以了
5. Start Database
6. Configuration 2
如果Tomcat已经占用了默认的8080端口,那就需要改端口。例如换成8090
可以设置为启动服务器时自动启动
7. testing
远程登录测试 e.g.
8. Q&A
Q: sqlplus / as sysdba. ORA-01031: insufficient privileges
A: 1)是否使用了oracle账号连接(即su - oracle);2)在oracle账号下,echo $ORACLE_SID;3)tnsping [service name]
Q: TNS-12541: TNS:no listener
A: lsnrctl status
Q: /etc/init.d/oracle-xe configure. Database Configuration failed. Look into /u01/app/oracle/product/11.2.0/xe/config/log for details
A: 查看日志中的具体错误信息。常见如ORA-01034: ORACLE not available,尝试手动启动数据库(参考5. Start Database)。
Q: sqlplus sys[/pwd][@service name] as sysdba. ORA-12641: Authentication service failed to initialize, ORA-01031: insufficient privileges
A: 1)将/u01/app/oracle/product/11.2.0/xe/network/admin/sqlnet.ora改名(即无此文件);2)账号是否存在,sqlplus / as sysdba, select * from v$pwfile_users;
9. Reference http://www.linuxidc.com/Linux/2012-08/66974.htm http://blog.csdn.net/edwzhang/article/details/9159645 http://blog.csdn.net/haiross/article/details/12775151
1. Preparation
下载所需的安装文件,其中,oracle xe可以到oracle官网免费下载,速度还算可以(需要在oracle注册一个账号)。
oracle-xe-11.2.0-1.0.x86_64.rpm.zip
安装前还需准备一些必备包,如:
libaio-0.3.107-10.el6.x86_64.rpm
bc-1.06.95-1.el6.x86_64.rpm
RPM包可以通过yum install拿下来,或通过以下途径获取:
http://www.rpmseek.com/index.html http://www.filewatcher.com/d/CentOS/x86_64-0.htm
检查虚拟内存和磁盘空间,建议参考以下文章,我就两个都改了才可以继续安装。
http://www.linuxidc.com/Linux/2012-08/66974.htm http://www.linuxidc.com/Linux/2012-08/66973.htm
2. Installation
rpm -ivh ... (一堆必备包) rpm -ivh oracle-xe-11.2.0-1.0.x86_64.rpm
2. Configuration 1
vi /etc/profile
# Oracle path export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/xe export TNS_ADMIN=$ORACLE_HOME/network/admin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export CLASSPATH=.:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib export PATH=$PATH:$ORACLE_HOME/bin export ORACLE_SID=XE
source /etc/profile
(这里不使用另一个方法 - 更改~/.bashrc 是考虑配置要在oracle账号下生效)
检验:
echo $ORACLE_SID
Update 以下文件:
/u01/app/oracle/product/11.2.0/xe/network/admin/tnsnames.ora
/u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
/u01/app/oracle/product/11.2.0/xe/network/admin/sqlnet.ora (XE安装后默认没有此文件,暂不需创建)
3. TNS
lsnrctl status lsnrctl start [listener name] (refer listener.ora) netstat -tlnup | grep 1521 tnsping [service name] (refer tnsnames.ora)
Expect: 看到 OK 的字样
4. Permission
id oracle
Expect: e.g. uid=503(oracle) gid=503(dba) groups=503(dba)
有dba 就可以了
5. Start Database
su - oracle -c "sqlplus / as sysdba" startup
6. Configuration 2
/etc/init.d/oracle-xe configure
如果Tomcat已经占用了默认的8080端口,那就需要改端口。例如换成8090
可以设置为启动服务器时自动启动
7. testing
远程登录测试 e.g.
sqlplus sys/sys@//192.168.153.131:1521/XE as sysdba show parameter service_name --(查看当前登录的数据库) select username from dba_users order by username; --(查看数据库下用户) create table test01(id int, name varchar2(20)); insert into test01 values (1, 'from_oracle'); commit; select * from test01; quit
8. Q&A
Q: sqlplus / as sysdba. ORA-01031: insufficient privileges
A: 1)是否使用了oracle账号连接(即su - oracle);2)在oracle账号下,echo $ORACLE_SID;3)tnsping [service name]
Q: TNS-12541: TNS:no listener
A: lsnrctl status
Q: /etc/init.d/oracle-xe configure. Database Configuration failed. Look into /u01/app/oracle/product/11.2.0/xe/config/log for details
A: 查看日志中的具体错误信息。常见如ORA-01034: ORACLE not available,尝试手动启动数据库(参考5. Start Database)。
Q: sqlplus sys[/pwd][@service name] as sysdba. ORA-12641: Authentication service failed to initialize, ORA-01031: insufficient privileges
A: 1)将/u01/app/oracle/product/11.2.0/xe/network/admin/sqlnet.ora改名(即无此文件);2)账号是否存在,sqlplus / as sysdba, select * from v$pwfile_users;
9. Reference http://www.linuxidc.com/Linux/2012-08/66974.htm http://blog.csdn.net/edwzhang/article/details/9159645 http://blog.csdn.net/haiross/article/details/12775151
相关文章推荐
- Oracle 11g Software Installation on Linux—CentOS-6
- Teamcenter10 step-by-step installation in Linux env-Oracle Server Installation
- skpye 4.3 installation and configuration in linux CentOS 7 / RHEL 7 / Fedora 20
- About IP Alias in Linux (Esp. CentOS)
- Linux(CentOS4)下Oracle.10g 安装图文教程
- Linux(Centos5.4)上安装oracle10gR2(10.2.1)
- 在Oracle (CentOS) Linux 5.5 (x32/x64)上安装Oracle 10g r2
- 在Oracle (CentOS) Linux 5.5 (x32/x64)上安装Oracle 10g r2
- after install oracle 10g express edition in linux
- Unix/Linux installation in disk, without cdrom.
- Linux(Centos5.4)上安装oracle10gR2(10.2.1)
- Oracle 11g R2在CentOS Linux上的安装指南
- Install Oracle XE in Debian
- Linux下Oracle-xe的安装及配置
- Install Oracle(Four) - Oracle XE in Debian
- CentOS Linux 4.8 + Oracle 9I R2 9.2.0.4 安装全过程
- 解决centos中安装pdo_dblib时出现的"Cannot find FreeTDS in known installation directories"错误
- Oracle installation on linux
- Install Language support in CentOS 5 or Red Hat Enterprise Linux CentOS add Chinese Support
- Linux(CentOS4)下Oracle.10g 安装图文教程