我的编程空间,编程开发者的网络收藏夹
学习永远不晚

Oracle修改数据文件名/移动数据文件

短信预约 -IT技能 免费直播动态提醒
省份

北京

  • 北京
  • 上海
  • 天津
  • 重庆
  • 河北
  • 山东
  • 辽宁
  • 黑龙江
  • 吉林
  • 甘肃
  • 青海
  • 河南
  • 江苏
  • 湖北
  • 湖南
  • 江西
  • 浙江
  • 广东
  • 云南
  • 福建
  • 海南
  • 山西
  • 四川
  • 陕西
  • 贵州
  • 安徽
  • 广西
  • 内蒙
  • 西藏
  • 新疆
  • 宁夏
  • 兵团
手机号立即预约

请填写图片验证码后获取短信验证码

看不清楚,换张图片

免费获取短信验证码

Oracle修改数据文件名/移动数据文件

生产上有时会用到数据文件的迁移,下边示例几种数据文件的迁移方法。

数据库版本

sys@ORCL>select * from v$version;
select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE11.2.0.4.0Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
sys@ORCL>select name from v$datafile;
select name from v$datafile;
NAME
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/u02/app/oracle/oradata/orcl/system01.dbf
/u02/app/oracle/oradata/orcl/sysaux01.dbf
/u02/app/oracle/oradata/orcl/undotbs01.dbf
/u02/app/oracle/oradata/orcl/users01.dbf
/u02/app/oracle/oradata/orcl/DEV_svctbl.dbf
/u02/app/oracle/oradata/orcl/DEV_ias_opss.dbf
/u02/app/oracle/oradata/orcl/DEV_iau.dbf
/u02/app/oracle/oradata/orcl/DEV_veridata_user.dbf
/u02/app/oracle/oradata/orcl/DEV3_mds.dbf
/u02/app/oracle/oradata/orcl/DEV3_wlsservices.dbf
/u02/app/oracle/oradata/orcl/DEV3_iau.dbf
/u02/app/oracle/oradata/orcl/DEV3_ias_opss.dbf
/u02/app/oracle/oradata/orcl/DEV3_oggmon.dbf
/u02/app/oracle/oradata/orcl/DEV2_ias_opss.dbf
/u02/app/oracle/oradata/orcl/DEV3_UMS.dbf
/u02/app/oracle/oradata/orcl/DEV3_svctbl.dbf
/u02/app/oracle/oradata/orcl/DEV2_oggmon.dbf
/home/oracle/tt.bdf
/home/oracle/undo02.dbf
19 rows selected.

一、关闭数据库修改

   1、使用mv方式(适用于文件系统)

sys@ORCL>shutdown immediate;
shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
sys@ORCL>! mv /home/oracle/tt.bdf /home/oracle/tt_mv.dbf
! mv /home/oracle/tt.bdf /home/oracle/tt_mv.dbf
l /home/oracle/tt_! ls -l /home/oracle/tt_mv.dbf
-rw-r----- 1 oracle oinstall 1073750016 Oct 29 08:31 /home/oracle/tt_mv.dbf
sys@ORCL>startup mount;
startup mount;
ORACLE instance started.
Total System Global Area  784998400 bytes
Fixed Size    2257352 bytes
Variable Size  478154296 bytes
Database Buffers  297795584 bytes
Redo Buffers    6791168 bytes
Database mounted.
sys@ORCL>alter database rename file '/home/oracle/tt.bdf' to '/home/oracle/tt_mv.dbf';
alter database rename file '/home/oracle/tt.bdf' to '/home/oracle/tt_mv.dbf';
Database altered.
sys@ORCL>select name from v$datafile;
select name from v$datafile;
NAME
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/u02/app/oracle/oradata/orcl/system01.dbf
/u02/app/oracle/oradata/orcl/sysaux01.dbf
/u02/app/oracle/oradata/orcl/undotbs01.dbf
/u02/app/oracle/oradata/orcl/users01.dbf
/u02/app/oracle/oradata/orcl/DEV_svctbl.dbf
/u02/app/oracle/oradata/orcl/DEV_ias_opss.dbf
/u02/app/oracle/oradata/orcl/DEV_iau.dbf
/u02/app/oracle/oradata/orcl/DEV_veridata_user.dbf
/u02/app/oracle/oradata/orcl/DEV3_mds.dbf
/u02/app/oracle/oradata/orcl/DEV3_wlsservices.dbf
/u02/app/oracle/oradata/orcl/DEV3_iau.dbf
/u02/app/oracle/oradata/orcl/DEV3_ias_opss.dbf
/u02/app/oracle/oradata/orcl/DEV3_oggmon.dbf
/u02/app/oracle/oradata/orcl/DEV2_ias_opss.dbf
/u02/app/oracle/oradata/orcl/DEV3_UMS.dbf
/u02/app/oracle/oradata/orcl/DEV3_svctbl.dbf
/u02/app/oracle/oradata/orcl/DEV2_oggmon.dbf
/home/oracle/tt_mv.dbf
/home/oracle/undo02.dbf
19 rows selected.
sys@ORCL>alter database open;
alter database open;
Database altered.

    2、RMAN备份方式(适用于文件系统、祼设备、ASM)

     

