Oracle DBA for Beginners

Embed Size (px)

Citation preview

  • 8/6/2019 Oracle DBA for Beginners

    1/4

    Oracle DBA Basic Terms for Beginners

    Oracle DBA Basic Terms for Beginners

    In order to become a fully fledged DBA, you need to have an understanding of the fundamental concepts.This article aims to provide the basics of what a DBA is and what a DBA does in their daily role.

    The Database Administrator takes care of all of the security, data management and efficient running of anorganisations database. Backup and recovery are also an essential part of the role. Frequently the DBA has

    to work out of hours in order to keep the organisations database operational. The DBA must frequently

    make recommendations for improvement and future strategy. The DBA must liaise frequently with co-workers and other departments who rely on the database for information. Developers rely on the database

    for their working platform. Therefore it not only affects end users but developers of products and

    applications.

    There are certain terms that DBAs must be aware of and understand what they mean. We will cover a few

    of these here:

    Oracle Instance:

    When an Oracle database is running, it is associated with what is known as an instance. This occurswhen a database is started on a server. The type of computer the database runs on is irrelevant. Oracle

    allocates memory to an area named the System Global Area (SGA). The processes needed to operate the

    database are also started. An instance refers to the combination of Oracle processes and the SGA. The

    instance memory and processes are used to manage the database data efficiently and serve one or moremultiple users of the database.

    Parameter Files:

    Parameter files are used to provide initialization directives for a particular installation. There are two types

    of parameter file. These are Server Parameter Files, which are in binary format and persistent across andinstance i.e. persist across instance shutdown and startup, and Initialization parameter files, which are text

    based and can be changed. Sample versions of the parameter files are provided for use as an example and

    so they can be changed with relevant parameters for a specific installation. The sample file is usually finefor a basic setup, but can be changed to improve performance and other settings. Once changed, the

    settings take effect once the database is restarted.

    System Global Area (SGA):

    Whilst the database is in operation, a memory area is required for all users to share such as a buffer cacheand a shared pool of SQL statements. This is known as the System Global Area (SGA). The SGA isdefined in memory once an Oracle instance is started. Changes to the SGA become effective the next time

    the database is started up.

    Program Global Area (PGA):

    In addition to the system global area there is another area which comes into the equation, and is intended

    for the processing of SQL statements and temporary areas for sorting and temporary calculations. Thisarea is allocated for each individual database session. As for the system global area the programmer area

    can also be changed and new settings would take effect on a new database start-up.

  • 8/6/2019 Oracle DBA for Beginners

    2/4

    1. User Accounts:

    User accounts are an essential part of management for a DBA, and an understanding of how these

    are managed is one of the first lessons a DBA must learn. A user account has several attributes,

    which help to identify the account. A user account must have a password, privileges and a role, adefault tablespace for database objects, and a default temporary tablespace for processing of their

    work space.

    Of course, a user account must have something to work with. In this case it is the database schema.A schema consists of all the objects that a typical database user will need in relation to how they

    work with the database. A typical schema consists of tables, views, triggers and stored procedures

    etc that the user may create. Therefore it can be said that a schema is where the user stores theirobjects.

    Users also have roles associated with them. A role in database terms is not unlike a role in theworkplace. A role may be a sales person role or a manager role, or a developer role. They differ in

    that some roles may be allowed to access tables which other roles cannot and vide versa. Some

    similar roles may view a cross-section of tables with other roles, in addition to those tables whichare specific to them. The role scenario does not only cover tables though, it also covers other kinds

    of objects in the database.

    In addition to a role a user is also allocated privileges. A privilege is a permitted operation upon anobject such as read or write privilege on a database table. A privilege can also provide

    administrative options such as creating other user accounts etc. Therefore a typical user has both a

    role and a set of privileges to work with.

    Oracle Indexes:

    Oracle indexes can be used as an optional method of speeding up access to the database. An SQL

    query may or may not use an index to access a table. An index provides a pointer to specific data

    in a table, and saves searching through a whole list of items. However, in the case of small tablesor tables with very few dissimilar values an index can also cause an overhead in efficiency. A goodDBA will have knowledge of optimisation techniques but this equally applies to Oracle

    developers.

    Oracle Tablespace:

    An Oracle tablespace is a large unit of logical storage. It is reserved for use by the Oracle server tostore structures such as data objects, for instance tables and indexes. A tablespace is physically

    constructed of oracle data files. The data files format matches those stored by the operating system.

    Therefore a tablespace can consist of one or more data files. In large databases this will be several.

    Static Data Dictionary:

    One of the first items a DBA must know about are Data Dictionaries. These are held internally inthe database in their own tables, but these are not directly accessible. The only way to access data

    dictionary information is via data dictionary views. The DBA can query the Dictionary view. A

    number of views may be available for data dictionary information. The views available are namedwith a prefix according to their purposes. For instance the ALL_ prefixed views display all the

    information available to the current user. Standard users an also query a number of these views,

    but the more privileged information is only viewable by a DBA. For instance, the DBA_ prefixedviews display all information for the current database. USER_ prefixed views are used by users to

  • 8/6/2019 Oracle DBA for Beginners

    3/4

    view details about their own objects and tables.

    Dynamic Performance View:

    There is a special login names SYS. This login allows the DBA to access views maintained by thedatabase server and provide useful information about the database and how it is performing. They

    also provide detailed information on internal disk structure and memory. These views cannot be

    updated, but they can be viewed by the SYS user.

    Recycle Bin:

    Like the recycle bin used in windows this recycle bin is a logical storage area in the database tohold deleted objects. In the case of Oracle and the recycle bin we say items have been dropped

    as opposed to deleted. Therefore, if a table has been dropped in error it can be recovered from the

    recycle bin. This feature may be turned off if it has been specifically stated in the parameter file.

    SQL*Plus:

    This tool is provided for developer use mainly. It is installed with every Oracle database

    installation has three modes of viewing, which are command line, a windows interface, and a web-based version.

    Summary

    This thread has only mentioned a few basic terms that any ORACLE DBA should be aware andhave knowledge of. It has only really scratched the surface of what is, a skilled and complex job.

    However, by familiarising yourself with these terms you have started your journey to becoming a

    DBA.

    As you know an oracle instance is composed of SGA plus oracle background processes.

    I will try to touch a bit of oracle background processes.

    1)Database Writer Process (DBWn): Write modified blocks to disk.

    2)Log Writer Process (LGWR): Write redo log buffer info to disk.

    3)Checkpoint Process (CKPT):Update database files.

    4)System Monitor Process (SMON):Handles Recovery.

    5)Process Monitor Process (PMON):Handles cleanup tasks after user processes terminate.

    Above five are madatory background process.Optional background processes are,

    Recoverer Process (RECO)

    Job Queue Processes

    Archiver Processes (ARCn)

  • 8/6/2019 Oracle DBA for Beginners

    4/4

    Queue Monitor Processes (QMNn) And,

    Several other Background Processes.