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

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

创建表空间指南

第一步:创建表空间

在数据库中创建表空间是数据库管理的基础操作。本文将指导您如何创建临时表空间和数据表空间。

1. 创建临时表空间

临时表空间主要用于排序运算、索引管理和视图访问等操作,系统会自动清理临时空间。

create temporary tablespace user_temp    tablespace_name 'user_temp'    datafile 'D:\app\weking\weking_temp.dbf' -- 自定义路径    size 50M    autoextend on next 50M    maxsize 20480M    extent management local;

2. 创建数据表空间

数据表空间用于存储实际数据,路径和大小可根据需求自定义。

create tablespace user_data    tablespace_name 'user_data'    datafile 'E:\app\Administrator\product\11.2.0\weking_data.dbf' -- 自定义路径    size 50M    autoextend on next 50M    maxsize 20480M    extent management local;

查看表空间信息

如果需要查看表空间详情,可以使用以下SQL语句。

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    default tablespace user_data -- 数据表空间名称    temporary tablespace user_temp; -- 临时表空间名称

第三步:授予用户权限

赋予用户必要的权限以进行数据库操作。

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

删除表空间

当不再需要表空间时,可以安全删除它。

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

请确保在删除表空间前,确保没有相关数据或正在进行的操作依赖该表空间。

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

你可能感兴趣的文章
OAuth2.0_环境介绍_授权服务和资源服务_Spring Security OAuth2.0认证授权---springcloud工作笔记138
查看>>
OAuth2.0_环境搭建_Spring Security OAuth2.0认证授权---springcloud工作笔记139
查看>>
oauth2.0协议介绍,核心概念和角色,工作流程,概念和用途
查看>>
OAuth2授权码模式详细流程(一)——站在OAuth2设计者的角度来理解code
查看>>
oauth2登录认证之SpringSecurity源码分析
查看>>
OAuth2:项目演示-模拟微信授权登录京东
查看>>
OA系统多少钱?OA办公系统中的价格选型
查看>>
OA系统选型:选择好的工作流引擎
查看>>
OA让企业业务流程管理科学有“据”
查看>>
OA项目之我的会议(会议排座&送审)
查看>>
OA项目之我的会议(查询)
查看>>
Object c将一个double值转换为时间格式
查看>>
object detection之Win10配置
查看>>
object detection训练自己数据
查看>>
object detection错误Message type "object_detection.protos.SsdFeatureExtractor" has no field named "bat
查看>>
object detection错误之Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
查看>>
object detection错误之no module named nets
查看>>
Object of type 'ndarray' is not JSON serializable
查看>>
Object Oriented Programming in JavaScript
查看>>
object references an unsaved transient instance - save the transient instance before flushing
查看>>