当前位置:网站首页>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’;
边栏推荐
猜你喜欢

Illegal use of crawlers, an Internet company was terminated, the police came to the door, and 23 people were taken away

commands out of sync. did you run multiple statements at once

Minecraft air Island service

Sqli labs level 1

OpenShift 部署应用

kubernetes部署loki日志系统

将一串数字顺序后移

Driving test Baodian and its spokesperson Huang Bo appeared together to call for safe and civilized travel

kubeadm部署kubernetes v1.23.5集群

Service de groupe minecraft
随机推荐
Detailed explanation of NIN network
C # save web pages as pictures (using WebBrowser)
Qt的connect函数和disconnect函数
Mysql安装时mysqld.exe报`应用程序无法正常启动(0xc000007b)`
KubeSphere 虚拟化 KSV 安装体验
Webflux responsive programming
群辉 NAS 配置 iSCSI 存储
HCIA - data link layer
Realization of basic function of sequence table
MYSQL安装出现问题(The service already exists)
Classes and objects (instantiation of classes and classes, this, static keyword, encapsulation)
Minecraft group service opening
随笔:RGB图像颜色分离(附代码)
Nacos download, start and configure MySQL database
QT qtimer class
Oracle related statistics
Openfeign is easy to use
Find the node with the smallest value range in the linked list and move it to the front of the linked list
Concise analysis of redis source code 11 - Main IO threads and redis 6.0 multi IO threads
Getting started with k8s: building MySQL with Helm