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

sys@ORCL>archive log list
archive log list
Database log mode      Archive Mode
Automatic archival      Enabled
Archive destination      /u02/app/oracle/product/11.2.4/db1/dbs/arch
Oldest online log sequence    3
Next log sequence to archive  5
Current log sequence      5
sys@ORCL>alter database datafile '/home/oracle/tt_mv2.dbf' offline;
alter database datafile '/home/oracle/tt_mv2.dbf' offline;
Database altered.
sys@ORCL>! mv /home/oracle/tt_mv2
! mv /home/oracle/tt_mv2.dbf /home/oracle/tt_mv3.dbf
sys@ORCL>! ls -l /home/oracle/tt_mv3.dbf
! ls -l /home/oracle/tt_mv3.dbf
-rw-r----- 1 oracle oinstall 1073750016 Oct 29 08:41 /home/oracle/tt_mv3.dbf
sys@ORCL>alter database rename file '/home/oracle/tt_mv2.dbf'to';
alter database rename file '/home/oracle/tt_mv2.dbf' to '/home/oracle/tt_mv3.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_mv3.dbf        TT      AVAILABLE RECOVER
/home/oracle/undo02.dbf        UNDOTBS1      AVAILABLE ONLINE
19 rows selected.
sys@ORCL>alter database datafile '/home/oracle/tt_mv3.dbf' online;
alter database datafile '/home/oracle/tt_mv3.dbf' online;
alter database datafile '/home/oracle/tt_mv3.dbf' online
*
ERROR at line 1:
ORA-01113: file 18 needs media recovery
ORA-01110: data file 18: '/home/oracle/tt_mv3.dbf'
sys@ORCL>recover datafile '/home/oracle/tt_mv3.dbf';
recover datafile '/home/oracle/tt_mv3.dbf';
Media recovery complete.
sys@ORCL>alter database datafile '/home/oracle/tt_mv3.dbf' online;
alter database datafile '/home/oracle/tt_mv3.dbf' online;
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_mv3.dbf        TT      AVAILABLE ONLINE
/home/oracle/undo02.dbf        UNDOTBS1      AVAILABLE ONLINE
19 rows selected.

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

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