The entire connection string is
jdbc:postgresql://mypostgresserver01:5432/vegdb01
Minimalistic Oracle contains a collection of practical examples from my encounters with Oracle technologies. When relevant, I also write about other technologies, like Linux or PostgreSQL. Many of the posts starts with "how to" since they derive directly from my own personal experience. My goal is to provide simple examples, so that they can be easily adapted to other situations.
jdbc:oracle:thin:@lx01oric.oric.no:1521:pdbveg1.oric.no
# sqlplus / as sysdba SQL> exec dbms_service.create_service(service_name=>'online_users', network_name=>'online_users');
SQL> exec dbms_service.start_service('online_users');
SQL> alter system set service_names='proddb01, online_users' scope=both;
show parameter service NAME TYPE VALUE ------------------------------------ --------------------------------- ------------------------------ service_names string online_users, proddb01
connect string : jdbc:oracle:thin:@//prodserver01:1521/online_users
online_users =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = myserver.mydomain.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = online_users)
)
)
show parameter domain NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_domain string mydomain.com
(SERVICE_NAME = online_users.mydomain.com)
lsnrctl services
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=myserver.mydomain.com)(PORT=1521)))
Services Summary...
Service "proddb01" has 1 instance(s).
Instance "proddb01", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "proddb01.mydomain.com" has 1 instance(s).
Instance "proddb01", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:1 refused:0 state:ready
LOCAL SERVER
Service "proddb01XDB.mydomain.com" has 1 instance(s).
Instance "proddb01", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=myserver.mydomain.com)(PORT=19394))
Service "online_users.mydomain.com" has 1 instance(s).
Instance "proddb01", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:3 refused:0 state:ready
LOCAL SERVER
alter system register;
alter system set local_listener='(address=(protocol=tcp)(host=myserver)(port=1526))' scope=both;
sqlplus scott/tiger@online_users
SQL> select sys_context('userenv','SERVICE_NAME') FROM DUAL;
SYS_CONTEXT('USERENV','SERVICE_NAME')
--------------------------------------------------------------------------------
online_users.mydomain.com
-- stop the service
SQL> exec dbms_service.stop_service('online_users');
-- after stopping the service, it may be deleted
SQL> exec dbms_service.delete_service('online_users');
PL/SQL procedure successfully completed.
set lines 200
column name format a30
column network_name format a30
column value format a60
select name,value
from v$system_parameter
where name in ('service_names','db_domain','local_listener');
SELECT name,
network_name
FROM v$active_services
ORDER BY 1;