如何从完好的数据文件恢复oracle数据库
2009-04-03 13:12:23 来源:WEB开发网 background_dump_dest=c:\demo\bdump
core_dump_dest=c:\demo\cdump
user_dump_dest=c:\demo\udump
control_files=("c:\demo\oradata\demo\CONTROL01.CTL", "c:\demo\oradata\demo\CONTROL02.CTL", "c:\demo\oradata\demo\CONTROL03.CTL")
dispatchers="(PROTOCOL=TCP) (SERVICE=demoXDB)"(实例名)
dispatchers="(PROTOCOL=TCP) (SERVICE=demoXDB)"
db_domain=""
db_name=demo
3.创建oracle服务和口令文件
C:\documents and settings\oradim — new —sid demo —intpwd oracle
4.配置监听和服务
用net manager 进行配置(demo实例的配置)
5.复制数据文件备份到指定的目录下。此处为c:\demo\oradata\demo
6.重建controlfile
C:\Documents and Settings\hefan>sqlplus /nolog
SQL*Plus: Release 9.2.0.1.0 - Production on 星期一 12月 29 10:57:07 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> conn as sysdba
请输入用户名: system
请输入口令:
已连接。
SQL> shutdown immediate
ORA-01507: 未安装数据库
ORACLE 例程已经关闭。
SQL> startup nomount file= c:\demo\pfile\initdemo.ora
ORACLE 例程已经启动。
Total System Global Area 135338868 bytes
Fixed Size 453492 bytes
Variable Size 109051904 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
SQL> @d:\controlfile.sql
控制文件已创建
Controlfile.sql内容如下:(此处也可以直接在sql>下输入以下内容进行创建controlfile)
CREATE CONTROLFILE REUSE DATABASE "demo" RESETLOGS NOARCHIVELOG
MAXLOGFILES 50
MAXLOGMEMBERS 5
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 226
LOGFILE
GROUP 1 'c:\demo\oradata\demo\redo01.log' SIZE 50M,
GROUP 2 'c:\demo\oradata\demo\redo02.log' SIZE 50M,
GROUP 3 'c:\demo\oradata\demo\redo03.log' SIZE 50M
DATAFILE
'c:\demo\oradata\demo\system01.dbf',
'c:\demo\oradata\demo\odm01.dbf',
'c:\demo\oradata\demo\indx01.dbf',
'c:\demo\oradata\demo\tools01.dbf',
'c:\demo\oradata\demo\undotbs01.dbf',
'c:\demo\oradata\demo\users01.dbf',
'c:\demo\oradata\demo\xdb01.dbf',
'c:\demo\oradata\demo\cwmlite01.dbf',
'c:\demo\oradata\demo\drsys01.dbf',
'c:\demo\oradata\demo\example01.dbf'
CHARACTER SET zhs16gbk
说明:此时没有日志文件,所以只能进行reserlogs,如果是有logfile,则此处不需要resetlogs,noresetlogs就可以
更多精彩
赞助商链接