Topic
  • 12 replies
  • Latest Post - ‏2014-02-23T22:26:49Z by Slavek_Dvorsky
TXOdysseus
TXOdysseus
6 Posts

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

    Re: Cannot Start DB2 on Mac OSX

    ‏2013-10-21T20:29:10Z  

    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

    Re: Cannot Start DB2 on Mac OSX

    ‏2013-10-21T20:52:38Z  
    • nivanov1
    • ‏2013-10-21T20:29:10Z

    On the Mac, ulimit has a max value of 1200

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

    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

    Re: Cannot Start DB2 on Mac OSX

    ‏2013-10-21T21:06:05Z  

    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# 
     

    Did you try launchctl limit?

  • TXOdysseus
    TXOdysseus
    6 Posts

    Re: Cannot Start DB2 on Mac OSX

    ‏2013-10-21T21:15:42Z  
    • nivanov1
    • ‏2013-10-21T21:06:05Z

    Did you try launchctl limit?

    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

    Re: Cannot Start DB2 on Mac OSX

    ‏2013-10-30T19:15:24Z  
    • nivanov1
    • ‏2013-10-21T21:06:05Z

    Did you try launchctl limit?

    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

    Re: Cannot Start DB2 on Mac OSX

    ‏2014-01-07T22:00:35Z  

    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.

    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
  • TXOdysseus
    TXOdysseus
    6 Posts

    Re: Cannot Start DB2 on Mac OSX

    ‏2014-01-08T01:55:23Z  
    • janetrm
    • ‏2014-01-07T22:00:35Z

    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 

    Thanks for the tip, but it still does not work. I notice you have db2inst1 on your command line. When you installed, did this user get created? I cannot su to it nor do I know its password. How did you get there?

     

     

  • janetrm
    janetrm
    5 Posts

    Re: Cannot Start DB2 on Mac OSX

    ‏2014-01-21T19:43:59Z  

    Thanks for the tip, but it still does not work. I notice you have db2inst1 on your command line. When you installed, did this user get created? I cannot su to it nor do I know its password. How did you get there?

     

     

    Before the db2 installation I created group and user IDs for a DB2 database installation according the table below

    http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=%2Fcom.ibm.db2.udb.uprun.doc%2Fdoc%2Ft0006742.htm

    Check the dbm cfg for the instance setting instance_memory, and see if it is set to automatic, use  this command:


    db2 get dbm cfg | grep -i instance_memory

    Size of instance shared memory (4KB) (INSTANCE_MEMORY) = AUTOMATIC 

    db2 update dbm cfg using INSTANCE_MEMORY AUTOMATIC

    Regards

  • TXOdysseus
    TXOdysseus
    6 Posts

    Re: Cannot Start DB2 on Mac OSX

    ‏2014-02-08T02:17:50Z  
    • janetrm
    • ‏2014-01-21T19:43:59Z

    Before the db2 installation I created group and user IDs for a DB2 database installation according the table below

    http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=%2Fcom.ibm.db2.udb.uprun.doc%2Fdoc%2Ft0006742.htm

    Check the dbm cfg for the instance setting instance_memory, and see if it is set to automatic, use  this command:


    db2 get dbm cfg | grep -i instance_memory

    Size of instance shared memory (4KB) (INSTANCE_MEMORY) = AUTOMATIC 

    db2 update dbm cfg using INSTANCE_MEMORY AUTOMATIC

    Regards

    When I click on that link, I get topic not found. Is there a different way to get there?

  • CRPence@vnet.ibm.com
    2 Posts

    Re: Cannot Start DB2 on Mac OSX

    ‏2014-02-10T20:02:11Z  

    When I click on that link, I get topic not found. Is there a different way to get there?

    I tried searching on the following tokens in the InfoCenter for DB2 10.5 for LUW docs and found a similar link, included below the search tokens along with drill-down and topic heading [identical to the wording provided with the earlier link, although with no indication that the text was the actual topic name]:

      group   id   installation

    http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/topic/com.ibm.db2.luw.qb.server.doc/doc/t0006742.html

    DB2 10.5 for Linux, UNIX, and Windows

    Creating group and user IDs for a DB2 database installation (Linux and UNIX)

  • Slavek_Dvorsky
    Slavek_Dvorsky
    2 Posts

    Re: Cannot Start DB2 on Mac OSX

    ‏2014-02-23T22:26:30Z  

    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$ 

  • Slavek_Dvorsky
    Slavek_Dvorsky
    2 Posts

    Re: Cannot Start DB2 on Mac OSX

    ‏2014-02-23T22:26:49Z  

    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$ 

    Worked on OS X 10.9.1