Sometime back, I wrote about how to know about a fenced user id in DB2 at http://www.db2ude.com/?q=node/30. The other day, someone asked me how do I change the fenced user id in DB2?

This is very easy but will require an outage if you are already in production. I wonder why there would be a need to change fenced id in production but it might be required at times. Who knows?

Here are the steps:

1. Run db2cfexp command to export settings to a file.

e.g.

C:\> db2cfexp mydb2instance.txt

It will dump your instance parameters, registry variables, all cataloged nodes, instances, databases, ODBC settings etc to a file.

2. Stop the instance

3. Drop the instance

4. Create the instance with new fenced user id

5. Import the configuration settings (Step-1) using db2cfimp command