pdo_oci_handle_factory:尝试为错误ORA-01804检索文本时出错 [英] pdo_oci_handle_factory: Error while trying to retrieve text for error ORA-01804
问题描述
我正在使用Laravel 5.5,php 7.1.9和oracle 10g
I'm using Laravel 5.5, php 7.1.9, and oracle 10g
我不知道我是否已连接到数据库,是的,我的代码是否有问题?
i don't know if i'm connected to the database or not and if yes, is the problem in my code ?
PDOException SQLSTATE [HY000]:pdo_oci_handle_factory:出现错误 尝试检索文本以获取错误ORA-01804 (ext \ pdo_oci \ oci_driver.c:640)
PDOException SQLSTATE[HY000]: pdo_oci_handle_factory: Error while trying to retrieve text for error ORA-01804 (ext\pdo_oci\oci_driver.c:640)
oracledb.php
oracledb.php
return [
'oracle' => [
'driver' => 'pdo',
'tns' => env('DB_TNS', 'XE'),
'host' => env('DB_HOST', 'GREEN-PC'),
'port' => env('DB_PORT', '1521'),
'database' => env('DB_DATABASE', 'XE'),
'username' => env('DB_USERNAME', 'esprit'),
'password' => env('DB_PASSWORD', 'esprit'),
'charset' => '',
'prefix' => '',
'quoting' => false,
],
];
在我的控制器中
public function show()
{
$res = DB::table('esp_etudiant')
->where('id_et','1630242')
->get();
print_r($res);
}
推荐答案
首先,尝试以SYSDBA
身份连接.
First, try connecting as SYSDBA
.
$ sqlplus / as sysdba
ORA-01804错误有多种原因:
There are several causes for the ORA-01804 error:
- 检查以确保在您的环境中正确设置了以下路径:
$LD_LIBRARY_PATH
$ORACLE_HOME
$NLS_LANG
- 您的oracle客户端可能缺少
$ORACLE_HOME
目录中的某些时区dat文件.每个Oracle版本都应该有一个单独的ORACLE_HOME
.如果是这种情况,那么: - Your oracle client may be missing some timezone dat files in the
$ORACLE_HOME
directory. You should have a separateORACLE_HOME
for each release of Oracle. If this is the case, then : - 检查是否已将权限设置为允许对
OCCI library
中的文件进行读取(chmod 444
). - Check that the permissions are set to allow reads (
chmod 444
) for the files in theOCCI library
.
要做的第一件事是检查是否设置了ORA_TZFILE,如果已设置, 删除它,然后重新启动数据库和侦听器.甲骨文将尝试 加载$ ORACLE_HOME/oracore/zoneinfo/timezlrg.dat文件.
The first thing to do is to check if ORA_TZFILE is set and if it is, remove it and restart the database and listener. Oracle will then try to load the $ORACLE_HOME/oracore/zoneinfo/timezlrg.dat file.
如果由于某种原因Oracle想要使用的文件不可用 那么这就是问题的原因.
If for some reason the file that Oracle wants to use is not available then this is the cause of the problem.
如果文件存在,则错误的另一种原因可能是 是因为权限问题,Oracle无法加载文件.
If the file is present then an alternative reason for the error could be that Oracle cannot load the file because of permission problems.
如果以上所有内容均正确,则可能是.dat文件已损坏.
If all above is correct then it might be a .dat file that is corrupt.
这篇关于pdo_oci_handle_factory:尝试为错误ORA-01804检索文本时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!