HowTo: Use BBED to hack the database SID in the datafiles if you’ve gone and got them all mixed during a “CREATE CONTROLFILE” operation.
WARNING: Using BBED is not supoprted by Oracle unless you are asked to use it by Oracle Support themselves.
Use UNIX vi to create a text file that contains a line number, followed by the file name for the DB files that need changing:
# cat <<EOF > filelist.txt
Save the file as “filelist.txt”.
Launch bbed (blockedit) as the Oracle DB UNIX owner.
Change the text “NEWID” for your new DB name in the “modify” line below.
BBED> set listfile 'filelist.txt'
BBED> set mode edit
# Dump the current block value for datafile #1 in your list file.
# exmaple: BBED> dump /v dba <file#>,<block> …
BBED> dump /v dba 1,1 offset 32 count 16
Make the swap:
BBED> modify /c NEWID file 1 block 1 offset 32
The checksum is now invalid:
BBED> sum file 1 block 1
Force save the new checksum:
BBED> sum file 1 block 1 apply
Verify the block:
BBED> verify file 1 block 1
Once you’ve done all your files:
Start the database with the CREATE CONTROLFILE SET DATABASE “NEWID”…