Oracle

创建表空间

create tablespace jecn datafile 'D:\devTools\oracle\tbspace\epros.dbf' size 200m autoextend on next 100m maxsize unlimited;

创建用户

create user epros identified by epros default tablespace jecn;

授权用户

grant connect,resource,dba to epros;

导出备份

exp   yll/jecn@xe  file=C:/Users/110/Desktop/EPROSV4.1/yll.dmp
导入备份
imp  名/密码@xe  file=e:/2020.dmp  full=y
imp  epros/epros@xe  file=e:/0630.dmp  full=y

删除用户

drop user epros cascade
删除表空间
DROP TABLESPACE epros INCLUDING CONTENTS AND DATAFILES;
修改字段长度
alter table 表明 modify 列明 varchar2(120);
字符串 ←→ 时间
to_date('2020-11-20 15:22:44', 'yyyymmddhh24miss')
to_char(sysdate,'yyyy-mm-dd hh24:mi:ss')
生成UUID
CREATE OR REPLACE
FUNCTION get_uuid
RETURN VARCHAR
IS
guid VARCHAR (50);
BEGIN
guid := lower(RAWTOHEX(sys_guid()));
RETURN
substr(guid,1,8)||'-'||substr(guid,9,4)||'-'||substr(guid,13,4)||'-'||substr(guid,17,4)||'-'||substr(guid,21,12);
END get_uuid;
​
SQL> select get_uuid from dual 
更新
update jecn_flow_org_image a 
set (a.figure_id) = (select b.figure_id from jecn_flow_org_image_tmp b  where a.figure_number_id = b.figure_number_id  ) 
where exists (select 1 from jecn_flow_org_image_tmp b where a.figure_number_id = b.figure_number_id ) ;
建表
CREATE TABLE jecn_flow_org_image_tmp AS select * from jecn_flow_org_image where  org_path is null;

 

 

 

posted @ 2021-07-15 14:06  lovleo  阅读(36)  评论(0编辑  收藏  举报