I'm new to Oracle, and I have installed Oracle Database 11g.
When I open some connection on Oracle SQL Developer, I get a dialog where I've to enter the username and the password as the following :
The problem is that I don't knwo what is the username and the password, in the installation I choosed orcl as the Username and orcl as the password but when I enter them I get the error message :
How can I solve this problem ?
I've another question : what is this page https://localhost:1158/em and why I get Page Web Inaccessible when I acces to it.
EDIT 1 :
This is the content of the listener.ora file :
# listener.ora Network Configuration File: C:\app\Aimad\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 = C:\app\Aimad\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\Aimad\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
ADR_BASE_LISTENER = C:\app\Aimad
EDIT 2:
this is the output of the command tnsping xe :
The reason why you are getting the error is because you have not specified service name or SID as it doesn't know to which instance it should connect.
I suppose you are using one of the latest versions of SQL Developer available for download.
Right click connections and choose New Connection from context menu, you will get a window like one is pasted below, there you enter connection details and do not forget to enter either service name or SID.
Hope this helps.
Related
My company is instituting an ssl requirement soon for database connections.
I previously connected to our Vertica database via DBI and RJDBC packages. I have tried adding an sslmode='require' parameter to my connection. But adding this parameter has no effect. I can still connect to the database but the connection is not ssl.
Can anyone advise on how to enable ssl connection for DBI? In PyCharm I merely had to set ssl to true in the driver properties.
DBI::dbConnect(
drv = RJDBC::JDBC(
driverClass = driver_class,
classPath = class_path
),
url = url,
UID = user_id,
PWD = password,
sslmode = 'require'
)
}
A different ssl parameter was required. I am having connection success with the function below that uses ssl = 'true'
DBI::dbConnect(
drv = RJDBC::JDBC(
driverClass = driver_class,
classPath = class_path
),
url = url,
UID = user_id,
PWD = password,
ssl = 'true'
)
I am connecting to oracle database through asp.net. My code is running well on server machine but when I try to run it on local machine I am getting TNS error.
My connection Strings are :
<add name="oraclebldb" connectionString="DataSource=SKM.SMEBANK.ORG;Persist Security Info=True;User ID=bldb;Password=bldb;Unicode=True" providerName="System.Data.OracleClient"/>
<add name="OraConnectionString" connectionString="Data Source=skm;Persist Security Info=True;User ID=bldb;Password=bldb;Unicode=True" providerName="System.Data.OracleClient"/>
There must be tnsname.ora file in your local machine where you must be having oracle client installed.
go to
localdrive:\oracle\product\oracle version\client_1\Network\admin
Note: localdrive must b C or D based on location given at the time of installation
or
go to command prompt and type path which will give you the oracle home directory path of your local machine.
See below definition for your reference
mydb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = myserver )(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = mydb)
)
)
I'm looking at a web application that's using JDBC Connection to connect to Oracle 11g database (11.2.0). The application works without any issues for some time (about an hour) and then I get:
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
I tried restarting Oracle and the Oracle services OracleServiceXE and OracleXETNSListener but the error won't go way. It only goes away after I restart my machine.
I've not changed any database parameters in my Tomcat or Oracle.
Here's my tnsnames.ora
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 = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
Here's my configuration for JDBC:
String serverName = "localhost";
String portNumber = "1521";
String sid = "xe";
String url = "jdbc:oracle:thin:#" + serverName + ":" + portNumber + ":" + sid;
String username = "xxx";
String password = "yyy";
When "XE" is working properly, if I check lsnrctl status, I can see
Service "XEXDB" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Service "xe" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
The command completed successfully
Once I get the exception, I do not see instance "xe" when I check lsnrctl status.
I would like to know why I'm getting this exception after some time and how to fix that. If not, how can I get around it without restarting my machine? Thanks.
Database URL should be as shown below.
// Create DataSource and connect to the local database
ods = new OracleDataSource();
ods.setURL("jdbc:oracle:thin:#//localhost:5221/orcl");
ods.setUser("HR");
ods.setPassword("hr");
conn = ods.getConnection();
Recommendation is to use the long form of connection URL as shown here.
jdbc:oracle:thin:#(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=myhost-vip)(PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=myorcldbservicename)))
Also, to verify if the connection URL is correctly formed, get a connection from the SQL developer using the below and test it out.
sqlplus hr/hr#"(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=myhost-vip)(PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=myorcldbservicename)))"
I'm trying to create a database link form an Oracle server to another.
The command I'm using is:
create public database link mylink connect to myuser identified by 0000 authenticated by myuser identified by 0000 using 'myTNSNameRemoteServer';
sqlplus give me this error:
ERROR at line 1:
ORA-00933: SQL command not properly ended
Putting the '*' under the first character of the password in its first instance.
Have I to escape it in someway?
Thanks
The solution was to double quote the password:
create public database link mylink connect to myuser identified by "0000" authenticated by myuser identified by "0000" using 'myTNSNameRemoteServer';
you can try this:
CREATE DATABASE LINK "dblink_name"
CONNECT TO "user_user"
IDENTIFIED BY "user_pass"
USING '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = "user_server" )(PORT ="user_port" ))
)
(CONNECT_DATA =
(SERVICE_NAME = "user_service_name")
(SRVR = DEDICATED)
)
)' ;
Try this one:
CREATE DATABASE LINK ABCD CONNECT TO USER IDENTIFIED BY PASSWORD USING 'DBALIASAME';
Details:
username is scott
password is tiger
Server name - I gave prashanth-PC, which I found in tnsnames.ora - at this point I get
ORA-12154: TNS:could not resolve the connect identifer specified
When I connect using code, it is working. In code I will leave data source blank. But when I connect using the grid view tool. It is asking server name. I don't know which server name should I specify. For reference I have posted the contents of my "tnsnames.ora" file. Please check it. Am using Oracle 10g.
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = prashanth-PC)(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)
)
)
I'm assuming you're using the ".Net Framework Data provider for oracle" as your provider.
In this case the server name should contain the "alias" from your tnsnames.ora - in your case "XE".
The error you get may be caused because it can't find the tnsnames.ora file.
Make sure you set the "TNS_ADMIN" environment variabl to point to the path of the directory containing the tnsnames.ora file.
Server name expects the Oracle service name, not your machine host name. Try entering XE at the server name. If this fails:
Check if you have multiple tnsnames.ora file
If so, ensure all the tnsnames.ora files are in sync or find out which tnsnames.ora
is in use - This can be done by checking your path variable & finding out which path has the first mention of tnsnames.ora
Also ensure that the tns listener service is up & running from the Windows Services list
I faced this issue just now. What I was trying to do was to provide share to the TNS files folder, located under "Admin" folder of the oracle client installation location, with developer folks to ensure that the sanity of TNSentries on the server.
What I noticed was that when I applied the share over the "Admin" folder, the "(LocalHostName)\Authenticated Users" was removed from the security context of the "Admin" folder.
Once I added "Authenticated Users" back to the security context of the folder with default rights, the error was gone.
OS version: Win 2012 DC Edition
Oracle client Client: Oracle client 11.2.0