Step by Step - create service name in oracle database or Add service name to single instance database


Service name can be different from database name or instance name (also know as SID). Default service name is created with same as database name. Service name is like an alias that allow us to connect the db, it can be recorded in tnsnames.ora file or may not be recorded in tnsnames.ora file, it depends what connection method we use to connect.
we can create more than one service name for single database. The way we create service name in single instance db is different from RAC. the method below shown is for single instance db.

In this example we are using the OEM repository database 'emrep' to also host recovery catalog schema. I will add another service name from recovery calatog 'rmancat'



SQL> select name from v$database;

NAME
---------
EMREP

SQL> show parameter service_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
service_names                        string      emrep.us.oracle.com
SQL> show parameter db_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_name                              string      emrep
SQL> alter system set service_names='emrep.us.oracle.com,emrep,rmancat' scope=both;

System altered.

SQL>  show parameter service_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
service_names                        string      emrep.us.oracle.com,emrep,rman
                                                 cat
SQL>

Edit the tnsanames.ora file and add the entry for rmancat service name

[oracle@emcc scripts]$ tnsping rmancat

TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 10-FEB-2020 10:42:03

Copyright (c) 1997, 2019, Oracle.  All rights reserved.

Used parameter files:
/u01/app/database/product/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = emcc.marketplace.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = emrep.us.oracle.com)))
OK (10 msec)





1 comment:

  1. Your Affiliate Profit Machine is ready -

    And making money with it is as simple as 1...2...3!

    Here's how it works...

    STEP 1. Input into the system what affiliate products the system will advertise
    STEP 2. Add some PUSH button traffic (this ONLY takes 2 minutes)
    STEP 3. Watch the system grow your list and sell your affiliate products all by itself!

    Are you ready to start making money?

    Get the full details here

    ReplyDelete