I've been experiencing some problems in the configuration of OTRS for Oracle 12.
What I did:
- edited /otrs/scripts/apache2-perl-startup.pl: added use lib PATH_TO_PERL , uncommented use DBD::Oracle (); and use Kernel::System::DB::oracle;
- edited /Kernel/Config.pm: added connection parameters to Oracle, commented the mysql ones.
Now, if I use mySql there are no problems, I can login into the web-interface and everything works fine, but whenever I edit Kernel/Config.pm to use Oracle something strange happens.
If I run otrs.Console.pl Maint::Database::Check it says "connection successful", but if I try to use the web-interface i get the following error:
ORA-12154: TNS:could not resolve the connect identifier specified (DBD ERROR: OCIServerAttach)
Full-log:
And it writes the same thing in /var/log/httpd/error_logBackend ERROR: OTRS-CGI-11 Perl: 5.16.3 OS: linux Time: Thu Mar 15 15:10:42 2018
Message: ORA-12154: TNS:could not resolve the connect identifier specified (DBD ERROR: OCIServerAttach)
RemoteAddress: ---
RequestURI: /otrs/index.pl?
Traceback (31481):
Module: Kernel::System::Web::InterfaceAgent::Run Line: 184
Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler Line: 40
Module: (eval) (v1.99) Line: 207
Module: ModPerl::RegistryCooker::run (v1.99) Line: 207
Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 173
Module: ModPerl::Registry::handler (v1.99) Line: 32
( I had the same problem running the CloneDB package to migrate mysql db to oracle, but I managed to resolve that editing "Kernel/System/CloneDB/Driver/oracle.pm", changing the rule for the DSN
if ( !defined $Param{TargetDatabaseDSN} ) {
$Param{TargetDatabaseDSN} =
"DBI:Oracle:sid=$Param{TargetDatabaseSID};host=$Param{TargetDatabaseHost};port=$Param{TargetDatabasePort};";
}
So CloneDB successfully migrated my DB from mysql to oracle)
Do you have any clue to help me?
Thanks in advance
EDIT:
./bin/otrs.Console.pl Maint::Database::Check
says "connection successful" only when run from otrs user
If I try to use
su -c "/opt/otrs/bin/otrs.Console.pl Maint::Database::Check" otrs
as root, I get the following error
Trying to connect to database '---' with user 'otrs'...
Error: install_driver(Oracle) failed: Can't locate DBD/Oracle.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs /root/perl5/lib/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at (eval 37) line 3.
Perhaps the DBD::Oracle perl module hasn't been fully installed,
or perhaps the capitalisation of 'Oracle' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, Proxy, SQLite, Sponge, mysql.
at /opt/otrs/Kernel/System/DB.pm line 204.