王子
ORACLE创建表空间和用户
10/31
本文最后更新于2023年10月31日,已超过418天没有更新。如果文章内容或图片资源失效,请留言反馈,我会及时处理,谢谢!
1、登录
以sys/sys超级用户登录pl/sql
运行 cmd
sqlplus /nolog
SQL>conn/as sysdba
2、创建临时表空间
create temporary tablespace RESIDENCY_TEMP
tempfile 'D:ctd_soft_installoracleoradataorclRESIDENCY_TEMP.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
3、创建数据表空间
create tablespace RESIDENCY
logging
datafile 'D:ctd_soft_installoracleoradataorclRESIDENCY.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
4、创建用户并指定表空间
create user RESIDENCY identified by RESIDENCY default tablespace RESIDENCY account unlock;
5、给用户授予权限
grant connect,resource,dba to RESIDENCY;
6.修改用户的默认表空间
ALTER USER RESIDENCY
DEFAULT TABLESPACE RESIDENCY;
7.删除表空间
DROP TABLESPACE RESIDENCY_TEMP INCLUDING CONTENTS AND DATAFILES;