You are on page 1of 54

DBA

Database administration refers to the whole set of activities performed by a


database administrator to ensure that a database is always available as needed.
Other closely related tasks and roles are database security, database monitoring and
troubleshooting, and planning for future growth.
v Database administration is an important function in any organization that is
dependent on one or more databases.
continue
•The database administrator (DBA) is usually a dedicated role in the IT
department for large organizations. However, many smaller
companies that cannot afford a full-time DBA usually outsource or
contract the role to a specialized vendor, or merge the role with
another in the ICT department so that both are performed by one
person.
•The primary role of database administration is to ensure maximum
up time for the database so that it is always available when needed
What are the functions of the Database
Administrator?
•Before trying to understand the functions of the database
administrator, it is necessary to first learn the three different
functional levels needed to maintain a database. These levels are the
data administration (DA), the database administration (DBA), and
database steward
What is a data administrator?
• A data administration (also known as a database administration
manager, data architect, or information center manager) is a high
level function responsible for the overall management of data
resources in an organization. In order to perform its duties, the DA
must know a good deal of system analysis and programming.
functions of a data administrator (not to be confused
with database administrator functions)
1. Data policies, procedures, standards
2. Planning- development of organization's IT strategy, enterprise
model, cost/benefit model, design of database environment, and
administration plan.
3. Data conflict (ownership) resolution=new version
4. Data analysis- Define and model data requirements, business rules,
operational requirements, and maintain corporate data dictionary
5. Internal marketing of DA concepts
6. Managing the data repository(partitioning)
What is a database administrator?
•Database administration is more of an operational or technical level
function responsible for physical database design, security
enforcement, and database performance. Tasks include maintaining
the data dictionary, monitoring performance, and enforcing
organizational standards and security
What is a database steward?
•A database steward is an administrative function responsible for
managing data quality and assuring that organizational applications
meet the enterprise goals. It is a connection between IT and business
units. Data quality issues include security and disaster recovery,
personnel controls, physical access controls, maintenance controls,
and data protection and privacy. For example, in order to increase
security the database steward can have control over who can gain
access to the data base by assigning a specific privileges to users
What are the functions of a database
administrator?
1.Selection of hardware and software
2.Managing data security and privacy
3.Managing data integrity
4.Databackup
5.Database recovery
6.Tuning database performance(upgrade)
7.Improving query processing performance
What are the functions of a database
administrator?
1. Selection of hardware and software
§ Keep up with current technological trends.
§ Predict future changes
§ Emphasis on established off the shelf products
§ 2. Managing data security and privacy
§ Protection of data against accidental or intentional loss, destruction, or
misuse
§ Firewalls
§ Establishment of user privileges
§ Complicated by use of distributed systems such as internet access and client/
server technology.
How many major threats to database security can you
think of?
1. Accidental loss due to human error or software/ hardware error.
2. Theft and fraud that could come from hackers or disgruntled
employees.
3. Improper data access to personal or confidential data.
4.Loss of data integrity.
5. Loss of data availability through sabotage(deliberate destroy), a virus,
or a worm.
3. Managing Data Integrity
ØIntegrity controls protects data from unauthorized use
ØData consistency
ØMaintaining data relationship
Ø Domains- sets allowable values (datatype)
ØAssertions- enforce database conditions(used by programmer)
4. Data backup
ØWe must assume that a database will eventually fail
Ø Establishment procedures
a. how often should the data be back-up?
b. what data should be backed up more frequently?
c. who is responsible for the back ups?
Ø Back up facilities
a . automatic dump- facility that produces backup copy of the
entire database
b . periodic backup- done on periodic basis such as nightly or weekly
c . cold backup- database is shut down during backup
d. hot backup- a selected portion of the database is shut down and
backed up at a given time
e. backups stored in a secure, off-site location
5.Database recovery
• Application of proven strategies for reinstallation of database after
crash
•Recovery facilities include backup, journalizing, checkpoint, and
recovery manager
If there are back up facilities, are there also journalizing, checkpoint,
and recovery facilities
ØJournalizing facilities include:
a. audit trail of transactions and database updates
b transaction log which records essential data for each transaction
processed against the database
c. database change log shows images of updated data.
The log stores a copy of the image before and after modification
ØCheckpoint facilitie
a.when the DBMS refuses to accept a new transaction, the system is in
a quiet state
b. database and transactions are synchronized
•Recovery Manager is a client/server application that uses database
server sessions to perform backup and recovery.
6. Tuning database performance
a. Set installation parameters/ upgrade DBMS
b. b.Monitor memory and CPU usage
c.Input/ output contention
7.Improving query processing performance
Requirement of technical training and years of
experience
•It is clear from all the above that the database administration
function requires technical training and years of experience. Some
companies that offer commercial database products, such as Oracle
DB and Microsoft's SQL Server, also offer certifications for their
specific products. These industry certifications, such as Oracle
Certified Professional (OCP) and Microsoft Certified Database
Administrator (MCDBA), go a long way toward assuring organizations
that a DBA is indeed thoroughly trained on the product in question.
Because most relational database products today use the SQL
language, knowledge of SQL commands and syntax is also a valuable
asset for today's DBAs
Types of database
1.Centralized database
2. Operational database
3. End-user database
4. Commercial database
5. Personal database
6. Distributed database
Centralized database
•Centralized database Users from different locations can access this
database from a remote location at the central database, that store
entire information and application programs at a central computing
facility for processing. The application programs pick up the
appropriate data from the database based on the transactions sent
by the communications controller for processing the transaction
Operational database
•Operational database This is more of a basic form of data that
contain information relating to the operations of an enterprise.
Generally, such databases are organized on functional lines such as
marketing, production, employees, etc.
End user database
•End user database End user is the user of a software, application or
a product. This is a shared database which is shared by users and is
meant for use by the end users, just like managers at different levels.
They may not be concerned about the individual transactions as
found in operational databases. This database is more about the
summary of the information.
Commercial database
•Commercial database This is a database that contains information
which external users may require. However, they will not be able to
afford maintaining such huge database by themselves. It’ s a paid
service to the user as the databases are subject specific. The access to
commercial database can be given through commercial links
Personal database
•Personal database The personal databases are maintained,
generally, on personal computers. They contain information that is
meant for use only among a limited number of users, generally
working in the same department.(ms access)
Distributed database
•A distributed database is a database that consists of two or more files
located in different sites either on the same network or on entirely
different networks. Portions of the database are stored in multiple
physical locations and processing is distributed among multiple
database nodes
assignments
1.Compare and contrast Traditional File Systems and Database Systems.
2.What are the drawbacks of file system?
3.Write at least five advantages of DBMS over file system.
4.Write four disadvantages of DBMS?
Chapter two : Managing Users

