当前位置:网站首页>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;
边栏推荐
- 2022-5-第四周日报
- 1041 Be Unique
- [rust notes] 17 concurrent (Part 2)
- 1039 Course List for Student
- Introduction to LVS [unfinished (semi-finished products)]
- Leetcode-1200: minimum absolute difference
- How to set the drop-down arrow in the spinner- How to set dropdown arrow in spinner?
- Leetcode-9: palindromes
- 做 SQL 性能优化真是让人干瞪眼
- Navicat連接Oracle數據庫報錯ORA-28547或ORA-03135
猜你喜欢
高斯消元 AcWing 884. 高斯消元解异或線性方程組
MIT-6874-Deep Learning in the Life Sciences Week 7
SQL三种连接:内连接、外连接、交叉连接
论文阅读报告
MySQL advanced part 1: index
Alibaba's new member "Lingyang" officially appeared, led by Peng Xinyu, Alibaba's vice president, and assembled a number of core department technical teams
Doing SQL performance optimization is really eye-catching
Open source storage is so popular, why do we insist on self-development?
LeetCode-61
Single chip computer engineering experience - layered idea
随机推荐
Leetcode-31: next spread
MIT-6874-Deep Learning in the Life Sciences Week 7
Data visualization chart summary (I)
Usage scenarios of golang context
Leetcode-9: palindromes
Multi screen computer screenshots will cut off multiple screens, not only the current screen
C Primer Plus Chapter 15 (bit operation)
Traversal of leetcode tree
快速使用Amazon MemoryDB并构建你专属的Redis内存数据库
容斥原理 AcWing 890. 能被整除的数
【LeetCode】Easy | 20. Valid parentheses
P2575 master fight
安装OpenCV--conda建立虚拟环境并在jupyter中添加此环境的kernel
[BMZCTF-pwn] ectf-2014 seddit
博弈论 AcWing 892. 台阶-Nim游戏
927. Trisection simulation
A reason that is easy to be ignored when the printer is offline
Leetcode-3: Longest substring without repeated characters
Suppose a bank's ATM machine, which allows users to deposit and withdraw money. Now there is 200 yuan in an account, and both user a and user B have the right to deposit and withdraw money from this a
Leetcode stack related