Oracle修改数据文件名以及移动数据文件(2)

sys@ORCL>col file_name for a70
sys@ORCL>select file_name,tablespace_name,status,online_status from dba_data_files;
select file_name,tablespace_name,status,online_status from dba_data_files;
FILE_NAME      TABLESPACE_NAME      STATUSONLINE_
---------------------------------------------------------------------- ------------------------------ --------- -------
/u02/app/oracle/oradata/orcl/users01.dbf      USERS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/undotbs01.dbf      UNDOTBS1      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/sysaux01.dbf      SYSAUX      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/system01.dbf      SYSTEM      AVAILABLE SYSTEM
/u02/app/oracle/oradata/orcl/DEV_svctbl.dbf      DEV_STB      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV_ias_opss.dbf      DEV_IAS_OPSS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV_iau.dbf      DEV_IAU      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV_veridata_user.dbf      DEV_VERIDATA_USER      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_mds.dbf      DEV3_MDS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_wlsservices.dbf      DEV3_WLS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_iau.dbf      DEV3_IAU      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_ias_opss.dbf      DEV3_IAS_OPSS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_oggmon.dbf      DEV3_OGGMON      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV2_ias_opss.dbf      DEV2_IAS_OPSS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_UMS.dbf      DEV3_IAS_UMS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_svctbl.dbf      DEV3_STB      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV2_oggmon.dbf      DEV2_OGGMON      AVAILABLE ONLINE
/home/oracle/tt_mv.dbf      TT      AVAILABLE ONLINE
/home/oracle/undo02.dbf        UNDOTBS1      AVAILABLE ONLINE
19 rows selected.
sys@ORCL>alter tablespace tt offline;
alter tablespace tt offline;
Tablespace altered.
sys@ORCL>select file_name,tablespace_name,status,online_status from dba_data_files;
select file_name,tablespace_name,status,online_status from dba_data_files;
FILE_NAME      TABLESPACE_NAME      STATUSONLINE_
---------------------------------------------------------------------- ------------------------------ --------- -------
/u02/app/oracle/oradata/orcl/users01.dbf      USERS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/undotbs01.dbf      UNDOTBS1      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/sysaux01.dbf      SYSAUX      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/system01.dbf      SYSTEM      AVAILABLE SYSTEM
/u02/app/oracle/oradata/orcl/DEV_svctbl.dbf      DEV_STB      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV_ias_opss.dbf      DEV_IAS_OPSS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV_iau.dbf      DEV_IAU      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV_veridata_user.dbf      DEV_VERIDATA_USER      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_mds.dbf      DEV3_MDS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_wlsservices.dbf      DEV3_WLS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_iau.dbf      DEV3_IAU      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_ias_opss.dbf      DEV3_IAS_OPSS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_oggmon.dbf      DEV3_OGGMON      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV2_ias_opss.dbf      DEV2_IAS_OPSS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_UMS.dbf      DEV3_IAS_UMS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_svctbl.dbf      DEV3_STB      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV2_oggmon.dbf      DEV2_OGGMON      AVAILABLE ONLINE
/home/oracle/tt_mv.dbf      TT      AVAILABLE OFFLINE
/home/oracle/undo02.dbf        UNDOTBS1      AVAILABLE ONLINE
19 rows selected.
sys@ORCL>! mv /home/oracle/tt_mv.dbf /home/oracle/tt_mv2.dbf
! mv /home/oracle/tt_mv.dbf /home/oracle/tt_mv2.dbf
sys@ORCL>! ls -l /home/oracle/tt_mv2.dbf
! ls -l /home/oracle/tt_mv2.dbf
-rw-r----- 1 oracle oinstall 1073750016 Oct 29 08:39 /home/oracle/tt_mv2.dbf
sys@ORCL>alter database rename file '/home/oracle/tt_mv.db';
alter database rename file '/home/oracle/tt_mv.dbf' to '/home/oracle/tt_mv2.dbf';
Database altered.
sys@ORCL>select file_name,tablespace_name,status,online_status from dba_data_files;
select file_name,tablespace_name,status,online_status from dba_data_files;
FILE_NAME      TABLESPACE_NAME      STATUSONLINE_
---------------------------------------------------------------------- ------------------------------ --------- -------
/u02/app/oracle/oradata/orcl/users01.dbf      USERS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/undotbs01.dbf      UNDOTBS1      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/sysaux01.dbf      SYSAUX      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/system01.dbf      SYSTEM      AVAILABLE SYSTEM
/u02/app/oracle/oradata/orcl/DEV_svctbl.dbf      DEV_STB      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV_ias_opss.dbf      DEV_IAS_OPSS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV_iau.dbf      DEV_IAU      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV_veridata_user.dbf      DEV_VERIDATA_USER      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_mds.dbf      DEV3_MDS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_wlsservices.dbf      DEV3_WLS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_iau.dbf      DEV3_IAU      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_ias_opss.dbf      DEV3_IAS_OPSS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_oggmon.dbf      DEV3_OGGMON      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV2_ias_opss.dbf      DEV2_IAS_OPSS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_UMS.dbf      DEV3_IAS_UMS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_svctbl.dbf      DEV3_STB      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV2_oggmon.dbf      DEV2_OGGMON      AVAILABLE ONLINE
/home/oracle/tt_mv2.dbf        TT      AVAILABLE OFFLINE
/home/oracle/undo02.dbf        UNDOTBS1      AVAILABLE ONLINE
19 rows selected.
sys@ORCL>alter tablespace tt online;
alter tablespace tt online;
Tablespace altered.
sys@ORCL>select file_name,tablespace_name,status,online_status from dba_data_files;
select file_name,tablespace_name,status,online_status from dba_data_files;
FILE_NAME      TABLESPACE_NAME      STATUSONLINE_
---------------------------------------------------------------------- ------------------------------ --------- -------
/u02/app/oracle/oradata/orcl/users01.dbf      USERS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/undotbs01.dbf      UNDOTBS1      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/sysaux01.dbf      SYSAUX      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/system01.dbf      SYSTEM      AVAILABLE SYSTEM
/u02/app/oracle/oradata/orcl/DEV_svctbl.dbf      DEV_STB      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV_ias_opss.dbf      DEV_IAS_OPSS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV_iau.dbf      DEV_IAU      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV_veridata_user.dbf      DEV_VERIDATA_USER      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_mds.dbf      DEV3_MDS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_wlsservices.dbf      DEV3_WLS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_iau.dbf      DEV3_IAU      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_ias_opss.dbf      DEV3_IAS_OPSS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_oggmon.dbf      DEV3_OGGMON      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV2_ias_opss.dbf      DEV2_IAS_OPSS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_UMS.dbf      DEV3_IAS_UMS      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV3_svctbl.dbf      DEV3_STB      AVAILABLE ONLINE
/u02/app/oracle/oradata/orcl/DEV2_oggmon.dbf      DEV2_OGGMON      AVAILABLE ONLINE
/home/oracle/tt_mv2.dbf        TT      AVAILABLE ONLINE
/home/oracle/undo02.dbf        UNDOTBS1      AVAILABLE ONLINE
19 rows selected.

2、数据文件OFFLINE方式(需要开户归档模式)

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/7e7b56519f680fc5b46a7f69ee60f7e3.html