ØManaging Users
Ø Creating new database users
ØAltering and dropping existing users
Ø Monitoring information about existing users
•User management is to create and manage login credentials for each
user. we can also limit their access functionality.
Types of User Management:
1)Managing Users
2)Managing Privileges
3)Managing Roles
4)Managing Profiles
Creating New Database Users
•One of the primary tasks early on in the creation of a
new database is adding new users. However, user
creation is an ongoing task. As users enter and leave
the organization, so too must the DBA keep track of
access to the database granted to those users. When
using Oracle’ s own database authentication method,
new users are created with the create user
Managing Users
ØEach Oracle db has listed of valid database users . To access a
database, a user must run a database application and connect to the
database instance using a valid user name defined in the database
Managing user
1 )Create User - We can create new user by using "Create User"
statement Before executing this statement we must have "Create
user" system privilege -It's a powerful privilege ,a DBA or security
administrator is normally have this privilege
Øcreate user ram identified by ram;
vin these above statement user - username of new user and their
password - after identified by (Note this command will create user
only )
Creating user with default tablespace:

Øi)Creating user with default tablespace:


Øcreate user villa identified by villa default tablespace zen;
Ø here i mentioned the user villa has been created on "ZEN"
tablespace
ii)Creating user with default and temp tablespaces:
Øcreate user raj identified by raj default tablespace zen temporary
tablespace temp_ts;
Øin above this command i 'm allocated default tablespace and temp
tablespace for that user
ii)Allocating Space:
Øcreate user sam identified by sam default tablespace zen quota 20m
on zen;
here i'm created a user sam and allocated space for "SAM" on zen
tablespace (Note: if we not mentioned quota size on tablespace it
automatically allow up to 125mb but its not showing dba_ts_quotas so
we must allocate space and one more thing bytes column is '0' that
user ve unlimited space on that particular tablepsace).
Alter user
2) Alter User -To change user password and account limitations -Before
executing this statement we must have "Alter user" system privilege
•alter user ram identified by reena;
i)Alter space with limit:
•alter user sam quota 25m on zen;
•here i 'm change the user quota of tablepsce
ii)Alter space with unlimited
•alter user sam quota unlimited on zen;
To View Quota Allocation
i)DBA Level
•select * from dba_ts_quotas;
ii)User Level
•select * from user_ts_quotas;
ØTo unlock the user account
i)Unlock
Øalter user ram identified by ram account unlock;
Ø ii)Unlock separation
Øalter user ram identified by ram; alter user ram account unlock;
ØTo lock the user account
i)Lock
Øalter user ram password expire account lock;
ii)Lock separation
Øalter user ram password expire;

Øalter user ram account lock;


