Oracle数据库创建表空间

发表于:2015-5-25 10:01

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:渣渣也能变成神    来源:51Testing软件测试网采编

--Oracle数据库创建表空间
create tablespace new_taspace
--表空间名
DATAFILE 'D:\NEWTABLESPACE.DBF'   --表空间关联的数据文件和位置
size 200M --文件初始大小
autoextend on next 20MB MAXSIZE 400MB; --文件大小可自动扩展,每次扩展20MB,最大400MB
--创建表空间
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
)
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号