Oracle RMAN備份時出現RMAN-06056: could not access datafile 6及其引發的另外兩個問題____Oracle

來源:互聯網
上載者:User

用rman備份資料庫時出現以下錯誤:
[oracle@mzl orcl]$ rman target/

Recovery Manager: Release 10.2.0.1.0 - Production on Wed Feb 13 15:36:06

Copyright (c) 1982, 2005, . All rights reserved.

connected to target database: ORCL (DBID=1172558471)

RMAN> backup database;

Starting backup at 13-FEB-08
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=137 devtype=DISK
could not read file header for datafile 6 error reason 1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 02/13/2008 15:36:14
RMAN-06056: could not access datafile 6

1 查看資料6檔案是什麼
SQL> select file#,name from v$datafile;

FILE#
----------
NAME
--------------------------------------------------------------------------------
1
/u01/app/oracle/oradata/orcl/system01.dbf

2
/u01/app/oracle/oradata/orcl/undotbs01.dbf

3
/u01/app/oracle/oradata/orcl/sysaux01.dbf


FILE#
----------
NAME
--------------------------------------------------------------------------------
4
/u01/app/oracle/oradata/orcl/users01.dbf

5
/u01/app/oracle/oradata/orcl/example01.dbf

6
/u01/app/oracle/product/10.2.0/db_1/dbs/MISSING00006


解決辦法:
看MISSING00006基於那個資料表空間,然後刪除該資料表空間
     
 select a.file#,a.name,b.name

from v$datafile a,v$tablespace b

where a.ts#=b.ts#

看到file 6 對應的資料表空間是users.

SQL> drop tablespace users;

但是,此時出現了個問題:ORA-12919: Can not drop the default permanent tablespace

sys@ora10g> select * from database_properties where property_name='DEFAULT_PERMANENT_TABLESPACE';

PROPERTY_NAME PROPERTY_VALUE DESCRIPTION
---------------------------- -------------- ------------------------------------
DEFAULT_PERMANENT_TABLESPACE USERS Name of default permanent tablespace

此系統的預設永久資料表空間是USERS    

.預設永久資料表空間的刪除方法
既然是因為是“預設”的永久資料表空間不可以刪除,我們僅需將預設的永久資料表空間指定到其他資料表空間,然後USERS資料表空間便可以被順利刪除。
1)將資料庫系統的預設永久資料表空間調整到TBS_SEC_D
sys@ora10g> alter database default tablespace TBS_SEC_D;

Database altered.

2)確認調整效果
sys@ora10g> select * from database_properties where property_name='DEFAULT_PERMANENT_TABLESPACE';

PROPERTY_NAME PROPERTY_VALUE DESCRIPTION
---------------------------- -------------- ------------------------------------
DEFAULT_PERMANENT_TABLESPACE TBS_SEC_D Name of default permanent tablespace

3)刪除原預設永久資料表空間USERS
sys@ora10g> drop tablespace USERS including contents and datafiles;

此時,無奈的是,又出現了一個新的問題:

SQL> drop tablespace users including contents;
drop tablespace users including contents
*
ERROR at line 1:
ORA-22868: table with LOBs contains segments in different tablespaces

解決辦法:

SQL> select owner,table_name,tablespace_name from dba_lobs where tablespace_name='USERS';

OWNER TABLE_NAME TABLESPACE_NAME
---------- ------------------------------ ------------------------------
OE PURCHASEORDER USERS
OE PURCHASEORDER USERS
OE PURCHASEORDER USERS
OE PURCHASEORDER USERS
OE PURCHASEORDER USERS
OE PURCHASEORDER USERS
OE PURCHASEORDER USERS
OE ACTION_TABLE USERS
OE LINEITEM_TABLE USERS
OE LINEITEM_TABLE USERS
SCOTT PLAN_TABLE USERS

11 rows selected.

SQL> select count(*) from oe.purchaseorder;

COUNT(*)
----------
132

SQL> drop user oe cascade;

User dropped.

SQL> drop tablespace users including contents;

Tablespace dropped.

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.