select dbid from v$database;
set dbid 3583462369
restore controlfile from 'D:\FTProot\bim\20170307\DMS_20170221_2468';
run{
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DATA_BIGEXTENT.DBF' to 'D:\app\Administrator\oradata\dms\DATA_BIGEXTENT.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DATA_BIGEXTENT_1.DBF' to 'D:\app\Administrator\oradata\dms\DATA_BIGEXTENT_1.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DATA_BIGEXTENT_2.DBF' to 'D:\app\Administrator\oradata\dms\DATA_BIGEXTENT_2.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DATA_BIGEXTENT_3.DBF' to 'D:\app\Administrator\oradata\dms\DATA_BIGEXTENT_3.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DATA_BIGEXTENT_4.DBF' to 'D:\app\Administrator\oradata\dms\DATA_BIGEXTENT_4.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_1.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_1.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_10.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_10.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_11.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_11.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_12.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_12.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_13.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_13.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_14.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_14.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_15.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_15.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_2.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_2.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_3.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_3.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_4.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_4.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_5.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_5.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_6.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_6.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_7.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_7.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_8.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_8.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_9.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_9.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_MATERIAL.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_MATERIAL.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_MATERIAL_1.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_MATERIAL_1.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_MATERIAL_2.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_MATERIAL_2.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_MATERIAL_3.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_MATERIAL_3.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_MATERIAL_4.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_MATERIAL_4.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_MATERIAL_5.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_MATERIAL_5.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_MATERIAL_6.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_MATERIAL_6.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_DATA_MATERIAL_7.DBF' to 'D:\app\Administrator\oradata\dms\DMS_DATA_MATERIAL_7.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_INDX.DBF' to 'D:\app\Administrator\oradata\dms\DMS_INDX.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_INDX_1.DBF' to 'D:\app\Administrator\oradata\dms\DMS_INDX_1.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_INDX_10.DBF' to 'D:\app\Administrator\oradata\dms\DMS_INDX_10.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_INDX_11.DBF' to 'D:\app\Administrator\oradata\dms\DMS_INDX_11.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_INDX_2.DBF' to 'D:\app\Administrator\oradata\dms\DMS_INDX_2.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_INDX_3.DBF' to 'D:\app\Administrator\oradata\dms\DMS_INDX_3.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_INDX_4' to 'D:\app\Administrator\oradata\dms\DMS_INDX_4';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_INDX_5.DBF' to 'D:\app\Administrator\oradata\dms\DMS_INDX_5.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_INDX_6.DBF' to 'D:\app\Administrator\oradata\dms\DMS_INDX_6.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_INDX_7.DBF' to 'D:\app\Administrator\oradata\dms\DMS_INDX_7.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_INDX_8.DBF' to 'D:\app\Administrator\oradata\dms\DMS_INDX_8.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_INDX_9.DBF' to 'D:\app\Administrator\oradata\dms\DMS_INDX_9.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_TEST.DBF' to 'D:\app\Administrator\oradata\dms\DMS_TEST.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\DMS_TESTINDX.DBF' to 'D:\app\Administrator\oradata\dms\DMS_TESTINDX.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\LAB_DATA.DBF' to 'D:\app\Administrator\oradata\dms\LAB_DATA.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMSDATA\LAB_INDEX.DBF' to 'D:\app\Administrator\oradata\dms\LAB_INDEX.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMS\SYSAUX01.DBF' to 'D:\app\Administrator\oradata\dms\SYSAUX01.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMS\SYSTEM01.DBF' to 'D:\app\Administrator\oradata\dms\SYSTEM01.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMS\UNDOTBS01.DBF' to 'D:\app\Administrator\oradata\dms\UNDOTBS01.DBF';
set newname for datafile 'H:\APP\ADMINISTRATOR\ORADATA\DMS\USERS01.DBF' to 'D:\app\Administrator\oradata\dms\USERS01.DBF';
restore database;
switch datafile all;
}
redolog:
alter database rename file 'H:\APP\ADMINISTRATOR\ORADATA\DMS\REDO06.LOG' to 'D:\app\Administrator\oradata\dms\REDO06.LOG';
alter database rename file 'H:\APP\ADMINISTRATOR\ORADATA\DMS\REDO04.LOG' to 'D:\app\Administrator\oradata\dms\REDO04.LOG';
alter database rename file 'H:\APP\ADMINISTRATOR\ORADATA\DMS\REDO05.LOG' to 'D:\app\Administrator\oradata\dms\REDO05.LOG';
7.继续回到rman下执行:
alter database open resetlogs;
recover database时候出现错误,如下:
RMAN-03002: recover 命令 (在 03/22/2017 19:04:28 上) 失败
RMAN-06054: 介质恢复正在请求未知的线程 1 序列 137423 的归档日志以及起始 SCN 25475181431
使用通道 ORA_DISK_1
介质恢复完成,用时: 00:00:02
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: alter db 命令 (在 03/22/2017 19:19:40 上) 失败
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-39700: database must be opened with UPGRADE option
进程 ID: 7756
会话 ID: 185 序列号: 9
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
ORA-03114: 未连接到 ORACLE
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: alter db 命令 (在 03/22/2017 19:19:40 上) 失败
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-39700: database must be opened with UPGRADE option
进程 ID: 7756
会话 ID: 185 序列号: 9
39700,00000,"database must be opened with UPGRADE option"
// *Cause: A normal database open was attempted,but the database has not
// been upgraded to the current server version.
// *Action: Use the UPGRADE option when opening the database to run
// catupgrd.sql (for database upgrade),or to run catalog.sql
// and catproc.sql (after initial database creation).
说明需要运行这些数据字典脚本,主要原因是升级以后数据字典的一些基表的内容修改了
C:\>sqlplus / as sysdba
sql*Plus: Release 11.2.0.3.0 Production on 星期四 11月 28 16:06:03 2013
Copyright (c) 1982,2011,Oracle. All rights reserved.
已连接到空闲例程。
sql> startup upgrade
ORACLE 例程已经启动。
Total System Global Area 860160000 bytes
Fixed Size 2260040 bytes
Variable Size 234881976 bytes
Database Buffers 616562688 bytes
Redo Buffers 6455296 bytes
数据库装载完毕。
数据库已经打开。
sql>
方法1:
-- CATalog UPGraDe to the new release:
This script is to be used for upgrading an 8.1.7,9.0.1,9.2 or 10.1 database to the new release. This script provides a direct upgrade path from these releases to the new Oracle release.
sql>@?/rdbms/admin/catupgrd.sql
---Creates data dictionary views.重新编译一下一些无效的对象
sql>@?/rdbms/admin/utlrp.sql
方法2:
--Creates data dictionary views.
sql>@?/rdbms/admin/catalog.sql
----Creates data dictionary views for types,stored procedures,
sql>@?/rdbms/admin/catproc.sql