473,216 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,216 software developers and data experts.

Moving home directory on DB2 instance?


Folks,

I need to move HOME directory of an instance to another directory.
What is the best way of doing it?
Is changing password file enough? or dies DB2 store this info in it's own
config?

I am running UDB 8.2 on Linux and AIX.

Thanks.
--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Nov 12 '05 #1
6 8764
Hemant Shah schrieb:
Folks,

I need to move HOME directory of an instance to another directory.
What is the best way of doing it?
Is changing password file enough? or dies DB2 store this info in it's own
config?


It does, so changing the password-file is not enough.
Search the Infocenter at

http://publib.boulder.ibm.com/infoce...help/index.jsp

for "db2relocatedb".

Think this is what you are looking for.

regards,

Norbert
Nov 12 '05 #2
You didn't state that you need to change the instance name so I suspect
that you discovered that the /home filesystem isn't large enough to hold
your database, forcing you to "move the HOME directory".

A simple approach is to offline backup the database(s) and do a
redirected restore to another location. Don't forget to change the
location of the log files. This will, however keep the existing home
directory and all of its references to the DB2 ececutables.
If you really need to move the entire home directory then you could try
the following:
1. Make an offline backup of the database(s).
2. Shut down the instance.
3. Double check that the instance is down.
4. Mount your new disk drive/partition on a temporary directory
5. Copy the home directory and all subdirectories to the temporary
directory. This must be done keeping existing ownership and permissions
for all files. All hidden files (starting with a ".") must also be
copied. Two piped copies of the tar utility should do this.
6. Unmount the temporary directory.
7. Mount the new disk drive/partition at the home directory of the
instance. browse through it and make sure that all links and files
appear present. Use the "df" command to verify the mount worked.
8. Start the instance in maintenance mode. verify that your tables are
accessable using only select statements. Shutdown the instance.
9. Unmount the disk/partition mounted on the home directory. Verify that
the unmount worked properly.
10. Delete all of the files and subdirectories of the home directory.
11. Remount the new disk drive/partition at the home directory.
12. Modify fstab to automount this at boot time.

The final step is to reboot the system and verify that the new
drive/partition is correctly mounted, allowing instance startup.

Phil Sherman


Hemant Shah wrote:
Folks,

I need to move HOME directory of an instance to another directory.
What is the best way of doing it?
Is changing password file enough? or dies DB2 store this info in it's own
config?

I am running UDB 8.2 on Linux and AIX.

Thanks.

Nov 12 '05 #3
While stranded on information super highway Norbert Munkel wrote:
Hemant Shah schrieb:
Folks,

I need to move HOME directory of an instance to another directory.
What is the best way of doing it?
Is changing password file enough? or dies DB2 store this info in it's own
config?
It does, so changing the password-file is not enough.
Search the Infocenter at

http://publib.boulder.ibm.com/infoce...help/index.jsp

for "db2relocatedb".

Think this is what you are looking for.


Thanks, that is exactly what I am looking for.
regards,

Norbert


--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Nov 12 '05 #4

Thanks for the info, but that is not what I was trying to to.

I am adding a new file system and want to move the db2instance to the new
file system. There are other users on the current filesystem and I want to
keep them there.

Norbert suggested db2relocatedb command in his post, that is exactly what I
was looking for.
While stranded on information super highway Phil Sherman wrote:
You didn't state that you need to change the instance name so I suspect
that you discovered that the /home filesystem isn't large enough to hold
your database, forcing you to "move the HOME directory".

A simple approach is to offline backup the database(s) and do a
redirected restore to another location. Don't forget to change the
location of the log files. This will, however keep the existing home
directory and all of its references to the DB2 ececutables.
If you really need to move the entire home directory then you could try
the following:
1. Make an offline backup of the database(s).
2. Shut down the instance.
3. Double check that the instance is down.
4. Mount your new disk drive/partition on a temporary directory
5. Copy the home directory and all subdirectories to the temporary
directory. This must be done keeping existing ownership and permissions
for all files. All hidden files (starting with a ".") must also be
copied. Two piped copies of the tar utility should do this.
6. Unmount the temporary directory.
7. Mount the new disk drive/partition at the home directory of the
instance. browse through it and make sure that all links and files
appear present. Use the "df" command to verify the mount worked.
8. Start the instance in maintenance mode. verify that your tables are
accessable using only select statements. Shutdown the instance.
9. Unmount the disk/partition mounted on the home directory. Verify that
the unmount worked properly.
10. Delete all of the files and subdirectories of the home directory.
11. Remount the new disk drive/partition at the home directory.
12. Modify fstab to automount this at boot time.

