ORACLE创建用户sql、赋权
创建用户修改密码赋权表查询赋权创建表空间将表空间分配给用户删除表空间创建用户
create user test identified by "123456" default tablespace test;
修改密码
alter user test identified by "123456";
赋权
grant connect, resource to test;grant dba to test;grant create session,create table,create view,create sequence,create procedure,unlimited tablespace to test;
表查询赋权
GRANT SELECT ON DBA_MVIEWS TO scott;
创建表空间
create tablespace testloggingdatafile 'E:\NEW\ORADATA\ORCL\test.DBF'size 50mautoextend onnext 100m MAXSIZE unlimited extent management local;
将表空间分配给用户
alter user test default tablespace test;
删除表空间
--删除空的表空间,但是不包含物理文件 drop tablespace tablespace_name; --删除非空表空间,但是不包含物理文件 drop tablespace tablespace_name including contents; --删除空表空间,包含物理文件 drop tablespace tablespace_name including datafiles; --删除非空表空间,包含物理文件 drop tablespace tablespace_name including contents and datafiles; --如果其他表空间中的表有外键等约束关联到了本表空间中的表的字段,就要加上CASCADE CONSTRAINTS drop tablespace tablespace_name including contents and datafiles CASCADE CONSTRAINTS;