当前位置:网站首页>5.Oracle-錶空間
5.Oracle-錶空間
2022-07-05 06:22: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;

边栏推荐
- MySQL advanced part 1: triggers
- One question per day 1020 Number of enclaves
- Is it impossible for lamda to wake up?
- Appium foundation - use the first demo of appium
- Alibaba established the enterprise digital intelligence service company "Lingyang" to focus on enterprise digital growth
- SQLMAP使用教程(一)
- Liunx starts redis
- 求组合数 AcWing 887. 求组合数 III
- 实时时钟 (RTC)
- Alibaba's new member "Lingyang" officially appeared, led by Peng Xinyu, Alibaba's vice president, and assembled a number of core department technical teams
猜你喜欢

1.13 - RISC/CISC

Leetcode array operation

求组合数 AcWing 889. 满足条件的01序列

阿里新成员「瓴羊」正式亮相,由阿里副总裁朋新宇带队,集结多个核心部门技术团队

Bash exercise 17 writing scripts to install the server side of FRP reverse proxy software

LeetCode 0108. Convert an ordered array into a binary search tree - the median of the array is the root, and the left and right of the median are the left and right subtrees respectively

中国剩余定理 AcWing 204. 表达整数的奇怪方式

Redis publish subscribe command line implementation

redis发布订阅命令行实现
![Introduction to LVS [unfinished (semi-finished products)]](/img/72/d5a943a8d6d71823dcbd7f23dda35b.png)
Introduction to LVS [unfinished (semi-finished products)]
随机推荐
MatrixDB v4.5.0 重磅发布,全新推出 MARS2 存储引擎!
Bash exercise 17 writing scripts to install the server side of FRP reverse proxy software
LeetCode-54
P2575 master fight
[leetcode] day95 effective Sudoku & matrix zeroing
Golang uses context gracefully
MPLS experiment
Doing SQL performance optimization is really eye-catching
What's wrong with this paragraph that doesn't work? (unresolved)
[rust notes] 16 input and output (Part 2)
MIT-6874-Deep Learning in the Life Sciences Week 7
MySQL advanced part 1: index
阿里新成员「瓴羊」正式亮相,由阿里副总裁朋新宇带队,集结多个核心部门技术团队
What is socket? Basic introduction to socket
什么是套接字?Socket基本介绍
【LeetCode】Easy | 20. Valid parentheses
Introduction to LVS [unfinished (semi-finished products)]
Appium foundation - use the first demo of appium
Erreur de connexion Navicat à la base de données Oracle Ora - 28547 ou Ora - 03135
C job interview - casting and comparing - C job interview - casting and comparing