当前位置:网站首页>Oracle修改表空间名称以及数据文件
Oracle修改表空间名称以及数据文件
2022-07-02 06:32:00 【Axi-ZYTao】
目的:我想将表空间tablespace1的名称和对应的数据文件名称/u01/app/oradata/oradb/tablespace1.dbf都修改为tablespace2
系统用户sys以sysdba的身份登录;
修改oracle表空间名称和数据文件名称的步骤如下:
1、修改表空间名称
alter tablespace /tablespace1 rename to /tablespace2;
2、将修改后的表空间离线
alter tablespace /tablespace2 offline;
3、然后将数据物理文件修改名称
我的文件目录为:
/u01/app/oradata/oradb//tablespace1.dbf
将/tablespace1.dbf修改为/tablespace2.dbf
PS:需要切换到oracle用户下面操作
4、使用系统用户sys以sysdba的身份登录后,执行如下语句:
alter tablespace /tablespace2 rename datafile '/u01/app/oradata/oradb//tablespace1.dbf' to '/u01/app/oradata/oradb/tablespace2.dbf';
5、使表空间在线
alter tablespace /tablespace2 online;
6、使用SQL语句查询表空间使用量与剩余量
--已使用表空间计算
select sum(bytes/1024/1024/1024) from user_segments;
--剩余表空间计算
select sum(bytes/1024/1024/1024) from user_free_space T where tablespace_name=‘tablespace_name’;
边栏推荐
- Data asset management function
- Minecraft air Island service
- Hcia - Application Layer
- Solution and analysis of Hanoi Tower problem
- Solution of Xiaomi TV's inability to access computer shared files
- 使用递归函数求解字符串的逆置问题
- HCIA—应用层
- sqli-labs(POST类型注入)
- Use of libusb
- C language custom types - structure, bit segment (anonymous structure, self reference of structure, memory alignment of structure)
猜你喜欢
commands out of sync. did you run multiple statements at once
sqli-labs第2关
Openfeign is easy to use
Sqli labs (post type injection)
Aneng logistics' share price hit a new low: the market value evaporated by nearly 10 billion yuan, and it's useless for chairman Wang Yongjun to increase his holdings
File upload Labs
Minecraft空岛服开服
MYSQL安装出现问题(The service already exists)
Routing foundation - dynamic routing
汉诺塔问题的求解与分析
随机推荐
队列的基本概念介绍以及典型应用示例
C call system sound beep~
Mirror protocol of synthetic asset track
选择排序和插入排序
Pointer initialization
Minecraft模组服开服
Minecraft air Island service
C# 调用系统声音 嘀~
NPOI 导出Word 字号对应
Minecraft install resource pack
Analysis and solution of a classical Joseph problem
Hcia - Application Layer
[blackmail virus data recovery] suffix Crylock blackmail virus
[blackmail virus data recovery] suffix Hydra blackmail virus
File upload Labs
Nacos 下载启动、配置 MySQL 数据库
gocv拆分颜色通道
kubeadm部署kubernetes v1.23.5集群
随笔:RGB图像颜色分离(附代码)
Aneng logistics' share price hit a new low: the market value evaporated by nearly 10 billion yuan, and it's useless for chairman Wang Yongjun to increase his holdings