RESPONSIBILITIES OF DBA. 1-instal and update the oracle application software’s. 2.start and stop the oracle instance. 3.maintain security policies, such as control user access to resources and information. 4- tunes the database. 5. Perform the physical database design. 6- be on call when problems occur with the database. 7- keeps current with database, operating system and application development techonologies. 8- performs database backup and recovery as required daily, weekly and monthly. 9 - assists developer in designing tables and queries for high efficiency. 10- keep your and users skill up to date. 11- performs future year planning. 12- provides necessary support and guidance to the user and programmers. ---------------------------------------------------------IMPORTANT DBA TASKS (is the database secure enough?) There are four major arias that need to be considering for database security. 1 - traditional backup & recovery mechanism that provide security against losing data due to media failure. 2- security against unauthorized instruction into the system and possible alternation of the data. 3- accident corruption of the data by an authorized user of the system. 4-ability to keep the system running in the event of the destruction of the data center or office in which your database server sits.

sys/chang_on_install. ----------------------------------------------------------- ORACLE MEMORY STRUCTURE ORACLE INSTANCE SGA (SYSTEM GLOBAL AREA) DATABASE BUFFER CACHE REDO LOG BUFFER SHARED POOL RECORD INSERT RECOVERY S S A D D L SERVER PROCESSOR 35% CHANGES 20% PMO N DBWR COMMANDS 45% LGWR CKPT USER PROCESS Paramete r File Password File SMON AR CC DATA FILES CONTRO L FILES REDO LOG FILES Archive Log file . 5.keeps the users privileges or rights to the minimum with respect to job title.avoid easy password. 3.----------------------------------------------------------SUGGESTION TO MAKE DATABASE SECURE 1-change the default oracle password.keeps changes your password after some time provide. because the most of the people know the default password of administration level user are system/manger. internal/oracle. 4.keeps the backup media very secure and away from data center. 2.

ORACLE SERVER Consist of an oracle instance and oracle database. which contains data and control information. Firstly we create a server process then he transfers sga.Dirty list (image of blocks before reuse) SERVER PROCESS When user process connect the front-end tool in oracle database server. 1. We do not directly connected sga. .Parsing User process sends the query to server process to check syntax. 2. ORACLE INSTANCE Consist of memory structure called sga (system global area) SGA Consist in memory region. 1. SERVER PROCESS HAS THREE STEPS. dtatbase buffer cache and redo log buffer. DATABASE BUFFER CACHE It is the most important area when a query is processed. The sga including shared pool. If record not available then dbwr search the information TYPES OF DATABASE BUFFER CACHE There are two types of database buffer cache.cache hit (fast work) 2. the server process looks for the blocks needed in the database buffer cache. This is called server process.cache miss (slow work) DATABASE BUFFER CACHE LISTS Database buffer cache has two lists 1. where oracle server resides. server process prepare to database.Execute The processing of the query. validity of commands.LRU (list recent used) mru (most recent used end) Lru (least recent used end) 2. SHARED POOL Used to store information such as the most recently execute sql commands from data dictionary. basically connected sga.

If control file damage then never database start. NOTE= if above four process are damaging then sga will also damage automatically order that database is damage and then again restart.Redo log file Contain a record of damage made to database to ensure reconstruction of database in case of failure. 6. At least one control file needed for database.Fetch To transfer result of query to the users BACKGROUND PROCESS 1. 1.Data File Store the data dictionary.Database writer (DBWR) Responsibilities for writing change the data to the database buffer cache. 3.Archived (ARC) Make duplicate files of any information in off line media. 4. Oracle’ name information in control file.Check Point (CKPT) To check any task perform to control all dirty database buffer covered by the log being ckpt are written to the data files by dbwr. 5. . 2. DATABASE FILES An oracle database has consisted of the following types of file.Control file Contain the information needed to maintain and verify database integrity. 2.3. if one of the process fail.System Monitor (SMON) Its primary function is to check for consistency and initiate recovery of database when the database is opened. A database has at least one data file. 3.Log writer (LGWR) Records change registered in the redo log buffer to database. user objects and before image of data that are modified by current transactions.Process Monitor (PMON) Cleanup the resources.

all names of control file in parameter files.Parameter File Use to define the characteristics of an oracle instance. data recovery. 2.Archived Log File Off line copies of the redo log files that may be necessary to recover from media failure.Mount This is used to alter file structured. (Control file open for dba). ON UNIX > SVRMGR1 (IN RUN OPTION) ORACLE 8 ON WINDOW NT/2000/XP > SVRMGR30 (IN RUN OPTION) SVRMGR> CONNECT SYS/ORACLE AS SYSDBA. 3. (Instance started). STARTUP AND SHUTDOWN STAGES Open STARTUP No mount Shutdown ONLY FOR Mount SHUTDOWN Database administrator can start database in one of three following different states. 2. OTHER KEY PHYSICAL STRUCTURE 1.A database requires at least two redo log files. STARTING SERVER MANAGER IN LINE MODE. memory information.Password file Use to authenticated privileged database users. modify control file. how much area cover by sga. 1.No Mount This state is used to create the database.Open . 3.

