0

Oracle11g データベースでは、次のように動作します。

SQL> connect USER/pass
Connected.

ただし、これはしません。

SQL> connect USER/pass@db
ERROR:
ORA-01017: invalid username/password; logon denied

私は実行しました:

SQL> grant connect to USER;
Grant succeeded.

私は何が欠けていますか?

tnsnames.ora:

DB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = a.dom.b.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = db)
    )
  )

編集:

:> sqlplus USER/pass
SQL*Plus: Release 11.1.0.7.0 - Production on Mon Mar 11 15
Copyright (c) 1982, 2008, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production

他の 2 つにはありません。

:> sqlplus USER/pass@db
SQL*Plus: Release 11.1.0.7.0 - Production on Mon Mar 11 15:04:44 2013
Copyright (c) 1982, 2008, Oracle.  All rights reserved.

ERROR:
ORA-01017: invalid username/password; logon denied

これは識別子エラーを生成します:

:> sqlplus USER/pass@db//localhost:1521
SQL*Plus: Release 11.1.0.7.0 - Production on Mon Mar 11 15:10:38 2013
Copyright (c) 1982, 2008, Oracle.  All rights reserved.

ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified

tnsnames.ora エントリを確認し、サービスのスペルが正しいことを確認しました。

EDIT2:

:> lsnrctl status

LSNRCTL for 64-bit Windows: Version 11.1.0.7.0 - Production on 11-MAR-2013 15:14:19

Copyright (c) 1991, 2008, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=a.dom.b.com)(PORT=1521
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for 64-bit Windows: Version 11.1.0.7.0 - Production
Start Date                01-MAR-2013 16:15:25
Uptime                    9 days 21 hr. 59 min. 8 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   d:\oracle\product\11.1.0\db_1\network\admin\listener.ora
Listener Log File         d:\oracle\diag\tnslsnr\TMDEV100\listener\alert\log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=a.dom.b.com)(PORT=1521)))
Services Summary...
Service "db" has 1 instance(s).
  Instance "db", status READY, has 1 handler(s) for this service...
...
...
The command completed successfully
4

1 に答える 1

0

@db を含めない場合、TWO_TASk 環境変数を介して接続するか、接続先のマシンのデータベースにローカル接続します。@db は tnsnames.ora を介して接続情報を検索し、接続します。2 つの異なるデータベースに接続していると思います。1 つはユーザー名とパスワードの組み合わせを持っていて、もう 1 つは持っていません。

于 2013-03-11T19:46:37.783 に答える