1,windows安装oracle,不用安装客户端,直接安装P/LSQL就可以,
2,两台电脑之间连
1,ping IP
2, 监听程序开启
3,sqlplus /nolog conn sys as sysdba startup (这一步一定要成功)
4,解析不出12541.。。 一定是环境变量错了
2,listener.ora tnsnames.ora
· 注:如果在PDB中创建用户名和密码,,,不用sysdba
# tnsnames.ora Network Configuration File: D:appAdministratorvirtualproduct12.2.0dbhome_1 etworkadmin nsnames.ora # Generated by Oracle configuration tools. EXTPROC_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) (CONNECT_DATA = (SID = PLSExtProc) 注:PLS开头 (PRESENTATION = RO) ) ) ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = WIN-GHB4TFBR6F9)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) ) #新增 @ 标识符,用于区分本地与远程 oracleORCL@10.8.98.246 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.98.246)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) ) #新增 @ 标识符,用于区分本地与远程 注在pdb创建用用 smartqORCL@10.8.98.246 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.98.246)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orclpdb) ) )
# listener.ora Network Configuration File: D:appAdministratorvirtualproduct12.2.0dbhome_1 etworkadminlistener.ora # Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_DESC = (SID_NAME = ORCL) (ORACLE_HOME = D:appAdministratorvirtualproduct12.2.0dbhome_1) (PROGRAM = orcl) (ENVS = "EXTPROC_DLLS=ONLY:D:appAdministratorvirtualproduct12.2.0dbhome_1inoraclr12.dll") ) (SID_LIST = (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = D:appAdministratorvirtualproduct12.2.0dbhome_1) (PROGRAM = extproc) (ENVS = "EXTPROC_DLLS=ONLY:D:appAdministratorvirtualproduct12.2.0dbhome_1inoraclr12.dll") ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.98.246)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) )
注:
(KEY = EXTPROC1521)