使用SQL Plus登录Oracle报错“ORA-12560:TNS:协议适配器错误”

news/2024/11/30 13:41:29/

尝试解决:

1. 监听服务和database instance没有起起来。

开启方法:开始—程序—管理工具—服务,打开服务面板,启动如下图2个服务

请添加图片描述

2.Oracle本地的配置文件可能被自己不小心改了,检查一下(如果检查服务开了,还是不行)

我的目录D:\app\renco\product\11.2.0\dbhome_1\NETWORK\ADMIN,一般后面几层目录名都一样的

请添加图片描述

  • listener.ora内容

    # listener.ora Network Configuration File: D:\app\renco\product\11.2.0\dbhome_1\network\admin\listener.ora
    # Generated by Oracle configuration tools.SID_LIST_LISTENER =(SID_LIST =(SID_DESC =(SID_NAME = CLRExtProc)(ORACLE_HOME = D:\app\renco\product\11.2.0\dbhome_1)(PROGRAM = extproc)(ENVS = "EXTPROC_DLLS=ONLY:D:\app\renco\product\11.2.0\dbhome_1\bin\oraclr11.dll")))LISTENER =(DESCRIPTION_LIST =(DESCRIPTION =(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))))ADR_BASE_LISTENER = D:\app\renco
  • sqlnet.ora内容

    # sqlnet.ora Network Configuration File: D:\app\renco\product\11.2.0\dbhome_1\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)
  • tnsnames.ora内容(重要!!!!)

    # tnsnames.ora Network Configuration File: D:\app\zhouml17060\product\11.2.0\client_1\NETWORK\ADMIN\tnsnames.ora
    # Generated by Oracle configuration tools.LISTENER_ORCL =(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))ORACLR_CONNECTION_DATA =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)))(CONNECT_DATA =(SID = CLRExtProc)(PRESENTATION = RO)))ORCL =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = orcl)))

我之前就是连公司数据库,使用其他人的tnsnames.ora文件把我自己的替换了,导致本地的配置没了。

增加了本地配置后,就连接成功了。


http://www.ppmy.cn/news/534238.html

相关文章

Mysql for Ubuntu配置安装

安装命令 sudo apt-get install mysql-server查看是否安装成功 ps aux | grep mysqldmysql 819 0.1 4.4 1424280 177096 ? Sl 22:04 0:00 /usr/sbin/mysqld --daemonize --pid-file/run/mysqld/mysqld.pid zhengdo 3954 0.0 0.0 21532 1088 pts/0 S…

安装科来-csnas_tech_12.0.5.12506_x64

1.这是科来-csnas_tech_12.0.5.12506_x64软件的安装包 2.右键解压到科来-csnas_tech_12.0.5.12506_x64\(E) 3.双击.exe文件 4.点击下一步 5.下一步 6.我接受,下一步 7.下一步 8.不用修改路径,下一步 9.下一步 10.下一步 11.创建桌面图标,创建…

数据结构(Java)-排序算法-插入排序

插入排序法思想: 插入排序的基本思想是:把n个待排序的元素看成为一个有序表和一个无序表,开始时有序表中只包含一个元素,无序表中包含有n-1个元素,排序过程中每次从无序表中取出第一个元素,把它依次与有序表元素进行比…

VRRP的配置

首先,先看这个图片,每个IP地址我都分配了。 接下来,就是实验操作了: [R2]INT E0/0/0 [R2-Ethernet0/0/0]IP address 12.1.1.3 24 [R2-Ethernet0/0/0]q [R2]int e0/0/1 [R2-Ethernet0/0/1]ip address 24.1.1.2 24 [R2]int e0/0/0 &…

Windows下命令行下启动ORACLE服务

检查监听器状态:C:\>lsnrctl statusLSNRCTL for 32-bit Windows: Version 9.2.0.1.0 - Production on 30-6月 -2009 21:08:04Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.正在连接到 (DESCRIPTION(ADDRESS(PROTOCOLIPC)(KEYEXTPROC1)))T…

解决mysql出现the table is full的问题

mysql出现"the table is full"的问题,一般有两个原因: 一 .You are using the MEMORY (HEAP) storage engine; in this case you need to increase the value of the max_heap_table_size system variable. See Section 5.1.3, “Server System Variables”. ERROR 1…

oracle sql plus12560,windows下 sqlplus / as sysdba 报ora-12560的终极解决方法

windows下 sqlplus / as sysdba 报ora-12560的终极解决方法 1.确认windows注冊表中的ORACLE_HOME 键及其 键值 是正确的,是有效的 比方:HKEY_LOCAL_MACHINESOFTWAREORACLEKEY_OraDb10g_home1下。找到ORACLE_HOME 键,相应的键值为H:oracleprod…

Python错误 UnicodeEncodeError: 'UCS-2' codec can't encode characters in position 73-73:

Python爬取页面时遇到的字符编码问题 在利用Python爬取微博页面时,遇到错误UnicodeEncodeError: ‘UCS-2’ codec can’t encode characters in position 73-73: Non-BMP character not supported in Tk,在网上找了一些资料,但都比较复杂&am…