Topic
14 replies Latest Post - ‏2014-06-19T05:28:54Z by Swati Thorve
PANT_Loutsavanh_Theuamthalaray
7 Posts
ACCEPTED ANSWER

Pinned topic DB2 Express-C not starting on Windows 7 - SQL1390C The environment variable DB2INSTANCE is not defined or is invalid.

‏2014-06-02T15:24:51Z |

I downloaded and installed DB2 Express-C from the following site: http://www-01.ibm.com/software/data/db2/express-c/download.html.
 
However, the database is not starting.  When I try to start from command prompt using db2start.exe, I get this error: SQL1390C  The environment variable DB2INSTANCE is not defined or is invalid.  I think the reason maybe due to the license key has expired.  I thought this is a free version to use.  I am using DB2 Express-C for my 10x training.

I am on Windows 7 Professional SP1.

Please help.

Thanks,

Kiki

  • LukeNumrych
    LukeNumrych
    17 Posts
    ACCEPTED ANSWER

    Re: DB2 Express-C not starting on Windows 7 - SQL1390C The environment variable DB2INSTANCE is not defined or is invalid.

    ‏2014-06-02T16:43:41Z  in response to PANT_Loutsavanh_Theuamthalaray

    Try setting the DB2INSTANCE variable.  Execute the below in command line (or better yet, db2 command window).  Make sure you are running the command line "As Administrator".

    Y:\>db2ilist

    DB2-or-whatever-name-does-your-instance-have  

    Y:\>set DB2INSTANCE=the-output-from-the-above

    Then try starting DB2 again.  

    • PANT_Loutsavanh_Theuamthalaray
      7 Posts
      ACCEPTED ANSWER

      Re: DB2 Express-C not starting on Windows 7 - SQL1390C The environment variable DB2INSTANCE is not defined or is invalid.

      ‏2014-06-09T16:38:32Z  in response to LukeNumrych

      It is not working.  I still get that same warning message.  When I run this command [db2licm.exe -l ] , I have the following settings.  It looks like DB2 Express-C has expired.  I have uninstalled and re-installed the software but I still get the same error.

      C:\Program Files\IBM\SQLLIB\BIN>db2licm.exe -l
      Product name:                     "DB2 Express-C"
      Expiry date:                      "Expired"
      Product identifier:               "db2expc"
      Version information:              "10.5"
      Max number of CPUs:               "2"
      Max amount of memory (GB):        "16"
      Enforcement policy:               "Soft Stop"

      Updated on 2014-06-09T17:22:48Z at 2014-06-09T17:22:48Z by PANT_Loutsavanh_Theuamthalaray
      • nivanov
        nivanov
        19 Posts
        ACCEPTED ANSWER

        Re: DB2 Express-C not starting on Windows 7 - SQL1390C The environment variable DB2INSTANCE is not defined or is invalid.

        ‏2014-06-10T16:19:08Z  in response to PANT_Loutsavanh_Theuamthalaray

        May be you can try to find the *.lic file and reapply it using "db2licm -a"?

      • Sreeharsha_Naik
        Sreeharsha_Naik
        34 Posts
        ACCEPTED ANSWER

        Re: DB2 Express-C not starting on Windows 7 - SQL1390C The environment variable DB2INSTANCE is not defined or is invalid.

        ‏2014-06-11T18:19:41Z  in response to PANT_Loutsavanh_Theuamthalaray

        Ok, so this problem still persists - I will see if I can check with IBM regarding this to fix this issue of the .lic file vanishing in thin air, this has happened to me earlier and I have a fix for this - follow this link here 

        Updated on 2014-06-11T18:20:01Z at 2014-06-11T18:20:01Z by Sreeharsha_Naik
        • PANT_Loutsavanh_Theuamthalaray
          7 Posts
          ACCEPTED ANSWER

          Re: DB2 Express-C not starting on Windows 7 - SQL1390C The environment variable DB2INSTANCE is not defined or is invalid.

          ‏2014-06-11T18:52:23Z  in response to Sreeharsha_Naik

          I don't have the .licbkup sub-folder under the BIN folder. 

          C:\Program files\IBM\SQLLIB\BIN ; there is a hidden folder named .licbkup and your license file resides here with the name lic00000001.lic ( DB2 Express C free version ).

          I have updated the windows explorer view option to "Show hidden files, folders, and drives".

          Nothing!!! :-(

          • Sreeharsha_Naik
            Sreeharsha_Naik
            34 Posts
            ACCEPTED ANSWER

            Re: DB2 Express-C not starting on Windows 7 - SQL1390C The environment variable DB2INSTANCE is not defined or is invalid.

            ‏2014-06-12T05:54:48Z  in response to PANT_Loutsavanh_Theuamthalaray

            Give me your email ID and I will try mailing you the license file, post which you can try to add the license on your own by following the steps given in the same link which I provided earlier

            Updated on 2014-06-12T05:55:23Z at 2014-06-12T05:55:23Z by Sreeharsha_Naik
            • PANT_Loutsavanh_Theuamthalaray
              7 Posts
              ACCEPTED ANSWER

              Re: DB2 Express-C not starting on Windows 7 - SQL1390C The environment variable DB2INSTANCE is not defined or is invalid.

              ‏2014-06-12T12:08:12Z  in response to Sreeharsha_Naik

              Here is my email: ktheua@us.ibm.com

              Thanks for your help!!

              • Sreeharsha_Naik
                Sreeharsha_Naik
                34 Posts
                ACCEPTED ANSWER

                Re: DB2 Express-C not starting on Windows 7 - SQL1390C The environment variable DB2INSTANCE is not defined or is invalid.

                ‏2014-06-12T15:20:10Z  in response to PANT_Loutsavanh_Theuamthalaray

                Just sent .. let me know if you got it and it worked

                • PANT_Loutsavanh_Theuamthalaray
                  7 Posts
                  ACCEPTED ANSWER

                  Re: DB2 Express-C not starting on Windows 7 - SQL1390C The environment variable DB2INSTANCE is not defined or is invalid.

                  ‏2014-06-16T12:54:01Z  in response to Sreeharsha_Naik

                  It is not working...I still get the error when I try to start the db2 from command prompt.

                   

                   

                  Attachments

                  Updated on 2014-06-16T12:55:37Z at 2014-06-16T12:55:37Z by PANT_Loutsavanh_Theuamthalaray
                  • vshasha
                    vshasha
                    1 Post
                    ACCEPTED ANSWER

                    Re: DB2 Express-C not starting on Windows 7 - SQL1390C The environment variable DB2INSTANCE is not defined or is invalid.

                    ‏2014-06-17T14:16:00Z  in response to PANT_Loutsavanh_Theuamthalaray

                    Your instance is not set, therefore you are hitting this issue.

                    set DB2INSTANCE = <instancename>

                    If you do not have any instance,
                    create a new instance using
                    1) db2icrt db2inst1       (where db2inst1 is the instance name)
                    2) set DB2INSTANCE = db2inst1
                    3) To verify if the instance is set or not run "db2 get instance" this should return you the name of the instance if instance is set properly
                    4) Now run db2start it should work fine.

                    Hope this helps

                    Thanks,
                    Shashank

                    • PANT_Loutsavanh_Theuamthalaray
                      7 Posts
                      ACCEPTED ANSWER

                      Re: DB2 Express-C not starting on Windows 7 - SQL1390C The environment variable DB2INSTANCE is not defined or is invalid.

                      ‏2014-06-18T12:21:59Z  in response to vshasha

                      I am able to start from command prompt after creating the db2 instance.  The next step, is to connect to the SAMPLE database from IBM Data Studio.   The new connection profile is setup; I only need to enter the user name and password.  When I try to connect, I am now getting a "connection refused" error.

                      I must be hitting all of the issues for this db2 install -- any suggestions on where and what to change?

  • Swati Thorve
    Swati Thorve
    4 Posts
    ACCEPTED ANSWER

    Re: DB2 Express-C not starting on Windows 7 - SQL1390C The environment variable DB2INSTANCE is not defined or is invalid.

    ‏2014-06-17T15:42:06Z  in response to PANT_Loutsavanh_Theuamthalaray

    I would suggest you follow the steps suggested by Shashank to resolve DB2INSTANCE error.

    Meanwhile, for license issue i.e license showing expired, I tried reproducing issue in-house,  I installed DB2 10.5 Express-C on Windows 7 64 bit, I was able to see permanent license:

    C:\Program Files\IBM\SQLLIB_02\BIN>db2licm -l
    Product name:                     "DB2 Express-C"
    License type:                     "Unwarranted"
    Expiry date:                      "Permanent"
    Product identifier:               "db2expc"
    Version information:              "10.5"
    Max number of CPUs:               "2"
    Max amount of memory (GB):        "16"
    Enforcement policy:               "Soft Stop"
     

    so if you are still facing the issue with license, I would suggest uninstalling current Express-C and installing latest one from here:

    http://www-01.ibm.com/software/data/db2/express-c/download.html

    Please let us know if you have any further questions.

    Thanks,

    -Swati Thorve

     

    • PANT_Loutsavanh_Theuamthalaray
      7 Posts
      ACCEPTED ANSWER

      Re: DB2 Express-C not starting on Windows 7 - SQL1390C The environment variable DB2INSTANCE is not defined or is invalid.

      ‏2014-06-18T12:26:44Z  in response to Swati Thorve

      I have been going to that site to download the latest DB2 Express-C so that is not the problem.  I did uninstall and re-install the application a couple of times but I am getting the same result.

  • Swati Thorve
    Swati Thorve
    4 Posts
    ACCEPTED ANSWER

    Re: DB2 Express-C not starting on Windows 7 - SQL1390C The environment variable DB2INSTANCE is not defined or is invalid.

    ‏2014-06-19T05:28:54Z  in response to PANT_Loutsavanh_Theuamthalaray

    We are seeing two different issues in this thread

    1> SQL1390C The environment variable DB2INSTANCE is not set

    2> DB2 Express C showing expired license.

    In your reply, when you say "I did uninstall and re-install the application a couple of times but I am getting the same result." , I believe by application you mean DB2 Express-C. So after uninstalling and reinstalling DB2 Express-C you are seeing both the issues? Was the installation successful?

    I would suggest try uninstall/ reinstall one more time, collect logs during uninstall and install. Please send logs to us. If you are seeing the issue after reinstall, please collect db2support.zip, after reproducing the issue.

    1> Uninstall DB2 Express-C using db2unins command located in your install image.

    db2unins -f

    http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/topic/com.ibm.db2.luw.admin.cmd.doc/doc/r0023371.html

    PS: We call this brute force uninstall. -f option will remove all DB2 Copies from the machine. So if you have any other copies on the machine, which you do not want to remove, please do not use -f option.

    2> Run setup command from command line with -t and -l options

    setup -t trace.txt -l log.txt

    http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/topic/com.ibm.db2.luw.admin.cmd.doc/doc/r0011768.html

    3> Once installation is successful, check for both problems i.e DB2INSTANCE and license. If problem persists, please collect db2support.zip reproducing the issue.

    1) Rename your db2diag.log to something like db2diag.log_old.
    2) Reproduce the issue.
    3) Collect db2support.zip

    DB2Support
    ------------------
    db2support  .  -s -g (this will generate a file called, 'db2support.zip')
    Rename the file <PMR_NO>.db2support.zip

    Please let us know if you have any questions.

    Thanks,

    -Swati Thorve