Bonjour,
j'ai installé oracle version 10 sur un serveur linux et le package Xamp. php prend en charge oracle.
voici ma fonction de connexion
function connexion()
{
/*$user ="SYSTEM";
$user_password ="manager";
$host ="anna";
$db ="(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=".$host.")(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=TOTAL)))";*/
$user ="total";
$user_password ="total";
$host ="serverbd";
//$db="TOTAL2";
$db ="(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=".$host.")(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=total2)))";
$con = ocilogon($user,$user_password,$db);
/* $error=OCIError();
if($error)
print_r($error);
else */
return $con;
}
Quand je vais sur le navigateur et que je tape l'url de mon application j'obtiens l'erreur suivante:
Warning: ocilogon(): _oci_open_server: Error while trying to retrieve text for error ORA-12541
Le problème est peut être que le listener de oracle n'est pas démarré.
quand je vais sur mon serveur et je tape les lignes suivantes
1) su - oracle
resultat: ORACLE_SID=total2
ORACLE_HOME=/u01/app/oracle/product/10.1.0
2) sqlplus "/as sysdba"
SQL*Plus: Release 10.1.0.3.0 - Production on Jeu. Oct. 6 08:17:41 2005
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
3) startup : ceci demarre oracle
4) lsnrctl stat
LSNRCTL for Linux: Version 10.1.0.3.0 - Production on 06-OCT. -2005 08:21:08
Copyright (c) 1991, 2004, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=serverbd)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
4) lsnrctl start (pour demarrer le listener)
LSNRCTL for Linux: Version 10.1.0.3.0 - Production on 06-OCT. -2005 08:22:43
Copyright (c) 1991, 2004, Oracle. All rights reserved.
Starting /u01/app/oracle/product/10.1.0/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.1.0.3.0 - Production
System parameter file is /u01/app/oracle/product/10.1.0/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.1.0/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=SERVERBD)(PORT=1521)))
TNS-01201: Listener cannot find executable /u01/app/oracle/oradata/bin/oracle for SID total2
Listener failed to start. See the error message(s) above...
voici mon fichier listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/10.1.0)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = total2)
(ORACLE_HOME = /u01/app/oracle/oradata)
(SID_NAME = total2)
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = serverbd)(PORT = 1521))
)
et mon fichier tnsnames.ora
TOTAL2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = serverbd)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = total2)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(Key = EXTPROC))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(SERVER = SHARED)
(PRESENTATION = RO)
)
)
USE_PLUG_AND_PLAY=ON
Pouvez vous maidez SVP![]()
![]()
Partager