473,385 Members | 1,893 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,385 software developers and data experts.

changing directory for data file

when installing db2, it only asks for installation directory and does
not ask where it is going to store data files. how can i change the
default directory after installation.
Jan 11 '06 #1
9 12451
"gopi" <gg****@hotmail.com> wrote in message
news:dq**********@rumours.uwaterloo.ca...
when installing db2, it only asks for installation directory and does not
ask where it is going to store data files. how can i change the default
directory after installation.


You can specify the location of data files when you create databases. See
create database command.
Jan 12 '06 #2
If you are at fixpack 9 or above, you can use command db2relocatedb

Norm
Mark A wrote:
"gopi" <gg****@hotmail.com> wrote in message
news:dq**********@rumours.uwaterloo.ca...
when installing db2, it only asks for installation directory and does not
ask where it is going to store data files. how can i change the default
directory after installation.


You can specify the location of data files when you create databases. See
create database command.


Jan 12 '06 #3
In article <dq**********@rumours.uwaterloo.ca>, gopi
(gg****@hotmail.com) says...
when installing db2, it only asks for installation directory and does
not ask where it is going to store data files. how can i change the
default directory after installation.


My guess is that you're on Windows.
If so all instance files are placed in the installation directory and
all databases are automatically located on the same drive.

Each instance has his own directory within the installation
directory. If you want them on a different location you can drop the
instance with the db2idrop command and recreate it with the db2icrt
command.
To create instance DB2TEST on d:\instancedata you can use the command
'db2icrt DB2TEST -p d:\instancedata'. It's also possible to change
the DB2INSTPROF variable but then you also need to drop and recreate
the administration instance.

If you want your databases automatically created on another drive you
need to change the instance configuration with the command
'db2 update dbm cfg using DFTDBPATH e:' or any other drive you want.

If you want your databases created on different drives you can
specify it on the create database command with the 'ON <drive>'
option.

Hope this helps.
Jan 12 '06 #4
Mark A wrote:
"gopi" <gg****@hotmail.com> wrote in message
news:dq**********@rumours.uwaterloo.ca...
when installing db2, it only asks for installation directory and does not
ask where it is going to store data files. how can i change the default
directory after installation.

You can specify the location of data files when you create databases. See
create database command.


thanks.
running on windows, i can specify drive like "create db tempdb on d:",
but when i try to give complete path "create db tempdb on
d:\db2\tempdb" it does not accept. how can i specify a subdiretory ?
Jan 12 '06 #5
Gert van der Kooij wrote:
In article <dq**********@rumours.uwaterloo.ca>, gopi
(gg****@hotmail.com) says...
when installing db2, it only asks for installation directory and does
not ask where it is going to store data files. how can i change the
default directory after installation.

My guess is that you're on Windows.
If so all instance files are placed in the installation directory and
all databases are automatically located on the same drive.

Each instance has his own directory within the installation
directory. If you want them on a different location you can drop the
instance with the db2idrop command and recreate it with the db2icrt
command.
To create instance DB2TEST on d:\instancedata you can use the command
'db2icrt DB2TEST -p d:\instancedata'. It's also possible to change
the DB2INSTPROF variable but then you also need to drop and recreate
the administration instance.

If you want your databases automatically created on another drive you
need to change the instance configuration with the command
'db2 update dbm cfg using DFTDBPATH e:' or any other drive you want.

If you want your databases created on different drives you can
specify it on the create database command with the 'ON <drive>'
option.

Hope this helps.


thanks. it was very helpful.
how can i put different databses in different user-defined
subdirectries. it seems 'ON' option only allows me to specify the drive.

Jan 12 '06 #6
In article <dq**********@rumours.uwaterloo.ca>, gopi
(gg****@hotmail.com) says...
Gert van der Kooij wrote:
In article <dq**********@rumours.uwaterloo.ca>, gopi
(gg****@hotmail.com) says...
when installing db2, it only asks for installation directory and does
not ask where it is going to store data files. how can i change the
default directory after installation.

My guess is that you're on Windows.
If so all instance files are placed in the installation directory and
all databases are automatically located on the same drive.

Each instance has his own directory within the installation
directory. If you want them on a different location you can drop the
instance with the db2idrop command and recreate it with the db2icrt
command.
To create instance DB2TEST on d:\instancedata you can use the command
'db2icrt DB2TEST -p d:\instancedata'. It's also possible to change
the DB2INSTPROF variable but then you also need to drop and recreate
the administration instance.

If you want your databases automatically created on another drive you
need to change the instance configuration with the command
'db2 update dbm cfg using DFTDBPATH e:' or any other drive you want.

If you want your databases created on different drives you can
specify it on the create database command with the 'ON <drive>'
option.

Hope this helps.


thanks. it was very helpful.
how can i put different databses in different user-defined
subdirectries. it seems 'ON' option only allows me to specify the drive.


That's right, only a drive can be specified. DB2 will auomatically
put all databases belonging to instance DB2 in the \DB2\NODE0000
directory when running with single partition DB2 on the drive
specified.
Jan 12 '06 #7
I am just wondering if DB2 automatic storage management would comes
into play here
http://publib.boulder.ibm.com/infoce...n/c0012278.htm.
I am not sure though when that was intorduced in DB2, anybody?

-Eugene

Jan 13 '06 #8
In article <11**********************@g14g2000cwa.googlegroups .com>,
Eugene F (ro********@yahoo.com) says...
I am just wondering if DB2 automatic storage management would comes
into play here
http://publib.boulder.ibm.com/infoce...n/c0012278.htm.
I am not sure though when that was intorduced in DB2, anybody?

-Eugene


If I understand it right you can put the tablespace containers in
some directory which is called the storagepath, but all other data
like the logfiles and the database history file is still on the
'old' location.

I tested it with the command:
db2 create db teststor on d:\xx dbpath on d:

It created the the directory d:\DB2\NODE0000\SQL00007 with the
following files:
<DIR> .
<DIR> ..
<DIR> DB2EVENT
1.028 db2rhist.asc
1.028 db2rhist.bak
512 SQLBP.1
512 SQLBP.2
4.096 SQLDBCON
16.384 SQLDBCONF
9 SQLINSLK
24.576 SQLOGCTL.LFH
<DIR> SQLOGDIR
8.192 SQLOGMIR.LFH
135.168 SQLSGF.1
135.168 SQLSGF.2
196.608 SQLSPCS.1
196.608 SQLSPCS.2
0 SQLTMPLK

In the d:\xx directory these files/directories were created:
D:\xx\DB2
D:\xx\DB2\NODE0000
D:\xx\DB2\SQLCRT.FLG
D:\xx\DB2\NODE0000\SQLCRT.FLG
D:\xx\DB2\NODE0000\TESTSTOR
D:\xx\DB2\NODE0000\TESTSTOR\SQLCRT.FLG
D:\xx\DB2\NODE0000\TESTSTOR\T0000000
D:\xx\DB2\NODE0000\TESTSTOR\T0000001
D:\xx\DB2\NODE0000\TESTSTOR\T0000002
D:\xx\DB2\NODE0000\TESTSTOR\T0000000\C0000000.CAT
D:\xx\DB2\NODE0000\TESTSTOR\T0000000\SQLCRT.FLG
D:\xx\DB2\NODE0000\TESTSTOR\T0000001\C0000000.TMP
D:\xx\DB2\NODE0000\TESTSTOR\T0000001\SQLCRT.FLG
D:\xx\DB2\NODE0000\TESTSTOR\T0000001\C0000000.TMP\ SQLTAG.NAM
D:\xx\DB2\NODE0000\TESTSTOR\T0000002\C0000000.USR
D:\xx\DB2\NODE0000\TESTSTOR\T0000002\SQLCRT.FLG

So it might help to store data on a different place but this could
also be done by specifying tablespace locations when creating the
database. The files which remain in d:\DB2\NODE0000 are the same in
both situations.
Jan 13 '06 #9
Have you considered changing operating systems for then database server?
Linux allows specifying the directory when creating a database.

Phil Sherman

gopi wrote:
Gert van der Kooij wrote:
In article <dq**********@rumours.uwaterloo.ca>, gopi
(gg****@hotmail.com) says...
when installing db2, it only asks for installation directory and does
not ask where it is going to store data files. how can i change the
default directory after installation.

My guess is that you're on Windows.
If so all instance files are placed in the installation directory and
all databases are automatically located on the same drive.

Each instance has his own directory within the installation directory.
If you want them on a different location you can drop the instance
with the db2idrop command and recreate it with the db2icrt command.
To create instance DB2TEST on d:\instancedata you can use the command
'db2icrt DB2TEST -p d:\instancedata'. It's also possible to change the
DB2INSTPROF variable but then you also need to drop and recreate the
administration instance.

If you want your databases automatically created on another drive you
need to change the instance configuration with the command 'db2 update
dbm cfg using DFTDBPATH e:' or any other drive you want.

If you want your databases created on different drives you can specify
it on the create database command with the 'ON <drive>' option.

Hope this helps.

thanks. it was very helpful.
how can i put different databses in different user-defined
subdirectries. it seems 'ON' option only allows me to specify the drive.

Jan 13 '06 #10

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

Similar topics

1
by: Parzival | last post by:
I have a package that includes some data files. I am planning to use a distutils setup script to install the package. How can I compute a path name for such a data file that will always be relative...
5
by: bart plessers | last post by:
Hello, Currently I am developping a internet "directory browser" My page 'default.asp' has following entries: CurrentPATH = Request("MyLink") Set oFSO =...
39
by: Joe Laughlin | last post by:
If I have a character array with "/some/file/directory/file_name", are there any functions / libraries that I could use to separate the directory ("some/file/directory") from the file name...
12
by: Steven Bethard | last post by:
Ok, so I have a module that is basically a Python wrapper around a big lookup table stored in a text file. The module needs to provide a few functions:: get_stem(word, pos, default=None)...
7
by: Randy Yates | last post by:
I'm a complete newbie to postgres so please look the other way if these questions are really stupid. Is it legitimate to have one database per data file? For organizational and backup purposes,...
3
by: James Wong | last post by:
Hi, I have some XML config file in my VB project. When I use clickonce to publish my project, the execute files and the xml data files are not in the same folder of the client computer. How...
1
by: nickyeng | last post by:
i have 3 directory, members and sounds directories. the directories sounds and members need to be protected from access by unauthorised people. how to configure my server so that only users...
2
by: phpnoob | last post by:
I have a php script that processes a form and then posts the user input to a data file on the server in a comma delimited format. For simplicity call the file "data.csv." The script is working...
6
by: Major Drake | last post by:
Windows 2003 64 bit sp2 + SQL Server std 32 bit sp2 compability mode 90, recovery model simple. I have about 40 Gb database where is about 98% free space (I deleted data from tables). dbcc...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.