• 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>
  • 相关阅读:
    day21--案例源码详解
    字节流,字符流文件复制总结,包含9种方法,都是标准写法
    字符流总结--Day21
    重踏学习Java路上_Day21(字符流,io小结,案例)
    IO流总结--Day20
    递归总结—-day20
    重踏学习Java路上_Day20(递归,IO流)
    File总结_day19
    题解 【POJ1934】 Trip
    题解 【POJ1952】 BUY LOW, BUY LOWER
  • 原文地址:https://www.cnblogs.com/kramer/p/3894785.html
Copyright © 2020-2023  润新知