一些Oracle数据库用法的小总结
insert into destdb.sub_contract (userid,contractid) select msisdn,product
from month_payinfo partition (partitionname)
(case when (status=7)
then 9
else status
end) as status
nvl(subdate,20100101) as subdate
先删除主键约束,再删除索引
alter table sub_contract drop constraint pk_sub_contract;
drop index pk_sub_contract;
数据割接完后,先并发无日志增加索引,再创建主键约束
create unique index pk_sub_contract on sub_contract(userid,contractid) local parallel 64 tablespace sub01_idx nologging;
alter index pk_sub_contract noparallel;
alter index pk_sub_contract logging;
alter table sub_contract add constraint pk_sub_contract primary key (userid,contractid) using index pk_sub_contract;
dbms_output.put_line('sqlcode:' || to_char(sqlcode) || ',sqlerrm:' || sqlerrm);
通过||拼接特殊字符&
或者set define off
sql%rowcount insert into影响的行数
sqlplus / as sysdba
sqlplus yw/yw@ip:1521/ora @install.sql
execute immediate'select count(1) from sub_contract where userid=:1 and contractid=:2' into v_temp using var.userid,var.contractid;
手机扫一扫
移动阅读更方便
你可能感兴趣的文章