Oracle dba's Responsibilities

Source: Internet
Author: User

The ORACLE Database Administrator should perform regular monitoring on the ORACLE database system as follows:
(1) daily running status, log files, backups, and data of ORACLE databases
Library space usage, system resource usage check, find and solve
Problem.
(2) Monitor the space expansion and data growth of database objects every week, check the database health, and check the status of database objects.
(3) perform Analyze on tables and indexes every month to check the space fragments and find databases.
Performance adjustment opportunities, database performance adjustment, and propose the next space management
Plan. Perform a comprehensive check on the ORACLE database status.
Daily Work
(1) confirm that all instances are in normal status
Log on to all databases or routines to check ORACLE background processes:
$ Ps-ef | grep ora
(2) Check the use of the file system (available space ). If the remaining space of the file system is less than 20%, delete unnecessary files to release space.
$ Df-k
(3) Check the log file and trace file to record errors in the alert and trace files.
Connect to each system to be managed
? Use 'telnet'
? Cd to the bdump directory for each database, usually $ ORACLE_BASE/<SID>/bdump
? Run the Unix 'tail' command to view the alert _ <SID>. log file.
? If any new ORA-errors are found, record and resolve them.
(4). Check the validity of the database backup on the current day.
RMAN backup method:
Check the backup logs of a third-party backup tool to check whether the backup is successful.
EXPORT backup mode:
Check the exp log file to check whether the backup is successful
Other backup methods:
Check the corresponding log file
(5) Check the data file whose status is not "online" and restore it.
Select file_name from dba_data_files where status = 'offline'
(6). Check the usage of the table space.
SELECT tablespace_name, max_m, count_blocks free_blk_cnt, sum_free_m, to_char (100 * sum_free_m/sum_m, '99. 99') | '%' AS pct_free
FROM (SELECT tablespace_name, sum (bytes)/1024/1024 AS sum_m FROM dba_data_files group by tablespace_name ),
(SELECT tablespace_name AS fs_ts_name, max (bytes)/1024/1024 AS max_m, count (blocks) AS count_blocks, sum (bytes/1024/1024) AS sum_free_m FROM dba_free_space group by tablespace_name)
WHERE tablespace_name = fs_ts_name
(7). Check the remaining tablespace
SELECT tablespace_name, sum (blocks) as free_blk,
Trunc (sum (bytes)/(1024*1024) as free_m,
Max (bytes)/(1024) as big_chunk_k, count (*) as num_chunks
FROM dba_free_space group by tablespace_name;
(8). Monitor database performance
Run bstat/estat to generate a system report
Or use statspack to collect statistics.
(9) Check the database performance and record the cpu usage, IO, buffer hit rate, and so on of the database.
Use vmstat, iostat, glance, top, and other commands
(10) Handling of daily problems.
Weekly Work
(1) control the space expansion of database objects
Find the database objects that quickly expand the space according to the daily check results of this week, and take
Measures
-- Delete historical data
--- Expand table space
Alter tablespace <name> add datafile '<file> 'size <size>
--- Adjust the storage parameters of Data Objects
Next extent
Pct_increase
(2) monitoring data volume growth
Based on the daily check results of this week, find the database objects with a fast increase in the number of records, and collect
Take corresponding measures
-- Delete historical data
--- Expand table space
Alter tablespace <name> add datafile '<file> 'size <size>
(3). System Health Check
Check the following:
Init <sid>. ora
Controlfile
Redo log file
Archiving
Sort area size
Tablespace (system, temporary, tablespace fragment)
Datafiles (autoextend, location)
Object (number of extent, next extent, index)
Rollback segment
Logging & tracing (alert. log, max_dump_file_size, sqlnet)
(4) Check invalid database objects
SELECT owner, object_name, object_type FROM dba_objects
WHERE status = 'invalid '.
(5) constraints that do not work
SELECT owner, constraint_name, table_name,
Constraint_type, status
FROM dba_constraints
WHERE status = 'Disabled 'AND constraint_type = 'P'
(6) Check for invalid triggers
SELECT owner, trigger_name, table_name, status
FROM dba_triggers
WHERE status = 'Disabled'
Monthly work
(1). Analyze Tables/Indexes/Cluster
Analyze table <name> estimate statistics sample 50 percent;
(2). Check the table space fragments.
Analyze database fragmentation Based on weekly checks this month and find the corresponding solution
(3). Seek opportunities for database performance Adjustment
Compare daily monitoring reports on database performance and determine whether it is necessary to adjust database performance
(4). database performance Adjustment
Adjust the performance if necessary
(5) propose the next space management plan
Based on weekly monitoring, this paper proposes an improvement method for space management.

Routine Oracle DBA management
Objective: This document provides detailed information about one or more ORACLE databases on a daily, monthly basis,
The results of the annual running status and the results of the check are displayed in the appendix of the document.
And PL/SQL code.
Directory
1. Routine Maintenance Procedures
A. Check all started instances
B. Search for some new warning logs
C. Check whether DBSNMP is running
D. Check whether the database backup is correct
E. Check whether the files backed up to the tape are correct.
F. Check whether the database performance is normal and reasonable, and whether there is sufficient space and resources.
G. Copy the document logs to the backup database.
H. Read the DBA user manual frequently.
2. Night Maintenance Program
A. Collect VOLUMETRIC Data
3. weekly maintenance
A. Find the objects that break the rules.
B. check whether any security policy violations occur.
C. view the SQL * NET log of the error location
D. archive all warning logs
E. Visit the supplier's home page frequently.
4. Monthly Maintenance Program
A. view the growth rate that harms the database
B. Review previous database optimization performance adjustments
C. view the I/O screen neck issues
D. Review FRAGMENTATION
E. Future execution plan
F. View adjustment points and Maintenance
5. Appendix
A. Monthly maintenance process
B. Night maintenance process
C. weekly maintenance process
6. References
----------------------------------------------------------------
1. Daily maintenance process
A. check whether all instances have started
Determine whether the database is available, write each instance into the log and run the daily report or run the test
File. Of course there are some operations that we want to automatically run.
Optional execution: Use the 'probe' event in the ORACLE manager to view
B. Search for the new warning log file.
1. connect to each Operating System
2. Use 'telnet 'or a comparable Program
3. Perform $ ORACLE_BASE/<SID>/bdump for each management instance.
And enables it to return to the SID of the control database.
4. Run the 'tail' command in UNIX to view alert _ <SID>. log, or
Check the warning logs of the latest period in the file in other ways
5. If some ORA_ERRORS appeared again before, record it to the database
Recover logs and study them carefully. The recovery logs of this database are in FILE
C. view the running status of DBSNMP
Check the 'dbsnmp 'processes of each managed machine and record them in the log.
In UNIX, in the command line, type ps-ef | grep dbsnmp, and two
The DBSNMP process is running. If no, restart DBSNMP.
D. Check whether the database backup is successful
E. Check whether the Backup Tape document is successful.
F. Check whether sufficient resources are available for reasonable performance.
1. check whether there is any available space in the tablespace.
For each instance, check whether there is any available space in the tablespace to meet the requirements of the current day.
. When the existing data in the database is stable, the daily data growth average
The number can also be calculated. The minimum remaining space must at least meet the daily data growth requirement.
A) Run 'free. SQL 'to check the remaining space.
B) Run 'space. SQL 'to check the percentage of available SPACE in the SPACE.
2. Check rollback segments
The status of a rollback segment is generally online. Except for some dedicated segments prepared for complex work, it is generally offline.
A) each database has a list of rollback segment names.
B) You can use V $ ROLLSTAT to query the current status of online or offline rollback segments.
C) the storage parameters and names of all rollback segments are available.
DBA_ROLLBACK_SEGS. But it is not as accurate as V $ ROLLSTAT.
3. Identify excessive growth
Check the storage parameters of the segments in the database that exceed the resource or the growth rate is too high.
A) collect information about the daily data size, which can be used
'Analyze5pct. SQL '. Skip this step if you collect information every night.
B) Check the current range. 'nr. EXTENTS. SQL 'is available '.
C) query the size of the current table.
D) query the current index size.
E) query the growth trend.
4. Determine the space range.
If the NEXT_EXTENT of the range space object is greater than the maximum range provided by the tablespace
This will affect the operation of the database. If we find this goal
Use 'alter TABLESPACE coaleid' to investigate its location or add another data file.
A) Run 'spacebound. SQL '. If they are all normal, no rows will be returned.
5. Review the process of CPU, memory, network, and hardware resource arguments
A) Check the CPU utilization and go to x: \ web \ phase2 \ default.htm => system
Metrics => CPU utilization page. The maximum CPU usage is 400.
For a period of time above 350, we need to check and study the problems.
G. Copy the archived logs to the standby database.
If there is a backup database, it is expected to copy the appropriate archived logs to the backup database.
Location, which saves the most recent data in the standby database.
H. Check the DBA user manual frequently.
If possible, read it extensively, including the DBA manual, industry magazine, news group, or email list.
-------------------------------------------------------------
Ii. Night maintenance process
Most database products will benefit from the running of check processes identified every night.
A. Collect VOLUMETRIC Data
1. Analyze plans and collect data
More Accurate Analysis and Computation and save results.
A) if you haven't done this now, use 'mk VOLFACT. SQL 'to create a table for volume determination.
B) collect the data size in the evening, and use 'analyze COMP. SQL '.
C) Collect statistical results and use 'pop VOL. SQL '.
D) Check the data when you are idle. If possible, check the data every week or every month.
I used the connection between MS EXCEL and ODBC to check the growth of data and charts.
-------------------------------------------------------------
3. weekly maintenance process
A. Search for damaged targets
1. For each given tablespace object, the NEXT_EXTENT size is the same, as shown in
12/14/98, the default NEXT_EXTENT DATAHI is 1 GB, and DATALO is 500 MB,
INDEXES is 256 MB.
A) Check NEXT_EXTENT settings and use 'nextext. SQL '.
B) Check the existing EXTENTS and use 'existext. SQL '.
2. All Tables should have unique primary keys.
A) Check the tables that do not have a primary key and can use 'no _ PK. SQL '.
B) find those primary keys that do not play a role and use 'dis _ PK. SQL '.
C) All primary keys used for indexing are unique and can be 'nonupk. SQL to check.
3. All indexes should be placed in the index tablespace. Run 'mkrebuild _ IDX. SQL'
4. The plan should be the same between different environments, especially between the test environment and the finished environment.
A) check whether the data types in the two running environments are consistent and available.
'Ype ype. SQL '.
B) Find the differences between objects in two different instances.
'Obj _ COORD. SQL '.
C) A better way is to use a tool like a scheduler manager looking for software.
B. check whether there is any problem that harms the security policy.
C. view the SQL * NET log of the error.
1. client logs.
2. server logs.
D. archive all warning logs
E. Supplier Homepage
1. ORACLE supplier
Http://www.oracle.com/
Http://technet.oracle.com/
Http://www.oracle.com/support
Http://www.oramag.com/
2. Quest Software
Http://www.quests.com/
3. Sun Microsystems
Http://www.sun.com/
----------------------------------------------------------------
4. Monthly maintenance process
A. view the growth rate that harms the database
1. Review changes in segment growth from previous records or reports to identify the hazards of segment growth
B. Review previous database optimization performance adjustments
1. Review the adjustment points of general ORACLE databases and compare previous reports to identify harmful development trends.
C. view the I/O screen neck issues
1. Check the activity of the database files in the early stage and compare the previous output to determine the trend that may cause the screen neck problem.
D. Review FRAGMENTATION
E. Plan database performance in the future
1. Compare the CPU, memory, network, and hard disk usage of ORACLE and the operating system.
To determine the trend of resource competition in the near future
2. When the system is out of scope, the performance trend should be regarded as a service level agreement.
F. Complete adjustment and Maintenance
1. Make modifications meet the need to avoid competition for system resources, including adding new resources or making the expected shutdown.
----------------------------------------------------------------
V. Appendix
A. Routine procedures
-- Free. SQL
-- To verify free space in tablespaces
-- Minimum amount of free space
-- Document your thresholds:
-- <Tablespace_name >=< amount> m
SELECT tablespace_name, sum (blocks) as free_blk, trunc (sum (bytes )/
(1024*1024) as free_m, max (bytes)/(1024) as big_chunk_k, count (*) as num_chunks
FROM dba_free_space group by tablespace_name
1. Space. SQL
-- Space. SQL
-- To check free, pct_free, and allocated space within a tablespace
-- 11/24/98
SELECT tablespace_name, largest_free_chunk
, Nr_free_chunks, sum_alloc_blocks, sum_free_blocks
, To_char (100 * sum_free_blocks/sum_alloc_blocks, '09. 99') | '%'
AS pct_free
FROM (SELECT tablespace_name, sum (blocks) AS sum_alloc_blocks
FROM dba_data_files group by tablespace_name)
, (SELECT tablespace_name AS fs_ts_name
, Max (blocks) AS largest_free_chunk
, Count (blocks) AS nr_free_chunks
, Sum (blocks) AS sum_free_blocks FROM dba_free_space
Group by tablespace_name) WHERE tablespace_name = fs_ts_name
2. analyze5pct. SQL
-- Analyze5pct. SQL
-- To analyze tables and indexes quickly, using a 5% sample size
-- (Do not use this script if you are inserting the overnight
-- Collection of volumetric data)
-- 11/30/98
BEGIN
Dbms_utility.analyze_schema ('& owner', 'estime', NULL, 5 );
END;
/
3. nr_extents. SQL
-- Nr_extents. SQL
-- To find out any object reaching <threshold>
-- Extents, and manually upgrade it to allow unlimited
-- Max_extents (thus only objects we * have CT * to be big
-- Are allowed to become big)
-- 11/30/98
SELECT e. owner, e. segment_type, e. segment_name, count (*) as nr_extents,
S. max_extents
, To_char (sum (e. bytes)/(1024*1024), '000000') as MB
FROM dba_extents e, dba_segments s
WHERE e. segment_name = s. segment_name
Group by e. owner, e. segment_type, e. segment_name, s. max_extents
HAVING count (*)> & THRESHOLD
OR (s. max_extents-count (*) <& THRESHOLD)
Order by count (*) desc
4. spacebound. SQL
-- Spacebound. SQL
-- To identify space-bound objects. If all is well, no rows are returned.
-- If any space-bound objects are found, look at value of NEXT extent
-- Size to figure out what happened.
-- Then use coalesce (alter tablespace <foo> coalesce.
-- Lastly, add another datafile to the tablespace if needed.
-- 11/30/98
SELECT a. table_name, a. next_extent, a. tablespace_name
FROM all_tables,
(SELECT tablespace_name, max (bytes) as big_chunk
FROM dba_free_space
Group by tablespace_name) f
WHERE f. tablespace_name = a. tablespace_name
AND a. next_extent> f. big_chunk
B. processing programs per night
1. mk_volfact. SQL
-- Mk_volfact. SQL (only run this once to set it up; do not run it nightly !)
-- Table UTL_VOL_FACTS
Create table utl_vol_facts (
Table_name VARCHAR2 (30 ),
Num_rows NUMBER,
Meas_dt DATE)
TABLESPACE platab
STORAGE (
Initialize 128 k
NEXT 128 k
PCTINCREASE 0
MINEXTENTS 1
MAXEXTENTS unlimited
)
/
-- Public Synonym
Create public synonym utl_vol_facts FOR & OWNER .. utl_vol_facts
/
-- Grants for UTL_VOL_FACTS
Grant select on utl_vol_facts TO public
/
2. analyze_comp. SQL
--
-- Analyze_comp. SQL
--
BEGIN
Sys. dbms_utility.analyze_schema ('& owner', 'compute ');
END;
/
3. pop_vol. SQL
--
-- Pop_vol. SQL
--
Insert into utl_vol_facts
Select table_name
, NVL (num_rows, 0) as num_rows
, Trunc (last_analyzed) as meas_dt
From all_tables -- or just user_tables
Where owner in ('& owner') -- or a comma-separated list of owners
/
Commit
/
C. Weekly Processing
1. nextext. SQL
--
-- Nextext. SQL
--
-- To find tables that don't match the tablespace default for NEXT extent.
-- The implicit rule here is that every table in a given tablespace shold
-- Use the exact same value for NEXT, which shoshould also be the tablespace's
-- Default value for NEXT.
--
-- This tells us what the setting for NEXT is for these objects today.
--
-- 11/30/98
SELECT segment_name, segment_type, ds. next_extent as Actual_Next
, Dt. tablespace_name, dt. next_extent as Default_Next
FROM dba_tablespaces dt, dba_segments ds
WHERE dt. tablespace_name = ds. tablespace_name
AND dt. next_extent! = Ds. next_extent
AND ds. owner = UPPER ('& owner ')
Order by tablespace_name, segment_type, segment_name
2. existext. SQL
--
-- Existext. SQL
--
-- To check existing extents
--
-- This tells us how many of each object's extents differ in size from
-- The tablespace's default size. If this report shows a lot of different
-- Sized extents, your free space is likely to become fragmented. If so,
-- This tablespace is a candidate for reorganizing.
--
-- 12/15/98
SELECT segment_name, segment_type
, Count (*) as nr_exts
, Sum (DECODE (dx. bytes, dt. next_extent, 0, 1) as nr_illsized_exts
, Dt. tablespace_name, dt. next_extent as dflt_ext_size
FROM dba_tablespaces dt, dba_extents dx
WHERE dt. tablespace_name = dx. tablespace_name
AND dx. owner = '& owner'
Group by segment_name, segment_type, dt. tablespace_name, dt. next_extent
3. No_pk. SQL
--
-- No_pk. SQL
--
-- To find tables without PK constraint
--
-- 11/2/98
SELECT table_name
FROM all_tables
WHERE owner = '& owner'
MINUS
SELECT table_name
FROM all_constraints
WHERE owner = '& owner'
AND constraint_type = 'P'
4. disPK. SQL
--
-- DisPK. SQL
--
-- To find out which primary keys are disabled
--
-- 11/30/98
SELECT owner, constraint_name, table_name, status
FROM all_constraints
WHERE owner = '& owner' AND status = 'Disabled' AND constraint_type = 'P'
5. nonuPK. SQL
--
-- NonuPK. SQL
--
-- To find tables with nonunique PK indexes. Requires that PK names
-- Follow a naming convention. An alternative query follows that
-- Does not have this requirement, but runs more slowly.
--
-- 11/2/98
SELECT index_name, table_name, uniqueness
FROM all_indexes
WHERE index_name like '& PKNAME %'
AND owner = '& owner' AND uniqueness = 'nonunique'
SELECT c. constraint_name, I. tablespace_name, I. uniqueness
FROM all_constraints c, all_indexes I
WHERE c. owner = UPPER ('& owner') AND I. uniqueness = 'nonunique'
AND c. constraint_type = 'p' AND I. index_name = c. constraint_name
6. mkrebuild_idx. SQL
--
-- Mkrebuild_idx. SQL
--
-- Rebuild indexes to have correct storage parameters
--
-- 11/2/98
SELECT 'alter Index' | index_name | 'rebuilt'
, 'Tablespace INDEXES storage'
| '(Initial 256 K next 256 K pctincrease 0 );'
FROM all_indexes
WHERE (tablespace_name! = 'Indexes'
OR next_extent! = (256*1024)
)
AND owner = '& owner'
/
7. datatype. SQL
--
-- Datatype. SQL
--
-- To check datatype consistency between two environments
--
-- 11/30/98
SELECT
Table_name,
Column_name,
Data_type,
Data_length,
Data_precision,
Data_scale,
Nullable
FROM all_tab_columns -- first environment
WHERE owner = '& owner'
MINUS
SELECT
Table_name,
Column_name,
Data_type,
Data_length,
Data_precision,
Data_scale,
Nullable
FROM all_tab_columns @ & my_db_link -- second environment
WHERE owner = '& owner2'
Order by table_name, column_name
8. obj_coord. SQL
--
-- Obj_coord. SQL
--
-- To find out any difference in objects between two instances
--
-- 12/08/98
SELECT object_name, object_type
FROM user_objects
MINUS
SELECT object_name, object_type
FROM user_objects @ & my_db_link

 

This article from the CSDN blog, reproduced please indicate the source: http://blog.csdn.net/long_li/archive/2005/08/04/445627.aspx

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.