Listener and TNS Configation - Startup and Shutdown Options - em
- The document discusses the process of establishing a database connection from a user's perspective. It explains how the user's command is broken down, how a listener handles connection requests, and launches server processes. It also covers local vs remote connections, configuring a listener using netca, creating a tnsnames.ora file for name resolution, adding a database service to the listener, and different database startup and shutdown options.
Download as DOC, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
37 views
Listener and TNS Configation - Startup and Shutdown Options - em
- The document discusses the process of establishing a database connection from a user's perspective. It explains how the user's command is broken down, how a listener handles connection requests, and launches server processes. It also covers local vs remote connections, configuring a listener using netca, creating a tnsnames.ora file for name resolution, adding a database service to the listener, and different database startup and shutdown options.
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 20
Day 1:
- Listener and TNS configation
- Startup and shutdown options - EM Check all the eniron!ent aria"les #$%CLE&'#ME( #$%CLE&S)D( TNS&%DM)N( *%T' Esta"lishing a Session +hen a user( through his user process( wishes to esta"lish a session against an instance(he will issue a co!!and so!ething like S,L- C#NNECT SC#TT.T)/E$0#$CL #f course( if he is using a properly written user interface( he won1t type in those words2 he will "e pro!pted to enter the details into a logon screen2"ut one way or another that is the co!!and the user process will generate3 )t is now ti!e to go into what actually happens when that co!!and is processed3 4irst( "reak down the co!!and into its co!ponents3 There is a data"ase userna!e 56SC#TT78( followed "y a data"ase password 56T)/E$78( and the two are separated "y a 6.7 as a deli!iter3 Then there is an 607 sy!"ol( followed "y a connect string( 6#$CL73 The 607 sy!"ol is an indication to the user process that a network connection is re9uired3 )f the 607 and the connect string are o!itted( then the user process will assu!e that the instance you wish to connect to is running on the local !achine( and that the always-aaila"le )*C protocol can "e used3 )f the 607 and a connect string are included( then the user process will assu!e that you are re9uesting a network connection to an instance on a re!ote !achine2though in fact( you could "e "ouncing off the network card and "ack to the !achine you are logged on to3 Connecting to a Local )nstance Een when you connect to an instance running on your local !achine( you still use #racle Net3 %ll #racle sessions use a network protocol( "ut for a local connection the protocol is )*C: this is the protocol proided "y your operating syste! that will allow processes to co!!unicate within the host !achine3 This is the only type of connection that does not re9uire a listener: indeed( local connections do not re9uire any configuration at all3 The only infor!ation needed is to tell your user process which instance you want to connect to3 $e!e!"er that there could "e seeral instances running on your local co!puter3 ;ou gie the process this infor!ation through an eniron!ent aria"le3 'ere we see( in the a"sence of listener configuration( we cannot connect with the 0 sign3 tnsping fails as no tns is configured : Launching a Serer *rocess The data"ase listener( running on the serer !achine( uses one or !ore protocols to !onitor one or !ore ports on one or !ore network interface cards for inco!ing connection re9uests3 +hen it receies a connect re9uest( the listener !ust first alidate whether the instance re9uested is actually aaila"le3 %ssu!ing that it is( the listener will launch a new serer process to serice the user process3 Thus if you hae a thousand users logging on concurrently to your instance( you will "e launching a thousand serer processes3 This is known as the 6dedicated serer7 architecture( where each user process is gien a serer process( dedicated to its session3 )n the TC* eniron!ent( each dedicated serer process launched "y a listener will ac9uire a uni9ue TC* port nu!"er3 This will "e assigned at process startup ti!e "y your operating syste!1s port !apping algorith!3 The port nu!"er gets passed "ack to the user process "y the listener and the user process can then co!!unicate directly with its serer process3 The listener has now co!pleted its work and waits for the ne<t connect re9uest3 )f the listener is not running( no new serer processes can "e launched( "ut this will not affect any e<isting sessions that hae already "een esta"lished3 Creating a Listener using net!gr e<ecuta"le : %ssigning a Listener na!e: %ssigning a port to the listener on which it will start listening for inco!ing re9uests: Listener3ora file has "een created in =TNS&%DM)N directory : Starting the listener using lsnrctl utility present in =#$%CLE&'#ME."in directory3 =#$%CLE&'#ME."in is already present in =*%T' as per the first screenshot3 Currently( the listener process that is started does not support any data"ase serices3 Techni9ue for Na!es $esolution: Local Na!ing: With local naming the user supplies an alias, known as an Oracle Net service alias, for the connect string, and the alias is resolved by a local file into the full network address(protocol, address, port, and service or instance name.) This local file is the tnsnames.ora file. Trying to create a tnsna!es3ora: Create a net serice na!e: %ssign a protocol: *oint to the host and port where listener is running : +hich d" serice needs to "e connected to : Test failed( as the listener still does not know which data"ase to sere as no data"ase serices are registered with the listener: %dd a data"ase serice #$CL to the listener L)ST1 See the new entries in listener3ora $estart the listener L)ST1 Check that the listener is sering a new serice na!ed #$CL: Now again try creating the Net Serice na!e and thus the tnsna!es3ora file : *rotocol used: %ddress of listener hostna!e and port nu!"er : Data"ase Serice to connect : Now the test passed as the listener is aware of the data"ase #$CL to sere3 Sae the network configuration using 4ile -- Sae Network Configuration3 /enerated tnsna!es3ora Tnsping with the newly created Net Serice na!e is happening fine3 Now we can connect scott.tiger0>net serice na!e- Stages of Data"ase Startup: No!out -- Mount -- #pen Shutdown options: Shutdown i!!ediate Shutdown Transactional : Shutdown a"ort and recoery while startup "y SM#N Starting and stopping e!ctl d"console to access data"ase Enterprise Manager: Login sys.+elco!e1 as sysd"a %ccessing the EM: