当前位置:网站首页>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;

边栏推荐
- SPI 详解
- Alibaba established the enterprise digital intelligence service company "Lingyang" to focus on enterprise digital growth
- Series of how MySQL works (VIII) 14 figures explain the atomicity of MySQL transactions and the principle of undo logging
- MySQL advanced part 2: the use of indexes
- Nested method, calculation attribute is not applicable, use methods
- 1040 Longest Symmetric String
- Règlement sur la sécurité des réseaux dans les écoles professionnelles secondaires du concours de compétences des écoles professionnelles de la province de Guizhou en 2022
- our solution
- 阿里新成员「瓴羊」正式亮相,由阿里副总裁朋新宇带队,集结多个核心部门技术团队
- MySQL advanced part 1: View
猜你喜欢
随机推荐
LeetCode 0107. Sequence traversal of binary tree II - another method
MySQL advanced part 1: stored procedures and functions
[BMZCTF-pwn] ectf-2014 seddit
1039 Course List for Student
MySQL怎么运行的系列(八)14张图说明白MySQL事务原子性和undo日志原理
2021apmcm post game Summary - edge detection
MySQL advanced part 2: SQL optimization
Leetcode dynamic programming
实时时钟 (RTC)
Filter the numbers and pick out even numbers from several numbers
SPI details
打印机脱机时一种容易被忽略的原因
Doing SQL performance optimization is really eye-catching
NotImplementedError: Cannot convert a symbolic Tensor (yolo_boxes_0/meshgrid/Size_1:0) to a numpy ar
11-gorm-v2-03-basic query
One question per day 1020 Number of enclaves
博弈论 AcWing 891. Nim游戏
MySQL advanced part 1: View
Sum of three terms (construction)
MatrixDB v4.5.0 重磅发布,全新推出 MARS2 存储引擎!









