oracle查询挂起,表挂起更新查询Oracle 11g(Table hangs on Update query Oracle 11g)

表挂起更新查询Oracle 11g(Table hangs on Update query Oracle 11g)

我正在更新一个Oracle表字段,引用另一个具有类似Key字段的表,但在此特定表上,Update会挂起最多十分钟。 具有相同记录数的另一个表上的此更新在几秒内执行。 是否有更快的方式更新表或我的查询有什么问题?

update MAINRETAIL_MIG s set s. accountid = (

select e. accountid from accounts e where s.ORGKEY = e.ORGKEY);

I am updating one Oracle table field in reference to another table having similar Key fields but on this Particular table the Update hangs for upto ten Minutes. This Update on another table having the same Number Of records executes in a few swconds. Is there a faster way to Update the Table or what is the Problem with My query?

update MAINRETAIL_MIG s set s. accountid = (

select e. accountid from accounts e where s.ORGKEY = e.ORGKEY);

原文:https://stackoverflow.com/questions/16434311

更新时间:2019-09-11 12:47

最满意答案

我刚刚在orgkey字段上创建了索引,而Update则是第一个。

I just created index on orgkey field and the Update goes first.

2014-02-26

相关问答

你是不是要在windows上安装,可下载的却是linux版本的oracle呀。 你仔细看看压缩文件的名字是for_windowns的还是for_linux的,如果不是你想要的再重新下载一个你想要的就好了。 下载地址 www.oracle.com

你是不是要在windows上安装,可下载的却是linux版本的oracle呀。

你仔细看看压缩文件的名字是for_windowns的还是for_linux的,如果不是你想要的再重新下载一个你想要的就好了。

下载地址

www.oracle.com

http://download.oracle.com/otn/nt/oracle11g/win32_11gR1_database.zip

不需要注册,直接复制到迅雷或其他下载软件中即可下载。

Oracle数据库创建用户 在dba权限的用户下执行命令"create user 用户名 identified by 密码;" 用这个命令创建的用户还不能登录,需要进行授权 赋予connect和resource权限 grant connect,resource to 用户名;

我刚刚在orgkey字段上创建了索引,而Update则是第一个。 I just created index on orgkey field and the Update goes first.

尝试使用to_timestamp_tz。 例如: SQL> create table tz_test

(

id number,

col1 timestamp with time zone

)

Table created.

SQL> insert into tz_test values (1, systimestamp)

1 row created.

SQL> insert into tz_test values (2, to_timestamp('20150716 7:40:04', 'YYYY

...

主要问题是:你想实现什么目标? 在内部查询中,您按A1,A2,A3进行分组,因此您可以根据A1 / A2 / A3组合获得一行。 所有这些列都在选择列表中。 所以每一行都与另一行不同,因为它们都有不同的A1 / A2 / A3组合。 一个使用DISTINCT从结果中删除重复项,但在你的情况下,可能没有重复项,因此DISTINCT在这里完全是多余的。 然后你选择A4,但是当你按A1,A2,A3分组时,你通常必须决定你想要的A4。 如果A4依赖于A1,A2,A3或其组合(例如员工号码上的员工姓名,即由

...

您可以为此目的使用序列: create sequence s;

检索id select s.nextval from dual;

或检索一系列ID: select s.nextval from dual connect by level <= 10;

you can use sequences for this purpose: create sequence s;

to retrieve a id select s.nextval from dual;

or to retrieve a

...

我使用Oracle SQL Developer: http : //www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index-098778.html 有Win-32,Win-64,Linux和Mac OS X版本。 I use Oracle SQL Developer: http://www.oracle.com/technetwork/developer-tools/sql-developer/downloa

...

您可以通过检查审核状态 SHOW parameter audit_trail

要么 SELECT name, value FROM v$parameter WHERE name = 'audit_trail';

如果它被设置为none则审核是否关闭,其他任何内容都已打开。 有关此值的选项的更多信息,请参见此处 。 You can check the audit status via SHOW parameter audit_trail

or SELECT name, value FROM v

...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值