What Is The Listener?
What Is The Listener?
<listener_name> =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = <db_hostname>)(PORT = <port_name>))
)
)
)
SID_LIST_<listener_name> =
(SID_LIST =
(SID_DESC =
(SID_NAME = <DB_sid>)
(ORACLE_HOME = <Oracle_home Location>)
)
)
in above we have to replace host into machine "IP Address" and SID_Name
is Instance name
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.171)(PORT = 1521))
)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = proddb)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
)
)
oracle@oracle11g~]$ lsnrctl
LSNRCTL> start
Stop listener
LSNRCTL> stop
LSNRCTL> status
# ps –ef|grep tns
What is tnsname.ora file?
* It contains the information about the server where our remotely connect
database is present,the port number information,the DB name,the protocol
used.
Testdb =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.121)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = Testdb)
)
)
* Generally, most of the people will use the db name as service name
tnsping Testdb
Tnsname.ora = The file contains the information about the server where
your database is present
Performance tuning
now HR is waiting for scott once we get problem issue from development
side first we ensure who are all in on-line
SID EVENT
SECONDS_IN_WAIT WAIT_TIME STATE
----------
----------------------------------------------------------------
--------------- ---------- -------------------
33 enq: TX - row lock contention
829 0 WAITING
34 SQL*Net message from client
914 0 WAITING
here the problem is "ENQ:TX- row lock contention" means that sid is
waiting for someone
EVENT
TIME_WAITED
----------------------------------------------------------------
-----------
enq: TX - row lock contention
154390
SQL> /
EVENT
TIME_WAITED
----------------------------------------------------------------
-----------
enq: TX - row lock contention
158326
SID EVENT
TIME_WAITED
----------
---------------------------------------------------------------- -----------
33 enq: TX - row lock contention
175386
SQL> select
event,service_name,total_waits,time_waited,average_wait,max_wait from
V$service_event where event='enq: TX - row lock contention';
EVENT
SERVICE_NAME TOTAL_WAITS TIME_WAITED AVERAGE_WAIT MAX_WAIT
---------------------------------------------------------------
---------------------------------------------------------------- -----------
----------- ------------ ----------
enq: TX - row lock contention
SYS$USERS 1 190688 190688 0
S-7: to find the object _id because using this id we can find which has been
trouble
MACHINE
OSUSER USERNAME SID SERVICE_NAME
LOGON_TIM
----------------------------------------------------------------
------------------------------ ------------------------------ ----------
---------------------------------------------------------------- ---------
goldengatesource
oracle HR 33 SYS$USERS
12-MAR-16
goldengatesource oracle
SCOTT 34 SYS$USERS
SQL_ID
-------------
1dc2pgg0uh57f
S-11: finally we found the issue query which has be given hr user now we
ensure whether user scott is going to commit or kill that session get the
conformation application team .
SQL_FULLTEXT
------------------------------------------------------------------------------
--
update scott.emp set sal=sal-3 where empno=7900
* sga_max_size set the over all amount of memory the sga can consume
but it is not dynamic
* if we set memory_targer set 1024mb oracle will manage sga and pga
components within itself