oracle 远程连接不到dba用户

时间:2023-11-12 16:13:08

如果要远程连接192.168.10.44上的oracle,那么192.168.10.44服务器必须启动TNSListener。(配置文件 listener.ora)

http://www.111cn.net/database/Oracle/42484.htm

开启服务器上的Guest 账户。给Guest账号添加到ora_dba用户组

服务器配置listener.ora

# listener.ora Network Configuration File: D:\app\User\product\11.2.0\dbhome_3\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = D:\app\User\product\11.2.0\dbhome_3)
#(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\app\User\product\11.2.0\dbhome_3\bin\oraclr11.dll")
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = orcl))
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
)
)

ADR_BASE_LISTENER = D:\app\User

客户端配置 tnsnames.ora

ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
ORCL154 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.154)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

客户端配置 sqlnet.ora 必须有这个,不然链接不到

# sqlnet.ora Network Configuration File: D:\app\User\product\11.2.0\dbhome_3\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.

# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

注意的是客户端只需要装sqlplus就行了,有tnsnames.ora配置,普通用户就可以登录