大家好,又见面了,我是全栈君
[root@localhost ~]# su – oracle
[oracle@localhost ~]$ sqlplus /nolog
SQL> conn /as sysdba;
SQL> show user;
USER is “SYS”
SQL> select name from v$datafile;
//创建临时表空间
create temporary tablespace xsgj_temp
tempfile ‘/opt/oradata/WULIU/xsgj_temp.dbf’
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;
//创建数据表空间
create tablespace xsgj_data
logging
datafile ‘/opt/oradata/WULIU/xsgj_data.dbf’
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;
//创建用户并指定表空间 http://hovertree.com/menu/oracle/
create user xsgj identified by xsgjmm
default tablespace xsgj_data
temporary tablespace xsgj_temp;
//给用户授予权限
grant connect,resource to xsgj;
//授dba权限
grant dba to xsgj;
//授dblink权限
grant create public database link to xsgj;
//以后以该用户登录,创建的任何数据库对象都属于test_temp 和test_data表空间,这就不用在每创建一个对象给其指定表空间了。
附加:
表空间的位置可以用一下的查询语句来查询
select name from v$datafile;
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/120337.html原文链接:https://javaforall.cn
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有