zoukankan      html  css  js  c++  java
  • oracle 12c show con_name

    今天安装了一个oracle 12c的数据库做测试,在运行一个很简单的命令时出错了:

    SQL> show con_name
    concat "." (hex 2e)
    SP2-0158: unknown SHOW option "_name"

    上网搜了好久也没搜到,在google里面居然只搜到一条记录,是一个法国人写的blog,可惜好像他也没有写这个错误的原因。最后又看了下自己的操作,发现是下面这样的,

    [oracle@oratest profile]$ sqlplus / as sysdba
    
    SQL*Plus: Release 11.2.0.4.0 Production on Wed Aug 6 15:17:28 2014
    
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
    
    SQL> show con_name
    concat "." (hex 2e)
    SP2-0158: unknown SHOW option "_name"
    SQL>

    可以发现sqlplus 是11g的。虽然sqlplus 是11g的,但是连接的却是12c数据库,这是因为我在设置环境变量的时候只设置了oracle sid 和 oracle home 没有设置path。 11g的sqlplus不识别12c的命令。所以需要用下面的方式。

    [oracle@oratest profile]$ /u01/app/oracle/product/12c/bin/sqlplus / as sysdba
    
    SQL*Plus: Release 12.1.0.1.0 Production on Wed Aug 6 15:22:11 2014
    
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
    
    SQL> show con_name
    
    CON_NAME
    ------------------------------
    CDB$ROOT
    SQL>
  • 相关阅读:
    VI的常用命令【工具篇】
    linux中安装中文字体
    阅读源代码,学习PostgreSQL数据库 (1) 准备工作
    如何安装gcc 3.3.6
    Buffered I/O and nonbuffered I/O
    Linux下查看硬件配置的相关命令
    linux disk i/o shceduler
    Linux编译内核操作流程 ——为新手指南
    HDOJ 1026 Ignatius and the Princess I
    HDOJ 2544 最短路 SPFA算法
  • 原文地址:https://www.cnblogs.com/kramer/p/3894785.html
Copyright © 2011-2022 走看看