怎么感觉oracle和sql server是一个货色。装个服务得装半天,还是mysql好,一下子就好了!下面有一个在centos7上面安装oracle11g的详细步骤,感觉找不到比这个更详细的了吧!

centos7安装详细步  :https://www.cnblogs.com/VoiceOfDreams/p/8308601.html

navicat连接oracle

安装数据库之后在使用客户端连接数据库的时候总是报如下错误:

ORA-: TNS:listener does not currently know of service requested in connect

然后百度+谷歌,解决办法说是修改listener.ora文件,在文件中添加如下内容:【下面文件中标红的表示添加的内容】

[oracle@oracle ~]$ cd /data/oracle/product/11.2./db_1/network/admin/
[oracle@oracle admin]$ cat listener.ora
# listener.ora Network Configuration File: /data/oracle/product/11.2./db_1/network/admin/listener.ora
# Generated by Oracle configuration tools. LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.9.8.201)(PORT = ))
) (SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = /data/oracle/product/11.2.0/db_1)
(SID_NAME = orcl)
)
) ADR_BASE_LISTENER = /data/oracle

添加完之后重新启动监听器,连接的时候报如下错误:

ERROR:
ORA-: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA

又去百度+谷歌,大部分答案都是说tnsnames.ora中service_name写成了server_name等,可是tnsnames.ora这个文件是oracle服务器自己生成的啊。

这时候查看监听器状态会有如下提示:

[oracle@oracle ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1. - Production on -MAY- ::

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1. - Production
Start Date -MAY- ::
Uptime days hr. min. sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /data/oracle/product/11.2./db_1/network/admin/listener.ora
Listener Log File /data/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.9.8.201)(PORT=)))
The listener supports no services #这里提示没有服务
The command completed successfully

最后的解决办法,重启监听器,重启服务器。

[oracle@oracle admin]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1. Production on Tue May  :: 

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

SQL> connect sys / as sysdba
Enter password:
Connected.
SQL> shutdown immediate #关闭oracle服务器
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup #启动oracle服务器
ORACLE instance started. Total System Global Area bytes
Fixed Size bytes
Variable Size bytes
Database Buffers bytes
Redo Buffers bytes
Database mounted.
Database opened.
SQL>

查看监听器状态:

[oracle@oracle admin]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1. - Production on -MAY- ::

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1. - Production
Start Date -MAY- ::
Uptime days hr. min. sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /data/oracle/product/11.2./db_1/network/admin/listener.ora
Listener Log File /data/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.9.8.201)(PORT=)))
Services Summary...
Service "orcl" has instance(s).
Instance "orcl", status READY, has handler(s) for this service...
Service "orclXDB" has instance(s).
Instance "orcl", status READY, has handler(s) for this service...
The command completed successfully

使用客户端连接oracle数据库:

[oracle@oracle admin]$ sqlplus scott/tiger@10.9.8.201/orcl

SQL*Plus: Release 11.2.0.1. Production on Tue May  :: 

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1. - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL>

客户端连接成功:

更改oracle监听端口

oracle安装之后监听的本地的127.0.0.1这个ip,但是在window系统连接很显然不行的,更改上面提到的哪两个文件中的localhost为服务器的ip即可,然后重启监听器。

