C:\Documents and Settings\Administrator>sqlplus /nolog
?
SQL*Plus: Release 9.2.0.1.0 - Production on
星期三
7
月
18 10:17:44 2007
?
Copyright (c) 1982, 2002, Oracle Corporation.? All rights reserved.
?
SQL> conn jss/jss
已連接。
SQL> create table tmp3(col varchar2(50));
######
創(chuàng)建一個(gè)臨時(shí)表并插入一些數(shù)據(jù)
表已創(chuàng)建。
?
SQL> insert into tmp3 values ('test1');
?
已創(chuàng)建
1
行。
?
SQL> insert into tmp3 values ('test2');
?
已創(chuàng)建
1
行。
?
SQL> insert into tmp3 values ('test3');
?
已創(chuàng)建
1
行。
?
SQL> select *from tmp3;
?
COL
--------------------------------------------------
test1
test2
test3
?
SQL> commit;
?
提交完成。
?
SQL> conn / as sysdba??? ####
已
dba
用戶連接并關(guān)閉數(shù)據(jù)庫
已連接。
SQL> shutdown immediate;
數(shù)據(jù)庫已經(jīng)關(guān)閉。
已經(jīng)卸載數(shù)據(jù)庫。
ORACLE
例程已經(jīng)關(guān)閉。
?
SQL> host del F:\OraHome1\oradata\jssweb\jweb.ora
######
手動刪除數(shù)據(jù)文件
SQL> startup
ORACLE
例程已經(jīng)啟動。
?
Total System Global Area? 143727516 bytes
Fixed Size?????????????????? 453532 bytes
Variable Size???????????? 109051904 bytes
Database Buffers?????????? 33554432 bytes
Redo Buffers???????????????? 667648 bytes
數(shù)據(jù)庫裝載完畢。
ORA-01157:
無法標(biāo)識
/
鎖定數(shù)據(jù)文件
10 -
請參閱
DBWR
跟蹤文件
ORA-01110:
數(shù)據(jù)文件
10: 'F:\ORAHOME1\ORADATA\JSSWEB\JWEB.ORA'
?
#######
看看,啟動報(bào)錯(cuò)了吧
SQL> select instance_name,status from v$instance;
#######
看看當(dāng)前數(shù)據(jù)庫狀態(tài),應(yīng)該是處于
mount
INSTANCE_NAME??? STATUS
---------------- ------------
jssweb?????????? MOUNTED
?
OK,
下面該
RMAN
出馬了。
SQL>exit
C:\Documents and Settings\Administrator>set oracle_sid=jssweb
?
C:\Documents and Settings\Administrator>rman target /
?
恢復(fù)管理器
:
版本
9.2.0
.1.0 - Production
?
Copyright (c) 1995, 2002, Oracle Corporation.? All rights reserved.
?
連接到目標(biāo)數(shù)據(jù)庫
: JSSWEB (DBID=3391142503)
?
RMAN> restore datafile 'F:\ORAHOME1\ORADATA\JSSWEB\JWEB.ORA';
####
首先修復(fù)數(shù)據(jù)文件。
是不是有疑問,為什么不像上面第三節(jié)講的那樣先將該數(shù)據(jù)文件置為脫機(jī),笨啊你,數(shù)據(jù)庫都沒打開,脫什么機(jī)啊,整個(gè)數(shù)據(jù)庫現(xiàn)在都是脫機(jī)的。
啟動
restore
于
18-7
月
-07
?
正在使用目標(biāo)數(shù)據(jù)庫控制文件替代恢復(fù)目錄
分配的通道
: ORA_DISK_1
通道
ORA_DISK_1: sid=11 devtype=DISK
通道
ORA_DISK_1:
正在開始恢復(fù)數(shù)據(jù)文件備份集
通道
ORA_DISK_1:
正在指定從備份集恢復(fù)的數(shù)據(jù)文件
正將數(shù)據(jù)文件
00010
恢復(fù)到
F:\ORAHOME1\ORADATA\JSSWEB\JWEB.ORA
通道
ORA_DISK_1:
已恢復(fù)備份段
1
段
handle=D:\BACKUP\1AIN4JU5_1_1 tag=TAG20070718T092837 params=NULL
通道
ORA_DISK_1:
恢復(fù)完成
完成
restore
于
18-7
月
-07
?
RMAN> recover datafile 'F:\ORAHOME1\ORADATA\JSSWEB\JWEB.ORA';
########
恢復(fù)數(shù)據(jù)文件
啟動
recover
于
18-7
月
-07
使用通道
ORA_DISK_1
?
正在開始介質(zhì)的恢復(fù)
完成介質(zhì)的恢復(fù)
?
完成
recover
于
18-7
月
-07
?
RMAN> alter database open;?? ########
看起來很順利,打開數(shù)據(jù)庫看看
?
數(shù)據(jù)庫已打開
?
RMAN> host;
?
Microsoft Windows [
版本
5.2.3790]
(C)
版權(quán)所有
1985-2003 Microsoft Corp.
?
C:\Documents and Settings\Administrator>sqlplus jss/jss? ####
連到該用戶
?
SQL*Plus: Release 9.2.0.1.0 - Production on
星期三
7
月
18 10:33:50 2007
?
Copyright (c) 1982, 2002, Oracle Corporation.? All rights reserved.
?
連接到
:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
?
SQL> select *from tmp3;???? ######查詢我們備份后創(chuàng)建的表
?
COL
--------------------------------------------------
test1
test2
test3
#######yeah,
成功恢復(fù),沒有數(shù)據(jù)丟失。