Determining SID [message #173663] |
Tue, 23 May 2006 18:03 |
clintonf
Messages: 82 Registered: May 2006
|
Member |
|
|
Hi everyone,
How can I determine the SID for an instance?
I have consulted my tnsnames.ora file to check but the file does not contain this information:
BOO.FOO.LOCAL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = Database)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = BOO.Database.FOO.local)
)
)
The examples that I have seen on the net places the SID in the CONNECT_DATA section. You can see that it's not present. This suggest to me that my database instance was never created with and SID.
How would I access programs like oradim then? Would I use the part of the SERVICE_NAME (ie. BOO) as the SID?
Thanks for your help.
|
|
|
Re: Determining SID [message #173723 is a reply to message #173663] |
Wed, 24 May 2006 03:46 |
Frank Naude
Messages: 4581 Registered: April 1998
|
Senior Member |
|
|
All instances MUST have a SID. A service, on the other hand, may consist of one or more instances, and may even have multiple service per instance.
To see the instance and service names:
SQL> SELECT instance_name, instance_role FROM gv$instance;
INSTANCE_NAME INSTANCE_ROLE
---------------- ------------------
o102 PRIMARY_INSTANCE
SQL> SELECT name, network_name FROM gv$services;
NAME NETWORK_NAME
------------------------------ ------------------------------
o102XDB o102XDB
o102 o102
SYS$BACKGROUND
SYS$USERS
|
|
|
Re: Determining SID [message #173827 is a reply to message #173723] |
Wed, 24 May 2006 12:41 |
clintonf
Messages: 82 Registered: May 2006
|
Member |
|
|
Thanks for that.
I tried out what you suggested but had a problem with the second query:
SQL> SELECT instance_name, instance_role FROM gv$instance;
INSTANCE_NAME INSTANCE_ROLE
---------------- ------------------
testclint PRIMARY_INSTANCE
SQL> SELECT name, network_name FROM gv$services;
SELECT name, network_name FROM gv$services
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL>
Any suggestions about what's going on here?
From those two queries - assuming they both work - which would be the SID: the network_name?
Thanks again for your help!
|
|
|