Moving IBM Connections databases to another disk

  • 02 Feb, 2016

On my connections test server i installed everything in one machine.

The  home directory for db2inst1 user ends the file space

The databases and all containers are under the default of /home/db2inst1. So we can use db2relocatedb to move them.

First i tested this here with the sample database, and it worked. Your configuration file should look like the following (This is for FILES DB, you will have to change at least the DB_NAME for the others):

DB_NAME=Files DB_PATH=/home/db2inst1,/dados INSTANCE=db2inst1 STORAGE_PATH=/home/db2inst1,/dados/db2inst1

/\* NOTE that I am assuming that all databases are using the default storage path like the FILES DB is. If not, you will need to modify this. You can verify by running for each database:

db2 “SELECT VARCHAR(STORAGE_GROUP_NAME, 30) AS STOGROUP, VARCHAR(DB_STORAGE_PATH, 40) AS STORAGE_PATH FROM TABLE(ADMIN_GET_STORAGE_PATHS(‘’,-1)) AS T”

So if the output shows /home/db2inst1, then you can use my example above. Otherwise you will need to use the actual value for te original location. */

LOG_DIR=oldDirPath,newDirPath

/\* For the log directory, with the FILES DB, you are suing the default of /home/db2inst1/etc etc, so you do not need to set this. If the others are the same, then you do not need to set them either. Otherwise you have to.

FAILARCHIVE_PATH=newDirPath LOGARCHMETH1=newDirPath LOGARCHMETH2=newDirPath MIRRORLOG_PATH=newDirPath OVERFLOWLOG_PATH=newDirPath

/\* For the above, for the FILES database, you are not using any of them so you can ignore these. For the other databases, if you are not using them OR you are using the default of /home/db2inst1, then you can ignore them.

So ultimately for the FILES database, you would have:

DB_NAME=Files DB_PATH=/home/db2inst1,/dados INSTANCE=db2inst1 STORAGE_PATH=/home/db2inst1,/dados/db2inst1

If the other databases are just like files (regarding storage path and log directory), then you will have the same thing except for the database name.

Then perform the following steps:

1. Stop the Connections server and terminate all connections and deactivate the databases - “db2 deactivate db ”. 2. Stop the instance - “db2stop”. 3. MOVE (do NOT copy!!) the database directory to the new location (VERY IMPORTANT TO MAKE SURE INSTANCE IS STOPPED!!):

mv /home/db2inst1/db2inst1 /dados

Once done you should have /dados/db2inst1/. Since all databases are under this directory, you only need to execute the one move command.

4. Ensure that the owner/group/permissions for /dados/db2inst1 are correct (should match old location). 5. Then you would execute the db2relocatedb command FOR EACH database. DO NOT START THE INSTANCE UNTIL ALL ARE DONE!!.

db2relocatedb -f

You should see the following output:

[db2inst1@connections ~]$ /home/db2inst1/sqllib/bin/db2relocatedb -f blogs.cfg Files and control structures were changed successfully. Database was catalogued successfully. 6. Once the above has been done for each database, you should be able to start the instance and then connect to the databases.

Thanks to IBM IM Support.

Related Posts

Homepage Search: Profiles server fails while creating the initial index

  • 10 Sep, 2013

When trying to create the initial index for Global Search from the Homepage server, the index update fails with an error. To prevent further problems with indexing, perform a search in the Profiles d

Homepage Search: Profiles server fails while creating the initial indexRead More

Proud to be an HCL Ambassador 2021

  • 15 Dec, 2020

​If you have a problem, and no-one else can help, and if you can find them, maybe you can ask an HCL Ambassador… !(http://www.mysphere.com.br/wp-content/uploads/2020/12/HCLAmbassaborlight4x.png) See

Proud to be an HCL Ambassador 2021Read More

Nominate an IBM Champion

  • 30 Oct, 2019

IBM Champions demonstrate both expertise in and extraordinary support and advocacy for IBM technology, communities, and solutions. I am an IBM Champion since the first class  (2011) an this year i wi

Nominate an IBM ChampionRead More