当前位置:网站首页>2.Oracle-数据文件的添加及管理
2.Oracle-数据文件的添加及管理
2022-07-05 06:20:00 【寒叶飘逸_】
- 查询V$DATAFILE、DBA_DATA_FILES表
查询V$DATAFILE
select name,file#,checkpoint_change# from v$datafile;

查询DBA_DATA_FILES
select tablespace_name,autoextensible,file_name from dba_data_files;

- 为users表空间添加数据文件users03.dbf,大小10mb
alter tablespace users add datafile 'D:\app\Snakewood\oradata\orcl\users03.dbf' size 10m;


- 为users表空间添加数据文件user02.dbf,大小10mb,自动扩展
alter tablespace users add datafile 'D:\app\Snakewood\oradata\orcl\user02.dbf' size 10m autoextend on;


3. 为users表空间添加数据文件users05.dbf,大小10mb,最大值50mb
alter tablespace users add datafile 'D:\app\Snakewood\oradata\orcl\users05.dbf' size 10m autoextend on maxsize 50m;


4. 修改users表空间中的users03.dbf为自动扩展,每次扩展5mb,最大20mb
alter database datafile 'D:\app\Snakewood\oradata\orcl\users03.dbf' autoextend on next 5m maxsize 20m;

- 把数据库改为归档方式
首先,查询数据库当前是否处于归档模式
select name,log_mode from v$database;

关闭数据库,在mount模式中修改数据库为归档模式,重新启动数据库
检查当前数据库的归档模式
6. 将users01.dbf脱机,观察控制文件的变化
脱机前:

脱机后:
alter database backup controlfile to trace as 'C:\Users\Snakewood\Desktop\offline.txt';


脱机(offline)后恢复联机(online):
7. 将users03.dbf更名为users003.dbf,users02移动到e盘(尝试3种方法)
将users03.dbf更名为users003.dbf:
① 只对users03.dbf脱机
先修改文件名为users003.dbf
进行脱机操作
修改控制文件中的记录

重新连接数据库并进行online
② 对表空间脱机
修改文件名为users03.dbf
进行脱机操作
① 只对users003.dbf脱机
修改控制文件中的记录

重新连接数据库
② 对表空间进行脱机操作
将表空间置为脱机状态
移动users003到新文件夹后命名为users203
修改控制文件信息
将表空间联机
边栏推荐
- 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
- 1040 Longest Symmetric String
- Error ora-28547 or ora-03135 when Navicat connects to Oracle Database
- Winter vacation water test 1 Summary
- 11-gorm-v2-03-basic query
- How to set the drop-down arrow in the spinner- How to set dropdown arrow in spinner?
- 【LeetCode】Easy | 20. Valid parentheses
- 11-gorm-v2-02-create data
- MySQL advanced part 1: index
- MPLS experiment
猜你喜欢

Doing SQL performance optimization is really eye-catching

MySQL advanced part 2: the use of indexes

【LeetCode】Easy | 20. Valid parentheses

阿里新成员「瓴羊」正式亮相,由阿里副总裁朋新宇带队,集结多个核心部门技术团队
![[2021]IBRNet: Learning Multi-View Image-Based Rendering Qianqian](/img/f1/e7a8a1a31bc5712d9f32d91305a2b0.jpg)
[2021]IBRNet: Learning Multi-View Image-Based Rendering Qianqian

区间问题 AcWing 906. 区间分组

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

SQL三种连接:内连接、外连接、交叉连接

Matrixdb V4.5.0 was launched with a new mars2 storage engine!

做 SQL 性能优化真是让人干瞪眼
随机推荐
MySQL advanced part 1: View
[BMZCTF-pwn] ectf-2014 seddit
QQ computer version cancels escape character input expression
liunx启动redis
SPI details
4. 对象映射 - Mapping.Mapster
SQLMAP使用教程(二)实战技巧一
【LeetCode】Day95-有效的数独&矩阵置零
Redis publish subscribe command line implementation
The difference between CPU core and logical processor
求组合数 AcWing 887. 求组合数 III
Regulations for network security events of vocational group in 2022 Guizhou Vocational College skill competition
Introduction to LVS [unfinished (semi-finished products)]
3.Oracle-控制文件的管理
开源存储这么香,为何我们还要坚持自研?
Bash exercise 17 writing scripts to install the server side of FRP reverse proxy software
Navicat连接Oracle数据库报错ORA-28547或ORA-03135
Sword finger offer II 058: schedule
栈 AcWing 3302. 表达式求值
2048项目实现