月度归档:2016年06月

oracle easy connect ORA-12504

[oracle@edbjr4p5 admin]$ sqlplus sys@127.0.0.1:1521/pdb2_1

SQL*Plus: Release 12.1.0.2.0 Production on Tue Jun 14 12:04:39 2016

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

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

Enter user-name: ^C

[oracle@edbjr4p5 admin]$ lsnrctl status

LSNRCTL for Linux: Version 12.1.0.2.0 – Production on 14-JUN-2016 12:04:01

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=edbjr4p5.us.oracle.com)(PORT=1521)))
STATUS of the LISTENER
————————
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 – Production
Start Date                08-JUN-2016 18:35:16
Uptime                    5 days 17 hr. 28 min. 44 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/edbjr4p5/listener/alert/log.xml
Listening Endpoints Summary…
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=edbjr4p5.us.oracle.com)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=edbjr4p5.us.oracle.com)(PORT=5502))(Presentation=HTTP)(Session=RAW))
Services Summary…
Service “cdb1” has 1 instance(s).
  Instance “cdb1”, status READY, has 1 handler(s) for this service…
Service “cdb1XDB” has 1 instance(s).
  Instance “cdb1”, status READY, has 1 handler(s) for this service…
Service “cdb2” has 1 instance(s).
  Instance “cdb2”, status READY, has 1 handler(s) for this service…
Service “cdb2XDB” has 1 instance(s).
  Instance “cdb2”, status READY, has 1 handler(s) for this service…
Service “em12rep” has 1 instance(s).
  Instance “em12rep”, status READY, has 1 handler(s) for this service…
Service “em12repXDB” has 1 instance(s).
  Instance “em12rep”, status READY, has 1 handler(s) for this service…
Service “pdb1_1” has 1 instance(s).
  Instance “cdb1”, status READY, has 1 handler(s) for this service…
Service “pdb2_1” has 1 instance(s).
  Instance “cdb2”, status READY, has 1 handler(s) for this service…
The command completed successfully

[oracle@edbjr4p5 admin]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Tue Jun 14 12:04:09 2016

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

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> connect sys\@localhost:1521\/pdb2_1 as sysdba
Enter password:
Connected.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

[oracle@edbjr4p5 admin]$ sqlplus sys@\”127.0.0.1:1521/pdb2_1\”

SQL*Plus: Release 12.1.0.2.0 Production on Tue Jun 14 12:04:51 2016

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

Enter password:
ERROR:
ORA-28009: connection as SYS should be as SYSDBA or SYSOPER

Enter user-name: ^C
[oracle@edbjr4p5 admin]$ sqlplus sys@\”127.0.0.1:1521/pdb2_1\” as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Tue Jun 14 12:05:03 2016

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

Enter password:

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> show user
USER is “SYS”
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options