View Issue Details

IDProjectCategoryView StatusLast Update
0008686mantisbtdb oraclepublic2014-12-08 00:34
Reporternovoferm Assigned 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
Attached Files
PHP 1.JPG (109,359 bytes)   
PHP 1.JPG (109,359 bytes)   
PHP 2.JPG (96,441 bytes)   
PHP 2.JPG (96,441 bytes)   
Mantis.JPG (194,480 bytes)   
Mantis.JPG (194,480 bytes)   
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);
>               }
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)   

Relationships

child of 0013227 closeddregad Oracle DB support multiple issues 

Activities

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.

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: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