Following commands can be used to shutdown the database in server manager. Svrmgr>startup. Svrmgr>connect sys/oracle as sysdba. If the instance already started. Svrmgr> shutdown immediate. When all transaction completed then close the database. Then Svrmgr>alter database mount. Svrmgr>startup force nomount. Mount the database if database already in no mount state. 1.Shutdown immediately 4. This option waits for current transaction.In this state the database is available to all users. SVRMGR>startup restricts.Shutdown transactional 3. Enabling restricted session in open database. which are not completed. Svrmgr> shutdown or Svrmgr> shutdown normal. Svrmgr> alter system disable restricted session. Svrmgr>startup mount force. . Svrmgr> startup force. Shutdown transaction It’s used to bring down the database as soon as the users complete their current transaction. RESTRICTED SESSION DBA not want to allow ordinary user to connect the database. In shutdown normal no new connection are allowed. Svrmgr>alter database open.Shutdown normal 2. SHUTTING DOWN THE DATABASE It is also responsibility of dba to shutdown the database is not available to all users. force option can be used. Svrmgr> alter system enable restricted session.Shutdown abort Shutdown normal Shutdown normal is default option in database will make the dba to wait for all other users to finish but they are doing before database will actually close.

ORA NOW MODIFY INIT. Svrmgr> shutdown abort. CREATE A DIRECTORY AT ANY LOCATION FOR EXAMPLE D:\MYDATABASE\ 2.Shutdown immediate In which oracle server doesn’t wait for currently connected users to log off from the database. One is manually and other is gui (graphic user interface).ORA’ REMOTE_LOGIN_PASSWORDFILE=SHARED . BEFORE CREATING A DATABASE HARDWARE RESOURCES. But this is not usual task. DATABASE CREATION It is very important task. Shutdown abort In which current client sql statements being processed by the oracle server are not completed and abort. FOR EXAMPLE DB_NAME= DYNAMIC CONTROL_FILE= ‘E:\MYDATABASE\CONTROL. more files can be added. which must be performed carefully. When you can create database with two methods. SOME PARAMETER SHOULD BE CHANGED FOR BETTER MANAGEMENT. COPY INITORCL. Oracle database can be altered after creation. and size can be changed. Some modification is not allowed after creation of database like db_block_size cannot be changed. THE MINIMUM REQUIREMENT OF DATABASE CREATION IS THAT IT MUST HAVE ONE DATA FILE.ORA FILE FROM DEFAULT LOCATION TO ABOVE LOCATION. ONE CONTROL FILE AND TWO REDO LOG GROUPS AND ATLEAST ONE MEMBER IN EACH GROUP. 1.ORA FILE REQURIED. Svrmgr>shutdown immediate. Creating a database is multiple steps operation. MEMORY AND DISK SPACE OPERATING SYSTEM PRIVILAGES LOCATION AND SIZE OF FILE PREPAREING PARAMETER FILE ORACLE SOFTWARE EXISTING DATABASE BACKUP STEPS OF CREATE DATABASE MANUALLY NOTE:. FOR EXAMPLE D:\MYDATABASE\INIT.

Its data file name is sys1orcl. Types of table space 1.Temporary data 4. SVRMGR> STARTUP NOMOUNT PFILE=E:\MYDATABASE\INITORCL.Rollback data System table space Their users for all user of database its work by default.ORA’ SIZE 20 M LOGFILE GROUP 1 ‘E:\MYDATABASE\LOG1. .RDO’ SIZE 500 K.System table space 2.User data 3.RDO’ SIZE 500 K. GROUP 2 ‘E:\MYDATABASE\LOG2. NOW RUN SERVER MANGER OR SQL/PLUS AND STARTUP INSTANCE IN NOMOUNT STATE.ora.3.ORA FORCE. Every table space has one data file. THEN SVRMGR>CREATE DATABASE DYNAMIC DATAFILE ‘E:\MYDATABASE\DATAFILE1. Table spaces Bit Byte Block Extend Segment Table space Database 8bit =1 byte 512 bytes = 1 block 5 block = 1 extend 1 extend = segments segments = tables spaces table space = database Definition of table space The smallest pieces of the segments in database are called table space.

User data Its user for giving space to other users Its data file name is usr1orcl.ora Rollback data In this table space has keep old image of the data. Its data file name is temp1orcl.ora Temporary data If space full that will use the user then dba assign temporary space given by temporary data.ora Objective: •Describing the logical structure of the database •Creating Tablespaces •Changing the size of Tablespaces using different methods •Changing the status and storage settings of Tablespaces •Relocating Tablespaces •Preparing necessary Tablespaces TYPES OF TABLESPACE 1-SYSTEM Tablespaces contains: –Data dictionary information –SYSTEM rollback segment 2-Non-SYSTEM Tablespaces contains: –Rollback segments –Temporary segments –Application data –Application indexes Creating Tablespaces . Its data file name is rbs1orcl.