[oracle@oracle admin]$ cat listener.ora
# listener.ora Network Configuration File: /data/oracle/product/11.2./db_1/network/admin/listener.ora
# Generated by Oracle configuration tools. LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.9.8.201)(PORT = ))
) (SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = /data/oracle/product/11.2./db_1)
(SID_NAME = orcl)
)
) ADR_BASE_LISTENER = /data/oracle [oracle@oracle admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /data/oracle/product/11.2./db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools. LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.9.8.201)(PORT = )) ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.9.8.201)(PORT = ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

oracle的sys用户远程登录

SQL> show parameter pass

NAME                     TYPE            VALUE
------------------------------------ ---------------------- ------------------------------
remote_login_passwordfile string EXCLUSIVE
SQL> remote_login_passwordfile有3个取值,取值如下:
  1. none:不允许sysdba用户组成员远程登录访问数据库
  2. exclusive: 只允许口令文件用于本数据库,允许sysdba用户组成员远程登录访问数据库
  3. shared: 允许其他数据库使用该口令文件,允许sysdba用户组成员远程登录访问数据库。

这个值设置若是none,则需要通过以下语句设置为exclusive.

SQL> alter system set remote_login_passwordfile=exclusive scope=spfile;
System altered.

然后需要重新启动数据库。

以上完成之后,设置sys用户的密码:

SQL> alter user sys identified by ;

User altered.

在navicat中填入对应的连接字段,点击测试,报如下错误:

这时候点击,高级选项,把角色选为sysdba,连接即可!

navicat连接客户端报错的更多相关文章

  1. Navicat连接Mysql报错:Client does not support authentication protocol requested by server;

    Navicat连接Mysql报错:Client does not support authentication protocol requested by server: 刚安装Mysql,想用Nav ...

  2. navicat连接mysql8报错,错误提示为1251,原因及解决步骤

    一.错误原因: MySQL8.0版本的加密方式和MySQL5.0的不一样,连接会报错. 二.解决步骤: 1.在linux虚拟机上登录mysql 2.更改加密方式: ALTER USER 'root'@ ...

  3. Navicat连接mysql报错1251 -client does not support authentication protocol

    原文https://blog.csdn.net/qq_35654080/article/details/82588188 详解请参考https://blog.csdn.net/chszs/articl ...

  4. navicat连接mysql报错1251解决方案

    感谢原文作者:XDMFC 原文链接:https://blog.csdn.net/xdmfc/article/details/80263215 问题描述 今天下了个 MySQL8.0,发现Navicat ...

  5. mac版本navicat连接oracle报错ORA-21561

    最近电脑更换成mac,很多软件都和win不一样了,正在慢慢适应,连接oracle原来用的客户端是pl/sql develop,蛋疼的是没有了mac版本, 用了navicat,具体设置如下 1.新建连接 ...

  6. navicat连接mysql报错1251的解决方法

    1.新安装的mysql8,使用破解版的navicat连接的时候一直报错,如图所示: 2.网上查找原因发现是mysql8 之前的版本中加密规则是mysql_native_password,而在mysql ...

  7. 解决Navicat连接mysql报错:1862 - Your password has expired. To log in you must change it using a client that supports expired passwords.

    今天尝试用Navicat连接mysql时,发现一个1862的报错问题: 后来参照这篇文章https://blog.csdn.net/u010513756/article/details/5073501 ...

  8. navicat连接oracle报错:ORA-12737 Instant Client Light:unsupported server character set ZHS16GBK

    今天使用Navicat连接Oracle数据库,报了下面的这个错误:“ORA-12737 Instant Client Light:unsupported server character set ZH ...

  9. navicat连接oracle报错

    Navicat 连接 Oracle ORA-28547:connection to server failed, probable Oracle Net admin error Navicat for ...

随机推荐

  1. React Native商城项目实战12 - 首页头部内容

    1.HomeTopView为首页头部内容,HomeTopListView为HomeTopView子视图. 2.HomeTopView.js /** * 首页头部内容 */ import React, ...

  2. 高通平台Camera调试(一)【转】

    本文转载自:http://www.voidcn.com/blog/Winva/article/p-6044730.html 4.3. Camera 参考文档: 1) 80-NA157-22_PRESE ...

  3. FlexPaper做的类似百度文库的效果

    这里有个误区,虽然我的截图这里有个FlexPaperViewer.swf,   但是这个文件还是要放在网站根目录一个. <%@ Page Language="C#" Auto ...

  4. 【C++进阶:移位运算符的用法】

    数据在计算机中以补码存储 移位运算符:<<  左移运算符 >>  右移运算符 一丶 << 左移运算符 移位规则:左边抛弃,右边补零 int num=10; num& ...

  5. PHP模拟请求和操作响应

    模拟请求 fsockopen <?php // 建立连接 $link = fsockopen('localhost', '80'); define('CRLF', "\r\n" ...

  6. VMware 虚拟化编程(15) — VMware 虚拟机的恢复方案设计

    目录 目录 前文列表 将已存在的虚拟机恢复到指定时间点 恢复为新建虚拟机 灾难恢复 恢复细节 恢复增量备份数据 以 RDM 的方式创建虚拟磁盘 创建虚拟机 Sample of VirtualMachi ...

  7. 阶段1 语言基础+高级_1-3-Java语言高级_07-网络编程_第2节 TCP协议_4_TCP通信的服务器端代码实现

    表示服务器的类是ServerSocket 启动服务器端 再启动客户端 客户端代码修改获取服务端会写的数据 先启动服务器端,再启动客户端 客户端打印: 服务器端读取:

  8. G2 基本使用 折线图 柱状图 饼图 基本配置

    G2的基本使用 1.浏览器引入  <!-- 引入在线资源 --> <script src="https://gw.alipayobjects.com/os/lib/antv ...

  9. 16/7/8_PHP-正则表达式

    什么叫正则表达式 PCRE库函数中,正则匹配模式使用分隔符与元字符组成,分隔符可以是非数字.非反斜线.非空格的任意字符.经常使用的分隔符是正斜线(/).hash符号(#) 以及取反符号(~),例如: ...

  10. [CERC2016]Hangar Hurdles

    你正在评估一些关于一个巨型飞机仓库的建设计划.飞机仓库的地面可以表示为n行n列的网格图,其中每个格子要么是空的,要么有障碍物.行从上到下依次被编号为1到n,列从左到右依次被编号为1到n.存放飞机零件的 ...