当前位置:Gxlcms > 数据库问题 > Oracle数据库创建表空间

Oracle数据库创建表空间

时间:2021-07-01 10:21:17 帮助过:3人阅读

--创建表空间

create tablespace new_taspace1 

--表空间关联的数据文件和位置

DATAFILE ‘D:\NEWTABLESPACE1.DBF‘ 

--文件初始大小

SIZE 200M
技术分享

--日志文件
Logging
extent management local
segment space management  auto; --以分号结束

--删除表空间把物理文件一并删除
drop tablespace new_taspace  including contents and datafiles

--创建用户
create user orders
identified by 123456
default tablespace new_taspace; --给用户创建默认表空间

--给用户赋予角色
grant connect,resource to orders
grant dba from orders

--撤销用户管理员角色

revoke dba from orders

--添加访问某张表的权限

grant select on tep to orders

 

--创建图书表
create table book(
id number(11) primary key,
bookname varchar2(50) not null,
price number(11,2) not null,
storage number(11) not null
)

Oracle数据库创建表空间

标签:

人气教程排行