DBA Hub

📋Steps in this guide1/2

Create Service using DBMS_SERVICE - Bright DBA

Create Service using DBMS_SERVICE AIM: We want to create new service (TEST) in database POCNDEV without using NETCA/NETMGR [oracle@rac2 ~]$ ps -ef | grep tns root 9 2 0 05:10 ? 00:00:00 [netns] oracle 3468 1 0 05:13 ? 00:00:00 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER -inherit oracle 5301 3976 0 05:38 pts/1 00:00:00 grep tns [oracle@rac2 ~]$ lsnrctl … Continue reading Create Service using DBMS_SER

oracle clusteringintermediate
by OracleDba
12 views
1

Overview

Create Service using DBMS_SERVICE AIM: We want to create new service (TEST) in database POCNDEV without using NETCA/NETMGR AIM: We want to create new service (TEST) in database POCNDEV without using NETCA/NETMGR

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
[oracle@rac2 ~]$
ps -ef | grep tns
root         9     2  0 05:10 ?        00:00:00 [netns]
oracle    3468     1  0 05:13 ?        00:00:00 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER -inherit
oracle    5301  3976  0 05:38 pts/1    00:00:00 grep tns
[oracle@rac2 ~]$
lsnrctl status LISTENER | grep -i TEST <-- no output
[oracle@rac2 ~]$

SQL>
select name, open_mode from v$database;
NAME      OPEN_MODE
--------- --------------------
POCNDEV   READ WRITE

SQL>

SQL>
exec dbms_service.CREATE_SERVICE(SERVICE_NAME=>'TEST', NETWORK_NAME=>'TEST');
PL/SQL procedure successfully completed.

SQL>
exec dbms_service.START_SERVICE('TEST');
PL/SQL procedure successfully completed.

SQL>

[oracle@rac2 ~]$
. oraenv
ORACLE_SID = [POCNDEV] ?
+ASM
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@rac2 ~]$
lsnrctl status LISTENER | grep -i TEST
Service "
TEST
.rajasekhar.com" has 1 instance(s).
<----
[oracle@rac2 ~]$

[oracle@rac2 ~]$
lsnrctl status LISTENER
..
..
Service "TEST.rajasekhar.com" has 1 instance(s).
Instance "
POCNDEV
", status
READY
, has 1 handler(s) for this service...
The command completed successfully
[oracle@rac2 ~]$

[oracle@rac2 ~]$ cd /u01/app/oracle/product/11.2.0.4/db_1/network/admin/
[oracle@rac2 admin]$
cat tnsnames.ora | grep -i TEST
[oracle@rac2 admin]$
-- dbms_service.CREATE_SERVICE will not add TNS entry to tnsnames.ora file.
2

Section 2

exec dbms_service.CREATE_SERVICE(SERVICE_NAME=>'TEST', NETWORK_NAME=>'TEST'); exec dbms_service.START_SERVICE('TEST'); <---- Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.

Comments (0)

Please to add comments

No comments yet. Be the first to comment!