C/C++教程

Oracle 常用脚本

本文主要是介绍Oracle 常用脚本,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

– 连接
sqlplus sys/sys as sysdba;

– 创建用户
create user ZLHIS identified by ZLHIS_2020;

– 删除用户
drop user yb CASCADE;

– 权限
grant connect,resource,dba to ZLHIS;
grant dba to ZLHIS;

–表空间
create tablespace ZL9MTLBASE datafile ‘E:\TABLESPACE\ZL9MTLBASE.dbf’ size 20000m;
create tablespace ZL9BASEITEM datafile ‘E:\TABLESPACE\ZL9BASEITEM.dbf’ size 20000m;
create tablespace ZL9EXPENSE datafile ‘E:\TABLESPACE\ZL9EXPENSE.dbf’ size 20000m;
create tablespace ZL9MEDBASE datafile ‘E:\TABLESPACE\ZL9MEDBASE.dbf’ size 1000m;

create tablespace ZL9PATIENT datafile ‘E:\TABLESPACE\ZL9PATIENT.dbf’ size 2400m;

–删除表空间
drop tablespace ZL9MTLBASE including contents and datafiles CASCADE CONSTRAINTS;
– 查看表空间 及大小
SELECT t.tablespace_name, round(SUM(bytes / (1024 * 1024)), 0) ts_size
FROM dba_tablespaces t, dba_data_files d
WHERE t.tablespace_name = d.tablespace_name
GROUP BY t.tablespace_name;

这篇关于Oracle 常用脚本的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!