您的位置:首页 > 数据库 > Oracle

创建Oracle数据库

2016-06-11 18:57 465 查看
[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;

推荐:http://www.cnblogs.com/roucheng/p/3504463.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: