473,732 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 12566
"gopi" <gg****@hotmail .com> wrote in message
news:dq******** **@rumours.uwat erloo.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.uwat erloo.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**********@r umours.uwaterlo o.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.uwat erloo.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**********@r umours.uwaterlo o.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**********@r umours.uwaterlo o.ca>, gopi
(gg****@hotmail .com) says...
Gert van der Kooij wrote:
In article <dq**********@r umours.uwaterlo o.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************ **********@g14g 2000cwa.googleg roups.com>,
Eugene F (ro********@yah oo.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\NODE0 000
D:\xx\DB2\SQLCR T.FLG
D:\xx\DB2\NODE0 000\SQLCRT.FLG
D:\xx\DB2\NODE0 000\TESTSTOR
D:\xx\DB2\NODE0 000\TESTSTOR\SQ LCRT.FLG
D:\xx\DB2\NODE0 000\TESTSTOR\T0 000000
D:\xx\DB2\NODE0 000\TESTSTOR\T0 000001
D:\xx\DB2\NODE0 000\TESTSTOR\T0 000002
D:\xx\DB2\NODE0 000\TESTSTOR\T0 000000\C0000000 .CAT
D:\xx\DB2\NODE0 000\TESTSTOR\T0 000000\SQLCRT.F LG
D:\xx\DB2\NODE0 000\TESTSTOR\T0 000001\C0000000 .TMP
D:\xx\DB2\NODE0 000\TESTSTOR\T0 000001\SQLCRT.F LG
D:\xx\DB2\NODE0 000\TESTSTOR\T0 000001\C0000000 .TMP\SQLTAG.NAM
D:\xx\DB2\NODE0 000\TESTSTOR\T0 000002\C0000000 .USR
D:\xx\DB2\NODE0 000\TESTSTOR\T0 000002\SQLCRT.F LG

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**********@r umours.uwaterlo o.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
1562
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 to my package root directory (i.e. both when installed, and in my development directory?) Or to rephrase, say the data file is mypkg/data/foo.dat relative to the package root "mypkg" (the directory that holds __init__.py). Is there an enquiry...
5
2209
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 = CreateObject("Scripting.FileSystemObject") Set oFolder = oFSO.GetFolder(CurrentPATH) Set oFolderContents = oFolder.Files
39
2647
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 ("file_name"). I looked at sscanf(), but that didn't seem to do what I wanted. Thanks, Joe
12
1926
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) stem_exists(word, pos) ... Because there should only ever be one lookup table, I feel like these functions ought to be module globals. That way, you could just do
7
2877
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, I'd like to keep the database files for each of several projects separate. This means, e.g., that postmaster must have multiple instances going simultaneously? I'm thinking the answer is NO because, for one, the TCPIP
3
1802
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 can I get the real path of my xml data files? Thanks for example, execute file path:
1
2386
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 in the member "group" have access ? i want to use directory configuration file(directory access control file) to prevent accessing from unauthorized user to members directory. So, i have to create a directory configuration file and place in...
2
2567
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 well and the data is posted correctly to the data file. The big problem is that anyone can point their web browser to www.mywebsite.com/data/data.csv and see exactly what is contained in the data file. Obviously, I want the data in that file to...
6
8793
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 checkdb -OK. dbcc reindex all tables -OK Shrink database (with reorganize and release unused pace) -no any affets,
0
8946
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8774
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9307
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9235
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.