sys@ORCL>shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
sys@ORCL>exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@rhel6 ~]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Sat Oct 29 21:13:36 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database (not started)
RMAN> startup mount;
Oracle instance started
database mounted
Total System Global Area     784998400 bytes
Fixed Size                     2257352 bytes
Variable Size                478154296 bytes
Database Buffers             297795584 bytes
Redo Buffers                   6791168 bytes
RMAN> backup as copy datafile '/u02/app/oracle/oradata/orcl/users01.dbf' format '/dev/raw/raw1';
Starting backup at 29-OCT-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=133 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u02/app/oracle/oradata/orcl/users01.dbf
output file name=/dev/raw/raw1 tag=TAG20161029T211402 RECID=2 STAMP=926543658
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
Finished backup at 29-OCT-16
RMAN> switch datafile '/u02/app/oracle/oradata/orcl/users01.dbf' to copy;
datafile 4 switched to datafile copy "/dev/raw/raw1"
RMAN> alter database open;
database opened
RMAN> exit
Recovery Manager complete.
[oracle@rhel6 ~]$ ss
SQL*Plus: Release 11.2.0.4.0 Production on Sat Oct 29 21:15:03 2016
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
sys@ORCL>select name from v$datafile;
NAME
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/u02/app/oracle/oradata/orcl/system01.dbf
/u02/app/oracle/oradata/orcl/sysaux01.dbf
/u02/app/oracle/oradata/orcl/undotbs01.dbf
/dev/raw/raw1
/u02/app/oracle/oradata/orcl/DEV_svctbl.dbf
/u02/app/oracle/oradata/orcl/DEV_ias_opss.dbf
/u02/app/oracle/oradata/orcl/DEV_iau.dbf
/u02/app/oracle/oradata/orcl/DEV_veridata_user.dbf
/u02/app/oracle/oradata/orcl/DEV3_mds.dbf
/u02/app/oracle/oradata/orcl/DEV3_wlsservices.dbf
/u02/app/oracle/oradata/orcl/DEV3_iau.dbf
/u02/app/oracle/oradata/orcl/DEV3_ias_opss.dbf
/u02/app/oracle/oradata/orcl/DEV3_oggmon.dbf
/u02/app/oracle/oradata/orcl/DEV2_ias_opss.dbf
/u02/app/oracle/oradata/orcl/DEV3_UMS.dbf
/u02/app/oracle/oradata/orcl/DEV3_svctbl.dbf
/u02/app/oracle/oradata/orcl/DEV2_oggmon.dbf
/home/oracle/tt_mv3.dbf
/home/oracle/undo02.dbf
19 rows selected.

二、在线修改

1、表空间OFFLINE方式

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方式(需要开户归档模式)

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.


免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

Oracle修改数据文件名/移动数据文件

下载Word文档到电脑,方便收藏和打印~

下载Word文档

猜你喜欢

修改Oracle数据文件名及数据文件存放路径

更改Oracle数据文件名及数据文件存放路径
2023-06-06

oracle 修改数据文件路径

一、关库修改文件位置 1.连接到数据库  [oracle@linux]$ ./sqlplus /nolog  SQL> conn / as sysdba   2. 查看数据文件位置 SQL> select name from v$datafile; FILE_
oracle 修改数据文件路径
2017-11-21

oracle怎么移动表空间数据文件

要移动一个表空间的数据文件,你可以按照以下步骤操作:首先,在Oracle数据库中,将表空间设置为只读模式:ALTER TABLESPACE READ ONLY;然后,将表空间中的数据文件复制到新的位置。可
oracle怎么移动表空间数据文件
2024-04-09

java怎么修改文件数据

在Java中,可以使用FileInputStream和FileOutputStream来读取和写入文件数据。下面是一个简单的示例代码,用来将文件中的数据进行修改:import java.io.*;public class ModifyFi
java怎么修改文件数据
2024-03-01

Linux下修改MySQL数据库数据文件路径

使用rpm安装方式安装完MySQL数据库后,数据文件的默认路径为/var/lib/mysql,然而根目录并不适合用于存储数据文件。原路径:/var/lib/mysql目标路径:/home/mysql_data/mysqlLinux系统版本:centos7.6M
2017-01-04

java如何移动文件并修改名称方式

这篇文章主要为大家展示了“java如何移动文件并修改名称方式”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“java如何移动文件并修改名称方式”这篇文章吧。java 移动文件,并修改名称从sour
2023-06-22

编程热搜

目录