Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. Unable to establish connection with database

Unable to establish connection with database

Scheduled Pinned Locked Moved Support
8 Posts 3 Posters 45.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y
    Y
    yuyang0571
    wrote on last edited by
    #1

    HI,My friends,
      I install NETXMS server(0.2.27) in windows server 2003,and my database is oracle (9i),which is installed  in the same sever.When config my server,I failed to connect oracle,'unable to connect to database'.
    and run "netxmsd -–debug=7",It said,"Unable to establish connection with database".
    The following is listed by the config procedure:
    Database engine: Oracle
    Database driver: oracle.ddr
    Create new database: no
    Initalize database: yes

    Database server: localhost
    Database name: zhmg (this DB is existing,but during config,this item can't be modified )
    Database user: system

    Where is wrong?

    thank you very much.

    1 Reply Last reply
    0
    • M
      M
      macro
      wrote on last edited by
      #2

      Please post your netxmsd.conf

      1 Reply Last reply
      0
      • Y
        Y
        yuyang0571
        wrote on last edited by
        #3

        HI,macro,the attached file is my netxmsd.conf.


        netxmsd.conf

        1 Reply Last reply
        0
        • M
          M
          macro
          wrote on last edited by
          #4

          I assume that you have tested your connection to Oracle DB with some other tools (e.g. sqlplus) and everything is in order. The only problem you have is to get NetXMS to connect to DB. If this is not the case please test Oracle connectivity first.

          There are two problems with your netxmsd.conf:

          • For Oracle, DBServer parameter must be set to your Oracle SID, not the hostname. This is the main problem which prevents NetXMS from connecting to your database
          • Setting DBLogin to system (Oracle's administrator username) is a very very very bad idea. NetXMS doesn't need admin rights and by using "system" you are not only giving it full admin rights but also cluttering system schema with absolutely foreign objects. Please create a separate username, assign "connect" and "resource" roles to it and you'll be fine.

          The proper netxmsd.conf file looks like this:

          # Driver - Oracle
          DBDriver = oracle.ddr
          # Oracle SID (check tnsnames.ora)
          DBServer = ODB1
          # Not used by NetXMS Oracle driver
          DBName = netxms_db
          # Oracle user name (schema)
          DBLogin = NETXMS
          # Oracle user password
          DBPassword = NETXMS
          
          1 Reply Last reply
          0
          • Y
            Y
            yuyang0571
            wrote on last edited by
            #5

            HI,macro
                I try again based on your suggestion,but It still failed.
                The following configuration is from my netxmsd.conf:
                  DBDriver = oracle.ddr
                  DBServer = zhmg #this is my oracle SID
                  DBName = zhmg
                  DBLogin = netxms
                  DBPassword = netxms

            The following messages is done at this try:

            SQL> CREATE USER netxms IDENTIFIED BY netxms;

            the user is created.

            SQL> grant connect,resource to netxms;

            authorized successfully。

            SQL> select instance_name from v$instance;

            INSTANCE_NAME
            ----------------
            zhmg

            and at command line,
            c:\sqlplus netxms/netxms
            can connect oracle successfully.

            Bset regards

            1 Reply Last reply
            0
            • M
              M
              macro
              wrote on last edited by
              #6

              Are you still getting "Unable to establish connection with database" message?

              Please try the following:

              1. Run cmd.exe, then set NLS_LANG environment variable to say AMERICAN_AMERICA.UTF8,
                then from the same window start netxmsd

              2. If #1 doesn't help run cmd.exe and check if the Oracle environment variables are ok
                (ORACLE_HOME, PATH to Oracle binaries, TNS_ADMIN) - if not set them to proper
                locations

              3. If #1 and #2 dont help and you're using Oracle instant client try to specify fully
                qualified TNS name instead of SID in DBServer parameter of netxmsd.conf
                Please see explanation here:
                http://www.oracle.com/technology/tech/oci/instantclient/ic-faq.html#A4428

              Hope this helps

              1 Reply Last reply
              0
              • Y
                Y
                yuyang0571
                wrote on last edited by
                #7

                HI,macro
                 many thanks ,It works! when I set envionment according to your suggestion 1 and 2.

                1 Reply Last reply
                0
                • U
                  U
                  [email protected]
                  wrote on last edited by
                  #8

                  Hi,
                      Iam getting the below error when iam restarting the nxdbr

                  [root@localhost ~]# /usr/local/bin/nxdbmgr init /usr/local/share/netxms/sql/dbinit_mysql.sql
                  NetXMS Database Manager Version 0.2.31

                  Configuration file OK
                  Unable to connect to database netxms@localhost as netxms

                  and this is my netxmsd.conf

                  [root@localhost ~]# cat /etc/netxmsd.conf
                  #
                  # Sample configuration file for NetXMS server
                  #

                  #
                  # DBDriver
                  #
                  # Database driver to use
                  #
                  # UNIX example:
                    DBDriver = /usr/local/lib/libnxddr_mysql.so
                  #
                  # Windows example:
                  # DBDriver = mysql.ddr

                  #
                  # DBServer
                  #
                  # Database server (ODBC source name for ODBC driver)
                  #
                  # Example:
                   DBServer = localhost

                  #
                  # DBName
                  #
                  # Database name (not used by ODBC driver)
                  #
                  # Example:
                   DBName = netxms

                  #
                  # DBLogin
                  #
                  # Database user name
                  #
                  # Example:
                   DBLogin = netxms

                  #
                  # DBPassword
                  #
                  # Database user's password
                  #
                  # Example:
                   DBPassword = trx123

                  #
                  # LogFailedSQLQueries
                  #
                  # Controls logging of failed SQL queries.
                  # Possible values: "yes" (default) or "no".
                  #
                  # Example:
                   LogFailedSQLQueries = yes

                  #
                  # LogFile
                  #
                  # Server's log file. To write log to syslog (or Event Log on Windows),
                  # use {syslog} as file name.
                  #
                  # Examples:
                   LogFile = {syslog}
                   LogFile = /var/log/netxms

                  Can Some one please help me how to fix this

                  Thanks
                  Subbu

                  1 Reply Last reply
                  0

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  Powered by NodeBB Contributors
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups