When you need to connect any database , you need to provide connection string. Oracle is the same. What you need to provide is following information basically.
- Database Server Name or IP.
- Database Name, Oracle SID or Service Name
- Datapase Port
- Username and password
First connection method is Local naming which uses Oracle Net. Before TCP/IP was standardized a lot of third party networking protocols existed. To overcome this problem, oracle used Oracle NET. According to Oracle Documentation Local Naming : "Resolves a net service name stored in a tnsnames.ora file stored on a client". tnsnames.ora file contains 1-3 of above. Therefore you only need to provide (4) username and password. Below an example line of tnsnames.ora can be seen.
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=my-server) (PORT=1521)))
Second easy connect is same. You provide information contained in tnsnames.ora in command line. Here host = 1 , port (2), service_name = (3). As you can see it is same as first one. You give same information to connector as before. You may skip default information like port.
CONNECT username/password@host[:port][/service_name]
http://docs.oracle.com/cd/B13789_01/network.101/b10775/naming.htm#i476040
Third is Directory Server, LDAP Server like Microsoft Active Directory. Here you provide a key and directory server gives you back connection string. You use this connection string to connect to oracle.
Fourth one is same as Directory server , you only use other network services. As explained in oracle documentation.
"Configuring External Naming Methods
External naming refers to the method of resolving a net service name, stored in a non-Oracle naming service, to a network address."
According to NIS wikipedia: "Network Information Service, or NIS is a client–server directory service protocol for distributing system configuration data ...over time other modern and secure distributed directory systems, most notably LDAP, came to replace it."
As you can see, External Naming is same as Directory Server, only uses a different server technology (older) than LDAP.
http://docs.oracle.com/cd/B13789_01/network.101/b10775/naming.htm#i476040
These are four connection methods. I do think other than where do they get connection string information, they differ. Therefore easy connect should not have less performance than local naming.
If you have the entries for your instance added to /etc/oratab (that should be "orcl:/your/oracle/home:Y" ) and you did run the root.sh in the end of that installation and the root.sh placed the environment scripts in /usr/locla/bin (the default), you can issue:
- ORACLE_SID=orcl
- ORAENV_ASK=NO
- . /usr/local/bin/oraenv
- unset ORAENV_ASK
- $ORACLE_HOME/bin/dbstart
What oraenv does is mainly setting environment variables like ORACLE_HOME, ORACLE_BASE and PATH. PATH is made up of $ORACLE_HOME/bin. You could add the environment setup to your .profile and of course, you can start the database manually using sqlplus.
The dbstart script starts all databases that are registered in the oratab file, that have a 'Y' in the third column.
Manually starting, after the environment has been setup for a specific instance as shown above:
sqlplus / as sysdba
startup
If you want to switch to a different database just issue . oraenv (if /usr/local/bin is in the PATH) and give it the ORACLE_SID of the database that you want to manage.
Most databases will be accessed using a client from an other machine/VM. In that case you also might want to start the listener: lsnrctl start
Best Answer
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.
You can specify multiple service names in order to distinguish among different users of the same database. For example:
You can also use service names to identify a single service that is available from two different databases through the use of replication.
If you do not qualify the names in this parameter with a domain, Oracle qualifies them with the value of the DB_DOMAIN parameter. If DB_DOMAIN is not specified, then no domain will be applied to the non-qualified SERVICE_NAMES values.
DATABASE NAME is the name of the physical database structure. It is stored at the controlfile and datafile header. It is used to identify all physical structures that belong to the same database. It can be defined at install time. It is originally defined by the static instance parameter database_name, and it cannot be changed, and the only way to change it is by means of rebuilding the controlfile and resetting the log sequence.
To conclude, you can have a common name for both of them. However, you might need different service names to distinguish among different users of the same database.