Drop the DB
This article describes the steps for dropping a WebSphere Administrative database. You will do this if, for example you want to practice installing WebSphere from scratch, but an existing WebSphere database already exists.
For convenience, I have documented my own experience dropping the test WebSphere admin database, nerwst1. Of course you should not assume that the specific names of databases, nodes, aliases, etc. described here apply to your situation. The procedures outlined are important, not the specific data shown.
Drop the database (nerwst1): We know that the websphere test admin DB is cataloged as "nerwst1" in the db2axs instance. We need to find out which actual instance holds the database and then drop the DB as the correct instance user.
-
Use XMLConfig to export the node, before dropping the database. Later, you'll want to import this data after you create the new admin DB. In this example I wanted to drop the admin database for WebSphere on spnode27; substitute the correct node_name value for your specific case, for example spnode27 for node 27.
$ <WAS_install_dir>/bin/XMLConfig.sh -adminNodeName <node_name> -export config.xml
If you plan to install WebSphere on a different spnode, you will need to edit the .xml file so that any references to a particular spnode will point to the correct, new location. In my case, I wanted to install the new application server on spnode17, so I had to change all the "spnode27" references to "spnode17" in config.xml (as well as the IP addresses that pointed to spnode27).
-
Find out the SP node and port number for the remote database.
-
$ db2 "list database directory" Database 6 entry: Database alias = NERWST1 Database name = NERWST1 Node name = NERWST1 Database release level = 9.00 Comment = WebSphere v4 Database Directory entry type = Remote Authentication = DCS Catalog node number = -1
Now we know that nerwst1 is on the node named nerwst1.
-
$ db2 "list node directory" Node 18 entry: Node name = NERWST1 Comment = WebSphere v4 Node Protocol = TCPIP Hostname = sp29en1.nerdc.ufl.edu Service name = 3724
So, now we know the actual database is on spnode29 on port 3724
-
-
Find out which DB2 instance contains nerwst1.
-
log onto spnode29, and then enter the custom scripts directory:
$ cd /nerdc/src/local/scripts
-
In this directory Eli wrote a helpful script, db2listdb, which creates files listing the DBs found in a given list of DB2 instances. Just feed it db2list, a list of all current DB2 instances.
$ ./db2listdb db2list output/
-
grep for the port number to find which instance to use
$ cd output/ $ grep 3724 * ne6tst1:TCP/IP Port = 3724
From the grep result, we know that ne6tst1 is the instance which holds the actual nerwst1 database.
-
-
Finally we can drop the database.
$ su - ne6tst1 $ source ~/sqllib/db2profile $ db2 "drop database nerwst1"

