ORA-01157&ORA-01110故障解決
今天在啟動虛擬機器測試庫時,資料庫報了ORA-01157和ORA-01110錯誤,提示找不到一個資料檔案。我一看檔名就知道問題在哪兒了,是另一臺虛擬機器沒有啟動導致的,因為這個資料庫透過dnfs建立了一個“遠端”表空間。由於暫時不想啟動那臺虛擬機器(節省記憶體),乾脆就把這個表空間刪除,熟悉一下trouble-shooting的過程。
1.環境準備
我們在Oracle11g中進行測試。點選(此處)摺疊或開啟
-
SQL>
-
SQL> select * from v$version;
-
-
BANNER
-
--------------------------------------------------------------------------------
-
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
-
PL/SQL Release 11.2.0.3.0 - Production
-
CORE 11.2.0.3.0 Production
-
TNS for Linux: Version 11.2.0.3.0 - Production
-
NLSRTL Version 11.2.0.3.0 - Production
-
- SQL>
2.啟動資料庫報錯
在啟動資料庫過程中,報了ORA-01157和ORA-01110錯誤,提示找不到資料檔案。
由於另外一臺虛擬機器沒有啟動,資料庫在啟動過程中後臺程式不能找到相應的資料檔案或者不能鎖定相應的資料檔案,資料庫將禁止訪問這些資料檔案而其他的資料檔案則沒有影響。ORA-01157錯誤一般和ORA-01110錯誤一起出現。
點選(此處)摺疊或開啟
-
SYS@HOEGH>startup
-
ORACLE instance started.
-
-
Total System Global Area 941600768 bytes
-
Fixed Size 1348860 bytes
-
Variable Size 524290820 bytes
-
Database Buffers 411041792 bytes
-
Redo Buffers 4919296 bytes
-
Database mounted.
-
ORA-01157: cannot identify/lock data file 9 - see DBWR trace file
-
ORA-01110: data file 9: \'/u02/oradata/HOEGH/test_tbs01.dbf\'
-
-
-
SYS@HOEGH>select status from v$instance;
-
-
STATUS
-
------------
-
MOUNTED
-
- SYS@HOEGH>
3.重啟資料庫到mount狀態,刪除資料檔案
啟動資料庫時,nomount狀態讀取引數檔案,mount狀態讀取控制檔案,在mount狀態下可以刪除資料檔案。點選(此處)摺疊或開啟
-
SYS@HOEGH>
-
SYS@HOEGH>startup nomount
-
ORACLE instance started.
-
-
Total System Global Area 941600768 bytes
-
Fixed Size 1348860 bytes
-
Variable Size 524290820 bytes
-
Database Buffers 411041792 bytes
-
Redo Buffers 4919296 bytes
-
SYS@HOEGH>
-
SYS@HOEGH>
-
SYS@HOEGH>alter database mount;
-
-
Database altered.
-
-
SYS@HOEGH>alter database datafile \'/u02/oradata/HOEGH/test_tbs01.dbf\' offline drop;
-
- Database altered.
4.開啟資料庫,刪除表空間
啟動資料庫到open狀態,查詢資料檔案對應的表空間名稱;然後,刪除表空間。點選(此處)摺疊或開啟
-
SYS@HOEGH>alter database open;
-
-
Database altered.
-
-
SYS@HOEGH>
-
SYS@HOEGH>select file_id,tablespace_name from dba_data_files;
-
-
FILE_ID TABLESPACE_NAME
-
---------- ------------------------------
-
4 USERS
-
3 UNDOTBS1
-
2 SYSAUX
-
1 SYSTEM
-
5 TEST1
-
6 TEST2
-
7 TEST3
-
8 TEST
-
9 TEST_TBS
-
-
9 rows selected.
-
SYS@HOEGH>col file_name for a50
-
SYS@HOEGH>col file_id for 99
-
SYS@HOEGH>col tablespace_name for a10
-
SYS@HOEGH>col status for a10
-
SYS@HOEGH>col online_status for a20
-
SYS@HOEGH>select file_name,file_id,TABLESPACE_NAME,STATUS,ONLINE_STATUS from dba_data_files;
-
FILE_NAME FILE_ID TABLESPACE STATUS ONLINE_STATUS
-
-------------------------------------------------- ------- ---------- ---------- --------------------
-
/u01/app/oracle/oradata/HOEGH/users01.dbf 4 USERS AVAILABLE ONLINE
-
/u01/app/oracle/oradata/HOEGH/undotbs01.dbf 3 UNDOTBS1 AVAILABLE ONLINE
-
/u01/app/oracle/oradata/HOEGH/sysaux01.dbf 2 SYSAUX AVAILABLE ONLINE
-
/u01/app/oracle/oradata/HOEGH/system01.dbf 1 SYSTEM AVAILABLE SYSTEM
-
/u01/app/oracle/oradata/HOEGH/TEST101.dbf 5 TEST1 AVAILABLE ONLINE
-
/u01/app/oracle/oradata/HOEGH/TEST201.dbf 6 TEST2 AVAILABLE ONLINE
-
/u01/app/oracle/oradata/HOEGH/TEST301.dbf 7 TEST3 AVAILABLE ONLINE
-
/u01/app/oracle/oradata/HOEGH/test.dbf 8 TEST AVAILABLE ONLINE
-
/u02/oradata/HOEGH/test_tbs01.dbf 9 TEST_TBS AVAILABLE RECOVER
-
-
9 rows selected.
-
-
SYS@HOEGH>drop tablespace TEST_TBS including contents;
-
-
Tablespace dropped.
-
-
SYS@HOEGH>
-
SYS@HOEGH>select file_name,file_id,TABLESPACE_NAME,STATUS,ONLINE_STATUS from dba_data_files;
-
-
FILE_NAME FILE_ID TABLESPACE STATUS ONLINE_STATUS
-
-------------------------------------------------- ------- ---------- ---------- --------------------
-
/u01/app/oracle/oradata/HOEGH/users01.dbf 4 USERS AVAILABLE ONLINE
-
/u01/app/oracle/oradata/HOEGH/undotbs01.dbf 3 UNDOTBS1 AVAILABLE ONLINE
-
/u01/app/oracle/oradata/HOEGH/sysaux01.dbf 2 SYSAUX AVAILABLE ONLINE
-
/u01/app/oracle/oradata/HOEGH/system01.dbf 1 SYSTEM AVAILABLE SYSTEM
-
/u01/app/oracle/oradata/HOEGH/TEST101.dbf 5 TEST1 AVAILABLE ONLINE
-
/u01/app/oracle/oradata/HOEGH/TEST201.dbf 6 TEST2 AVAILABLE ONLINE
-
/u01/app/oracle/oradata/HOEGH/TEST301.dbf 7 TEST3 AVAILABLE ONLINE
-
/u01/app/oracle/oradata/HOEGH/test.dbf 8 TEST AVAILABLE ONLINE
-
-
8 rows selected.
-
- SYS@HOEGH>
5.重啟資料庫
在進行上述操作後,重啟資料庫,確保資料庫能夠正常開啟。點選(此處)摺疊或開啟
-
SYS@HOEGH>
-
SYS@HOEGH>shut immediate
-
Database closed.
-
Database dismounted.
-
ORACLE instance shut down.
-
SYS@HOEGH>
-
SYS@HOEGH>
-
SYS@HOEGH>startup
-
ORACLE instance started.
-
-
Total System Global Area 941600768 bytes
-
Fixed Size 1348860 bytes
-
Variable Size 511707908 bytes
-
Database Buffers 423624704 bytes
-
Redo Buffers 4919296 bytes
-
Database mounted.
-
Database opened.
- SYS@HOEGH>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30162081/viewspace-1726797/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- NFS故障解決NFS
- 故障解決法(摘抄)
- 【故障解決】OGG-00446 錯誤解決
- 【故障解決】enq: PS - contentionENQ
- metalink登陸故障解決!
- 【故障解決】IPCS和IPCRM使用
- 【故障解決】ORA-06502錯誤解決
- 常見硬碟故障大全 硬碟故障解決辦法大全硬碟
- 解決docker: Error response from daemon故障DockerError
- Sentinel哨兵模式解決故障轉移模式
- 【Spark篇】---Spark故障解決(troubleshooting)Spark
- ORA-10873 故障解決
- Dataguard日常維護及故障解決
- TSM故障問題解決一則
- 解決儲存硬碟故障一則硬碟
- 兩個系統故障解決薦
- 【故障-ORACLE】OSWBB不能執行解決Oracle
- linux 故障解決方法彙總Linux
- 解決DNS解析故障的幾種方法DNS
- ORA-12516故障解決
- DVR常見故障原因及解決方法VR
- Rownum分頁故障解決一例
- TSM無法備份故障解決(續)
- 從一次故障解決想到的
- goldengate 故障及解決方法彙總Go
- 一次ASM環境故障解決ASM
- ORA-01555故障解決案例
- ORA-01152 故障解決
- 利用 Tmux 和 kubectl 解決 Kubernetes 故障UX
- 故障解決:埠已被佔用 1080
- Oracle ASM故障資料恢復解決方案OracleASM資料恢復
- fedora16無線網路卡故障解決
- 常見的光纖故障及其解決方案
- 網路卡常見故障及解決辦法
- mysql的三個故障解決小結薦MySql
- ubuntu 和VMWare共享資料時故障解決Ubuntu
- create index , rebuild index troubleshooting 索引故障解決IndexRebuild索引
- RMAN故障解決——RMAN使用者手冊