oracle新建用户以及创建表空间

--创建用户XXXuser,设置初始密码XXXpassword

create user XXXuser identified by XXXpassword;

--修改XXXuser的密码为newPassword
alter user XXXuser identified by newPassword;

--删除已存在的表空间XXXuser
drop tablespace XXXuser including contents and datafiles;

--创建表空间XXXuser,数据文件名为及路径为D:\XXXuser.dbf
create tablespace XXX_TBS datafile '/u01/app/oracle/oradata/orcl/XXX_TBS.dbf' size 100m autoextend on next 32m maxsize unlimited;

--设置XXXuser用户默认表空间为XXXuser
alter user XXXuser default tablespace XXXuser;

--根据实际需要对用户进行授权开始

grant resource,connect to XXXuser;

grant create session to XXXuser;

grant create table to XXXuser;

grant create view to XXXuser;

grant create tablespace to XXXuser;

grant unlimited tablespace to XXXuser;

grant select any table to XXXuser;

grant select any dictionary to XXXuser;

根据实际需要给用户授权

posted @ 2025-09-02 16:19  黄多鱼  阅读(12)  评论(0)    收藏  举报