Control File: Contains Structure of Database, DBName, location of all the data
files and redo log files. WIthout control file you cannot even open the database.
This is the first file read while startin db.
Redo Log Files : Contains list of changes made on your data. This is a LOG
sequential of all changes in all data (Chronological). Changes in datafile is done
on the respective block, whereas redo log file is sequential. Benefit is for
recovery purpose in case of a crash. It also helps in performance imporvement of
database.
Whenever we take a backup/reovery we need to take the backup of all the 3 types of
files.
Password file: every user and his password and his privileges are stored in the
system data file. But even before you can access the system dictionary (data file)
the database should be up, user who is capable of starting the database is
authenticated (SYSDBA)
Parameter file: contains list of parameters with which DATABASE is going to run.
there are two types. PFILE and SPFile (Server parameter file)
Pfile is the text file, SPFile is a binary file manipulated by instance. Typically
we Start with creating a PFIle and then create SPFile from PFIle. benefit of SPFile
is that, whenever you want to make a change in PFILe, login in SQLPlus as DBA make
the change, change is in meory and recorded in SPFile.
-----------------------------
Video 7 - Listener
Whenever you want to connect from app, sqlplus or sql developer. you need to
provide 3 important attributes to connect to the DB
Host, Port and SID/Service_name - Let us demistify what are these 3
Let us assume, we have a database instance available on a host.
DB Instance will typically have a SID which will be same as DBName
Database is running on a Host
When we install Database software, we will have a network component called the
listener already configured. Purpose is to listen to connection requests.
when we have application running, and connect by giving 3 information, the app is
reaching out basically to the listener.
The port we specify is the port in which the listener runs. default is 1521. THe
listener which runs in 1521 is called default listener. Defailt listener listens to
all databases. So there will be one listener no matter how many database instances
are running on this host.
whenever we make a connection from the app to the database. request 1st goes to the
listener, the listener will then connect to the database instance and creates a
server process (assuming database is in dedicated server mode) on behalf of the
application, which will work every single sql you send from App will be run by
server process. This server process is spawned by the listener. Server process will
authenticate and a session is established.
Once this 1st connection request comes, thereafter the server process communicates
to the applciation directly, then listener is out of picture. It will only listen
for connection request and once connection is established the listener is out of
the way. Communication happens directly between the client and server process.