informix数据库和oracle区别,oracle和informix的基础区别-Oracle

oracle和informix的基础区别

1:查看表空间

select

b.file_name 物理文件名,

b.tablespace_name 表空间,

b.bytes/1024/1024 大小M,

(b.bytes-sum(nvl(a.bytes,0)))/1024/1024 已使用M,

substr((b.bytes-sum(nvl(a.bytes,0)))/(b.bytes)*100,1,5) 利用率

from dba_free_space a,dba_data_files b

where a.file_id=b.file_id

group by b.tablespace_name,b.file_name,b.bytes

order by b.tablespace_name

2:oracle

select into的时候会报错

这个时候可以使用count(*)或者是max等来避免出错

3:oracle执行存储过程是直接调用存储过程名称就行

而informix则需要call 或者是execute procedure

informix调用call 如果有错误只是会提示笼统错误。而execute则是提示具体错误

4:informix更新语句是Update tablename set(字段1,字段2)=(value1,value2);

而oracle 的更新则是Set 字段一=value1,字段二=value2

5:informix的赋值语句是let __TimeConfig=0;

而oracle的赋值语句是:__TimeConfig :=0;

6:对于判断是否存在,informix 可以用 exists直接在存储过程中调用,而不仅仅是select 语句中

if exists(select 1 from gspmajor where majorid=M_MajorID) then

let __IsGSPSHeet=1;

end if

oracle 则不行

oracle 一般使用count 判断

7:informix 可以在存储过程中直接创建临时表

create temp table t_SumFeeInfo1

(

sumMemDiscRate dec(12,2),--VIP卡折扣率

sumAllocateRate dec(12,2),--折扣费用分摊

sumVipDDisc dec(12,2),--会员日折扣率

sumVipAllocateRatedec(12,2),--会员日折扣分摊比

sumMaterialFee dec(12,2),--能源物料使用费

sumShopExtFee dec(12,2),--店铺扩展费

sumTotalYearFee dec(12,2),--年度费用汇总

sumGuarantyAmt dec(12,2)--保证金

) with no log;

或者是直接

select A.a1,A.a2 into temp tmp_mallccsheetashopgoods with no log;

而oracle如果在存储过程中,则需要调用

execute immediate

'create GLOBAL TEMPORARY table tmp_orderdif(

GoodsID int not null, --商品编码

DiffQty dec(12,3) default 0 not null--验收差异量

);

drop table tmp_orderdif';

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Informix数据库数据迁移到Oracle数据库,可以按照以下步骤进行操作: 1. 在Oracle数据库中创建相同的表结构:使用CREATE TABLE语句在Oracle数据库中创建与Informix数据库中相同的表结构,确保两个表的字段、数据类型和长度等相同。 2. 在Informix数据库中导出数据:使用UNLOAD命令将Informix数据库中的表数据导出到一个文本文件中。例如,以下命令将table1表的所有数据导出到table1.txt文件中: ``` unload to table1.txt select * from table1; ``` 3. 将数据文件从Informix服务器复制到Oracle服务器:使用scp或sftp等命令将数据文件从Informix服务器复制到Oracle服务器。 4. 在Oracle数据库中导入数据:使用SQL*Loader(SQLLDR)实用程序将数据文件中的数据加载到Oracle数据库中。例如,以下命令将table1.txt文件中的数据加载到table1表中: ``` sqlldr username/password control=load_table1.ctl ``` 在load_table1.ctl文件中指定了数据文件的路径和格式,例如: ``` load data infile '/path/to/table1.txt' into table table1 fields terminated by ',' optionally enclosed by '"' (tran_id, col1, col2, col3, ...) ``` 其中,tran_id是Informix表中的主键或唯一键,需要在Oracle表中进行匹配和插入操作。根据实际情况,您可能需要调整数据文件和控制文件中的格式和字段。 请注意,这只是一个概述,具体操作步骤可能因为版本、环境等原因有所不同。在进行数据迁移前,请务必详细阅读官方文档并进行测试,以确保迁移过程正确无误。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值