Download presentation
Presentation is loading. Please wait.
Published byGeorgiana Booker Modified over 8 years ago
1
Database Administration 3.Using Administration Tools
2
Database Administration Using Administration Tools 1. Using the Server Manager Line Mode 2. Identified the application supplied with OEM 3.Using OEM component
3
Database Administration Using Administration Tools On UNIX svrmgrl svrmgrl command=@crdb.sql svrmgrl command=“connect scott/tiger” On NT svrmgrl30 svrmgrl30 command=@crdb.sql
4
Database Administration Using Administration Tools On UNIX svrmgrl svrmgrl command=@crdb.sql svrmgrl command=“connect scott/tiger” On NT svrmgrl svrmgrl command=@crdb.sql
5
Database Administration Using Administration Tools On NT svrmgrl svrmgrl command=@crdb.sql
6
Database Administration Using Administration Tools 1. Exit,remark, set,show,spool 2. Connect/disconnect,describe,execute show errors,show parameter,show sga 3. Connect … as sysdba/sysoper archive log,recover database,startup/shutdown set charwidth 20, spool crdb.log,show all,show spool
7
Database Administration Using Administration Tools OEM Architecture OEM Console Intelligent Agent OEM Repository
8
Database Administration Using Administration Tools Starting and using OEM - Create repository automatically by invoking OEM - define services auto/manual discovery - set up security using preferred - using OEM applications
9
Database Administration
10
4. Creating a database
11
Database Administration Creating a database 1. Preparing the operating system 2. Preparing the parameter file 3. Create the database
12
Database Administration Creating a database 1. Preparing the operating system 2. Preparing the parameter file 3. Create the database
13
Database Administration Creating a database. A privileged account by one of the following ways by OS or password file. Memory to start the instance. Sufficient disk space for planned database Multiplex the control,log file and balance Data files Optimal Flexible Architecture - OFA
14
Database Administration Creating a database Optimal Flexible Architecture - OFA - ORACLE_BASE ORACLE_HOME -The OFA directory structure for NT is not identical to that for UNIX because of naming conversion and lack of symbolic links - OFA copy and the directory information
15
Database Administration Creating a database On Unix - Created automatically during the installation - Created manually after install On NT - Created automatically using database assistant - Created manually after install
16
Database Administration Creating a database Manually create a database - decide the instance, database and character set - set the OS variables - prepare the parameter file - create a password file - start the instance - create the database - Run scripts to generate the data dictionary and further steps
17
Database Administration Creating a database OS Environment variables - ORACLE_HOME /u01/app/oracle/product/8.1.5 - ORACLE_SID - ORACLE_BASE /u01/app/oracle - ORA_NLS33 $ORACLE_HOME/ocommon/nls/admin/data - PATH $ORACLE_HOME/bin In Korn shell.profile $ORACLE_SID=U16; export ORACLE_SID In C shell source.cshrc $setenv ORACLE_SID U16
18
Database Administration Creating a database On NT - Set the variable ORACLE_SID C:\> set ORACLE_SID=U16 - Create the service and the password file with ORADIM Editing the Parameter file DB_NAME CONTROL_FILES DB_BLOCK_SIZE
19
Database Administration Creating a database 1. Connect as SYSDBA/INTERNAL 2. STARTUP NOMOUNT 3. Creating the database 4. Creating data dictionary view and standard packages Steps : 1. Syntax errors in the SQL scripts 2. Files that should be created already exist 3. OS errors such as permission or insufficient space errors Troubleshooting :
20
Database Administration Creating a database After creation of the database 1. Data file for system 2. Control and redo logs 3. SYS/change_on_install 4. SYSTEM/manager 5. system Rollback segment 6. Internal tables 7. System views
21
Database Administration 5.Data Dictionary and Standard Packages
22
Database Administration Data Dictionary Views and Standard Packages The data dictionary provides information about - Logical and physical structure - Names,definitions and space allocations of schema objects - Integrity constraints - Database user and privileges - Auditing Created by - Created with catalog.sql,catproc.sql script - base table created with sql.bsq scripts Data dictionary Views DBA_XXX, ALL_XXX,USER_XXX
23
Database Administration Data Dictionary Views and Standard Packages Dict dba_tables,dba_objects,dba_tab_columns,dba_constraints dba_users,dba_sys_privs,dba_roles dba_extents,dba_free_space,dba_segments dba_rollback_segs,dba_data_files,dba_tablespaces dba_audit_trail,dba_audit_objects,dba_audit_obj_opts
24
Database Administration Data Dictionary Views and Standard Packages Cat*.sql catalog and DD info. Dbms*.sql DB package specification prvt*.plb Wrapped database package code utl*.sql Views and tables for database utilities UNIX $ORACLE_HOME/rdbms/admin NT %ORACLE_HOME%/rdbms80/admin
25
Database Administration Data Dictionary Views and Standard Packages Oracle supplied Packages DBMS_LOB,DBMS_SESSION,DBMS_SPACE,DBMS_ROWID, DBMS_SHARED_POOL,DBMS_UTILITY DBMS_SHARED_POOL.KEEP (UNKEEP) DBMS_UTILITY.ANALIZE_SCHEMA DBMS_ROWID.ROWID_INFO Check the status about the stored objects
26
Database Administration 6. Maintaining The Control File
27
Database Administration Maintaining The Control File - The usage of the control file - Examining the contents of control file - Obtaining the control file information - Multiplexing the control file
28
Database Administration Maintaining The Control File Using of control file - binary file is necessary for the database start and operate successfully - for locate the data file and log files - must be available whenever the database mounted and opened - about the database consistency used during recovery
29
Database Administration The contents of the control file - Database name and sid - Names and location of log files - Names of the tablespace - The time stamp of database creation - Checkpoint information - Log history - Backup info for Recovery Manager Maintaining The Control File
30
Database Administration The size of the control file depend on - MAXLOGFILES - MAXLOGMEMBERS - MAXLOGHISTORY - MAXDATAFILES - MAXINSTANCES Maintaining The Control File
31
Database Administration Obtaining control file info - V$CONTROLFILE - NAME - V$PARAMETER - NAME ‘control_files’ - VALUE - V$CONTROLFILE_RECORD_SECTION - type - records_size - records_total - records_used Maintaining The Control File
32
Database Administration Multiplexing the control file to avoid a single point of database failure control_files=(/disk1/control1.con, /disk2/control2.con Steps : 1. Shutdown database 2. Make a copy of the cotrol file 3. Edit or Add the CONTROL_FILES parameters 4. Restart the database Backup the control file : alter database backup controlfile to name - Created at $ORACLE_HOME/database alter database backup controlfile to trace - Created at BACKGROUND_DUMP_DEST Maintaining The Control File
33
Database Administration 7. Maintaining Redo Log File
34
Database Administration - the usage of redo log files - obtain the log and archive information - controlling log switches and checkpoint - multiplexing and maintaining online redo log files - planning online redo log files - troubleshooting the redo log file problems Maintaining The LOG Files
35
Database Administration The usage of redo log files - minimize the loss of data in the database - used for the recovery - record all the changes made to the database Redo log groups and members Maintaining The LOG Files Disk1 Disk2 Group1 member Group2 member Group3 member
36
Database Administration Parameters for redo logs MAXLOGFILES (255) MAXLOGMEMBERS (CREATE DATABASE) LOG_FILES Redo log and LGWR LGWR process under the following case - when commit occurs - when redo log buffer pool become one third full - when LGWR time out occurs (every 3 seconds0 - before the DBWR write the modified blocks to the data files Maintaining The LOG Files
37
Database Administration Maintaining The LOG Files Log switch - switch form one log group to the other Checkpoint - all the database write to the datafile by DBWR - CKPT updates the headers of all data and controls files Checkpoint occurs in the following situations - every log switch - when database shutdown( not abort) - forced by LOG_CHECKPOINT_INTERVAL & LOG_CHECKPOINT_TIMEOUT - when manually requested by the DBA
38
Database Administration Maintaining The LOG Files NOARCHIVELOG mode - the log files are overwritten each time an redo logs filled or switch occur ARCHIVELOG mode - the ARCH archive the log to archive LOG - manually or automatically LOG_ARCHIVE_START=TRUE/FALSE ARCHIVE LOG LIST V$DATABASE V$LOG V$THREAD V$INSTANCE V$LOGFILE more information in BACKUP/RECOVERY course
39
Database Administration Maintaining The LOG Files Force log switch with the command ALTER SYSTEM SWITCH LOGFILE; Control the check point with - LOG_CHECKPOINT_INTERVAL set to high value > log file size, not to 0 - LOG_CHECKPOINT_TIMEOUT set to 0 disable the time based checkpoint
40
Database Administration Maintaining The LOG Files Add database Redo log file groups ALTER DATABASE ADD LOGFILE [group n] file name eg. ALTER DATABASE ADD LOGFILE ( ‘/disk3/log3a.rdo’, ‘/disk4/log3b.rdo’ ) size 1M; Add database Redo log file members ALTER DATABASE ADD LOGFILE member to GROUP eg. ALTER DATABASE ADD LOGFILE MEMBER ‘/disk4/log1b.rdo’ to GROUP1, ‘/disk4/log2b.rdo’ to GROUP2,;
41
Database Administration Maintaining The LOG Files Drop online Redo log groups ALTER DATABASE DROP LOGFILE GROUP 3; Drop online Redo log members ALTER DATABASE DROP LOGFILE member ‘/disk4/log2b.dbf’; Clear on line redo log files ALTER DATABASE CLEAR [ UNARCHIVED] LOGFILE ‘/disk3/log2a.rdo’; Notes : - an instance at least 2 groups of online log files - the active group can not be dropped - the not archived log group can not be dropped - when drop the log file the system file are not deleted
42
Database Administration Maintaining The LOG Files - Number Of online redo log files LGWR,ARCH and no of transactions - Locationof online Redo log files 1. Multiplex redo logs 2. Redo logs X archive logs (LGWR,ARCH) 3. Redo logs X data files (LGWR,DBWR) - Size of the redo logs minimum 50 k maximum depend on OS switch and checkpoint number and amount of redo entries space and recovery time
43
Database Administration Maintaining The LOG Files Possible LGWR Errors 1. one member is not available still work dropping and adding a new redo log member 2. All the members of next group are not available shutdown the instance if group not active dropping and recreating new group if active need media recovery from the loss of an online redo logs 3.All member of current group are not available shutdown the instance need media recovery from the loss of an online redo logs
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.