创建用户
时间:2010-08-26 来源:snailshen
--修改用户口令
alter user user01 identified by user10;
--修改表空间
alter table js.dr_wj_voice_20080801 move tablespace TS_CDR_DAT_03;
--查错误
oerr ora 01756
--sqlplus语句
declare
a number(10);
b number(10);
tabname varchar2(32);
sqlstr varchar2(100);
begin
a := 20081001;
b := 1;
while b<=31 loop
tabname := 'js.dr_wj_voice_'|| to_char(a);
sqlstr := 'drop table ' ||tabname ;
--sqlstr := 'truncate table dr_wj_voice_'|| tabname;
--sqlstr := 'delete dr_wj_voice_20080401 where odn not like ''157%'' and tdn not like ''157%''';
execute immediate sqlstr;
a := a+1;
b := b+1;
end loop;
end;
--多列更新
update js.dr_wj_voice_20080701 t set(t.CHARGE_DIR,t.ACC_SETTLE_ID,t.CHARGE)=
(select 1,110801,ceil(duration/60)*0.06*1000 from js.dr_wj_voice_20080701 t2 where
t2.trunk_in in ('6','7')and t2.trunk_out in ('85','89') and t.rowid = t2.rowid)
where t.trunk_in in ('6','7')and t.trunk_out in ('85','89') ;
--创建用户
system/oracle
SQL> drop user joyw;
用户已丢弃
SQL> create user joyw identified by joyw;
用户已创建
SQL> grant create session,select any table to joyw;
授权成功。
SQL> alter user joyw quota 0 on system;
用户已更改。
SQL> set wrap off