[ubuntu] 安装oracle

ubuntu下面安装oracle10g Express遇到问题以及解决办法


安装环境 ubuntu 8.04。由于 ubuntu 是 debian 的内核,所以要在 oracle 官方上下载 oracle-xe-universal_10.2.0.1-1.0_i386.deb。
开始安装(先看最下面要注意的问题)
关于libaio,libaio1的缺少

sudo dpkg -i /home/xxx/download/oracle-xe-universal_10.2.0.1-1.0_i386.deb

出现以下问题:

正在解压缩将用于更替的包文件 oracle-xe-universal ...
dpkg :依赖关系问题使得 oracle-xe-universal 的配置工作不能继续:
oracle-xe-universal 依赖于 libaio (>= 0.3.96) | libaio1 (>= 0.3.96);然而:
软件包 libaio还没有被安装。
软件包 libaio1还没有被安装。
dpkg :处理 oracle-xe-universal (--install)时出错:
依赖关系问题 - 仍未被配置
在处理时有错误发生:
oracle-xe-universal
原来是libaio缺少,没有安装,我就下载下来,是个rpm,然后安装这个rpm,

sudo apt-get libaio-0.3.96-7.i386.rpm

正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成

E: 无法找到软件包 libaio-0.3.96-7.i386.rpm
真是郁闷反复试验都不行
放弃这样安装,到网上查找其他方案安装libaio

网上说采用apt-get -f install安装方式可能自动获取包

apt-get -f install 果然可以日志如下:

root@ubuntu:/home/oem# apt-get -f install
Quote
正在读取软件包列表... 完成

正在分析软件包的依赖关系树... 完成

正在更正依赖关系... 完成

将会安装下列额外的软件包:

libaio1

下列【新】软件包将被安装:

libaio1

共升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 7 个软件未被升级。

有 1 个软件包没有被完全安装或卸载。

需要下载 5182B 的软件包。

解压缩后会消耗掉 61.4kB 的额外空间。

您希望继续执行吗?[Y/n]y

获取:http://mirror.lupaworld.com dapper/main libaio1 0.3.104-1ubuntu6 [5182B]下载 5182B,耗时 2s (2346B/s)

选中了曾被取消选择的软件包 libaio1。

( 正在读取数据库 ... 系统当前总共安装有 76207 个文件和目录。)

正在解压缩 libaio1 (从 .../libaio1_0.3.104-1ubuntu6_i386.deb) ...

正在设置 libaio1 (0.3.104-1ubuntu6) ...

正在设置 oracle-xe-universal (10.2.0.1-1.0) ...

Executing Post-install steps...

You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.
然后执行/etc/init.d/oracle-xe configure

root@ubuntu:/home/oem# /etc/init.d/oracle-xe configure
Quote
Oracle Database 10g Express Edition Configuration

-------------------------------------------------

This will configure on-boot properties of Oracle Database 10g Express

Edition. The following questions will determine whether the database should

be starting upon system boot, the ports it will use, and the passwords that

will be used for database accounts. Press <Enter> to accept the defaults.

Ctrl-C will abort.

Specify the HTTP port that will be used for Oracle Application Express [8080]:8080

Specify a port that will be used for the database listener [1521]:1521

Specify a password to be used for database accounts. Note that the same

password will be used for SYS and SYSTEM. Oracle recommends the use of

different passwords for each database account. This can be done after

initial configuration:

Confirm the password:

Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]:y

Starting Oracle Net Listener...Done

Configuring Database...

Starting Oracle Database 10g Express Edition Instance...Done

Installation Completed Successfully.

To access the Database Home Page go to "http://127.0.0.1:8080/apex"
到此位置安装成功,这个版本是Oracle 10 Express,按官方的说法,比较适合在笔记本和做开发的电脑上面使用,提供了Oracle 10g的大多数功能,并且仅需要更小的安装空间和运行环境。

在实践中,我的Ubuntu安装在Windows下的VMWare里面,形成局域网,Ubuntu中的Oracle 10g Express安装成功后,我在Windows下安装了Oracle 10g Express 的Client,可以使用sqlplus以及PL/SQL连接到Ubuntu中的数据库服务器并进行操作。

然后,访问数据:

http://127.0.0.1:8080/apex

可以用system用户访问,密码是在安装过程中设置的那个。进入后可以在网页中进一步激活hr用户。

需要注意的问题:

在刚开始安装的时候可能出现一下问题

