Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Global Database Name or SID...what to fill in

Options
  • 11-11-2019 5:27pm
    #1
    Registered Users Posts: 5,532 ✭✭✭


    During a setup of Spacewalk, the DB part asks me for the below


    [root@dub-svrfarm27 ~]# spacewalk-setup --external-oracle
    * Setting up SELinux..
    * Setting up Oracle environment.
    * Setting up database.
    ** Database: Setting up database connection for Oracle backend.
    Global Database Name or SID (requires tnsnames.ora)?

    Making it up as i went along, i tried putting something in but no joy

    Global Database Name or SID (requires tnsnames.ora)? oracle.mydom.com
    Database hostname [localhost]?
    Database (listener) port [1521]?
    *** Database connection error: ORA-12541: TNS:no listener (DBD ERROR: OCIServerAttach)
    Global Database Name or SID (requires tnsnames.ora)? spacewalk
    Database hostname [localhost]?
    Database (listener) port [1521]?
    *** Database connection error: ORA-12541: TNS:no listener (DBD ERROR: OCIServerAttach)


Comments

  • Moderators, Computer Games Moderators Posts: 4,281 Mod ✭✭✭✭deconduo


    Do you have a local oracle DB running? It's looking for the SID of it.


  • Registered Users Posts: 5,532 ✭✭✭veryangryman


    Thanks for the reply. Doesnt look like it (unless theres another way to check for)

    [root@dub-svrfarm27 ~]# ps -ef | grep pmon
    root 23539 23476 0 17:15 pts/2 00:00:00 grep --color=auto pmon


  • Moderators, Computer Games Moderators Posts: 4,281 Mod ✭✭✭✭deconduo


    Thanks for the reply. Doesnt look like it (unless theres another way to check for)

    [root@dub-svrfarm27 ~]# ps -ef | grep pmon
    root 23539 23476 0 17:15 pts/2 00:00:00 grep --color=auto pmon

    The --external-oracle flag means you are setting spacewalk up to use an Oracle DB. You'll need to have one set up and ready to use.


  • Registered Users Posts: 5,532 ✭✭✭veryangryman


    Ok thanks, i wonder though, the command to create one gives

    [root@dub-svrfarm27 /]# dbca
    -bash: dbca: command not found

    Googling this doesnt find it. Ive tried yum and pip to install but neither finds it


  • Moderators, Technology & Internet Moderators Posts: 1,333 Mod ✭✭✭✭croo


    Why not just use the default postgresql database?
    From here
    Spacewalk needs a database server to store it’s primary data. By default, Spacewalk uses an embedded PostgreSQL database. Also, you can use Oracle RDBMS (version 10g or higher) if you want.

    We will go with defaults. Install postgreSQL database for Spacewalk using command:

    yum install spacewalk-setup-postgresql


  • Advertisement
  • Registered Users Posts: 5,532 ✭✭✭veryangryman


    croo wrote: »
    Why not just use the default postgresql database?
    From here

    Trying thse instructions, but get a 404 when looking for spacewalk-repo-2.5-3.el7.noarch.rpm
    [root@dub-svrfarm27 ~]# rpm -Uvh http://yum.spacewalkproject.org/2.5/RHEL/7/x86_64/spacewalk-repo-2.5-3.el7.noarch.rpm
    Retrieving http://yum.spacewalkproject.org/2.5/RHEL/7/x86_64/spacewalk-repo-2.5-3.el7.noarch.rpm
    curl: (22) The requested URL returned error: 404 Not Found 
    


  • Moderators, Technology & Internet Moderators Posts: 1,333 Mod ✭✭✭✭croo


    My link was primarily for the purpose of where I took the quote [that spacewalk worked with postgresql] from rather than instructions to install on you distro. Did you mention the distro?


  • Registered Users Posts: 5,532 ✭✭✭veryangryman


    Ok, ive gone on and managed to create an Oracle Database with dbca but the spacewalk-setup still throws back an error

    spacewalk-setup --external-oracle
    * Setting up Oracle environment.
    * Setting up database.
    ** Database: Setting up database connection for Oracle backend.
    Global Database Name or SID (requires tnsnames.ora)? orcl.ie.oracle.com
    Database hostname [localhost]?
    Database (listener) port [1521]?
    *** Database connection error: ORA-12541: TNS:no listener (DBD ERROR: OCIServerAttach)
    Global Database Name or SID (requires tnsnames.ora)?


  • Registered Users Posts: 5,532 ✭✭✭veryangryman


    See the configuration where database is clearly been created


  • Registered Users Posts: 5,532 ✭✭✭veryangryman


    From feedback, here is output of lsnctl stat
    [root@dub-mgrfarm113 dbhome_1]# pwd
    /opt/oracle/product/19c/dbhome_1
    [root@dub-mgrfarm113 dbhome_1]# echo $ORACLE_HOME
    /opt/oracle/product/19c/dbhome_1/
    [root@dub-mgrfarm113 dbhome_1]# echo $PATH
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/opt/oracle/product/19c/dbhome_1//bin
    [root@dub-mgrfarm113 dbhome_1]# ./product/19c/dbhome_1/bin/lsnrctl stat
    -bash: ./product/19c/dbhome_1/bin/lsnrctl: No such file or directory
    [root@dub-mgrfarm113 dbhome_1]# ./bin/lsnrctl stat
    
    LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 14-NOV-2019 09:32:26
    
    Copyright (c) 1991, 2019, Oracle.  All rights reserved.
    
    TNS-01150: The address of the specified listener name is incorrect
     NL-00303: syntax error in NV string
    


  • Advertisement
  • Closed Accounts Posts: 2,910 ✭✭✭begbysback


    See the configuration where database is clearly been created

    Next page is database identification, does this not have SID?


  • Registered Users Posts: 5,532 ✭✭✭veryangryman


    begbysback wrote: »
    Next page is database identification, does this not have SID?

    Nah when you click next, the left menu changes altogether. Getting the SID seems to be difficult, even when creating anew


  • Moderators, Technology & Internet Moderators Posts: 1,333 Mod ✭✭✭✭croo


    What do your tnsnames.ora & listener.ora look like?

    ps. I've not installed oracle for 10 years but back then I was working on the open source Adempiere ERP project which required installing & testing on oracle & postgresql on a regular basis. All database have their quirks but oracle was a total pain to setup. Unless you need oracle because of organisation rules I really would use the built in database rather than oracle. It's a beast.


  • Registered Users Posts: 5,532 ✭✭✭veryangryman


    Attached the contents. Specific file locations here
    [root@dub-mgrfarm113 ~]# find /opt/oracle/ -name listener.ora
    /opt/oracle/product/19c/dbhome_1/network/admin/samples/listener.ora
    /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
    ^[[A[root@dub-mgrfarm113 find /opt/oracle/ -name tnsnames.ora
    /opt/oracle/product/19c/dbhome_1/network/admin/samples/tnsnames.ora
    


  • Closed Accounts Posts: 2,910 ✭✭✭begbysback


    Can you connect to the database directly, then run select name from v$database

    Or select sys_context(‘userenv’, ‘instance_name’) from dual


  • Registered Users Posts: 5,532 ✭✭✭veryangryman


    begbysback wrote: »
    Can you connect to the database directly,



    Nah i get this when trying
    [root@dub-mgrfarm113 ~]# sqlplus SYS
    
    SQL*Plus: Release 11.2.0.4.0 Production on Thu Nov 14 14:55:26 2019
    
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    
    Enter password:
    ERROR:
    ORA-12162: TNS:net service name is incorrectly specified
    


  • Closed Accounts Posts: 2,910 ✭✭✭begbysback




  • Registered Users Posts: 5,532 ✭✭✭veryangryman


    Cheers, yeah i spotted him earlier.

    Possibly going through a wormhole of links but when i do his suggestion to EXPORT ORACLE_SID, the error is now
    [root@dub-mgrfarm113 ~]# sqlplus
    
    SQL*Plus: Release 11.2.0.4.0 Production on Thu Nov 14 15:23:40 2019
    
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    
    Enter user-name: ADMIN
    Enter password:
    ERROR:
    ORA-12547: TNS:lost contact
    


  • Moderators, Technology & Internet Moderators Posts: 1,333 Mod ✭✭✭✭croo


    okay so those are the template files but you must then use those templates to configure oracle ... at least you did 10 years ago.

    Check here for simple examples https://oracle-base.com/articles/misc/oracle-network-configuration


  • Registered Users Posts: 5,532 ✭✭✭veryangryman


    croo wrote: »
    okay so those are the template files but you must then use those templates to configure oracle ... at least you did 10 years ago.

    Check here for simple examples https://oracle-base.com/articles/misc/oracle-network-configuration

    Figured same but there is scant stuff out there for how to fill these in correct. Port 1521 is as great as ive got in it


  • Advertisement
  • Moderators, Technology & Internet Moderators Posts: 1,333 Mod ✭✭✭✭croo


    yeah I know - this is why I wouldn't recommend oracle to unless it was a big corp that could afford oracle admins - I had a bunch manuals/books but still found it to be a bit if a "black art",,
    Listener.ora
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS = (PROTOCOL = TCP)(HOST = YOUR_IP)(PORT = 1521))
    )
    )

    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = from your original screen dump)
    (ORACLE_HOME = /u01/app/oracle/product/11.2.0.4/db_1)
    (SID_NAME = database name)
    )
    )

    Just noticed on you screen capture oracle 19c ... I was using 8-10 I hope I'm not sending you down the garden path because I'm so out of date!

    Anyway,
    tnsnames.ora
    LISTENER = (ADDRESS = (PROTOCOL = TCP)(HOST = your_ip)(PORT = 1521))

    orcl.example.com =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = your_ip)(PORT = 1521))
    )
    (CONNECT_DATA =
    (SERVICE_NAME = your database name)
    )
    )

    Perhaps just leave them all as is and just change you HOST to begin with. If host as IP gives you a problem use the hostname on your box - I do remember issues unless you used a fully "qualified name" i.e. myserver.example.com - but as I said that was a long time ago.

    ps.
    >> leave them all as is
    BY "as is" I meant on the oracle webpage


  • Registered Users Posts: 4,757 ✭✭✭cython


    Cheers, yeah i spotted him earlier.

    Possibly going through a wormhole of links but when i do his suggestion to EXPORT ORACLE_SID, the error is now
    [root@dub-mgrfarm113 ~]# sqlplus
    
    SQL*Plus: Release 11.2.0.4.0 Production on Thu Nov 14 15:23:40 2019
    
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    
    Enter user-name: ADMIN
    Enter password:
    ERROR:
    ORA-12547: TNS:lost contact
    

    I can see you're trying to connect while logged in as root. You may have more luck if you switch user to oracle (you possibly should have done any post-install steps as oracle also, like dbca, but not 100% on that), as typically the oracle install configures everything for the oracle OS user reasonably correctly, so if you can't log in/connect to the DB as that user via sqlplus, you're going to struggle with any other connection mechanism, IMO.

    TL;DR su - oracle, and then attempt to sqlplus to the DB. If this doesn't work, little else is likely to.


  • Moderators, Computer Games Moderators Posts: 4,281 Mod ✭✭✭✭deconduo


    cython wrote: »
    I can see you're trying to connect while logged in as root. You may have more luck if you switch user to oracle (you possibly should have done any post-install steps as oracle also, like dbca, but not 100% on that), as typically the oracle install configures everything for the oracle OS user reasonably correctly, so if you can't log in/connect to the DB as that user via sqlplus, you're going to struggle with any other connection mechanism, IMO.

    TL;DR su - oracle, and then attempt to sqlplus to the DB. If this doesn't work, little else is likely to.

    Agreed - though I think we need to take a couple of steps back here.

    @veryangryman - what exactly are you trying to achieve and why?
    What is the spacewalk server for, and what's the reason to use an Oracle DB over the default postgres one?
    Is this a learning exercise or will this be used in some production capacity?


  • Registered Users Posts: 5,532 ✭✭✭veryangryman


    Attempting to install spacewalk on a Linux server to test its functionality, just restarting it now to install the Oracle DB as user oracle


  • Registered Users Posts: 5,532 ✭✭✭veryangryman


    Attempting to install spacewalk on a Linux server to test its functionality, just restarting it now to install the Oracle DB as user oracle

    Saying that

    -bash-4.2$ yum install -y oracle-database-ee-19c-1.0-1.x86_64.rpm
    Loaded plugins: versionlock
    You need to be root to perform this command.


  • Registered Users Posts: 4,757 ✭✭✭cython


    Saying that

    -bash-4.2$ yum install -y oracle-database-ee-19c-1.0-1.x86_64.rpm
    Loaded plugins: versionlock
    You need to be root to perform this command.

    At this point this is arguably less a development question, more a linux/unix one, but to use yum for installs, you need root privileges, either as the root user or via sudo.


  • Registered Users Posts: 5,532 ✭✭✭veryangryman


    So i did some more rummaging around the dbca tool and found that if i did the install with advanced options, i could create SYSTEM user etc. Bingo!

    [root@dub-mgrfarm113 ~]# sqlplus SYSTEM@orcl2
    
    SQL*Plus: Release 11.2.0.4.0 Production on Mon Nov 18 09:58:38 2019
    
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    
    Enter password:
    
    Connected to:
    Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
    


    Thanks for all efforts both successful and unsuccessful lads!


Advertisement