Home » RDBMS Server » Server Administration » Create new service for database
Create new service for database [message #466099] Fri, 16 July 2010 20:15 Go to next message
casttree
Messages: 83
Registered: August 2008
Member
I hope to create a new DB service and apply the load , then I need to verify the service load from Enterprise Manager or table V$SERVICEMETRIC .

Below are what I did


Quote:

I tried to add service in tnsnames.ora like below

SERVICE = (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(PORT=25057)(HOST=dadvmc))(CONNECT_DATA=(SID=tgc4)))

/************
Also I tried the serviceName like below, but not working when I conneted SALES1 from sqlplus

SALES1 = (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(PORT=25057)(HOST=dadvmc))(CONNECT_DATA=(SERVICE_NAME=host.us.xxx.com)))

**********/

and login as
sqlplus scott/tiger@SERVICE[/email][/email]

then lock table EMP in exclusive mode in two session.



I can see the load is added to service SYS$USERS , but I can't see the new service from V$SERVICEMETRIC or Enterprise Manager.

    select     
         SERVICE_NAME   
         from V$SERVICEMETRIC    



Do I missed any step? How could we create the new DB service?

Thanks,


[Updated on: Fri, 16 July 2010 20:19]

Report message to a moderator

Re: Create new service for database [message #466101 is a reply to message #466099] Fri, 16 July 2010 20:53 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>I hope to create a new DB service
post URL to manual that describes the steps needed to create new SERVICE.
Then using COPY & PASTE show us you duplicated those steps successfully.

It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/

[Updated on: Fri, 16 July 2010 21:08]

Report message to a moderator

Re: Create new service for database [message #466105 is a reply to message #466099] Fri, 16 July 2010 23:18 Go to previous messageGo to next message
casttree
Messages: 83
Registered: August 2008
Member
I used the steps in the URL http://download.oracle.com/docs/cd/B14117_01/server.101/b12170/ch4.htm , but am not sure if it is the right process.


Quote:

To use a net service name (alias), it must have an entry in the tnsnames.ora file on the machine running SQL*Plus, or for iSQL*Plus, the machine running the iSQL*Plus Application Server. An entry in tnsnames.ora is not required if you use a connection identifier.

Example 4-1 tnsnames.ora entry for the sales database

SALES1 =

(DESCRIPTION =

(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521) )
(CONNECT_DATA=

(SERVICE_NAME=sales.us.acme.com) ) )

Example 4-2 Start a command-line session to the sales database using the net service name

SQLPLUS hr/password@SALES1[/email]

See the Oracle Net Services Reference Guide and the Oracle Net Services Administrator's Guide for more information about database connections and net service name definitions.




Probably I didn't get the right URL to create the DB service. If there are better link explaining the process to create the DB service, could you let me know?





My Steps are


I tried to add service in tnsnames.ora like below.

SERVICE = (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(PORT=25057)(HOST=dadvmc))(CONNECT_DATA=(SID=tgc4)))


and login as
sqlplus scott/tiger@SERVICE[/email]
SQL> lock table EMP in exclusive mode;
Table(s) Locked.


Login as sqlplus scott/tiger@SERVICE[/email]



SQL> lock table EMP in exclusive mode;



SQL> select
SERVICE_NAME
from V$SERVICEMETRIC 2 3 ;

SERVICE_NAME
----------------------------------------------------------------
tgc4.xyz.com
tgc4.xyz.com
SYS$BACKGROUND
SYS$BACKGROUND
SYS$USERS
SYS$USERS

8 rows selected.



[Updated on: Fri, 16 July 2010 23:21]

Report message to a moderator

Re: Create new service for database [message #466119 is a reply to message #466105] Sat, 17 July 2010 01:36 Go to previous messageGo to next message
John Watson
Messages: 8932
Registered: January 2010
Location: Global Village
Senior Member
You haven't created a service at all, you have only tried to use one. I would use the procedures in dbms_service to create and start it first.
Re: Create new service for database [message #466191 is a reply to message #466099] Sat, 17 July 2010 12:12 Go to previous messageGo to next message
casttree
Messages: 83
Registered: August 2008
Member
Thanks,

I find the URL http://psoug.org/reference/dbms_service.html and created the service with sysdba

set linesize 140
col name format a30
col network_name format a30

SELECT service_id, name,network_name, creation_date
FROM dba_services;

exec dbms_service.create_service('UW', 'u.washington.edu');

SELECT service_id, name,network_name, creation_date
FROM dba_services;



I can see the new service UW from
1 SELECT service_id, name,network_name
2* FROM dba_services



but if I check with

SQL> select service_name from V$SERVICEMETRIC ;


I can't see the new service, any difference between it ? I need to verify the new service load from V$SERVICEMETRIC, How could we see the new service in V$SERVICEMETRIC?

Thanks,
Re: Create new service for database [message #466201 is a reply to message #466191] Sat, 17 July 2010 22:53 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
When all else fails, Read The Fine Forum

http://www.orafaq.com/wiki/DBMS_SERVICE

Why do you refuse to use SEARCH & GOOGLE before posting here?
Previous Topic: V$ACTIVE_SESSION_HISTORY not populating
Next Topic: How to see what happened on past 10days in DB
Goto Forum:
  


Current Time: Sun May 19 16:40:40 CDT 2024