root@ubuntu:/home/oem# dpkg -i oracle-xe-universal_10.2.0.1-1.0_i386.deb
Quote
选中了曾被取消选择的软件包 oracle-xe-universal。

( 正在读取数据库 ... 系统当前总共安装有 73613 个文件和目录。)

正在解压缩 oracle-xe-universal (从 oracle-xe-universal_10.2.0.1-1.0_i386.deb) ...

This system does not meet the minimum requirements for swap space. Based on

the amount of physical memory available on the system, Oracle Database 10g

Express Edition requires 750 MB of swap space. This system has 711 MB

of swap space. Configure more swap space on the system and retry the installation.

dpkg :处理 oracle-xe-universal_10.2.0.1-1.0_i386.deb (--install)时出错:

子进程·pre-installation script·返回了错误号·1

在处理时有错误发生:

oracle-xe-universal_10.2.0.1-1.0_i386.deb
这个问题是由于SWAP分区不够的原因造成的,那就增加一个SWAP分区

1 :采用文件的方式增加swap分区

dd if=/dev/zero of=tmp_swap bs=1k count=1100000( 建立一个1.1G的文件)
chmod 600 tmp_swap
mkswap tmp_swap ( 标识swap文件)
swapon tmp_swap ( 激活swap)

安装完成后释放这个空间

swapoff tmp_swap
rm tmp_swap

count 值是根據你需要調整的交換分區大小而定。



sid默认为xe
select name from $dba_table;
--------------------------------------------------------------------
create tablespace  dbspace datafile 'D:\oracle\product\10.2.0\oradata\orcl\dbspace.dbf' size 400M autoextend on next 10m maxsize unlimited;--创建表空间


alter table DX_BBS_PAGE drop column ID;
alter table student drop constraint SYS_C002715;
3、向表中添加主键约束
alter table student add constraint pk_student primary key(studentid);


添加列:
alter table DX_BBS_FORUM add(PARSE_ID NUMBER(10));
---------------------------------------------------------------------
查询每个用户下面拥有哪些表:
select object_name from dba_objects where owner='DAYHAND' and object_type='TABLE';






exp system/manager@TEST file=d:daochu.dmp tables=(table1) query=" where filed1 like 'A1234%'"

./imp dayhand@xe file=/dayhand.dmp full=y




从这里下载oracle的deb安装包:
http://www.oracle.com/technology/software/products/database/xe/htdocs/102xelinsoft.html

安装上以后的地址为:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin



如果是安装deb安装包oracle-xe的,
登录:./sqlplus system@localhost


如果出些下面这个错误:
SP2-0157:
则设置此文件:$ORACLE_HOME/network/admin/sqlnet.ora中设置: SQLNET.AUTHENTICATION_SERVICES= none

SP2-0750:
这个错误设置oracle_home就可: export ORACLE_HOE=xxx






ubuntu下配置oracle 10g express,使别的机器可以访问本机oracle express在SQL命令行里面执行
SQL> exec dbms_xdb.setlistenerlocalaccess(false);
SQL> commit;




OracleXE 简介
甲骨文2005年宣布向中国市场推出的可免费下载的Oracle Database 10g Express Edition (Oracle Database XE) ,供专业人员在学习及应用开发的起步阶段使用。Oracle Database XE建立在Oracle数据库10g第二版的代码库之上,与Oracle数据库产品系列完全兼容。Oracle Database XE可用于32位Linux和Windows操作系统,在功能上,Oracle Database XE版相当于Oracle Standard Edition One。但由于是免费版本,在硬件上受到了一定的限制,如:
至多使用1个CPU或1个双核CPU的处理能力;
最多可使用1GB内存;
每个服务器只限于一个CPU;
最多存储4GB的用户数据。
安装Oracle XE
测试环境建立于Debian系统上,系统具备4Gb的磁盘空间用于建立数据库,500M以上的空间用于安装数据库。要数据库真正运行起来,那么你最好为你的系统配置1Gb的内存。




oracle 修改密码:
sqlplus /nolog
conn / as sysdba
alter user scott identified by ivanok (注:scott是你要更改的用户名,ivanok是你要设置的新密码)。
然后用 sqlplus 登陆试试你刚刚修改的用户和密码有没有生效。



在oracle中,初学者经常报一个错误:
the account is locked

输入语句:
alter user scott account unlock; 
这条语句的作用是解锁







在ubuntu 8.04下安装Oracle 11g方法
http://forum.ubuntu.org.cn/viewtopic.php?t=136860

猜你喜欢

转载自iaiai.iteye.com/blog/1103061