Suddenly getting ORA-12514 error Oracle 11gr2 - oracle11gr2

I installed Oracle 11g r2 fine, had 2 databases (se3 and mydb, both have db_domain .orcl i.e. mydb.orcl and se3.orcl) running on it fine till yesterday. but suddenly im getting ORA-12514 error (TNS:listener doesn't know of service requested in connect descriptor)..
My tnsnames.ora file:
# tnsnames.ora Network Configuration File: G:\oracledb\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_MYDB =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
MYDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = mydb.orcl)
)
)
SE3 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = se3.orcl)
)
)
LISTENER_SE3 =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
LISTENER.ORA FILE:
# listener.ora Network Configuration File: G:\oracledb\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = G:\oracledb\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:G:\oracledb\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
ADR_BASE_LISTENER = G:\oracledb
I am able to "tnsping mydb/se3" fine.. Tried to change tnsnames.ora and listener.ora files too (now restored) but cannot connect to either one of them through sqlplus or sqldeveloper/visual studio.. plz help me.. thanks!

Based on your own comment "im able to set ORACLE_SID but cannot connect via sqlplus ... ORA-01034 - Oracle not available" it's likely that your database instances are down. It is theoretically possible to have the underlying Windows service OracleServiceMYDB running and corresponding oracle.exe in processes, but the database instance being down. Your best bet is to look on the server for the trace directory containing alert_mydb.log and review the last entries.
If the database is simply not running and alert log shows no serious errors, start it like this:
set ORACLE_SID=MYDB
set ORACLE_HOME=D:\my\oracle\home
%ORACLE_HOME%\bin\sqlplus "/ as sysdba"
ORACLE not available.
SQL> STARTUP
SQL> EXIT
lsnrctl services
The last command should show MYDB is registered.
Proceed with ORACLE_SID=SE3

In my case, I received the ORA-12514 error when attempting to connect via SQL*Plus from a client-only machine to a remote database:
C:\Temp>sqlplus username#connect_descriptor
SQL*Plus: Release 11.2.0.3.0 Production on Wed Sep 24 09:43:04 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Enter password:
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
I found this puzzling because tnsping responded successfully:
C:\Temp>tnsping connect_descriptor
TNS Ping Utility for 32-bit Windows: Version 11.2.0.3.0 - Production on 24-SEP-2
014 09:48:04
Copyright (c) 1997, 2011, Oracle. All rights reserved.
Used parameter files:
D:\Oracle\product\11.2.0\client_1\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = host
.intranet.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME =
HOST13)))
OK (20 msec)
Ultimately, I tracked down my problem as an incorrect SERVICE_NAME value in my tnsnames.ora file:
CONNECT_DESCRIPTOR =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = host.intranet.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = HOST13)
)
)
After changing HOST13 (via an ordinary text editor) to the correct value for SERVICE_NAME, I was able to connect to the remote Oracle database.
On my Oracle 11.2 client machine, here is the location of tnsnames.ora:
C:\Oracle\product\11.2.0\client_1\network\admin\tnsnames.ora

Related

TNS-12541: TNS:no listener

