Results 1 to 11 of 11
  1. #1
    Join Date
    Sep 2009
    Posts
    4

    Unanswered: Change default instance location

    New to DB2, just installing DB2 Express-C. Spent some time reading the documentation (okay really briefly) and searching the net but I can't find the answer to this question:

    During install I do not want ANYTHING installed to c:\db2. I want to choose where all files go. How do I change the instance location (and anything else that gets installed there).

    This is a fresh install (again). There has got to be a way to "undummify" this blasted thing.
    Last edited by mrcob; 09-30-09 at 09:16.

  2. #2
    Join Date
    Oct 2007
    Posts
    246
    chk on db2relocatedb tool
    will help you to relocated the instance location
    regds
    Paul

  3. #3
    Join Date
    Jul 2006
    Location
    Pune , India
    Posts
    433
    Not got hold of your question properly!
    Doesn't GUI asks for Installation location while installing DB2. I recall it asks for it ?
    Rahul Singh
    Certified DB2 9 DBA / Application Developer

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Do you mean the database path? On Windows the instance directory is under "Application Data" in the "Documents and Settings" directory.

    You don't have much choice for the database path on Windows; you can only specify a different drive letter by updating the DFTDBPATH instance configuration parameter.
    ---
    "It does not work" is not a valid problem statement.

  5. #5
    Join Date
    Sep 2009
    Posts
    4
    Quote Originally Posted by rahul_s80
    Not got hold of your question properly!
    Doesn't GUI asks for Installation location while installing DB2. I recall it asks for it ?
    In addition to the install location, it installs the default instance in C:\DB2 without prompting where to put it.

    Quote Originally Posted by n_i
    You don't have much choice for the database path on Windows; you can only specify a different drive letter by updating the DFTDBPATH instance configuration parameter.
    Well that sucks. I am a firm believer in data belongs on the data drive(s), never EVER on the system drive. Why is this such a difficult concept for developers to wrap their head around?

    Guess I could try creating a new instance in a different location post-install, make that the default, then remove the old one. Should work but just feels "wrong" somehow to have to jump through some many hoops.

    Thanks all for the help/input.

  6. #6
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by mrcob

    Well that sucks. I am a firm believer in data belongs on the data drive(s), never EVER on the system drive. Why is this such a difficult concept for developers to wrap their head around?
    Not sure what developers you have in mind, but nothing prevents you from specifying the database path, or individual tablespaces' paths, when creating them, if you don't like the default.
    ---
    "It does not work" is not a valid problem statement.

  7. #7
    Join Date
    Sep 2009
    Posts
    4
    It would appear I am getting conflicting information here.

    Quote Originally Posted by n_i
    You don't have much choice for the database path on Windows; you can only specify a different drive letter by updating the DFTDBPATH instance configuration parameter.
    This would imply that only the drive letter (on Windows) can be changed, which is consistent with what I have read in the documentation and on other forums. I've read (forget where) that on Windows only, the DFTDBPATH can only specify the drive letter, the path is ignored if specified.

    But now I get this reply:

    Quote Originally Posted by n_i
    Not sure what developers you have in mind, but nothing prevents you from specifying the database path, or individual tablespaces' paths, when creating them, if you don't like the default.
    If this is in fact the case, please share EXACTLY how to do this.

    Edit: Just noticed its the same user giving me conflicting information. Nice!!!

  8. #8
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,368
    I don't deal with DB2 installation on Windows, but it looks like you can use the following in order to change the location of an existing instance / future instances:

    db2iupdt /p <new path>
    db2set -g DB2INSTPROF=<new path>


    For databases, you can specify the drive on the create db command, the same for create tablespace

  9. #9
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,368
    for create db on path instead of drive, take a look at DB2_CREATE_DB_ON_PATH registry variable

  10. #10
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by mrcob

    If this is in fact the case, please share EXACTLY how to do this.
    Check the CREATE DATABASE and CREATE TABLESPACE commands in the manual.

    Quote Originally Posted by mrcob
    Edit: Just noticed its the same user giving me conflicting information. Nice!!!
    If you don't understand something, it's often better to ask for clarifications than to blame other people.
    ---
    "It does not work" is not a valid problem statement.

  11. #11
    Join Date
    Sep 2009
    Posts
    4
    Quote Originally Posted by n_i
    If you don't understand something, it's often better to ask for clarifications than to blame other people.
    My apologies if it seems that way. I was venting my frustration a bit on the often conflicting information on this topic. Guilty there.

    My question (not well expressed I guess) was: I seem to missing finding this information in the manual, or on this and other forums. In fact I see the same question pop up repeatedly on various forums with no answer, which quite frankly worried me.

    I was looking to:
    a) Ideally change location of default instance during install (apparently not)
    b) failing that, move the default instance (tricky)
    c) or failing that, make a new instance where I want and make that the default (doable)

    This has been answered here (I think). I'm about to give it a try, so we'll see.

    Again thank you all for the advice/help. Sorry if I ruffled some feathers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •