ubuntu安装oracleXE

ubuntu不支持oracle,网上教程太复杂,总是出错.后来找到个能装XE的就装了.
Oracle Database 10g Express Edition requires 1006 MB of swap space


echo "deb http://oss.oracle.com/debian/ unstable main non-free" >> /etc/apt/sources.list
apt-get update
apt-get install oracle-xe-client
apt-get install oracle-xe
sh /etc/init.d/oracle-sh configure
vim /etc/default/oracle-xe

You can always disable Oracle XE startup in boot time with (no update-rc.d method here ;-) ):

chmod -x /etc/init.d/oracle-xe

The alernative way to the same is to edit /etc/default/oracle-xe and change:

#ORACLE_DBENABLED=true
ORACLE_DBENABLED=false

Web console management
- If you have installed OracleXE database on remote *nix server, you can easily setup a ssh tunnel in order to gain access to a web administration console (since web console is bound to loopback device and therefore unavailable outside to the network):

$ ssh oracle-xe-server -L 8081:localhost:8080

While keeping this proces running (or keep it on background via `screen` or `nohup`), you may now login to Oracle XE web administrations console on your local computer: http://localhost:8081/apex/. Please notice that your ssh daemon on your local computer should allow TCP forwarding: AllowTcpForwarding yes in your sshd configuration file.
SQL Remote connection management
- By default OracleXe installation does not allow sql network connections to your XE database. To enable it, logon to web management console and enable "Remote connections": "Administration->enable "Available from local server and remote clients"-> press "Apply Changes". The same procedure can also be done from the commandline:

$ sqlplus -S system/password@//localhost/XE <<!
EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);
EXIT;
/
!

If your SQL client uses a Oracle Instant client installation, the SQL connection can be obtained by entering:

[atrakic@adm2-43 ~]$ sqlplus username/password@//oraclexe.hostname.or.ip//XE

If somewhat connection is refused (due to firewall restrictions) you can use same ssh trick as done previously:

$ ssh oracle-xe-server -L 1512:localhost:1512


where your sql connection should be like this:

[atrakic@adm2-43 ~]$ sqlplus username/password@//localhost//XE

User management
Add user
- In order to add single sql user with non-dba privilages to OracleXE execute following commands:

--
-- Contents of: this_script.sql
--
CREATE USER myuser IDENTIFIED BY the_password DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp QUOTA UNLIMITED ON users;
CREATE ROLE myconnection;
GRANT CREATE session, CREATE table, CREATE view, CREATE procedure, CREATE synonym TO myconnection;
GRANT myconnection TO myuser;
/


You can run this SQL script with:

# su - oracle
oracle@server:~$ sqlplus / as sys
SQL> @this_script.sql
SQL> exit;


Alternatively use web managment console to add new Oracle XE users accordingly.
Delete user
- For deleting a sql users from OracleXE use web management console or execute following commands from the commandline:


# su - oracle
oracle@server:~$ sqlplus / as sys
SQL> drop user myuser cascade;
SQL>exit;


ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/
可在命令行创建表空间
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值