I have issue with LISTENER so I can't start listener with :
>lsnrctl status LISTENER
LSNRCTL for 64-bit Windows: Version 19.0.0.0.0 - Production on 09-MAR-2022 16:07:04
Copyright (c) 1991, 2020, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) TNS-12541: TNS:no listener TNS-12560: TNS:protocol adapter error TNS-00511: No listener 64-bit Windows Error: 61: Unknown error
Same error with the lsnrctl reload
When I try to restart it from services windows I have the issue :services on local computer started and stopped
As mentioned in the Snape below
enter image description here
This is listener.ora:
# listener.ora Network Configuration File: C:\app\instantclient_19_8\NETWORK\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER_UBIX =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\E5665551\product\19.3.0\dbhome19c)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\E5665551\product\19.3.0\dbhome19c\bin\oraclr19.dll")
)
(SID_DESC =
(GLOBAL_DBNAME = ubix)
(ORACLE_HOME = C:\app\E5665551\product\19.3.0\dbhome19c)
(SID_NAME = ubix2)
)
)
ADR_BASE_LISTENER_UBIX = C:\app\e5665551
SAVE_CONFIG_ON_STOP_LISTENER_UBIX = TRUE
LISTENER_UBIX =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = EMEA-TUN-LP0872.FNFIS.com)(PORT = 1521))
)
and the tnsnames file :
# tnsnames.ora Network Configuration File: C:\app\E5665551\product\19.3.0\dbhome19c\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
UBIX =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = EMEA-TUN-LP0872.FNFIS.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = UBIX)
)
)
LISTENER_UBIX =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = EMEA-TUN-LP0872.FNFIS.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
and the log file:
LISTENER for 64-bit Windows: Version 19.0.0.0.0 - Production
Version 19.10.0.0.0
Message 459 not found; No message file for product=NETWORK, facility=NL
Message 279 not found; No message file for product=NETWORK, facility=NL
Message 509 not found; No message file for product=NETWORK, facility=NL
Message 510 not found; No message file for product=NETWORK, facility=NL
Message 1081 not found; No message file for product=NETWORK, facility=TNS
Message 1074 not found; No message file for product=NETWORK, facility=TNS
Message 1050 not found; No message file for product=NETWORK, facility=TNS
I ask if the problem with security update my block the service of listener ?
>sc.exe query OracleOraDB19Home1TNSListenerORACLE19C
SERVICE_NAME: OracleOraDB19Home1TNSListenerORACLE19C
TYPE : 10 WIN32_OWN_PROCESS
STATE : 1 STOPPED
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
I try to start it by the command line :
sc start OracleOraDB19Home1TNSListenerORACLE19C
also with killing the service
taskkill /pid 94196 /F
THE service still stuck on STOPPED it's the same issue please any help ?

ORA-12505: Listener refused the connection with the following error -- SQL Developer

In the past i got no problem doing this, but when i've reinstalled Oracle 11g and SQL Developer, i got in troubles. I am trying to connect my oracle 11g database to sql developer, but when I test the connection, I get this error. I tried everything: config file, tnsnames.ora changed several times, listener.ora file changed, but it was all in vain. I have seen many videos or posts dealing with the error, and they all say to look at the match between the SID and the Host name/Service name in the tnsnames.ora file, but in my case they are correct and coincide. Can anyone help me out? I've deleted everything: files, env variables etc.
When i open SQL Developer, it automatically detects the tns file, so it is actually read, so I don't understand what the problem could be.
This is my tnsnames.ora
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LAPTOP-SMTRG338)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
This is the listener
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = LAPTOP-SMTRG338)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
Basic connection does not make use of the tnsnames.ora file.
Basic is EZConnect: user/pass#host:port/SERVICE_NAME
You can try to check "Nombre servizio" and set it to XE and connect, but I do not think it will solve your problem.
For scenarios like this, the alert_<SID>.log is your friend. Here you can diagnose the database health.
Your Windows Service can be running, but your database can be in any of these modes: shutdown | nomount | mount | open
%ORACLE_BASE%\diag\rdbms\xe\XE\trace\alert_XE.log
Note! Please do not use notepad.exe reading log-files. In Windows-land Notepad++ is a better option.
Best of luck!

Oracle DB connection between two computers

