Presentation on theme: "Overview of Database Administrator (DBA) Tools"— Presentation transcript:
1 Overview of Database Administrator (DBA) Tools Week 1Lecture 2Overview of Database Administrator (DBA) ToolsWelcome back to Week 1 Lecture 2 of MSCD640.In Lecture 1 we took a look at the Oracle 9i physical Architecture, Oracle Software Components, Oracle Client, Oracle Server, and Optimal Flexible Architecture (OFA).In this Lecture we’ll look closer at the Oracle’s administration tools and how they fit into the overall architecture.References Cited:Oracle9i Database Online Documentation
2 Objectives Identify the main DBA tools in the Oracle9i software suite Configure Oracle Net to connect to the databaseList the memory and background process components of the database instanceStart using the Enterprise ManagerThe course objectives in this lecture are to:Identify the Oracle 9i DBA toolsConfiguring Oracle NetIdentify the memory and background processes of an InstanceStart using OEM (Oracle Enterprise Manager)Loading OEM, which is a group of software components, is merely part of the overall picture. Oracle installer makes installation easy. The real understanding comes when you know how to configure connectivity of these tools to an instance within a few seconds.A typical phone call to a DBA goes something like this:Caller: Hi, my database is slow…Can you help us?DBA: I’ll need a host, port, SID, user/password and I could begin to help.
3 Overview of DBA toolsTools can be started from the console or as stand-alone components.Important tools to know:Database Configuration AssistantEnterprise Manager ConsoleLog MinerNet Manager and Net Configuration AssistantSQL*Plus and SQL*Plus WorksheetOEM prides itself on the ‘console’ concept of separate software components. OEM console is a main window where all the tools can be launched. The console offers ‘one stop shopping’ for all the toolsets but it also allows for single sign-on whereby the DBA can log into a database once and all other tools started against that instance do not require re-logging in. Running tools separately from icon short cuts will require separate logins. In the previous versions of OEM, the console was extremely sluggish while initiating another tool. Most DBAs opted to run OEM as separate components.Important v9 OEM tools are:Database Configuration Assistant - The Database Configuration Assistant (DBCA) an Oracle supplied tool that enables you to create an Oracle database, configure database options for an existing Oracle database, delete an Oracle database, or manage database templates. DBCA is launched automatically by the Oracle Universal Installer, but it can be invoked standalone from the Windows operating system start menu (under Configuration Assistants) or by entering the following on the UNIX command line: dbcaEnterprise Manager Console - The Console is the primary interface used for all Oracle Enterprise Manager operations. It provides menus, toolbars, and the framework to access Oracle tools and utilities in addition to those available through other vendors. The graphical configuration of the Console and the tools available are determined by the optional products installed and user preferences.Log Miner - LogMiner provides information necessary for performing recovery operations, tuning, and capacity planning. The Oracle9i LogMiner utility makes it possible to query both online and archived redo log files through a SQL interface in real time. LogMiner provides optional tracking of data definition language (DDL) statements, the ability to limit queries to committed transactions, and the ability to perform queries based on actual data values. Log Miner also supports a multi-versioned dictionary.Net Manager and Net Configuration Assistant - A post-installation tool(s) that configures basic network components after installation, including: Listener names and protocol addresses, Naming methods the client will use to resolve connect identifiers, Net service names in a tnsnames.ora file, and Directory server usageSQL*Plus and SQL*Plus Worksheet – SQL*Plus enables you to manipulate SQL commands and PL/SQL blocks, and to perform many additional tasks:Enter, edit, store, retrieve, and run SQL commands and PL/SQL blocks.Format, perform calculations on, store, and print query results in the form of reports.List column definitions for any table.Send messages to and accept responses from an end user.Perform database administration.The SQL*Plus for Windows Graphical User Interface (GUI) will be desupported in future releases of SQL*Plus. The browser-based iSQL*Plus User Interface will replace the SQL*Plus for Windows GUI. The SQL*Plus for Windows command-line (DOS) interface will continue to be supported.
4 Overview of DBA tools Important operating system commands: Tool name UNIX commandWindows commandEnterprise Manager consoleoemapp consoleoemapp.bat consoleSQL*Plussqlplus <user>/<pwd>Net ManagernetmgrSQL*Plus Worksheetoemapp worksheetoemapp.bat worksheetThis chart outlines the command used to start OEM, SQL*Plus, Net Manager and SQL*Plus Worksheet on both the UNIX and Windows environments.Note how similar the commands are between the operating systems. Oracle is striving to make all their commands that way both in and out of the database. In that way the skills of the DBA are more portable between different systems.
5 Configuring Oracle Net: Architecture Oracle Net Services is Oracle's mechanism for interfacing with the communication protocols used by the networks that facilitate distributed processing and distributed databases. Communication protocols define the way that data is transmitted and received on a network. In a networked environment, an Oracle database server communicates with client workstations and other Oracle database servers using Oracle Net Services software.Oracle Net Services supports communications on all major network protocols, ranging from those supported by PC LANs to those used by the largest of mainframe computer systems.Using Oracle Net Services, application developers do not need to be concerned with supporting network communications in a database application. If a new protocol is used, then the database administrator makes some minor changes, while the application requires no modifications and continues to function.Oracle Net was previously known as SQL*Net.Oracle Net must be configured on both the client and the server when using Oracle tools on the client side.
6 Configuring Oracle Net: Architecture When connecting to a local computer, Oracle Administration Assistant for Windows NT first tries to connect to the database as a SYSDBA, using the Bequeath networking protocol. When connecting to a remote computer, Oracle Administration Assistant for Windows NT first tries to connect to the database using Windows native authentication as a SYSDBA, using the TCP/IP networking protocol (port 1521 or the deprecated 1526). If it is unsuccessful, one or more dialogs appear and prompt you to enter information to connect to the database.JDBC (Java Database Connectivity) is a standard Java interface for connecting from Java to relational databases. The JDBC standard was defined by Sun Microsystems, allowing individual providers to implement and extend the standard with their own JDBC drivers.The Oracle JDBC Thin driver is a 100% pure Java, Type IV driver. It is targeted for Oracle JDBC applets but can be used for applications as well. Because it is written entirely in Java, this driver is platform-independent. It does not require any additional Oracle software on the client side. The Thin driver communicates with the server using TTC, a protocol developed by Oracle to access the Oracle Relational Database Management System (RDBMS).For applets it can be downloaded into a browser along with the Java applet being run. The HTTP protocol is stateless, but the Thin driver is not. The initial HTTP request to download the applet and the Thin driver is stateless. Once the Thin driver establishes the database connection, the communication between the browser and the database is stateful and in a two-tier configuration.The JDBC Thin driver allows a direct connection to the database by providing an implementation of TCP/IP that emulates Oracle Net and TTC (the wire protocol used by OCI) on top of Java sockets. Both of these protocols are lightweight implementation versions of their counterparts on the server. The Oracle Net protocol runs over TCP/IP only. The driver supports only TCP/IP protocol and requires a TNS listener on the TCP/IP sockets from the database server.Three methods of connecting:Oracle NetJDBC thin driverBequeath protocol
7 Configuring Oracle Net: Net Manager Use Net Manager to configure Oracle NetA service name defines the database’s name, location, and listening portNet Manager contains a wizard to configure a new service nameThe file tnsnames.ora stores Oracle Net configuration settingsOracle Net Manager is a graphical user interface tool that combines configuration abilities with Oracle Names component control to provide an integrated environment for configuring and managing Oracle Net. It can be used on either the client or server. Oracle Net Manager is also integrated with Oracle Enterprise Manager.The Oracle Net Manager wizards provide step-by-step guidance for tasks that require many steps. The wizards simplify complex tasks by guiding you through the task in manageable steps. The wizards are not intended to provide all configuration options. Once you have completed a task with a wizard, use other components of Oracle Net Manager to modify the configuration.The tnsnames.ora file will be found in the following places:On UNIX$ORACLE_HOME/network/admin subdirectory$TNS_ADMINsomewhere in your path like /etcOn WindowsORACLE_HOME/network/admin orORACLE_HOME/net80/admin subdirectoryTNS_ADMIN (set in the registry or the user environment)somewhere in your path like ‘C:\’
8 Oracle Memory and Background Processes: Connecting to a Shared Server Red lines trace the path between the client and the instanceNow we’ll depict how a client connect to the database Server Process through Shared Server formerly called multi-threaded server (MTS).A database server that is configured to allow many user processes to share very few server processes, so the number of users that can be supported is increased. With shared server configuration, many user processes connect to a dispatcher. The dispatcher directs multiple incoming network session requests to a common queue. An idle shared server process from a shared pool of server processes picks up a request from the queue. This means that a small pool of server processes can serve a large number of clients. Contrast with dedicated server.
9 Oracle Memory and Background Processes: Connecting to a Dedicated Server Red lines trace the path between the client and the instanceA dedicated server is a server process that is dedicated to one client connection. Note how a separate server process is spawned to interface directly to each user process.These separate user-server processes take memory away from the server and will cause performance tuning concerns during periods of high demand to the database.Compare this slide to the previous slide for further understanding.
10 Oracle Memory : PGA & SGA The SGA is allocated when the instance starts upThe PGA has private areas for each applicationA program global area (PGA) is a memory region which contains data and control information for a server process. It is a nonshared memory created by Oracle when a server process is started. Access to it is exclusive to that server process and is read and written only by Oracle code acting on behalf of it. The total PGA memory allocated by each server process attached to an Oracle instance is also referred to as the aggregated PGA memory allocated by the instance.A system global area (SGA) is a group of shared memory structures that contain data and control information for one Oracle database instance. If multiple users are concurrently connected to the same instance, then the data in the instance's SGA is shared among the users. Consequently, the SGA is sometimes called the shared global area.An SGA and Oracle processes constitute an Oracle instance. Oracle automatically allocates memory for an SGA when you start an instance, and the operating system reclaims the memory when you shut down the instance. Each instance has its own SGA.The SGA is read/write. All users connected to a multiple-process database instance can read information contained within the instance's SGA, and several processes write to the SGA during execution of Oracle.
11 Oracle Memory : SGA Components The shared pool stores parsed SQL commands for possible reuseThe buffer cache stores data blocks read from the datafilesThe database buffer cache is the portion of the SGA that holds copies of data blocks read from datafiles. All user processes concurrently connected to the instance share access to the database buffer cache.The database buffer cache and the shared SQL cache are logically segmented into multiple sets. This organization into multiple sets reduces contention on multiprocessor systems.The shared pool portion of the SGA contains three major areas: library cache, dictionary cache, buffers for parallel execution messages, and control structures.The total size of the shared pool is determined by the initialization parameter SHARED_POOL_SIZE. The default value of this parameter is 8MB on 32-bit platforms and 64MB on 64-bit platforms. Increasing the value of this parameter increases the amount of memory reserved for the shared pool.
12 Oracle Memory: SGA Components The redo log buffer stores all changes to data before the changes are written to the datafilesThe cursor pool is optional and provides extra memory for program cursorsThe redo log buffer is a circular buffer in the SGA that holds information about changes made to the database. This information is stored in redo entries. Redo entries contain the information necessary to reconstruct, or redo, changes made to the database by INSERT, UPDATE, DELETE, CREATE, ALTER, or DROP operations. Redo entries are used for database recovery, if necessary. Redo entries are copied by Oracle server processes from the user's memory space to the redo log buffer in the SGA. The redo entries take up continuous, sequential space in the buffer.The database administrator can configure an optional memory area called the large pool to provide large memory allocations. By allocating session memory from the large pool for shared server, Oracle XA, or parallel query buffers, Oracle can use the shared pool primarily for caching shared SQL and avoid the performance overhead caused by shrinking the shared SQL cache.If an application repeatedly issues parse calls on the same set of SQL statements, then the reopening of the session cursors can affect system performance. Session cursors can be stored in a session cursor cache. This feature can be particularly useful for applications that use Oracle Forms, because switching from one form to another closes all session cursors associated with the first form.Oracle checks the library cache to determine whether more than three parse requests have been issued on a given statement. If so, then Oracle assumes that the session cursor associated with the statement should be cached and moves the cursor into the session cursor cache. Subsequent requests to parse that SQL statement by the same session then find the cursor in the session cursor cache.To enable caching of session cursors, you must set the initialization parameter SESSION_CACHED_CURSORS. The value of this parameter is a positive integer specifying the maximum number of session cursors kept in the cache.The large pool is optional and adds more memory for better response time
13 Background Processes: PMON & SMON PMON (Process Monitor) cleans up remaining resourcesafter the server and user processes endSMON (System Monitor) handles recovery if needed, cleans up old temporary tables, and restores spaceA process monitor database process that performs process recovery when a user process fails. PMON is responsible for cleaning up the cache and freeing resources that the process was using. PMON also checks on dispatcher and server processes and restarts them if they have failed. As a part of service registration, PMON registers instance information with the listener.The system monitor performs recovery when a failed instance starts up again. With Real Application Clusters, the SMON process of one instance can perform instance recovery for other instances that have failed. SMON also cleans up temporary segments that are no longer in use and recovers terminated transactions skipped during recovery because of file-read or offline errors. These transactions are eventually recovered by SMON when the tablespace or file is brought back online. SMON also coalesces free extents in the dictionary managed tablespaces to make free space contiguous and easier to allocate.
14 Background Processes: DBWn & CKPT DBWn (Database Writer) writes modified buffers to the datafilesCKPT (Checkpoint Process) signals the DBWn process and assigns SCNThe database writer writes modified blocks from the database buffer cache to the datafiles. Although one database writer process (DBW0) is sufficient for most systems, you can configure additional processes (DBW1 through DBW9 and DBWa through DBWj) to improve write performance for a system that modifies data heavily. The initialization parameter DB_WRITER_PROCESSES specifies the number of DBWn processes.Because Oracle uses write-ahead logging, DBWn does not need to write blocks when a transaction commits. Instead, DBWn is designed to perform batched writes with high efficiency. In the most common case, DBWn writes only when more data needs to be read into the SGA and too few database buffers are free. The least recently used data is written to the datafiles first. DBWn also performs writes for other functions, such as checkpointing.At specific times, all modified database buffers in the SGA are written to the datafiles by DBWn. This event is called a checkpoint. The checkpoint process is responsible for signaling DBWn at checkpoints and updating all the datafiles and control files of the database to indicate the most recent checkpoint.
15 Background Processes: ARCn & LGWR ARCn (Archiver) copies redo log files to archive log filesLGWR (Log Writer) writes redo log buffers to the redo log filesThe log writer writes redo log entries to disk. Redo log entries are generated in the redo log buffer of the SGA, and LGWR writes the redo log entries sequentially into an online redo log. If the database has a multiplexed redo log, then LGWR writes the redo log entries to a group of online redo log files.The archiver copies the online redo log files to archival storage after a log switch has occurred. Although a single ARCn process (ARC0) is sufficient for most systems, you can specify up to 10 ARCn processes by using the dynamic initialization parameter LOG_ARCHIVE_MAX_PROCESSES. If the workload becomes too great for the current number of ARCn processes, then LGWR automatically starts another ARCn process up to the maximum of 10 processes. ARCn is active only when a database is in ARCHIVELOG mode and automatic archiving is enabled.
16 Background Processes: RECO & LMS RECO (Recoverer Process) fixes errors if changes across distributed databases failLMS (Lock Manager Service) handles updates that affect data in multiple clustered databasesThe recoverer is used to resolve distributed transactions that are pending due to a network or system failure in a distributed database. At timed intervals, the local RECO attempts to connect to remote databases and automatically complete the commit or rollback of the local portion of any pending distributed transactions.The Lock Manager Server process (LMS) is used for inter-instance locking in Real Application Clusters.
17 Introducing Enterprise Manager Central clearinghouse of DBA toolsWindows-like interface with little or no SQL coding requiredCentered around the Enterprise Manager consoleOptionally, uses the Enterprise Management ServerOracle Enterprise Manager combines Oracle's system management Console, common services, and integrated platform graphical tools. It provides an integrated set of standard database administration applications to help automate and simplify the common daily tasks of administrators. These supplemental applications focus on specific areas of database administration, helping administrators with their daily and routine tasks of managing databases and other services and keeping them operational.
18 Enterprise Manager console Important featuresFrom the Console, you can perform the following tasks:Administer, diagnose, and tune multiple databases.Manage a wide range of targets in addition to Oracle databases, including: Web servers, application servers, applications, and services.Administer Oracle Real Application Groups Clusters if the option is installed.Schedule tasks on multiple systems at varying time intervals.Monitor database conditions throughout the network.Share tasks with other administrators.Group related targets together to facilitate administration tasks.Create, schedule, and publish HTML reports to quickly view and analyze information about your managed systems.Administer targets from any location via a Web browser.Launch integrated Oracle and third-party tools.Customize the display of an Enterprise Manager administrator.
19 Enterprise Manager: Instance Manager Instance Manager handles these tasks (and more):Setting initialization parametersStarting and shutting down the databaseMonitoring and adjusting memory usageLocating redo log filesThe Instance Management feature helps you manage database instances and sessions in your Oracle environment. With the Instance Management feature you can:Start up and shut down a database.View and edit the values of instance parameters.Tune your database resources for optimal use with the help of Memory and Mean-Time-To-Recover (MTTR) Advisors.Manage users' sessions, and view currently running SQL and its explain plan.Administer locks and sessions consuming the highest amounts of resources (if the Diagnostics Pack is installed).Monitor long-running operations.Control processing resources via Resource Plans.Perform backup, recovery and maintenance operations on the database files.
20 Enterprise Manager: Schema Manager Schema Manager handles these tasks (and more):Adding and removing columns on tables or viewsCreating new tables, indexes, views, and object typesAdding constraints to tablesViewing statistics on tablesWith the Schema Management feature, you can create, alter, or drop database schema objects such as clusters, indexes, materialized views, tables, and views, as well as view dependencies of schema objects. Storage layout information is also available for a table or an index if they are on EMC devices.The Schema Management feature also supports index organized tables, partitioned tables and indexes, advanced queues, Java classes and sources, and unicode. Advanced queuing offers message transformation which can be used to transform and validate message communication amongst different business processes. The unicode feature allows you to select a column of "character" type and specify the length in bytes or characters.You can also compile multiple objects such as functions, packages, package bodies, and triggers from their Summary View panel, and you can edit the storage and options information for clusters, indexes, and tables if the values apply to multiple objects.
21 Enterprise Manager: Security Manager Security Manager handles these tasks (and more):Creating new users and rolesChanging user passwordsAssigning and revoking user privilegesAdjusting user storage quotasIn a large network environment, security parameters for objects, administrators, and users are in constant change. With the Security Management feature, an administrator can make these necessary changes quickly and efficiently.When you expand the Security node under the database in the tree view, folders for users, roles, and profiles appear.User OperationsThe Security Management feature helps you manage the database users in your network by helping you create users and clones of users, add and remove user permissions and roles, grant or revoke the switch privilege of resource consumer groups for a user or role, alter user properties, including account status and default profiles, and set up database users to act as proxy for a user. Security Management capabilities also allow you to easily see users' dependents and dependencies.Role OperationsWith the Security Management role operations feature, you can modify role properties as easily as user properties. You can also create roles and clones of roles, add and remove permissions from roles, and see grantees of roles, including consumer groups.Profile OperationsA profile is a set of limits on a user's database resources. As with users and roles, you can create a profile or a clone of a profile, alter a profile's properties, and assign and remove profiles from users. You also have the ability to see profile dependents and dependencies, as well as grantees of profiles.Profiles, roles, and the users to which they are assigned can easily be seen in security lists provided by Security Management. Administrators can then use property sheets to determine security parameters, simplifying the process of making changes.The Security Management feature also supports Oracle password management, which increases system security. Supported features includes: account locking, password lifetime and expiration, password history, password complexity, verifications, and export/import of passwords.
22 Enterprise Manager: Storage Manager Storage Manager handles these tasks (and more):Creating new tablespacesAdjusting size of data filesTaking tablespaces offlineMonitoring storage usageThe Storage Management feature helps you administer tablespaces (permanent, temporary, and undo), datafiles, redo logs, archive logs, and rollback segments for optimum database storage.Controlfile OperationsWhen you select the Controlfile icon, a property sheet appears where you can see the number of controlfiles created for the database and other statistics.Tablespace OperationsUsing the contents of the Tablespaces folder, you can create, edit, or drop a tablespace, switch to a new default temporary tablespace, add a datafile or rollback segment, take a tablespace off- or on-line, make a tablespace read-only or writable, and set tablespace storage parameters, including multiple block sizes which is key in facilitating the transportability of tablespaces from one database type to another.Beginning with Enterprise Manager 9.2, you can choose to use bitmaps to manage the free space within segments. Bitmaps allow Oracle to manage free space more automatically, and offers high performance for free space management.In addition, you can click the tablespace to see the used and free space of the tablespace or datafile.Beginning with Oracle9i, you can also allocate your undo space in a single undo tablespace, instead of distributing them into a set of statically allocated rollback segments. For each Oracle instance, you will only have to allocate enough disk space for the workload in that instance in an undo tablespace. In additon, using Enterprise Manager, you can create or alter an undo tablespace.Datafile OperationsWith the contents of the Datafiles folder, you can create a datafile or a clone of a datafile, edit a datafile, and take a datafile off- or on-line. You can also click the datafile to see the used and available space. In 9.2, you can delete datafiles when dropping a tablespace. Also, the storage layout feature, which includes a page to display the storage layout information for a datafile and a page to display the overview of the file map, is available for datafiles on EMC devices.Rollback Segment OperationsUsing the Rollback Segments folder, you can create, alter, drop, or shrink a rollback segment as well as take one off- or on-line.Redo Log Group OperationsUsing the Redo Log Groups folder, you can switch the current redo log group, trigger a checkpoint in a redo log group, create a new redo log group, and rename, remove, or add new redo log group members.Archive Log OperationsThe archive log folder allows you to view the current archive logs in the database.
23 Lecture SummaryOracle’s DBA tools are available inside the Enterprise Manager console or stand-aloneOracle Net is the most common way to communicate between client and database serverOther methods of communicating are JDBC driver and Bequeath protocolNet Manager provides a tool for configuring Oracle NetThe tnsnames.ora file stores Oracle Net configuration information
24 Lecture SummaryDatabase servers are either in shared server mode or dedicated modeUser processes and server processes handle connections and user sessionsOracle memory is made up of the PGA and the SGAThe PGA has private areas for each applicationThe SGA is part of the database instance
25 Lecture SummaryThe SGA stores data blocks read from the data files and stores changed data blocksThe background processes run the database functions such as reading and writing datafilesThe Enterprise Manager console is the center of Oracle’s DBA tool setThe console can run stand-alone or as part of the Enterprise Management Server
26 Lecture SummaryThe four main tools within the Enterprise Management console are:Instance ManagerSchema ManagerSecurity ManagerStorage Manager