Каким образом sqlplus, не соединяющийся?

                        var res = [];
                        if (criteria.HotelName !== "") {
                            response.forEach(function (element) {
                                if (element.HotelName.toLowerCase().indexOf(criteria.HotelName.toLowerCase()) > -1) {
                                    res.push(element);
                                    response = res;
                                }
                            }, this);
                        }
                        else res = response;
7
задан ROMANIA_engineer 10 March 2016 в 14:28
поделиться

6 ответов

Since you are using a 10g client, it's advisable to use Easy Connect syntax instead:

export TWO_TASK=//dbhost/zzz
sqlplus xxx/yyy

, or just this:

sqlplus 'xxx/yyy@//dnhost/zzz'

Also check your ORACLE_HOME points to the right folder: tnsnames.ora is searched for in $ORACLE_HOME/network/admin/tnsnames.ora

8
ответ дан 6 December 2019 в 10:53
поделиться

Your brackets seem correct.

Try using the SID:

The following is an example of a tnsnames.ora file:

IDENTIFIER =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP) (HOST = userid.myhosteddb.net)(PORT = 1521))
    )
    (CONNECT_DATA = (SID = odb))
  )

Read about SID here.

4
ответ дан 6 December 2019 в 10:53
поделиться

Возможно, в вашем рабочем каталоге создается файл sqlnet.log. Это может помочь вам, или если вы опубликуете его содержание, это может дать нам больше информации.

В вашем примере вы пробуете две разные вещи. В командной строке вы использовали "xxx / yyy @ zzz". It looks like this is finding the "zzz" entry in tnsnames.ora successfully, but the timeout indicates that it is getting no response whatsoever from the server. Can you ping dbhost successfully?

On your second try you just entered "xxx" for the username; which makes sense if you are no accustomed to SQLPlus, but as you can see there is no point where it prompts you for the database name. So in this case it was trying to connect to "xxx/yyy" without a service name, leading to the second error. This just means you don't have a default service name set up. So this error comes from incomplete input. (You would enter "xxx@zzz" for the username to specify the service name at this prompt. You can actually enter the whole connect string "xxx/yyy@zzz"в приглашении имени пользователя, если вы не возражаете против того, чтобы пароль был виден.)

1
ответ дан 6 December 2019 в 10:53
поделиться

Вы пытались использовать telnet, чтобы добраться до открытого порта, чтобы убедиться, что брандмауэр не блокирует вас? может стоит попробовать telnet port-num host

1
ответ дан 6 December 2019 в 10:53
поделиться

Вы настроили свою среду с помощью скрипта oraenv ?

Пробовали tnsping ?

$ tnsping $ORACLE_SID

Возможно, это поможет сравнить выходные данные на машине, которая подключается к выходу на машине, которая не может подключиться. По крайней мере, это то, что я делаю непосредственно перед тем, как связаться с нашим администратором базы данных.

Вы можете получить более подробную информацию о том, что ошибка, с помощью команды oerr :

$ oerr ora 12170
12170, 00000, "TNS:Connect timeout occurred"
// *Cause:  The server shut down because connection establishment or
// communication with a client failed to complete within the allotted time
// interval. This may be a result of network or system delays; or this may
// indicate that a malicious client is trying to cause a Denial of Service
// attack on the server.
// *Action: If the error occurred because of a slow network or system,
// reconfigure one or all of the parameters SQLNET.INBOUND_CONNECT_TIMEOUT,
// SQLNET.SEND_TIMEOUT, SQLNET.RECV_TIMEOUT in sqlnet.ora to larger values.
// If a malicious client is suspected, use the address in sqlnet.log to
// identify the source and restrict access. Note that logged addresses may
// not be reliable as they can be forged (e.g. in TCP/IP).
1
ответ дан 6 December 2019 в 10:53
поделиться

Вы можете использовать

sqlplus user/password@servicename_host

, если вы не можете подключиться, вы можете использовать

sqlplus user/password@(DESCRIPTION=((ADDRESS=(PROTOCOL = TCP)(HOST = dbhost)(PORT = 1521))(CONNECT_DATA=(SERVICE_NAME = zzz)))

Если вы используете Linux другую *Nix OS, вам нужно использовать кавычки, иначе () интерпретируются оболочкой

, например,

sqlplus user/password@'(DESCRIPTION=((ADDRESS=(PROTOCOL = TCP)(HOST = dbhost)(PORT = 1521))(CONNECT_DATA=(SERVICE_NAME = zzz)))'
2
ответ дан 6 December 2019 в 10:53
поделиться
Другие вопросы по тегам:

Похожие вопросы: