您好,登錄后才能下訂單哦!
這篇文章主要講解了“Oracle表空間誤刪除導(dǎo)致startup啟動時提示ORA-01110和ORA-01157錯誤怎么辦”,文中的講解內(nèi)容簡單清晰,易于學(xué)習(xí)與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“Oracle表空間誤刪除導(dǎo)致startup啟動時提示ORA-01110和ORA-01157錯誤怎么辦”吧!
今天遇到一個比較神奇的問題,客戶某套測試數(shù)據(jù)庫斷電重啟了,重啟時發(fā)現(xiàn)數(shù)據(jù)庫提示ORA-01157: cannot identify/lock data file和ORA-01110的錯誤,經(jīng)過檢查發(fā)現(xiàn)是系統(tǒng)啟動后未掛載存儲,表空間都放在存儲盤上,手工掛載存儲后所有問題迎刃而解。當(dāng)時沒有記錄問題,這里通過測試環(huán)境模擬重現(xiàn)問題。
[oracle@XLJ181 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Mon Dec 10 19:27:14 2018 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SYS@cams> create tablespace test datafile '/home/oracle/test.dbf' size 100M; Tablespace created. SYS@cams> create user test identified by 123456 default tablespace test; User created. SYS@cams> grant connect,resource to test; Grant succeeded. TEST@cams> create table test(id number primary key,name varchar2(20)); Table created. TEST@cams> insert into test values(1,'bob'); 1 row created. TEST@cams> insert into test values(2,'joe'); 1 row created. TEST@cams> select count(*) from test; COUNT(*) ---------- 2 TEST@cams> conn / as sysdba Connected. SYS@cams> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SYS@cams> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@XLJ181 ~]$ mv /home/oracle/test.dbf /home/oracle/test.dbf.bak
啟動數(shù)據(jù)庫,發(fā)現(xiàn)數(shù)據(jù)文件不存在:
[oracle@XLJ181 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Mon Dec 10 19:38:26 2018 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to an idle instance. SYS@cams> startup; ORACLE instance started. Total System Global Area 5344731136 bytes Fixed Size 2262656 bytes Variable Size 1040189824 bytes Database Buffers 4294967296 bytes Redo Buffers 7311360 bytes Database mounted. ORA-01157: cannot identify/lock data file 63 - see DBWR trace file ORA-01110: data file 63: '/home/oracle/test.dbf'
查看trace文件:
Mon Dec 10 19:38:35 2018 ALTER DATABASE OPEN Errors in file /u01/app/oracle/diag/rdbms/cams/cams/trace/cams_dbw0_21153.trc: ORA-01157: cannot identify/lock data file 63 - see DBWR trace file ORA-01110: data file 63: '/home/oracle/test.dbf' ORA-27037: unable to obtain file status Linux-x86_64 Error: 2: No such file or directory Additional information: 3 Errors in file /u01/app/oracle/diag/rdbms/cams/cams/trace/cams_ora_21175.trc: ORA-01157: cannot identify/lock data file 63 - see DBWR trace file ORA-01110: data file 63: '/home/oracle/test.dbf' ORA-1157 signalled during: ALTER DATABASE OPEN...
查看cams_ora_21175.trc文件,報錯信息如下:
DDE: Problem Key 'ORA 1110' was flood controlled (0x1) (no incident) ORA-01110: data file 63: '/home/oracle/test.dbf' ORA-01157: cannot identify/lock data file 63 - see DBWR trace file ORA-01110: data file 63: '/home/oracle/test.dbf'
查看cams_dbw0_21153.trc文件,報錯信息如下:
ORA-01157: cannot identify/lock data file 63 - see DBWR trace file ORA-01110: data file 63: '/home/oracle/test.dbf' ORA-27037: unable to obtain file status Linux-x86_64 Error: 2: No such file or directory Additional information: 3
問題已經(jīng)很明顯了,就是找不到data file 63: '/home/oracle/test.dbf'。
針對該問題,我們應(yīng)該怎么去處理呢?特別是測試環(huán)境,一般為了節(jié)約資源,不會開啟歸檔,更不會有RMAN備份,那怎么讓數(shù)據(jù)庫跑起來,讓數(shù)據(jù)損失降到最低呢?
SQL> shutdown immediate; SQL> startup mount; SQL> alter database datafile '/home/oracle/test.dbf' offline drop; SQL> alter database open; SQL> drop tablespace test including contents; --注意:執(zhí)行之前檢查是否還有其他文件屬于該表空間 SQL> create tablespace test datafile '/home/oracle/test.dbf' size 100M;
因為是測試環(huán)境,想辦法重建數(shù)據(jù)或者利用最近的邏輯備份或其他測試導(dǎo)入數(shù)據(jù),這樣能把數(shù)據(jù)損失降到最低。
如果刪除的是核心系統(tǒng)的表空間,那么還不如重建表空間之后把相關(guān)數(shù)據(jù)清理之后重新導(dǎo)入一份。
感謝各位的閱讀,以上就是“Oracle表空間誤刪除導(dǎo)致startup啟動時提示ORA-01110和ORA-01157錯誤怎么辦”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對Oracle表空間誤刪除導(dǎo)致startup啟動時提示ORA-01110和ORA-01157錯誤怎么辦這一問題有了更深刻的體會,具體使用情況還需要大家實(shí)踐驗證。這里是億速云,小編將為大家推送更多相關(guān)知識點(diǎn)的文章,歡迎關(guān)注!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。