The final step is to reboot the system and verify that the new
drive/partition is correctly mounted, allowing instance startup.

Phil Sherman


Hemant Shah wrote:
Folks,

I need to move HOME directory of an instance to another directory.
What is the best way of doing it?
Is changing password file enough? or dies DB2 store this info in it's own
config?

I am running UDB 8.2 on Linux and AIX.

Thanks.


--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Nov 12 '05 #5
db2relocatedb will NOT move the instance. It allows you to move a
database to a different instance or move it to a new location within the
same instance. The instance "location" is determined by the operating
system when the userid is established. For both Linux and AIX, userids
are, by default, defined in the /home directory. To move a single userid
to another filesystem; you would usually define a different home
directory, ie. /home1/db2inst1 where the new file system is mounted at
/home1.

If you are moving a single userid (instance), the technique I documented
will move everything; the database(s) instance configuration files,
references to the installation libraries (do an ls -l on
/home/db2inst1.sqllib) and anything else you've put in the instance
owner's home directory or subdirectories. It has the advantage of
avoiding changes to any references to the instance, such as a user
executing the instance's db2profile before connecting. Mounting the new
filesystem on the instance owner directory avoids impacting any other
userids and guarantees that all files associated with the instance end
up on the new filesystem. It can also be done with the system up and
running without impact to other users.

If all you need to do is to relocate a database; then db2relocatedb will
do that. My experience tells me that one should always take an offline
backup (if possible) before attempting a change this significant. It
should give you an excellent recovery mechanism if anything goes wrong
when moving the database. Once you have the backup; then a redirected
restore will also move the database.

There's always more than one way to accomplish most tasks. Choose the
one you like best.

Phil Sherman

Hemant Shah wrote:
Thanks for the info, but that is not what I was trying to to.

I am adding a new file system and want to move the db2instance to the new
file system. There are other users on the current filesystem and I want to
keep them there.

Norbert suggested db2relocatedb command in his post, that is exactly what I
was looking for.
While stranded on information super highway Phil Sherman wrote:
You didn't state that you need to change the instance name so I suspect
that you discovered that the /home filesystem isn't large enough to hold
your database, forcing you to "move the HOME directory".

A simple approach is to offline backup the database(s) and do a
redirected restore to another location. Don't forget to change the
location of the log files. This will, however keep the existing home
directory and all of its references to the DB2 ececutables.
If you really need to move the entire home directory then you could try
the following:
1. Make an offline backup of the database(s).
2. Shut down the instance.
3. Double check that the instance is down.
4. Mount your new disk drive/partition on a temporary directory
5. Copy the home directory and all subdirectories to the temporary
directory. This must be done keeping existing ownership and permissions
for all files. All hidden files (starting with a ".") must also be
copied. Two piped copies of the tar utility should do this.
6. Unmount the temporary directory.
7. Mount the new disk drive/partition at the home directory of the
instance. browse through it and make sure that all links and files
appear present. Use the "df" command to verify the mount worked.
8. Start the instance in maintenance mode. verify that your tables are
accessable using only select statements. Shutdown the instance.
9. Unmount the disk/partition mounted on the home directory. Verify that
the unmount worked properly.
10. Delete all of the files and subdirectories of the home directory.
11. Remount the new disk drive/partition at the home directory.
12. Modify fstab to automount this at boot time.

The final step is to reboot the system and verify that the new
drive/partition is correctly mounted, allowing instance startup.

Phil Sherman

Nov 12 '05 #6

Let me see if I understand your method correctly.

Let's say I have a /home filesystem containing db2 instance which does not
have enough diskspace.

I move everything to a new filesystem and re-mount it as /home.
It that is correct, then it is not what I am trying to do.

In my case, I have other users in /home (including another database instance),
and I want to move one instance from /home to /home1.

While stranded on information super highway Phil Sherman wrote:
db2relocatedb will NOT move the instance. It allows you to move a
database to a different instance or move it to a new location within the
same instance. The instance "location" is determined by the operating
system when the userid is established. For both Linux and AIX, userids
are, by default, defined in the /home directory. To move a single userid
to another filesystem; you would usually define a different home
directory, ie. /home1/db2inst1 where the new file system is mounted at
/home1.

