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;
标签:脚本,常用,create,datafile,dbf,tablespace,Oracle,TABLESPACE,size 来源: https://blog.csdn.net/CNGE13/article/details/117129957