当前位置:网站首页>5.Oracle-表空间
5.Oracle-表空间
2022-07-05 06:20:00 【寒叶飘逸_】
- 创建一个本地管理方式下自动分区管理的表空间USERTBS1,对应的数据文件为20m
create tablespace usertbs1 datafile 'D:\app\Snakewood\oradata\orcl\usertbs1.dbf' size 20m;
- 创建一个本地管理方式下的表空间USERTBS2,每个分区大小为512K
create tablespace usertbs2 datafile 'D:\app\Snakewood\oradata\mydba\usertbs2.dbf' size 20m extent management local uniform size 512k;
- 修改USERTBS1表空间大小,将该表空间的数据文件改为自动扩展方式,最大值100M
alter database datafile 'D:\app\Snakewood\oradata\mydba\usertbs1.dbf' autoextend on next 5m maxsize 100m;
- 为USERTBS2表空间添加一个数据文件,大小20M
alter tablespace usertbs2 add datafile 'D:\app\Snakewood\oradata\mydba\usertbs2_1.dbf' size 20m;
- 创建一个临时表空间TEMPTBS1,并设置为数据库的默认临时表空间
create temporary tablespace temptbs1 tempfile 'D:\app\Snakewood\oradata\mydba\ temptbs1_1.dbf' size 20m extent management local uniform size 16m;
alter database default temporary tablespace temptbs1;
- 使用SQL命令对USERTBS1表空间进行联机和脱机状态转换
Alter tablespace USERTBS1 offline;
Alter tablespace USERTBS1 online;
- 创建一个SC表(SNO,CNO,GRADE),增加tablespace users字句,然后将USERS表空间设置为只读,尝试为SC表增加一条记录
create table SC (
SNO varchar2(20) primary key,
CNO varchar2(20) not null,
GRADE number(3) not null
)
tablespace users;
alter tablespace users read only;
insert into SC values (‘B201801’,’C0101’,98);
- 创建一个回滚表空间UNDOTBS2,并作为数据库的撤销表空间
create undo tablespace UNDOTBS2 datafile ‘D:\app\Snakewood\oradata\mydba\ UNDOTBS2_1.DBF’ size 20m;
- 将USERTBS1表空间重命名为USERTBS01
alter tablespace USERTBS1 rename to USERTBS01;
- 删除表空间USERTBS2,同时删除该表空间的内容和数据文件
drop tablespace USERTBS2 including contents and datafiles;
边栏推荐
猜你喜欢
Erreur de connexion Navicat à la base de données Oracle Ora - 28547 ou Ora - 03135
实时时钟 (RTC)
容斥原理 AcWing 890. 能被整除的数
Leetcode-6111: spiral matrix IV
QQ computer version cancels escape character input expression
SQLMAP使用教程(二)实战技巧一
Leetcode-6110: number of incremental paths in the grid graph
Appium foundation - use the first demo of appium
RGB LED infinite mirror controlled by Arduino
MySQL advanced part 1: stored procedures and functions
随机推荐
Error ora-28547 or ora-03135 when Navicat connects to Oracle Database
Record the process of configuring nccl and horovod in these two days (original)
Leetcode-6109: number of people who know secrets
Quickly use Amazon memorydb and build your own redis memory database
[rust notes] 16 input and output (Part 2)
Data visualization chart summary (I)
快速使用Amazon MemoryDB并构建你专属的Redis内存数据库
Erreur de connexion Navicat à la base de données Oracle Ora - 28547 ou Ora - 03135
[rust notes] 17 concurrent (Part 2)
Chart. JS - Format Y axis - chart js - Formatting Y axis
MySQL advanced part 2: SQL optimization
Open source storage is so popular, why do we insist on self-development?
1040 Longest Symmetric String
开源存储这么香,为何我们还要坚持自研?
One question per day 1020 Number of enclaves
Leetcode recursion
MySQL advanced part 2: optimizing SQL steps
【LeetCode】Day95-有效的数独&矩阵置零
A reason that is easy to be ignored when the printer is offline
[BMZCTF-pwn] ectf-2014 seddit