If you are moving a single userid (instance), the technique I documented
will move everything; the database(s) instance configuration files,
references to the installation libraries (do an ls -l on
/home/db2inst1.sqllib) and anything else you've put in the instance
owner's home directory or subdirectories. It has the advantage of
avoiding changes to any references to the instance, such as a user
executing the instance's db2profile before connecting. Mounting the new
filesystem on the instance owner directory avoids impacting any other
userids and guarantees that all files associated with the instance end
up on the new filesystem. It can also be done with the system up and
running without impact to other users.

If all you need to do is to relocate a database; then db2relocatedb will
do that. My experience tells me that one should always take an offline
backup (if possible) before attempting a change this significant. It
should give you an excellent recovery mechanism if anything goes wrong
when moving the database. Once you have the backup; then a redirected
restore will also move the database.

There's always more than one way to accomplish most tasks. Choose the
one you like best.

Phil Sherman

Hemant Shah wrote:
Thanks for the info, but that is not what I was trying to to.

I am adding a new file system and want to move the db2instance to the new
file system. There are other users on the current filesystem and I want to
keep them there.

Norbert suggested db2relocatedb command in his post, that is exactly what I
was looking for.
While stranded on information super highway Phil Sherman wrote:
You didn't state that you need to change the instance name so I suspect
that you discovered that the /home filesystem isn't large enough to hold
your database, forcing you to "move the HOME directory".

A simple approach is to offline backup the database(s) and do a
redirected restore to another location. Don't forget to change the
location of the log files. This will, however keep the existing home
directory and all of its references to the DB2 ececutables.
If you really need to move the entire home directory then you could try
the following:
1. Make an offline backup of the database(s).
2. Shut down the instance.
3. Double check that the instance is down.
4. Mount your new disk drive/partition on a temporary directory
5. Copy the home directory and all subdirectories to the temporary
directory. This must be done keeping existing ownership and permissions
for all files. All hidden files (starting with a ".") must also be
copied. Two piped copies of the tar utility should do this.
6. Unmount the temporary directory.
7. Mount the new disk drive/partition at the home directory of the
instance. browse through it and make sure that all links and files
appear present. Use the "df" command to verify the mount worked.
8. Start the instance in maintenance mode. verify that your tables are
accessable using only select statements. Shutdown the instance.
9. Unmount the disk/partition mounted on the home directory. Verify that
the unmount worked properly.
10. Delete all of the files and subdirectories of the home directory.
11. Remount the new disk drive/partition at the home directory.
12. Modify fstab to automount this at boot time.

The final step is to reboot the system and verify that the new
drive/partition is correctly mounted, allowing instance startup.

Phil Sherman


--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Nov 12 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: James Jiao | last post by:
Hi all I am having a little trouble uploading files (html form with post) with php... I am trying to copy the file from its temporary upload directory to the destination directory, however,...
4
by: Luca T. | last post by:
Hello, i need a way to find the home folder of the current user no matter if i am in Linux or Windows for instance: * Linux: /home/username * Windows: C:\Documents and Settings\username Is...
0
by: Don Rozenberg | last post by:
Hello, I'm successfully running MySql under Debian with the data files in /var/lib/mysql. I would like to move the data base files to my home directory and have mysql use them from there. How...
1
by: Kenjis Kaan | last post by:
I had to run DB2 on Win2k. After installation it puts a directory under c:\DB2 and c:\DB2Log and C:\Program Files\SQLLIB Now am all confused which is instance home, db2 home etc. I had to...
4
by: esmith2112 | last post by:
Having a bear of a time trying to implement replication under 8.2 environment. I've created all of the control structures on both source and target database and can actually see data being staged...
1
by: db2udbgirl | last post by:
When I installed DB2 UDB 8.2 on AIX 5.3 it got installed in /home/db2inst1 (and I didn't care about it much then but now I would like to move the same instance of DB2 to a dedicated filesystem. May...
0
by: linkswanted | last post by:
We are your trusted source. World Moving & Storage is bonded and licensed by the U.S. Department of Transportation and is one of the largest residential moving and corporate relocation company in...
0
by: linkswanted | last post by:
We are your trusted source. World Moving & Storage is bonded and licensed by the U.S. Department of Transportation and is one of the largest residential moving and corporate relocation company in...
2
by: ogo796 | last post by:
hi friends i am having a problem with creating folder within a directory. $Tdate = date('dFY'); // first directory. $_POST)) { mkdir($Tdir."/".$Tdate."/".$_POST); ...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.