作者 lvxinglong, 转载请注明出处

http://lvxing.cublog.cn

1、新建和数据sid 数据形同的 数据库。 停止服务。 删除所有文件, 把备份的数据文件考过来。
2、使用 orapwd 重建密码文件

删除 d:\oracle\ora92\database\pwdglis1.ora
D:\oracle\ora92\bin>orapwd file=d:\oracle\ora92\database\pwdglis1.ora password=info
3、启动服务。 
使用 sqlplus /nolog;
connect system/info@sid as sysdba 登录
shutdown abort
startup mount
--查看 数据文件目录
select name from v$datafile;

执行以下命令修改

alter database rename file 'E:\ORACLE\ORADATA\GLIS1\SYSTEM01.DBF' to 'D:\ORACLE\ORADATA\GLIS1\SYSTEM01.DBF';
alter database rename file 'E:\ORACLE\ORADATA\GLIS1\UNDOTBS01.DBF' to 'D:\ORACLE\ORADATA\GLIS1\UNDOTBS01.DBF';
alter database rename file 'E:\ORACLE\ORADATA\GLIS1\CWMLITE01.DBF' to 'D:\ORACLE\ORADATA\GLIS1\CWMLITE01.DBF';
alter database rename file 'E:\ORACLE\ORADATA\GLIS1\DRSYS01.DBF' to 'D:\ORACLE\ORADATA\GLIS1\DRSYS01.DBF';
alter database rename file 'E:\ORACLE\ORADATA\GLIS1\EXAMPLE01.DBF' to 'D:\ORACLE\ORADATA\GLIS1\EXAMPLE01.DBF';
alter database rename file 'E:\ORACLE\ORADATA\GLIS1\INDX01.DBF' to 'D:\ORACLE\ORADATA\GLIS1\INDX01.DBF';
alter database rename file 'E:\ORACLE\ORADATA\GLIS1\ODM01.DBF' to 'D:\ORACLE\ORADATA\GLIS1\ODM01.DBF';
alter database rename file 'E:\ORACLE\ORADATA\GLIS1\TOOLS01.DBF' to 'D:\ORACLE\ORADATA\GLIS1\TOOLS01.DBF';
alter database rename file 'E:\ORACLE\ORADATA\GLIS1\USERS01.DBF' to 'D:\ORACLE\ORADATA\GLIS1\USERS01.DBF';
alter database rename file 'E:\ORACLE\ORADATA\GLIS1\XDB01.DBF' to 'D:\ORACLE\ORADATA\GLIS1\XDB01.DBF';
alter database rename file 'E:\ORACLE\ORADATA\GLIS1\GLIS8_INDEX.ORA' to 'D:\ORACLE\ORADATA\GLIS1\GLIS8_INDEX.ORA';
alter database rename file 'E:\ORACLE\ORADATA\GLIS1\GLIS8_TABLE.ORA' to 'D:\ORACLE\ORADATA\GLIS1\GLIS8_TABLE.ORA';
alter database rename file 'E:\ORACLE\ORADATA\GLIS1\GLIS8_MAINTABLE.ORA' to 'D:\ORACLE\ORADATA\GLIS1\GLIS8_MAINTABLE.ORA';
alter database rename file 'E:\ORACLE\ORADATA\GLIS1\TEMP01.DBF' to 'D:\ORACLE\ORADATA\GLIS1\TEMP01.DBF';

--日志
select * from v$log;
select * from v$logfile;

alter database rename file 'E:\ORACLE\ORADATA\GLIS1\REDO01.LOG' TO 'D:\ORACLE\ORADATA\GLIS1\REDO01.LOG';
alter database rename file 'E:\ORACLE\ORADATA\GLIS1\REDO02.LOG' TO 'D:\ORACLE\ORADATA\GLIS1\REDO02.LOG';
alter database rename file 'E:\ORACLE\ORADATA\GLIS1\REDO03.LOG' TO 'D:\ORACLE\ORADATA\GLIS1\REDO03.LOG';

alter database open;

--临时表空间

--首先我们可以先看一下,当前用户所属的临时表空间有那些  
select username ,temporary_tablespace from dba_users;
--查看当前有那些临时文件。  
select * from V$tempfile;

alter tablespace temp add tempfile 'D:\ORACLE\ORADATA\GLIS1\TEMP01.DBF' SIZE 200M;
alter database tempfile 'E:\ORACLE\ORADATA\GLIS1\TEMP01.DBF' drop including datafiles;

提示错误。redo 文件 无法找到