Cannot connect to database [message #634808] |
Mon, 16 March 2015 08:43  |
 |
ramy_send2010@yahoo.com
Messages: 8 Registered: March 2015
|
Junior Member |
|
|
Hello All,
I'm new to Oracle Database.
I changed the password for sys user using
alter user SYS identified by "P@ssw0rd"
and tried to connect using the following command
sqlplus /nolog
SQL> connect sys as sysdba
Enter password:
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
SQL>
how can I solve this error ?
Thanks & Regards
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Cannot connect to database [message #634821 is a reply to message #634820] |
Mon, 16 March 2015 09:46   |
gazzag
Messages: 1119 Registered: November 2010 Location: Bedwas, UK
|
Senior Member |
|
|
I get:
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for 64-bit Windows: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
SQL> conn / as sysdba
Connected.
SQL> alter user sys identified by "P@ssw0rd";
User altered.
SQL> conn sys/"P@ssw0rd" as sysdba
Connected.
SQL>
|
|
|
|
|
|
|
Re: Cannot connect to database [message #634826 is a reply to message #634825] |
Mon, 16 March 2015 10:00   |
gazzag
Messages: 1119 Registered: November 2010 Location: Bedwas, UK
|
Senior Member |
|
|
It appears that Ed is correct. The below is parsed as if it was just one command-line:
SQL> connect sys as sysdba
Enter password:
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
SQL>
The above assumes that @OP didn't type the quotation marks when prompted for the password.
|
|
|
|
Re: Cannot connect to database [message #634828 is a reply to message #634825] |
Mon, 16 March 2015 10:04   |
 |
ramy_send2010@yahoo.com
Messages: 8 Registered: March 2015
|
Junior Member |
|
|
my registry file is
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraDb11g_home1]
"ORACLE_HOME"="C:\\app\\Administrator\\product\\11.2.0\\dbhome_1"
"ORACLE_HOME_NAME"="OraDb11g_home1"
"ORACLE_GROUP_NAME"="Oracle - OraDb11g_home1"
"NLS_LANG"="AMERICAN_AMERICA.WE8MSWIN1252"
"ORACLE_BUNDLE_NAME"="Enterprise"
"OLEDB"="C:\\app\\Administrator\\product\\11.2.0\\dbhome_1\\oledb\\mesg"
"ORAMTS_CP_TRACE_LEVEL"="0"
"ORAMTS_CP_TRACE_DIR"="C:\\app\\Administrator\\product\\11.2.0\\dbhome_1\\oramts\\Trace"
"ORAMTS_CONN_POOL_TIMEOUT"="120"
"ORAMTS_SESS_TXNTIMETOLIVE"="120"
"ORAMTS_NET_CACHE_MAXFREE"="5"
"ORAMTS_NET_CACHE_TIMEOUT"="120000"
"ORAMTS_OSCREDS_MATCH_LEVEL"="OS_AUTH_LOGIN"
"MSHELP_TOOLS"="C:\\app\\Administrator\\product\\11.2.0\\dbhome_1\\MSHELP"
"SQLPATH"="C:\\app\\Administrator\\product\\11.2.0\\dbhome_1\\dbs"
"ORACLE_HOME_KEY"="SOFTWARE\\ORACLE\\KEY_OraDb11g_home1"
"ORACLE_BASE"="C:\\app\\Administrator"
"RDBMS_CONTROL"="C:\\app\\Administrator\\product\\11.2.0\\dbhome_1\\DATABASE"
"RDBMS_ARCHIVE"="C:\\app\\Administrator\\product\\11.2.0\\dbhome_1\\DATABASE\\ARCHIVE"
"ORA_MYSID_AUTOSTART"=hex(2):54,00,52,00,55,00,45,00,00,00
"ORA_MYSID_SHUTDOWN"=hex(2):54,00,52,00,55,00,45,00,00,00
"ORA_MYSID_SHUTDOWNTYPE"=hex(2):69,00,6d,00,6d,00,65,00,64,00,69,00,61,00,74,\
00,65,00,00,00
"ORA_MYSID_SHUTDOWN_TIMEOUT"=hex(2):39,00,30,00,00,00
"ORACLE_SID"="mysid"
[HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraDb11g_home1\ODE]
"TraceFileName"="C:\\ODE.trc"
"TraceLevel"="0"
"TraceOption"="0"
".NETFramework"=""
[HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraDb11g_home1\OLEDB]
"CacheType"="Memory"
"EnableCmdTimeout"="0"
"ChunkSize"="100"
"DistribTX"="1"
"FetchSize"="100"
"OSAuthent"="0"
"PLSQLRset"="0"
"PwdChgDlg"="1"
"SchRstLng"="10000"
"UserDefFn"="0"
"DisableRetClause"="1"
"VCharNull"="1"
"TraceCategory"="0"
"TraceFileName"="c:\\OraOLEDB.trc"
"TraceLevel"="0"
"TraceOption"="0"
"SPPrmDefVal"="0"
"StmtCacheSize"="0"
"MetaDataCacheSize"="0"
"DBNotifications"="0"
"DeferUpdChk"="0"
|
|
|
|
Re: Cannot connect to database [message #634831 is a reply to message #634829] |
Mon, 16 March 2015 10:20   |
gazzag
Messages: 1119 Registered: November 2010 Location: Bedwas, UK
|
Senior Member |
|
|
Anything in quotation marks is used as that character by Oracle. Outside quotation marks, Oracle treats the "@" character as signifying what follows is a connection string.
|
|
|
|
|
|
|
Re: Cannot connect to database [message #634846 is a reply to message #634844] |
Mon, 16 March 2015 14:09  |
 |
EdStevens
Messages: 1376 Registered: September 2013
|
Senior Member |
|
|
Michel Cadot wrote on Mon, 16 March 2015 12:53
The service name is not part of the password.
I do not talk about "estevens/*****@mydb@mysrv" but about "estevens@mydb@mysrv" followed by "Enter password: " displayed by SQL*Plus.
There is no doubt for SQL*PLus when it asks for "Enter password:" that what is entered is the password not the service name.
Ah, point taken.
Lot's of permutations possible at that point, but a limited test seems to indicate that even when prompting for a username OR password, it will still try to parse out a net service name. Perhaps this could be considered acceptable at the username (think of the implications if not - it would have to add another prompt to get a net service name or confirm you want a local connection) but yeah, I'd agree that when specifically prompting for password, it should not try to parse anything else out of it.
|
|
|