当前位置:网站首页>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;
边栏推荐
- [rust notes] 13 iterator (Part 2)
- Leetcode-6111: spiral matrix IV
- Leetcode heap correlation
- [rust notes] 17 concurrent (Part 1)
- Leetcode-6108: decrypt messages
- [rust notes] 16 input and output (Part 2)
- [rust notes] 16 input and output (Part 1)
- P3265 [jloi2015] equipment purchase
- What is socket? Basic introduction to socket
- Leetcode divide and conquer / dichotomy
猜你喜欢
liunx启动redis
Sorting out the latest Android interview points in 2022 to help you easily win the offer - attached is the summary of Android intermediate and advanced interview questions in 2022
Error ora-28547 or ora-03135 when Navicat connects to Oracle Database
Leetcode array operation
可变电阻器概述——结构、工作和不同应用
MySQL advanced part 1: stored procedures and functions
4. 对象映射 - Mapping.Mapster
高斯消元 AcWing 884. 高斯消元解异或线性方程组
Alibaba established the enterprise digital intelligence service company "Lingyang" to focus on enterprise digital growth
背包问题 AcWing 9. 分组背包问题
随机推荐
[rust notes] 14 set (Part 2)
MatrixDB v4.5.0 重磅发布,全新推出 MARS2 存储引擎!
Single chip computer engineering experience - layered idea
11-gorm-v2-02-create data
Currently clicked button and current mouse coordinates in QT judgment interface
Chart. JS - Format Y axis - chart js - Formatting Y axis
4. Object mapping Mapster
[BMZCTF-pwn] ectf-2014 seddit
求组合数 AcWing 887. 求组合数 III
Records of some tools 2022
快速使用Amazon MemoryDB并构建你专属的Redis内存数据库
Chapter 6 relational database theory
Leetcode-22: bracket generation
Groupbykey() and reducebykey() and combinebykey() in spark
Introduction to LVS [unfinished (semi-finished products)]
数据可视化图表总结(一)
927. 三等分 模拟
Alibaba's new member "Lingyang" officially appeared, led by Peng Xinyu, Alibaba's vice president, and assembled a number of core department technical teams
[rust notes] 16 input and output (Part 1)
Navicat连接Oracle数据库报错ORA-28547或ORA-03135