I have Computer A , IP = 10.20.30.40 (that store the Oracle Database)
I have Computer B , IP = 10.20.30.50 (with this computer i want to connect)
I have used connection string:
Data Source = LOCALHOST , User = SYSTEM , Password = xxxxx
Its works fine in Computer A. Even i can connect it as
Data Source = 10.20.30.40 , User = SYSTEM , Password = xxxxx
How I can Connect from Computer B - to - Computer A ?
What are the requirements for Computer B Should have??
My tnsnames.ora on Computer A contains info like this:
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
)
(CONNECT_DATA =
(SID = CLRExtProc)
I'm very new with Oracle, anyone can help some step by step easy guide how to configure this situation?
On computer B you will need to use the IP address of computer A (machine running the database).
localhost refers to the local machine.

oracle 11g r2 install error - ORA-00119: invalid specification for system parameter LOCAL_LISTENER

I keep getting this error after I installed Oracle 11g R2 database server in my 64 bit machine
startup failed: ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00132: syntax error or unresolved network name 'LISTENER_ORLL', please help.
I can't even modify the spfile because I can't connect to the instance; database has not started, so there is no way to create pfile from spfile.
tnsnames.ora entry
LISTENER_ORLL.WORLD =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = localhost)(PORT = 1521))
listener.ora entry
SID_LIST_LISTENER =(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\username\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\username\product\11.2.0\dbhome_1\bin\oraclr11.dll")
) )
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)

Data encryption issues with Oracle Advanced Security

I have used Oracle Advanced Security to encrypt data during data transfer. I have successfully configured ssl with below parameters and I have restarted the instance. I am retrieving data from a Java class given below. But I could read the data without decrypting, the data is not getting encrypted.
Environment:
Oragle 11g database
SQLNET.AUTHENTICATION_SERVICES= (BEQ, TCPS, NTS)
SSL_VERSION = 0
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
SSL_CLIENT_AUTHENTICATION = FALSE
WALLET_LOCATION =
(SOURCE =
(METHOD = FILE)
(METHOD_DATA =
(DIRECTORY = C:\Users\kcr\Oracle\WALLETS)
)
)
SSL_CIPHER_SUITES= (SSL_RSA_EXPORT_WITH_RC4_40_MD5)
Java class:
try{
Properties properties = Utils.readProperties("weka/experiment/DatabaseUtils.props");
// Security.addProvider(new oracle.security.pki.OraclePKIProvider()); //Security syntax
String url = "jdbc:oracle:thin:#(DESCRIPTION =\n" +
" (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))\n" +
" (CONNECT_DATA =\n" +
" (SERVER = DEDICATED)\n" +
" (SERVICE_NAME = sal)\n" +
" )\n" +
" )";
java.util.Properties props = new java.util.Properties();
props.setProperty("user", "system");
props.setProperty("password", "weblogic");
// props.setProperty("javax.net.ssl.trustStore","C:\\Users\\kcr\\Oracle\\WALLETS\\ewallet.p12");
// props.setProperty("oracle.net.ssl_cipher_suites","SSL_RSA_EXPORT_WITH_RC4_40_MD5");
// props.setProperty("javax.net.ssl.trustStoreType","PKCS12");
//props.setProperty("javax.net.ssl.trustStorePassword","welcome2");
DriverManager.registerDriver(new OracleDriver());
Connection conn = DriverManager.getConnection(url, props);
/*8 OracleDataSource ods = new OracleDataSource();
ods.setUser("system");
ods.setPassword("weblogic");
ods.setURL(url);
Connection conn = ods.getConnection();*/
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("select * from iris");
///////////////////////////
while(rset.next()) {
for (int i=1; i<=5; i++) {
System.out.print(rset.getString(i));
}
}
Are you expecting that your SELECT statement would return encrypted data and that your System.out.print calls would result in encrypted output going to the screen? If so, that's not the way advanced security works-- Advanced Security allows you to encrypt data over the wire but the data is unencrypted in the SQLNet stack. Your SELECT statement, therefore, would always see the data in an unencrypted state. You would need to do a SQLNet trace or use some sort of packet sniffer to see the encrypted data flowing over the wire.
You'll find the documentation in "SSL With Oracle JDBC Thin Driver".
In particular you should probably use PROTOCOL = TCPS instead of PROTOCOL = TCP. I'd also suggest using a stronger cipher suite (and avoid the anonymous ones, since with them you don't verify the identity of the remote server).

Resources