前提:
恢復步驟:
ORA
ORA
ORA
可能會遇到的問題:
試驗過程:
Microsoft Windows XP [版本
(C) 版權所有
C:\Documents and Settings\qigong>oradim
C:\Documents and Settings\qigong>sqlplus / as sysdba
SQL*Plus: Release
Copyright (c)
Connected to:
Oracle Database
With the Partitioning
SQL> shutdown immediate;
Database closed
Database dismounted
ORACLE instance shut down
SQL> exit
Disconnected from Oracle Database
With the Partitioning
C:\Documents and Settings\qigong>sqlplus / as sysdba
SQL*Plus: Release
Copyright (c)
Connected to an idle instance
SQL> startup nomount;
ORACLE instance started
Total System Global Area
Fixed Size
Variable Size
Database Buffers
Redo Buffers
SQL> alter database mount;
alter database mount
*
ERROR at line
ORA
SQL> shutdown
ORA
ORACLE instance shut down
SQL> startup
ORACLE instance started
Total System Global Area
Fixed Size
Variable Size
Database Buffers
Redo Buffers
Database mounted
Database opened
SQL> alter system switch logfile;
System altered
SQL> /
System altered
SQL> /
System altered
SQL> create tablespace test
Tablespace created
SQL> insert into testlost values(
SQL> commit;
Commit complete
SQL> create table testlost
Table created
SQL> shutdown immediate;
Database closed
Database dismounted
ORACLE instance shut down
SQL> startup nomount
ORACLE instance started
Total System Global Area
Fixed Size
Variable Size
Database Buffers
Redo Buffers
C:\Documents and Settings\qigong>rman
Recovery Manager: Release
Copyright (c)
RMAN> connect target
connected to target database: test (not mounted)
RMAN> restore controlfile from autobackup;
Starting restore at
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_
channel ORA_DISK_
recovery area destination: C:\oracle\product\
database name (or lock name space) used for search: TEST
channel ORA_DISK_
channel ORA_DISK_
channel ORA_DISK_
output filename=C:\ORACLE\PRODUCT\
output filename=C:\ORACLE\PRODUCT\
output filename=C:\ORACLE\PRODUCT\
Finished restore at
RMAN> exit
RMAN
RMAN
SQL> alter database mount;
alter database mount
*
ERROR at line
ORA
SQL> DECLARE
PL/SQL procedure successfully completed
SQL> shutdown immediate;
ORA
Database dismounted
ORACLE instance shut down
SQL> startup nomount
ORACLE instance started
Total System Global Area
Fixed Size
Variable Size
Database Buffers
Redo Buffers
SQL> CREATE CONTROLFILE REUSE DATABASE
Control file created
SQL> recover database;
ORA
ORA
ORA
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
auto
ORA
ORA
ORA
ORA
SQL> select name from v$datafile;
NAME
C:\ORACLE\PRODUCT\
C:\ORACLE\PRODUCT\
C:\ORACLE\PRODUCT\
C:\ORACLE\PRODUCT\
C:\ORACLE\PRODUCT\
C:\TBS
C:\TBS
C:\TBS
C:\TBS
C:\TBS
C:\TBS
NAME
C:\TBS
C:\TBS
C:\TEST
C:\WINDOWS\SYSTEM
SQL> alter database create datafile
Database altered
SQL> recover database;
Media recovery complete
SQL> alter database open;
Database altered
SQL> select * from testlost
no rows selected
SQL> select * from testlost;
A
在上面這個試驗裡面我們可能還會有一個疑問
ORA
ORA
ORA
ORA
Oracle他是從哪裡得到這個unamedxxxxxxx文件的真實文件是
先來看看日志裡記載了什麼東西
用logminer查一下
EXECUTE DBMS_LOGMNR_D
EXECUTE DBMS_LOGMNR
EXECUTE DBMS_LOGMNR
SELECT sql_redo FROM V$LOGMNR_CONTENTS where upper(sql_redo) like
SQL_REDO
create tablespace test
datafile
extent management local
segment space management auto
uniform size
只發現了這句ddl
再來看create tablespace的trace文件
……
insert into ts$ (ts#
dflmaxext
scnbas
directallowed
values
(:
insert into file$ (file#
values
(:
……
這兩條語句說明了oracle在ts$
看起來好像這個文件名是無出處的
看下控制文件中包含這個文件的dump 信息
DATA FILE #
(name #
creation size=
tablespace
unrecoverable scn:
Checkpoint cnt:
Stop scn:
Creation Checkpointed at scn:
從這裡我們知道test
From:http://tw.wingwit.com/Article/program/Oracle/201311/16821.html