๐Ÿ’ป Programming/Oracle 11g

ORA-01157: cannot identify/lock data file

ORA-01157: cannot identify/lock data file

๋ฐ์ดํƒ€ ํŒŒ์ผ์„ ์‹ค์ˆ˜๋กœ ์‚ญ์ œํ•ด๋ฒ„๋ ธ๋‹ค๊ฐ€ DB์žฌ์‹œ์ž‘ํ•˜๊ฒŒ๋˜๋ฉด ์•„๋ž˜์ฒ˜๋Ÿผ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•˜๊ฒŒ ๋œ๋‹ค.

๋‚ด๊ฐ€ ์•„๋‹Œ ๋ˆ„๊ตฐ๊ฐ€๊ฐ€ dbf์ƒ์„ฑํ–ˆ๋‹ค๊ฐ€ drop๋ช…๋ น์„ ์“ฐ์ง€์•Š๊ณ  unix ์ฝ˜์†”์—์„œ dbfํŒŒ์ผ์„ ์‚ญ์ œํ•˜๊ฒŒ ๋˜๋ฉด ๋ฐœ์ƒํ•˜๊ฒŒ๋˜๋Š” ์˜ค๋ฅ˜์ธ๋ฐ ์ƒ๊ฐ๋ณด๋‹ค ์‰ฝ๊ฒŒ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.



ERROR at line 1:
ORA-01157: cannot identify/lock data file 29 - see DBWR trace file
ORA-01110: data file 29:
'/opt/oracle/product/oracle9i/dbs/C:oracleproduct10.2.0oradatapentahoptho_ts.dbf
'

from above datafile name you have realized that its a kinda jerk :s someone has made a datafile with no sense and then he/she have removed the file by O.S command, but he/she did'nt updated database about it !

So during the test when we were starting this database it came untill mount stage and then got stuck !!! i.e.

Problem:

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 29 - see DBWR trace file
ORA-01110: data file 29:
'/opt/oracle/product/oracle9i/dbs/C:oracleproduct10.2.0oradatapentahoptho_ts.dbf
'

so to fix it, i did following:

Solution:


SQL>alter database datafile 29 OFFLINE DROP;
SQL>alter database open;


์ถœ์ฒ˜ : http://nayyares.blogspot.kr/2009/08/ora-01157-cannot-identifylock-data-file.html