у меня есть 2 разных сервера Red Hat с Oracle 12c. На одном из них я могу войти в sqlplus, указав ORACLE SID и пароль из командной строки:
[root@server1 ~]# $ORACLE_HOME/bin/sqlplus ourdbuser@$ORACLE_SID/ourpassword
SQL*Plus: Release 12.2.0.1.0 Production on Fri Mar 23 20:16:01 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Last Successful login time: Fri Mar 23 2018 20:14:29 +00:00
Connected to:
Oracle Database 12c Standard Edition Release 12.2.0.1.0 - 64bit Production
на другом, он не работает, когда я указываю ORACLE SID и пароль из командной строки:
[root@server2 ~]# $ORACLE_HOME/bin/sqlplus ourdbuser@$ORACLE_SID/ourpassword
SQL*Plus: Release 12.2.0.1.0 Production on Fri Mar 23 20:16:53 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
ERROR:
ORA-12545: Connect failed because target host or object does not exist
но если я не укажу ORACLE SID и пароль из командной строки, и я введу пароль в командной строке, то он работает:
[root@server2 ~]# $ORACLE_HOME/bin/sqlplus ourdbuser
SQL*Plus: Release 12.2.0.1.0 Production on Fri Mar 23 20:17:17 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Enter password:
Last Successful login time: Fri Mar 23 2018 20:12:25 +00:00
Connected to:
Oracle Database 12c Standard Edition Release 12.2.0.1.0 - 64bit Production
Я пытался увидеть, если есть какая-то разница между server1 и server2, и я ничего не нашел. Server1:
[root@server1 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.3 (Maipo)
[root@server1 ~]# env | grep "ORACLE"
ORACLE_SID=ourdb
ORACLE_HOME=/opt/oracle/product/12.2.0/db
[root@server1 ~]# ls -lrt /opt/oracle/product/12.2.0/db/network/admin/tnsnames.ora
-rw-r-----. 1 oracle oinstall 416 Aug 3 2017 /opt/oracle/product/12.2.0/db/network/admin/tnsnames.ora
[root@server1 ~]# cat /opt/oracle/product/12.2.0/db/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /opt/oracle/product/12.2.0/db/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_OURDB =
(ADDRESS = (PROTOCOL = TCP)(HOST = server1)(PORT = 1521))
OURDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = server1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ourdb)
)
)
Server2:
[root@server2 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.3 (Maipo)
[root@server2 ~]# env | grep "ORACLE"
ORACLE_SID=ourdb
ORACLE_HOME=/opt/oracle/product/12.2.0/db
[root@server2 ~]# ls -lrt /opt/oracle/product/12.2.0/db/network/admin/tnsnames.ora
-rw-r-----. 1 oracle oinstall 466 Aug 22 2017 /opt/oracle/product/12.2.0/db/network/admin/tnsnames.ora
[root@server2 ~]# cat /opt/oracle/product/12.2.0/db/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /opt/oracle/product/12.2.0/db/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_OURDB =
(ADDRESS = (PROTOCOL = TCP)(HOST = server2)(PORT = 1521))
OURDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = server2)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ourdb)
)
)
что еще я должен проверить?