Connecting to ORACLE RAC using service_name

Moderator: crythias

Locked
Christo
Znuny newbie
Posts: 2
Joined: 29 Feb 2016, 17:19
Znuny Version: 3.3.9
Real Name: Christo Todorov
Company: C&T Consult

Connecting to ORACLE RAC using service_name

Post by Christo »

Dear all,
My system provider recently migrated to ORACLE RAC and asked me to start login using service_name to the OTRS databases.

Here are the settings in my linux box


export |grep -i oracle
declare -x LD_LIBRARY_PATH="/u01/app/oracle/product/11.2.0/client_1/lib"
declare -x ORACLE_HOME="/u01/app/oracle/product/11.2.0/client_1"
declare -x ORACLE_SERVICE_NAME="pcl1taf.eu.acncorp.com"
declare -x ORACLE_SID="pcl1taf.eu.acncorp.com"
declare -x PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/u01/app/oracle/product/11.2.0/client_1/bin"


And indeed it is possible to connect with sqlplus to the backend database

sqlplus otrshasfr@pcl1oltp

SQL*Plus: Release 11.2.0.3.0 Production on Mon Feb 29 16:13:44 2016

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL>

SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options


But when I am adding the following settings to Config.pm


# The database user
$Self->{DatabaseHost} = 'ams1-pcluster1';
$Self->{Database} = 'pcl1oltp';
$Self->{DatabaseUser} = 'otrshasfr';
$Self->{DatabasePw} ='xxxxxx';
$Self->{DatabaseDSN} = "DBI:Oracle:$Self->{'Database'}";


And trying to check the connectivity I am getting an error

/opt/otrs/bin/otrs.CheckDB.pl
DBI connect('service_name=PCL1TAF.eu.acncorp.com;host=ams1-pcluster1;port=1521;','otrshasfr',...) failed: ORA-01017: invalid username/password; logon denied (DBD ERROR: OCISessionBegin) at /opt/otrs/Kernel/System/DB.pm line 252
ERROR: OTRS-otrs.CheckDB.pl-77 Perl: 5.10.1 OS: linux Time: Mon Feb 29 16:15:52 2016

Message: ORA-01017: invalid username/password; logon denied (DBD ERROR: OCISessionBegin)

Traceback (20305):
Module: Kernel::System::DB::new (OTRS 3.3.14) Line: 223
Module: /opt/otrs/bin/otrs.CheckDB.pl (unknown version) Line: 46

Trying to connect to database
DSN: DBI:Oracle:service_name=PCL1TAF.eu.acncorp.com;host=ams1-pcluster1;port=1521;
DatabaseUser: otrshasfr



Please note I am using the same credentials as in sqlplus command.

Can you help me, may be I am not setting correctly the Config.pm

Thank you in advance,
Christo
Christo
Znuny newbie
Posts: 2
Joined: 29 Feb 2016, 17:19
Znuny Version: 3.3.9
Real Name: Christo Todorov
Company: C&T Consult

SOLVED Re: Connecting to ORACLE RAC using service_name

Post by Christo »

Removing the domain (eu.acncorp.com) in service did the trick
Locked