ØTo Check the user account by connection
ØSQL> grant connect ,resource to SAM;
ØGrant succeeded.
CREATE USER
•This statement highlights several items of information that comprise
the syntax and semantics of user creation
•The user’ s name in Oracle. The name should also
start with a letter. On single-byte character sets,
the name can be from 1 to 30 characters long. In
addition, the contain one single-byte character .
The username is not case sensitive and cannot be
a reserved wordname should
IDENTIFIED BY
•The user’s password in Oracle. This item should
contain at least three characters, and preferably six or
more. Generally, it is recommended that users change
their password once they know their username is
created
DEFAULT TABLESPACE& TEMPORARY
TABLESPACE
•DEFAULT TABLESPACE Tablespace management is a crucial task in
Oracle. The default tablespace names the location where the user’s
database objects are created by default.
•TEMPORARY TABLESPACE If temporary tablespace is not explicitly
specified by the DBA when the username is created, the location for
all temporary segments for that user will be the SYSTEM tablespace.
SYSTEM, as you already know, is a valuable resource that should not
be used for user object storage.
QUOTA
•QUOTA A quota is a limit on the amount of space the user’ s database
objects can occupy within the tablespace. If a user attempts to create
a database object that exceeds that user’ s quota for that tablespace,
then the object creation script will fail. Quotas can be specified either
in kilobytes (K) or megabytes (M).
PROFILE
ØPROFILE Profiles are a bundled set of resource-usage parameters
that the DBA can set in order to limit the user’
s overall host machine
utilization. To reduce the chance that one user could affect the
overall database performance with, say, a poorly formulated ad hoc
report that
Ødrags the database to its knees, you may assign profiles for each user
that limit the amount of time they can spend on the system.
PASSWORD EXPIRE& ACCOUNT UNLOCK

•PASSWORD EXPIRE This clause enforces the requirement that a user


change his or her password on first logging into Oracle. This extra level
of password security guarantees that , the DBA, will know a user’ s
password.
•ACCOUNT UNLOCK This is the default for user accounts created. It
means that the user’s account is available for use immediately. The DBA
can prevent users from using their accounts by specifying account lock
instead.
Guidelines for User-Account Management
•The following list identifies several new guidelines to follow when
managing user accounts.
• Use a standard password for user creation, such as 123abc or first1,
and use password expire to force users to change this password to
something else the first time they log into Oracle.
• Avoid OS authentication unless all your users will access Oracle
while connected directly to the machine hosting your database
ØBe sure to always assign temporary tablespace and default
tablespace to users .
Give few users quota unlimited. Although it’ s annoying to have users
asking for more space, it’s even more annoying to reorganize
tablespaces carelessly filled with database objects
Become familiar with the user-account management and other host
machine limits that can be set via profiles. These new features take
Oracle user-account management to new levels of security.
************
Altering and Dropping Existing Users
•Once a user is created, there are a few reasons you’ ll need to modify
that user. One is to expire the password if a user forgets it, so that
the next time the user logs in, the password can be changed by the
user. The alter user identified by statement is used to change the
user’s password:
•ALTER USER Psu IDENTIFIED BY forgotpassword
•PASSWORD EXPIRE;
In certain situations, as the result of user profiles, a user’s account may
become locked. This may occur if the user forgot his or her password
and tried to log in using a bad password too many times.
•To unlock a user’s account while also making it possible for the user
to change the password, the following alter user statement can be
used: ALTER USER Psu IDENTIFIED BY forgotpassword ACCOUNT
UNLOCK PASSWORD EXPIRE;
•In an attempt to prevent misuse, you may want to lock an account
that has been used many times unsuccessfully to gain access to
Oracle, with the following statement: ALTER USER athena ACCOUNT
LOCK;
Changing User Tablespace Allocation
ØYou may want to reorganize tablespaces to distribute I/O load and
make more effective use of the hardware running Oracle.
Ø ALTER USER Psu DEFAULT TABLESPACE overflow_tabspc01;
ØALTER USER Psu TEMPORARY TABLESPACE temp_overflow_01;
Ø A quota can be altered by the DBA with the alter user quota
statement. For example, the DBA may want to reduce the quota on
the USERS_01 tablespace from 10MB to 5MB for user Psu.
ØALTER USER Psu QUOTA 5M ON users_01;
Dropping User Accounts
ØAs users come and go, their access should be modified to reflect
their departure. To drop a user from the database, you execute the
drop user statement. If a user has created database objects, the user
cannot be dropped until the objects are dropped, as well. In order to
drop the user and all related database objects in one fell swoop,
Oracle provides the cascade option. DROP USER Psu CASCADE;
******
Monitoring Information About Existing Users
•The DBA may periodically want to monitor information about users.
Several data dictionary views may be used for the purpose of
obtaining information about users. Some information a DBA may
want to collect includes default and temporary tablespace
information, objects created by that user, and what the current
account status for that user account is. The following data dictionary
views can be used to determine this information.
1. DBA_USERS Contains username, Oracle-generated ID number,
encrypted password, default and temporary tablespace information,
and the user profile that was specified in the ID creation statements or
any alteration that may have followed.
2. DBA_OBJECTS Contains the specific information about every object
in the database. The DBA can determine which objects belong to which
users by using the OWNER column of this view.
3. DBA_TS_QUOTAS Names all users and any tablespace quotas that
have been created for them. *********

You might also like