Where to get Oracle SERVICE_NAME? - oracle

I just installed Oracle database 10g free version for students on my Windows XP. I am confused how to know the SERVICE_NAME? Am running it at my localhost 127.0.0.1, with username SYSTEM. May I know where can I get to know the SERVICE_NAME?

It is normally XE for the free version. ORCL is another typical value.
Once logged in, it can be determined from
select sys_context('USERENV','SERVICE_NAME') from dual
If you need to know it so that you can log in, look for a file called TNSNAMES.ORA in
$ORACLE_HOME/rdbms/network/admin and the service name will probably be in the connection string.

Since its windows, you can go to control panel - administrative tools - services : (switch to classic mode in control panel if you do not see admin tools). Once there you will have a service by the name "Oracle service_". The is your service name.

Related

Point local TNS listener to remote database

I'm using neXtep to compare databases, and I'd like to use it for version control for an Oracle database. The connect string
REPORT_DEV2 = (DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)(HOST=dbs-nprd1-vm-002.mycompany.com)(PORT=1550))(CONNECT_DATA=(SERVICE_NAME=DEV.MYCOMPANY.COM)))
works with tnsping
TNS Ping Utility for 64-bit Windows: Version 18.0.0.0.0 - Production on 02-DEC-2019 21:22:55
Copyright (c) 1997, 2018, Oracle. All rights reserved.
Used parameter files:
C:\app\woodsman\product\18.0.0\dbhomeXE\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)(HOST=dbs-nprd1-vm-002.mycompany.com)(PORT=1550))(CONNECT_DATA=(SERVICE_NAME=DEV.MYCOMPANY.COM)))
OK (20 msec)
The dialog
Is misleading. When I give it the service name as the database name, it says:
ORA-12505, TNS:listener does not currently know of a SID in the given connect descriptor.
I have no way of telling it to use a service name and not a SID. I'm hoping I can set up a TNS Listener entry in my local tnsnames.ora file that points to the service name that I want to use. Oh, and the neXtep program is on github, but is no longer being supported. Worse, I've tried but cannot figure out how to build it myself so that I can fix it.
I was able to find a SID to use. It seems that while I normally use a service name, somehow there's a local SID that gets built as part of the Oracle installation process. Nonetheless, for anyone who uses nexTep for Oracle, please make sure you have access to the SID name.
The Database name prompt in the nexTep dialog is really asking for a SID name. Bonus points to anyone willing to fix this one issue with nexTep so people can, out of the box, use an Oracle service name. Even better if they can change it to allow a straight up JDBC URL like every other Java based program.

How to create local connection in SQL Developer

I only have SQL Developer installed. What other programs do I need to install to create a local database. Please provide links.
SQL Developer is a client that access to a database server to extract data.
You need a database server.
If you operate with SQLDeveloper probably you like to install Oracle. There is a simplified version of Oracle that is called Oracle-XE. Search it over google and download the right version for your operating system.
Give the username and password of the user you created. You can specify localhost in Host name. If you haven't modified the port on which Oracle works then give 1521. If you haven't changed SID as well then give XE. You might be able to connect with DB.

oracle 11g Personal Edition: Create Schema

This is a two-part question. I have installed an Oracle 11g Personal Edition Server on a Windows Server 2008 VM. During the installation I chose the option to install a database as well (sample/blank database?).
Now, on the VM, I can launch the Oracle Enterprise Manager Console at localhost port 1158, login as either SYSMAN or SYSTEM and in that I can see: 'Database Instance': orcl.127.55.199 . I can also see 'OracleOraDb11g_home1TNSListener' in the Services control panel in running state.
1) I need to be able to create a new Schema in the default database. How do I do that using the Oracle Enterprise Manager or anything else?
2) How can connect to that schema from another computer, say a Windows 7 workstation? I am able to see the VM running the Oracle server and I am even able to make a connection but I get an error like '12541 no listener'. I am pretty sure I have the Oracle client software installed. Do I need to create a TNS file? I am using Direct Connection.
Thanks!
Never mind:
I got this all to work. Here are some brief notes:
1) Used Oracle Database Configuration Assistant (ODCA) to create a database
2) Used Oracle NET Manager to Create a Listener
3) Restarted Oracle Listener Service
4) Used Oracle Enterprise Manager in localhost environment to create Users--which seem to be the same as Schema--thanks #Leo for your input in the Comments!
Everything works now!
Hope this helps someone.

Oracle Client set oracle home

In the Windows, I have issues in Oracle client driver, so Toad and Sql developer can't login. how to create an oracle home ? which bin path I should point to ? how to set up toad home and should point to which oracle bin ?
here is my oracle structure.
--oracle
---- client
--- 11.2.0.1
---- product
---- 10.2.0
---- 11.1.0.6
Thanks
SQL developer is self contained and comes with it's own Oracle drivers. An Oracle client is not necessary in order to make a connection.
Open the program
click on the green plus sign on the left side to create a new connection
Enter a connection name which can be anything you want
enter the username and password
select a Basic connection type to use the built in drivers
enter the machine name, port and database name in SID or service name depending on how your database was configured
click test to confirm and you are good to go
Have you tried making a new Basic connection from SQL Developer as outlined above? Visual Studio should not affect SQL developer and I'm doubtful that it would affect the database name or port.

Getting ORA-12560 with Oracle Express 10g

I started to receive this error while I`m using C# with Oracle 10g.
ORA-12560 and I really need to solve it as I`m running out of time on my grad project.
ORA-12560 is a configuration issue. This makes it difficult to diagnose remotely. I have answered a similar question on SO before. my advice is general enough that it should help you too. Find out more.
If it doesn't you'll need to post more details of your listener.ora, tnsnames.ora and perhaps your hosts files.
edit
"All the files are hosted here:"
Hmmmm. Both listener.ora andtnsnames.ora reference HOST = SIKAS-TOSH but server is not included in the hosts file.
edit 2
"the Oracle 10g Express Edition is
installed on my PC"
If your database is on your PC then the files on some web-server are irrelevant. It is the listener.ora andtnsnames.ora on your PC which matter. Those versions of the file need to reference HOST = localhost or else your hosts needs to include SIKAS-TOSH as an alias for 127.0.0.1.
Make sure your listener is running. If it is, try restarting it and re-registering your database with it (through sqlplus as sysdba, type the command alter system register;). Also, make sure that if you run a local firewall you have allowed the port 1521 for incoming traffic (or your custom port if you have changed this).
In Windows the listener is a service, prefixed with the oracle home name + TNSListener.
In Linux, set your oracle home environment and type:
lsnrctl stop
lsnrctl start
I have unintalled and re-installed the oracle 10g many times as well as the ODAC112011beta, last time I didn`t install the ODAC112011beta, instead, I used the Oracle.DataAccess.Client file found in the C:\oraclexe\app\oracle\product\10.2.0\server\BIN\Oracle.DataAccess.dll ... then I started the service from START->All Programs->Oracle Database 10g Express Edition->Start Database as administrator ... now I can connect to the Oracle through C# ... I hope I face no more problems

Resources