Bienvenue à l'univers Oracle Cloud !

Oracle DataBase – ERROR: ORA-12162: TNS:net service name is incorrectly specified

We then start up SQL*Plus (Oracle’s command-line interface) and connect as sysdba (the account that is allowed to do virtually anything in the database).

Initially, assuming you haven’t yet set the environment variable ORACLE_SID, you’ll see the following:
[ora12cr1@dellpe dbs]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.1.0 Production on Mon Sep 2 14:35:52 2013
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR: ORA-12162: TNS:net service name is incorrectly specified

This error occurs because the database software has no idea what to try to connect to. When you connect, the Oracle software will look for a TNS connect string (a network connection).

If, as in our example, the connect string is not supplied, the Oracle software will look at the environment for a variable named ORACLE_SID (on Windows, it would look also in the registry for the ORACLE_SID variable).

The ORACLE_SID is the Oracle “site identifier;” it is sort of a key to gain access to an instance. If we set our ORACLE_SID:
[ora12cr1@dellpe dbs]$ export ORACLE_SID=ora12c
the connection is successful and SQL*Plus reports we are connected to an idle instance:
[ora12cr1@dellpe dbs]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Mon Sep 2 14:36:54 2013
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.
SQL>

Laisser un commentaire