Friday, October 31, 2014

tnsnames.ora setup

system@DEMO>
system@DEMO> show parameter name

NAME                                 TYPE                             VALUE
------------------------------------ -------------------------------- ------------------------------
cell_offloadgroup_name               string
db_file_name_convert                 string
db_name                              string                           DEMO
db_unique_name                       string                           DEMO
global_names                         boolean                          FALSE
instance_name                        string                           DEMO1
lock_name_space                      string
log_file_name_convert                string
processor_group_name                 string
service_names                        string                           DEMO
system@DEMO>
system@DEMO> show parameter domain

NAME                                 TYPE                             VALUE
------------------------------------ -------------------------------- ------------------------------
db_domain                            string


system@DEMO>  select * from global_name;

GLOBAL_NAME
----------------------------------------------------------------------------------------------------
DEMO


sun001@DEMO1:/ora01/oracle/admin/network $ cat sqlnet.ora
NAMES.DIRECTORY_PATH= (TNSNAMES, LDAP, EZCONNECT)
ADR_BASE = /oramisc01/oracle
DIAG_ADR_ENABLED=true
SQLNET.SEND_TIMEOUT=10

=============================================================================

Db_name=DEMO

Service name : DEMO and DEMO_REPORT

step 1

# In database

alter system set service_name= DEMO,  DEMO_REPORT scope=both sid='*';

step 2
check sqlnet.ora and comment parameter names.default_domain 

step 3
lsnrctl reload
lsnrctl status 


step 4

# in tnsnames

DEMO_REPORT =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST <SCANNAME>)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = DEMO)
    )
  )


DEMO =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST <SCANNAME>)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = DEMO)
    )
  )

# the end