今天在导库的时候失败了,就把oracle服务给停了,然后把表空间文件给删了.结果在启动实例的时候报了如下错误:
后来通过执行一下查询发现,实例的状态为mounted.
1 SELECT * FROM V$INSTANCE;
没办法,内事不决问百度,发现如下解决办法:
1 alter database datafile 'd:\xx.dbf' offline drop;2 alter database open;
oracle 官方说明如下:
Altering Datafile Availability
You can alter the availability of individual datafiles or tempfiles by taking them offline or bringing them online. Offline datafiles are unavailable to the database and cannot be accessed until they are brought back online.
Reasons for altering datafile availability include the following:
-
You want to perform an offline backup of a datafile.
-
You want to rename or relocate a datafile. You must first take it offline or take the tablespace offline.
-
The database has problems writing to a datafile and automatically takes the datafile offline. Later, after resolving the problem, you can bring the datafile back online manually.
-
A datafile becomes missing or corrupted. You must take it offline before you can open the database.
Taking Datafiles Offline in NOARCHIVELOG Mode
To take a datafile offline when the database is in NOARCHIVELOG
mode, use the ALTER
DATABASE
statement with both the DATAFILE
and OFFLINE
FOR
DROP
clauses.
-
The
OFFLINE
keyword causes the database to mark the datafileOFFLINE
, whether or not it is corrupted, so that you can open the database. -
The
FOR
DROP
keywords mark the datafile for subsequent dropping. Such a datafile can no longer be brought back online.
The following statement takes the specified datafile offline and marks it to be dropped:
ALTER DATABASE DATAFILE '/u02/oracle/rbdb1/users03.dbf' OFFLINE FOR DROP;