View Issue Details

IDProjectCategoryView StatusLast Update
0008686mantisbtdb oraclepublic2014-12-08 00:34
ReporternovofermAssigned Todregad 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
PlatformPCOSWindowsOS Version XP PRO SP2
Product Version1.1.0rc3 
Target Version1.3.0-beta.1Fixed in Version1.3.0-beta.1 
Summary0008686: Pb on : "Attempting to connect to database as admin"
Description

Hello,
I try to install mantis on a VMWARE with :
Apache2.2
Tomcat 6.0
Oracle XE

When I try to connect with a php test page to my database there's no problem
But when I try to install/upgrade Database I've an error on the line "Attempting to connect to database as admin ":

BAD
Does administrative user have access to the database? ( ORA-12514: TNS:listener does not currently know of service requested in connect descriptor )

Could you help me please to resolve my issue.
Best regards.
Emmanuel DUC.

Tagspatch

Relationships

child of 0013227 closeddregad Oracle DB support multiple issues 

Activities

2007-12-20 13:49

 

PHP 1.JPG (109,359 bytes)
PHP 1.JPG (109,359 bytes)

2007-12-20 13:49

 

PHP 2.JPG (96,441 bytes)
PHP 2.JPG (96,441 bytes)

2007-12-20 13:49

 

Mantis.JPG (194,480 bytes)
Mantis.JPG (194,480 bytes)
thraxisp

thraxisp

2008-01-05 21:40

reporter   ~0016562

I believe that Oracle (like PostgreSQL) needs to have the database created manually, and users assigned before we can initialize it. Can you retry after setting up the user and database?

I'd appreciate feedback as Oracle support in the installer is still experimental.

novoferm

novoferm

2008-01-07 03:44

reporter   ~0016568

Hello,
I have already made the test with users and tables created upstream.
For my oracle tests, I used a XE version in place on VMWARE as well as access to a 9.2.0.1 server.
Results were the same.
Best regards.

novoferm

novoferm

2008-01-10 11:25

reporter   ~0016623

Hello,
I try to create a config_inc.php but now i've this error on the login page :

APPLICATION ERROR #101
Configuration option 'db_type' has invalid value 'oci8'

Could you help me please...
Best regards.
Emmanuel.

2008-02-06 11:52

 

install.php.connectSID.patch (502 bytes)
292c292,298
<               $t_result = @$g_db->Connect($f_hostname, $f_admin_username, $f_admin_password);
---
>               if ( $f_db_type == 'oci8') {
>                       $g_db->connectSID = true;
>                       $t_result = @$g_db->Connect($f_hostname, $f_admin_username, $f_admin_password, $f_database_name);
>               }
>               else {
>                       $t_result = @$g_db->Connect($f_hostname, $f_admin_username, $f_admin_password);
>               }
cpmccull

cpmccull

2008-03-27 17:54

reporter   ~0017480

Last edited: 2008-03-27 17:58

I've run into the same error using Oracle 10g in Mantis 1.1.1 Resolved it by doing the following:

config_inc.php:
<?php
$g_hostname = 'oracle instance name;
$g_db_type = 'oci8';
$g_database_name = 'database user';
$g_db_username = 'database user';
$g_db_password = 'database user password';
?>

database_api.php:
~LINE 400
----BEGIN CODE
case 'mysqli':
$t_escaped = $g_db->qstr( $p_string, false );
return substr( $t_escaped, 1, strlen( $t_escaped ) - 2 );

case 'oci8':
return $p_string;
---END CODE

~LINE 695 (end of file after db_time_queries function)
----BEGIN CODE
if ( !isset( $g_skip_open_db ) ) {
if ( OFF == $g_use_persistent_connections ) {
if ( $g_db_type == 'oci8' ) {
db_connect( config_get_global( 'dsn', false ), $g_hostname,
$g_db_username, $g_db_password );
} else {
db_connect( config_get_global( 'dsn', false ), $g_hostname,
$g_db_username, $g_db_password, $g_database_name,
config_get_global( 'db_schema' ) );
}
} else {
db_pconnect( config_get_global( 'dsn', false ), $g_hostname,
$g_db_username, $g_db_password, $g_database_name, config_get_global(
'db_schema' ) );
}
}
----END CODE

I think that's it...

