此案例是本人在生产环境扩充表空间时,误操作遇到的问题,别慌,不用去考虑删除数据文件,这个不现实,因为这是生产环境!
问题:扩充表空间的时候,只修改了数据文件的名称,忘了修改表空间的名称了,请看下图:
解决步骤:
①先把错误的数据文件给resize了
命令:
alter database datafile ‘+DATA/bjivradg/datafile/telematics20.dbf’ resize 1G;
alter database datafile ‘+DATA/bjivradg/datafile/telematics21.dbf’ resize 1G;
alter database datafile ‘+DATA/bjivradg/datafile/td_emap238.dbf’ resize 1G;
alter database datafile ‘+DATA/bjivradg/datafile/td_emap239.dbf’ resize 1G;
②用move命令把数据文件给重命名了
命令:
alter database move datafile ‘+DATA/bjivradg/datafile/telematics20.dbf’ to ‘+DATA/bjivradg/datafile/mbecall07.dbf’;
alter database move datafile ‘+DATA/bjivradg/datafile/telematics21.dbf’ to ‘+DATA/bjivradg/datafile/mbecall08.dbf’;
alter database move datafile ‘+DATA/bjivradg/datafile/td_emap238.dbf’ to ‘+DATA/bjivradg/datafile/mbecall09.dbf’;
alter database move datafile ‘+DATA/bjivradg/datafile/td_emap239.dbf’ to ‘+DATA/bjivradg/datafile/mbecall10.dbf’;
③查看修改完的结果
命令:
select FILE_NAME,BYTES/1024/1024 from dba_data_files where TABLESPACE_NAME=‘MBECALL’;