Windows重装系统如何恢复数据库
前提条件:数据库的版本(大版本,小版本要求相同)
把数据文件、控制文件、redo log拷贝到对应的目录,并建立相应的admin目录
数据库SID为Week
参数文件是D:\oracle\admin\week\pfile\init.ora.35200618377(注意文件的扩展名)
操作如下:
Microsoft Windows 2000 [Version 5.00.2195]
(C) 版权所有 1985-2000 Microsoft Corp.
C:\Documents and Settings\Administrator>set oracle_sid=week
C:\Documents and Settings\Administrator>orapwd file=d:\oracle\ora92\database\pwdweek.ora password=solex entries=10
C:\Documents and Settings\Administrator>oradim -new -sid week -startmode a
C:\Documents and Settings\Administrator>sqlplus /nolog
SQL*Plus: Release 9.2.0.1.0 - Production on 星期三 4月 19 14:51:48 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> conn / as sysdba
已连接到空闲例程。
SQL> startup pfile='d:\oracle\ora92\database\pwdweek.ora ';
ORACLE 例程已经启动。
Total System Global Area 101785284 bytes
Fixed Size 454340 bytes
Variable Size 75497472 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
数据库装载完毕。
数据库已经打开。
C:\Documents and Settings\Administrator>sqlplus /nolog
SQL*Plus: Release 9.2.0.1.0 - Production on 星期三 4月 19 16:32:40 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> conn sys/solex@week as sysdba
已连接。
SQL>
数据恢复成功
注:
C:\Documents and Settings\Administrator>orapwd
Usage: orapwd file=<fname> password=<password> entries=<users>
where
file - name of password file (mand),
password - password for SYS (mand),
entries - maximum number of distinct DBA and OPERs (opt),
There are no spaces around the equal-to (=) character.
Orapwd命令用于创建密码文件
C:\Documents and Settings\Administrator>oradim
ORADIM: <command> [options]。 请参阅手册。
请输入以下命令之一:
通过指定以下参数创建例程:
-NEW -SID sid | -SRVC service [-INTPWD password] [-MAXUSERS number] [-STARTM
ODE a|m] [-PFILE file] [-TIMEOUT secs]
通过指定以下参数编辑例程:
-EDIT -SID sid [-NEWSID sid] [-INTPWD passwd] [-STARTMODE a|m] [-PFILE file] [-
SHUTMODE a|i|n] [-SHUTTYPE srvc|inst]
通过指定以下参数删除例程:
-DELETE -SID sid | -SRVC service name
通过指定以下参数启动服务和例程:
-STARTUP -SID sid [-USRPWD password] [-STARTTYPE srvc|inst|srvc,inst] [-PFIL
E filename]
通过指定以下参数关闭服务和例程:
-SHUTDOWN -SID sid [-USRPWD password] [-SHUTTYPE srvc|inst|srvc,inst] [-SHUT
MODE a | i | n]
通过指定以下参数查询帮助: -? | -h | -help
您为 -NEW 命令输入了无效的选项
Oradim命令用于创建例程名