I've run other issues as well...

  • any DB statement that contains a table alias stated as 'table As alias' will cause Oracle to fail out. the correct alias statement for ORacle is 'table alias' eg. 'SELECT * FROM table t '...
  • the email field in email_table won't do inserts of email bodies > 4000 chars because it's a CLOB. I've seen a way around it using bind parameters, but haven't implemented it yet. This is related to http://bugs.mantisbt.org/view.php?id=8834
  • Oracle freaks out on any fields that have a ' in INSERT statements. the ' needs to be a '' in order to escape it.

Should those be put into their own issues? I'm new here (1st post), and am not quite sure of the protocol...

msierszen

msierszen

2009-05-13 11:01

reporter   ~0021815

Using Mantis 1.1.6 and Oracle 10g you can leave database_name empty and put the whole connection string into hostname.

Like this:

<?php
$g_hostname = 'serverip:port/service-name';
$g_db_type = 'oci8';
$g_database_name = '';
$g_db_username = 'database user';
$g_db_password = 'database user password';
?>

novoferm

novoferm

2009-05-13 11:48

reporter   ~0021817

I try it as soon as possible.
And sent you a feed back.
Thanks for the information.

sveyret

sveyret

2010-10-22 10:42

reporter  

oracle.patch (580 bytes)
diff -Naur mantisbt-1.2.3/admin/install.php mantisbt-patch/admin/install.php
--- mantisbt-1.2.3/admin/install.php	2010-10-22 16:24:23.000000000 +0200
+++ mantisbt-patch/admin/install.php	2010-10-22 16:25:47.000000000 +0200
@@ -292,6 +292,11 @@
 	$g_db = ADONewConnection( $f_db_type );
 	$t_result = @$g_db->Connect( $f_hostname, $f_admin_username, $f_admin_password );
 
+	# Second chance
+	if( !$t_result ) {
+		$t_result = @$g_db->Connect( $f_hostname, $f_admin_username, $f_admin_password, $f_database_name );
+	}
+
 	if( $t_result ) {
 
 		# check if db exists for the admin
oracle.patch (580 bytes)
sveyret

sveyret

2010-10-22 10:49

reporter   ~0027136

I added a patch (oracle.patch) which is almost the same as the previous one (I didn't see there already was one), although it does not have a specific behavior for oci8.
The purpose is to try to connect to database, and if it does not work, do a second try giving the database name, which is required with Oracle. If the second chance connection work, then it means the database is already created, so admin connection is not required.

This patch should be installed using command line:
patch -p1 <oracle.patch

Issue History

Date Modified Username Field Change
2007-12-20 13:45 novoferm New Issue
2007-12-20 13:49 novoferm File Added: PHP 1.JPG
2007-12-20 13:49 novoferm File Added: PHP 2.JPG
2007-12-20 13:49 novoferm File Added: Mantis.JPG
2008-01-05 21:40 thraxisp Note Added: 0016562
2008-01-05 21:40 thraxisp Assigned To => thraxisp
2008-01-05 21:40 thraxisp Status new => feedback
2008-01-07 03:44 novoferm Note Added: 0016568
2008-01-10 11:25 novoferm Note Added: 0016623
2008-02-06 11:52 Martin Karas File Added: install.php.connectSID.patch
2008-03-27 17:54 cpmccull Note Added: 0017480
2008-03-27 17:58 cpmccull Note Edited: 0017480
2009-05-13 11:01 msierszen Note Added: 0021815
2009-05-13 11:48 novoferm Note Added: 0021817
2009-05-19 19:22 thraxisp Assigned To thraxisp =>
2010-10-22 10:42 sveyret File Added: oracle.patch
2010-10-22 10:42 sveyret Tag Attached: patch
2010-10-22 10:49 sveyret Note Added: 0027136
2011-09-09 12:30 dregad Relationship added child of 0013227
2013-10-17 12:50 dregad Status feedback => resolved
2013-10-17 12:50 dregad Fixed in Version => 1.3.0-beta.1
2013-10-17 12:50 dregad Resolution open => fixed
2013-10-17 12:50 dregad Assigned To => dregad
2013-10-17 12:51 dregad Target Version => 1.3.0-beta.1
2014-04-12 19:39 grangeway Issue cloned: 0017208
2014-12-08 00:34 vboctor Status resolved => closed