dbf’ SIZE 100M. ‘C:\ORANT\DATABASE\NEWDATA2. Adding Data Files to a Tablespace ALTER TABLESPACE ADNANQASIR ADD DATAFILE ‘/DISK5/app03.dbf’ SIZE 50M MINIMUM EXTENT 1M DEFAULT STORAGE (INITIAL 2M NEXT 2M MAXEXTENTS 500 PCTINCREASE 0) TEMPORARY. Enabling Automatic Extension of Data Files ALTER TABLESPACE ADNANQASIR .CREATE TABLESPACE ADNANQASIR DATAFILE ‘C:\ORANT\DATABASE\NEWDATA1.dbf’ SIZE 200M. Storage Parameters The following parameters influence the segment storage allocation: • INITIAL • NEXT • MAXEXTENTS • MINEXTENTS • PCTINCREASE Temporary Tablespace •Used for sort operations • Cannot contain any permanent objects CREATE TABLESPACE sort DATAFILE ‘/DISK2/sort01.dbf’ SIZE 100M MINIMUM EXTENT 500K DEFAULT STORAGE (INITIAL 500K NEXT 500K MAXEXTENTS 500 PCTINCREASE 0).

dbf’ SIZE 200M AUTOEXTEND ON NEXT 10M MAXSIZE 500M. ALTER TABLESPACE app_data OFFLINE. Changing the Size of Data Files Manually ALTER DATABASE DATAFILE ‘C:\ORANT\DATABASE\NEWDATA1. Changing the Storage Settings ALTER TABLESPACE ADNANQASIR MINIMUM EXTENT 2M. ALTER TABLESPACE app_data RENAME DATAFILE ‘/DISK4/app01.ADD DATAFILE ‘/DISK6/app04.dbf’ TO ‘/DISK5/app01. . Moving Data Files: ALTER TABLESPACE •The tablespace APP_DATA must be offline. •The target data files must exist.dbf’.dbf’ RESIZE 50M. OFFLINE Status •The tablespace that is offline is not available for data access. ALTER TABLESPACE ADNANQASIR DEFAULT STORAGE (INITIAL 2M NEXT 2M MAXEXTENTS 999). • The SYSTEM tablespace and any tablespace with active rollback segments cannot be taken offline.

The READ-ONLY Tablespace Status ALTER TABLESPACE app_data READ ONLY. • The tablespace must not contain active rollback segments.dbf’.DBF Moving Data Files: ALTER DATABASE •The database must be mounted. The tablespace APP_DATA is only available for read operations.dbf’ TO ‘/DISK2/system01. • The tablespace must not currently be involved in an online backup. Making Tablespace Read-Only •The tablespace must be online.DBF E:\MYDATABASE\NEWDATA2. DROP TABLESPACE app_data . •The target data file must exist. • No active transactions are allowed.Moving Data Files: BY OPERATING SYSTEM (DOS) MOVE C:\ORANT\DATABASE\NEWDATA2. ALTER DATABASE RENAME FILE ‘/DISK1/system01. Dropping Tablespaces The following statement removes the APP_DATA tablespace and all its contents.

Obtaining Tablespace Information (Select * from v$dba_tablespace) DBA_TABLESPACES •TABLESPACE_NAME •NEXT_EXTENT •MAX_EXTENTS •PCT_INCREASE •MIN_EXTLEN •STATUS •CONTENTS Obtaining Data File Information DBA_DATA_FILES •FILE_NAME •TABLESPACE_NAME •BYTES •AUTOEXTENSIBLE •MAXBYTES •INCREMENT_BY Storage Structure and Relationships Objective: •Listing the different segment types and their uses •Controlling the use of extents by segments •Stating the use of block space utilization parameters by objects •Obtaining information about storage structures from the data dictionary •Locating the segments by considering fragmentation and life-spans Types of Segments Table Table partition Cluster .INCLUDING CONTENTS.

Index Index-organized table Index partition Rollback segment Temporary segment LOB segment LOB index Nested table Bootstrap segment Extent Allocation and Deallocation •Allocated when the segment is +Created +Extended +Altered •Deallocated when the segment is –Dropped –Altered –Truncated –Automatically resized (rollback segments only) Database Block: Review •Minimum unit of I/O •Consists of one or more O/S blocks •Set by DB_BLOCK_SIZE •Set at database creation Database Block Contents .

Block Space Utilization Parameters Block Space Usage .

PCTFREE=20 PCTUSED=40 Inserts 1 Data Dictionary Views Used extents DBA_EXTENTS 2-freextents DBA_FREE_SPACE Segments DBA_SEGMENTS Data files DBA_DATA_FILES Tablespaces DBA_TABLESPACES Querying Segment Information DBA_SEGMENTS –General information –OWNER SEGMENT_NAME –SEGMENT_TYPE –TABLESPACE_NAME –Size – EXTENTS – BLOCKS –Storage settings – – – – – INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS MAX_EXTENTS PCT_INCREASE .

Organizing Tablespaces Based on Tablespace Usage Fragmentation Fragmentation SYSTEM Data dictionary Zero TOOLS Applications Very low Propensity DATA Data segments Low n INDEXn RBSn TEMPn Index segments Rollback segments Temporary segments Low High Very high* .

• Relevant only if tablespace PERMANENT .

Sign up to vote on this title
UsefulNot useful