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?
SERVICE_NAMES specifies one or more names by which clients can connect to the instance. The instance registers its service names with the listener. When a client requests a service, the listener determines which instances offer the requested service and routes the client to the appropriate instance.
select instance_name from v$instance; will give you SID name. select name from v$database; will give DB NAME. select instance_name from v$instance; will give you SID name.
SERVICE_NAME is the new feature from oracle 8i onwards in which database can register itself with listener. If database is registered with listener in this way then you can use SERVICE_NAME parameter in tnsnames. ora otherwise - use SID in tnsnames. ora.
The tnsnames. ora file is located in both the Grid_home\network\admin and Oracle_home\network\admin directories. By default, the tnsnames. ora file is read from the Grid home when Oracle Grid Infrastructure is installed.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With