Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
12 replies Latest Post - ‏2014-02-23T22:26:49Z by Slavek_Dvorsky
TXOdysseus
TXOdysseus
6 Posts
ACCEPTED ANSWER

Pinned topic Cannot Start DB2 on Mac OSX

‏2013-10-21T17:03:46Z |

When I run db2start on my OSX 10.7.5, I get this message:

SQL1220N  The database manager failed to allocate shared memory.

Scouring the Internet, I find two solutions: Setting instance_memory to automatic and increasing ulimit. On the Mac, ulimit has a max value of 1200. I notice that db2profile is trying to set it to 65000. Since that is not going to fly, what do I do?

 

  • nivanov1
    nivanov1
    53 Posts
    ACCEPTED ANSWER

    Re: Cannot Start DB2 on Mac OSX

    ‏2013-10-21T20:29:10Z  in response to TXOdysseus

    On the Mac, ulimit has a max value of 1200

    I find it very unlikely. Is this a non-root installation, by chance?

    • TXOdysseus
      TXOdysseus
      6 Posts
      ACCEPTED ANSWER

      Re: Cannot Start DB2 on Mac OSX

      ‏2013-10-21T20:52:38Z  in response to nivanov1

      In my research, I ran across that limit a few times. Here is what happens when I su to root:

      macpro1:V10.1 root# ulimit -n 65000
      -sh: ulimit: open files: cannot modify limit: Invalid argument
      macpro1:V10.1 root# 
       
      • nivanov1
        nivanov1
        53 Posts
        ACCEPTED ANSWER

        Re: Cannot Start DB2 on Mac OSX

        ‏2013-10-21T21:06:05Z  in response to TXOdysseus

        Did you try launchctl limit?

        • TXOdysseus
          TXOdysseus
          6 Posts
          ACCEPTED ANSWER

          Re: Cannot Start DB2 on Mac OSX

          ‏2013-10-21T21:15:42Z  in response to nivanov1

          No, but it did not seem to make a difference:

           

          macpro1:sqllib gerald$ launchctl limit maxfiles 65000
          macpro1:sqllib gerald$ db2start
          SQL1220N  The database manager failed to allocate shared memory.
          macpro1:sqllib gerald$ 
           

           

        • TXOdysseus
          TXOdysseus
          6 Posts
          ACCEPTED ANSWER

          Re: Cannot Start DB2 on Mac OSX

          ‏2013-10-30T19:15:24Z  in response to nivanov1

          No reply in over a week. Fortunately, this is just a learning exercise for JPA. I'll switch to MySQL or Postgres or something. Thanks for the help.

          • janetrm
            janetrm
            5 Posts
            ACCEPTED ANSWER

            Re: Cannot Start DB2 on Mac OSX

            ‏2014-01-07T22:00:35Z  in response to TXOdysseus

            Hi, 

            Well I have the  same  issue than you "SQL1220N  The database manager failed to allocate shared memory." and I could not  find any answer. and when I start db2 I have some errors

            LEVEL: Severe

            FUNCTION: DB2 UDB, base sys utilities, DB2StartMain, probe:4767

            MESSAGE : ZRC=0x850F0005=-2062614523=SQLO_NOSEG

                      "No Storage Available for allocation"

                      DIA8305C Memory allocation failure occurred.

            LEVEL: Severe

            FUNCTION: DB2 UDB, base sys utilities, DB2StartMain, probe:3

            MESSAGE : ZRC=0xFFFFFB3C=-1220

                      SQL1220N  The database manager failed to allocate shared memory. 

            Also this link gave me a clue that what was wrong http://support.apple.com/kb/HT402

            So I fixed this way

            Open /etc/sysctl.conf and  make  sure the  file  has line of text as you can see below 

            kern.sysv.shmmax=1073741824

            kern.sysv.shmmin=1

            kern.sysv.shmmni=4096

            kern.sysv.shmseg=32

            kern.sysv.shmall=1179648

            kern.maxfilesperproc=65536

            dkern.maxfiles=65536 Install DB2 

            Restart the  machine and run again db2start

            macbookpro:adm db2inst1$ ./db2start

            SQL1063N  DB2START processing was successful.

            I hope it can help you 

            Updated on 2014-01-07T22:02:13Z at 2014-01-07T22:02:13Z by janetrm
  • Slavek_Dvorsky
    Slavek_Dvorsky
    2 Posts
    ACCEPTED ANSWER

    Re: Cannot Start DB2 on Mac OSX

    ‏2014-02-23T22:26:30Z  in response to TXOdysseus

    I had the same problem as you guys. I tried a simple solution and it WORKS!

    [SOLUTION]

    The problem is with db2profile command. It stops working on line 177 ulimit -n 65000. And than the database manager is unable to alocate memory...you all know this error. 

    So I simply erased the line 177. I erased ulimit -n 65000 from db2profile file and saved the file. Then I ran . ./db2profile and db2start

     

    bohuslav-mbp:sqllib db2admin$ . ./db2profile

    bohuslav-mbp:sqllib db2admin$ db2start

    SQL1063N  DB2START processing was successful.

    bohuslav-mbp:sqllib db2admin$ db2

    (c) Copyright IBM Corporation 1993,2007

    Command Line Processor for DB2 Client 10.1.0

     

    You can issue database manager commands and SQL statements from the command 

    prompt. For example:

        db2 => connect to sample

        db2 => bind sample.bnd

     

    For general help, type: ?.

    For command help, type: ? command, where command can be

    the first few keywords of a database manager command. For example:

     ? CATALOG DATABASE for help on the CATALOG DATABASE command

     ? CATALOG          for help on all of the CATALOG commands.

     

    To exit db2 interactive mode, type QUIT at the command prompt. Outside 

    interactive mode, all commands must be prefixed with 'db2'.

    To list the current command option settings, type LIST COMMAND OPTIONS.

     

    For more detailed help, refer to the Online Reference Manual.

     

    db2 => quit

    DB20000I  The QUIT command completed successfully.

    bohuslav-mbp:sqllib db2admin$ db2sampl

     

      Creating database "SAMPLE"...

      Connecting to database "SAMPLE"...

      Creating tables and data in schema "DB2ADMIN"...

      Creating tables with XML columns and XML data in schema "DB2ADMIN"...

     

      'db2sampl' processing complete.

     

    bohuslav-mbp:sqllib db2admin$