-
[oracle@e1 ~]$ sqlplus / as sysdba
-
-
SQL*Plus: Release 11.2.0.3.0 Production on Fri Oct 24 14:25:44 2014
-
-
Copyright (c) 1982, 2011, Oracle. All rights reserved.
-
-
ERROR:
-
ORA-12162: TNS:net service name is incorrectly specified
-
-
-
Enter user-name:
-
ERROR:
-
ORA-12162: TNS:net service name is incorrectly specified
-
-
-
Enter user-name:
-
ERROR:
-
ORA-12162: TNS:net service name is incorrectly specified
-
-
-
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
-
[oracle@e1 ~]$
这个错误是因为ORACLE_SID变量没有传进去造成的。
把ORACLE_SID变量赋值,登录数据库。
-
[oracle@e1 ~]$ echo $ORACLE_SID
[oracle@e1 ~]$
[oracle@e1 ~]$ export ORACLE_SID=P1
-
[oracle@e1 ~]$ echo $ORACLE_SID
-
P1
-
[oracle@e1 ~]$ sqlplus / as sysdba
-
-
SQL*Plus: Release 11.2.0.3.0 Production on Fri Oct 24 14:28:13 2014
-
-
Copyright (c) 1982, 2011, Oracle. All rights reserved.
-
-
Connected to an idle instance.
-
-
SYS@P1>startup
-
ORACLE instance started.
-
-
Total System Global Area 920678400 bytes
-
Fixed Size 1348720 bytes
-
Variable Size 549456784 bytes
-
Database Buffers 364904448 bytes
-
Redo Buffers 4968448 bytes
-
Database mounted.
-
Database opened.
-
SYS@P1>
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29505646/viewspace-1463405/
,如需转载,请注明出处,否则将追究法律责任。