登录linux,切换到oracle用户
su oracle
sqlplus / as sysdba
查询当前系统所有表空间
select name from v$datafile;
新建表空间,语法如下:
create tablespace 表空间名 datafile '对应的文件名' size 大小;
create tablespace yzh datafile '/u01/app/oracle/oradata/orcl/yzh.dbf' size 10240m;
表空间名为:yzh ,文件路径为:/u01/app/oracle/oradata/orcl/yzh.dbf ,初始大小为:10240m=10g
设置yzh的表空间为自动扩展,并确认是否已经修改成功
alter database datafile '/u01/app/oracle/oradata/orcl/yzh.dbf' autoextend on;
select tablespace_name,file_name,autoextensible from dba_data_files where tablespace_name = 'yzh';
创建用户,语法如下:
create user 用户名 identified by 密码 default tablespace 用户默认使用哪一个表空间;
create user yzh_epay identified by yzh_epay default tablespace yzh;
修改用户的权限,语法如下:
grant 角色1,角色2 to 用户名;
grant dba, connect to yzh_epay;