大家好,又见面了,我是你们的朋友全栈君。
创建用户
create user 用户名 identified by 密码;
DBA 用户执行
默认表空间:users
建议指定 表空间
默认临时表空间:temp
-- DBA 用户执行,默认 users 表空间(不推荐)create user <username> identified by <password>;-- 实际开发中create user <username> identified by <password> default tablespace <tablespace_name> -- 默认表空间temporary tablespace temp -- 临时表空间quota unlimited on <tablespace_name> -- 表空间额度grant create session to <username>; -- 授权(可以登录)
示例:创建用户 zhangsan 密码 12345,表空间 TESTTBS
create user zhangsan identified by 12345
default tablespace TESTTBS
temporary tablespace temp
quota unlimited on TESTTBS;
grant create session TO zhangsan;
登录成功:
select *
from dba_users t
where t.username = 'ZHANGSAN';
查询截图:
-- zhangsan 必须已断开连接
drop user zhangsan cascade;
-- 创建
create tablespace TESTTBS -- 区分大小写
datafile 'E:\TableSpace\TESTTBS01.dbf' size 10m;
-- 查询表空间
select *
from dba_tablespaces t
where t.tablespace_name = 'TESTTBS';
-- 查询数据文件
select *
from dba_data_files t
where t.tablespace_name = 'TESTTBS';
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/144680.html原文链接:https://javaforall.cn