Monday, June 30, 2008

DBVerify can not deal with datafile which name spans two lines

In one case, we need to issue 'DBV' to check the block corruption of a 9.2.0.8 production database datafiles. However, there were two datafiles which names span two lines and dbv command failed on such filenames even with quotation marks. (of course multiple line filename is not desired and must be there due to carelessness).

We end up copying these two files with proper names, then run the DBV on the copied files.

Though it looks like a very small maintenance task, I tested the following procedure in order to feel more comfortable when fixing it in the maintenance windows.

Test Steps:
(1) create the bad file name - multiple line file name


SQL> create tablespace temp_tbs datafile '/tmp/tmp_
2 data_01.dbf' size 10M;


Tablespace created.



bxxxxd2:/tmp [sxxxxxt2] $ ls -l tmp*
-rw-r----- 1 oracle dba 10493952 Mar 30 19:59 tmp_
data_01.dbf



(2) shutdown database

(3) copy
cp "tmp_
data_01.dbf" tmp_data_01_good.dbf

Note: the double quotation mark is necessary.

(4) mount database


(5) rename



SQL> ALTER DATABASE RENAME FILE '/tmp/tmp_
data_01.dbf' to '/tmp/tmp_data_01_good.dbf'; 2

Database altered.



(6) open the database

SQL> alter database open;

Database altered.

(7) drop the temp_tbs

SQL> drop tablespace temp_tbs including contents and datafiles;

Tablespace dropped.

No comments: