博客
关于我
安装Oracle之后的第一步---创建表空间、新增用户、用户授权
阅读量:227 次
发布时间:2019-03-01

本文共 1094 字,大约阅读时间需要 3 分钟。

第一步:创建表空间

表空间:此空间是用来进行的。

临时表空间:主要用途是在数据库进行排序运算、管理索引、访问视图等操作时提供临时的运算空间,当运算完成之后系统会自动清理。
备注:因为用途不同所以才有了区分,实际上数据库都是有默认临时空间的,但实际应用中很难满足需求,所以才需要自己创建临时空间。

1、创建临时表空间

create temporary tablespace user_temp    --user_temp:表空间名称tempfile 'D:\app\weking\weking_temp.dbf' --路径自定义size 50mautoextend onnext 50m maxsize 20480mextent management local;

 

 

2、创建数据表空间

create tablespace user_data    --user_data:表空间名称loggingdatafile 'E:\app\Administrator\product\11.2.0\weking_data.dbf' --路径自定义size 50mautoextend onnext 50m maxsize 20480mextent management local;

 

--tips:查看表空间的名称及大小 

SELECT t.tablespace_name, round(SUM(bytes / (1024 * 1024)), 0) ts_sizeFROM dba_tablespaces t, dba_data_files dWHERE t.tablespace_name = d.tablespace_nameGROUP BY t.tablespace_name;

 

第二步:创建用户并指定表空间

create user weking identified by weking    --两个weking都是用户名default tablespace user_data    --user_data:表空间名temporary tablespace user_temp;    --user_temp:临时表空间名

 

第三步:给用户授予权限

grant connect,resource,dba to weking;    --weking:用户名

 

----tips:删除表空间(含物理位置)

alter tablespace user_temp offline;drop tablespace user_temp including contents and datafiles;

 

 

转载地址:http://eyav.baihongyu.com/

你可能感兴趣的文章
Mysql数据库备份的问题:mysqldump: Got error: 1049: Unknown_无需整理
查看>>
MySQL数据库实现主从同步数据
查看>>
mysql数据库扫盲,你真的知道什么是数据库嘛
查看>>
mysql数据库批量插入数据shell脚本实现
查看>>
MySQL数据库操作
查看>>
MySQL数据库故障排错
查看>>
MySQL数据库无法远程连接的解决办法
查看>>
mysql数据库时间类型datetime、bigint、timestamp的查询效率比较
查看>>
MySQL数据库服务器端核心参数详解和推荐配置(一)
查看>>
Mysql数据库的条件查询语句
查看>>
MySQL数据库的高可用
查看>>
MYSQL数据库简单的状态检查(show processlist)
查看>>
MYSQL数据库简单的状态检查(show status)
查看>>
MYSQL数据库自动本地/异地双备份/MYSQL增量备份
查看>>
mysql数据库表增添字段,删除字段、修改字段的排列等操作,还不快来
查看>>
MySQL数据库设计与开发规范
查看>>
MYSQL数据库进阶操作
查看>>
MySQL数据库配置文件调优详解
查看>>
MySQL数据库面试题(2021最新版)
查看>>
MySQL数据库高并发优化配置
查看>>