oracle帮助文档——DBA's Guide

/3 Starting Up and Shutting Down


3.3  Shutting Down a Database

Shutting Down with the Abort Mode


/6 Managing Memory



6.2 Configuring Memory Manually


手动PGA内存管理: 
在10版本时候:PGA以SORT_AREA_SIZEHASH_AREA_SIZEBITMAP_MERGE_AREA_SIZECREATE_BITMAP_AREA_SIZE
11的时候:PGA_AGGREGATE_TARGET为非零
因此,Oracle强烈建议您启用自动PGA内存管理





/8 监控数据库操作

8.1 Monitoring Errors and Alerts
跟踪文件和警报日志Monitoring Errors:



Server-Generated Alerts监控Database Operations
(1)可以基于阈值级别,或者仅仅因为事件发生而发出
(2)alter被发送到sys所有的redefined persistent queue ALERT_QUE




8.2 Monitoring Performance


/11 Managing Diagnostic Data

11.1 诊断基础架构
问题对象 :code bugs, metadata corruption, and customer data corruption
组件
自动诊断存储库(ADR)  USER_DUMP_DEST, DIAGNOSTIC_DEST设置位置的参数已经被弃用,可以across multiple instances.
警报日志,XML文件
跟踪文件,转储和核心文件 :DUMP是响应于事件(例如事件)的诊断数据的一次性输出.区别于连续性输出的trace
其他ADR内容:健康监视器报告,数据修复记录,SQL测试用例,事件包
企业经理支持工作台
ADRCI命令行实用程序


位置:
diag / product_type / product_id / instance_id
如果环境变量设置,则认为ORACLE_BASE
如果未设置则为:$ORACLE_HOME/log

alert The XML-formatted alert log
cdump Core files
incident Multiple subdirectories, where each subdirectory is named for a particular incident, and where each contains dumps pertaining only to that incident
trace Background and server process trace files, SQL trace files, and the text-formatted alert log
(others) Other subdirectories of ADR home, which store incident packages, health monitor reports, and other information
11.2 调查,报告和解决问题
软件包: DBMS_HM和DBMS_SQLDIAG
流程:
 


 
11.3 Problems with the Enterprise Manager Support Workbench
(1)可以先自助-健康检查/结构完整性检查
(2)收集严重问题,打包上床,追踪SR号
 
 

11.7 运行健康检查与健康监视器
作用: 检查f ile corruptions, physical and logical block corruptions, undo and redo corruptions, data dictionary corruptions,(完整性一致性)
 





/14 Managing Tablespaces

14.1 Guidelines for Managing Tables


Table Compression: 
优点:
1、saves disk space, 
2、reduces memory use in the database buffer cache, 
3、and can significantly speed query execution during reads.
缺点:
Compression has a cost in CPU overhead for data loading and DML.However, this cost might be offset by reduced I/O requirements.


14.2 Creating Tablespaces
(1)bitmaps stored in header files
(2)对数据字典依赖少
(3)不需要合并可用空间

创建本地管理的表空间:CREATE TABLESPACE lmtbsb DATAFILE'/u02/oracle/data/lmtbsb01.dbf'SIZE 50M EXTENT MANAGEMENT LOCAL AUTOALLOCATE;
创建Bigfile表空间:CREATE BIGFILE TABLESPACE bigtbs
压缩表空间:CREATE TABLESPACE ... DEFAULT COMPRESS FOR OLTP ... ;
加密表空间:CREATE TABLESPACE securespace DATAFILE'/u01/app/oracle/oradata/orcl/secure01.dbf'SIZE 100M ENCRYPTION DEFAULT STORAGE(ENCRYPT);
    在undo tablespace, to the redo logs, and to any temporary tablespace就自动加密,不需要单独创建空间
临时表空间:CREATE TEMPORARY TABLESPACE lmtemp TEMPFILE'/u02/oracle/data/lmtemp01.dbf' SIZE 20M REUSE EXTENT MANAGEMENT LOCAL UNIFORM SIZE 16M;
创建表空间组:CREATE TEMPORARY TABLESPACE lmtemp2 TEMPFILE '/u02/oracle/data/lmtemp201.dbf' SIZE 50M TABLESPACE GROUP group1;

14.7 Altering and Maintaining Tablespaces


shrink本地管理的临时表空间:大型排序时会占大量的temp;ALTER TABLESPACE lmtemp1 SHRINK SPACE KEEP 20M;


/17 Managing Space for Schema Objects

17.2 Managing Resumable Space Allocation
resumable space allocation定义:large database执行 space allocation failures时,可以   suspending, and later resuming
工作原理:(1)ALTER SESSION ENABLE RESUMABLE+ RESUMABLE_TIMEOUT非零
操作:(1)session enable时, ALTER SESSION ENABLE RESUMABLE  statement, and the timeout value is zero.
                  (instance)system level时不需要指定? ALTER SYSTEM SET RESUMABLE_TIMEOUT=0;



/19管理Schema Objects的 Space


19.2 Managing Resumable Space Allocation

启用和禁用可恢复空间分配: RESUMABLE_TIMEOUT 初始化参数设置为会话的非零值
ALTER SESSION ENABLE RESUMABLE TIMEOUT 3600 NAME 'insert into table';
默认值为: NAME' User username(userid)Session sessionid,Instance instanceid''。


19.3  Reclaiming Wasted Space

Shrinking Database Segments online
(1)DML操作和查询可以在收缩阶段发出,只在收缩阶段短时间终止
(2)因为降低高水位线,ALTER TABLE... ENABLE ROW MOVEMENT
(3)能在ASSM本地管理执行;除了 IOT映射表; 具有基于rowid的实例化视图的表; 具有基于功能的索引的表; SECUREFILE LOB; 压缩表
(4)cam pact回推迟空间释放;cascade扩展到相关段,索引也将缩小,

/22 Managing Tables

22.2 Guidelines for Managing Tables
Table Compression:Compression data loading 和DML有CPU开销增加 ;可能会被较少的IO抵消;
可压缩的操作:(1) 单行或数组插入和更新
                          (2)以下直接路径INSERT方法: 直接路径SQL * Loader CREATE TABLE AS SELECT 声明; 并行INSERT语句 INSERT带有APPEND或APPEND_VALUES暗示的声明

22.3 Creating Tables


创建临时表:ON COMMIT   DELETE ROWS   定于事务,提交后截断表| 
                     PRESERVE ROWS 定于会话,终止会话时截断表     
(1)索引可以在临时表上创建。它们也是临时的
(2)临时表中的rows存储在用户创建的默认临时表空间中,也可以 CREATE GLOBAL TEMPORARY TABLE分配到另一个表空间 .
全局临时表与一般临时表的区别:不初始化空间,只有insert时才分配表空间,commit后,对其他用户可见

/26 Managing Automated Database Maintenance Tasks

26.1 关于自动维护任务
1、自动优化统计信息的收集  sql tuning guide:收集所有模式对象的统计信息
2、自动段顾问:段的随便整理
3、自动SQLtuning顾问:
26.2 关于维护窗口
自动维护作业的前缀:ora$at_
(1)每个维护任务创建一个Oracle Scheduler作业,
(2)作业完成后,将从Oracle Scheduler作业系统中删除。但是存在在 Scheduler job history
(3)除了SQL tuning adviser 其他每4个小时重启一次?
26.3 配置自动维护任务
可以全部window的任务:EXECUTE DBMS_AUTO_TASK_ADMIN.DISABLE;或者ENABLE
可以某个window的任务:begin window_name=>'monday_window'
26.4 配置维护Windows
begin
  dbms_scheduler.create_window(                                    --remove_group_mumber
    window_name =>'EARLY_MORNING_WINDOW',
    duration => numtodsinterval(1,'hour'),
    resource_plan =>'DEFAULT_MAINTENANCE_PLAN',
    repeat_interval =>'FREQ = DAILY; BYHOUR = 5; BYMINUTE = 0; BYSECOND = 0');
  dbms_scheduler.add_group_member(
    group_name =>'MAINTENANCE_WINDOW_GROUP',
    member =>'EARLY_MORNING_WINDOW');
end;
/
26.5 配置自动维护任务的资源分配
默认 maintenance windows use the resource plan,   DEFAULT_MAINTENANCE_PLAN
消费者群体/子计划 1级 2级 最大使用限制
ORA$AUTOTASK_SUB_PLAN - 25% 90
ORA$DIAGNOSTICS - 5% 90
OTHER_GROUPS - 70%  
SYS_GROUP 75% -  
26.6 自动维护任务参考
7个预定于维护window
5个维护DBA_AUTODESK

/27  Managing Resources with Oracle Database Resource Manager

27.1 简介

功能:
(1)确保某些会话达到最少量的CPU。
(2)不同的用户和应用程序来分配可用的CPU
(3)限制一组用户执行的任何操作的并行度。
(4)管理并行语句的顺序
(5)限制一组用户可以使用的并行服务器的数量
(6)Create an active session pool.
(7)管理失控的会话或呼叫
(8)限制优化器估计的运行时间超过指定限制
(9)限制会话空闲的时间量
(10)动态地更改资源计划


27.5 Creating a Complex Resource Plan
步骤
1:创建pending area,提交后其他用户才能创建
2:创建,修改或删除consumer groups.
3:创建 resource plan.
4:创建resource plan directives.
5:验证待处理区域Validate the pending area.。
6: Submit the pending area.



27.11    查看资源管理器
????差看不到 V$RSRC_CONSUMER_GROUP  里面有个cpu_wait_time??


/28  调度程序schedule概念

 
28.2 Scheduler的概念
program:类型: STORED_PROCEDURE,,PLSQL_BLOCK或EXTERNAL,其中EXTERNAL指示外部可执行文件。

Job Classes: 
Windows: 
Windows work with job classes to control resource allocation

Windows help define the resources that are allocated to jobs
Description of Figure 28-2 follows


28.3 更多关于job
28.3.1 Job Categories类别有:
数据库作业: job_type 设置为 'PLSQL_BLOCK' 'STORED_PROCEDURE' job_action 包含PL / SQL匿名块
外部工作: 'EXECUTABLE' job_action 包含 完整操作系统相关路径
多目标作业
链工作: 'CHAIN'
独立工作
轻量级的工作:(1) LIGHTWEIGHT, 其他作业样式是“  REGULAR ”,(2) not schema objects因此您无法向其授予权限,(3) 必须引用程序对象(程序)来指定作业动作 )(4)不产生redo?(5)必须使用模板??(6)有更少的元数据
28.3.2 Job Instances(a specific run of a job)
不存在的时候job链就不会complete

28.4 Scheduler Architecture
       以下是图28-6的说明

协调员和job log无关

/29 Scheduling Jobs with Oracle Scheduler



29.2 Creating, Running, and Managing Jobs

SET_JOB_ANYDATA_VALUE用于不能用VARCHAR2字符串表示的复杂数据类型
停止作业: When a job is stopped, only the current transaction is rolled back.This can cause data inconsistency.


29.4 Creating and Managing Schedules to Define Jobs
FREQ=MONTHLY; INTERVAL=2; BYMONTHDAY=15;    没有rundate

29.6 创建管理Job Chains
Chains are the means by which you can implement dependency based scheduling执行基于调度的附属物??more than one dependency.
步骤:(1)create chain name;
           (2)define program_name=>‘mychian’或者'myprogram'
                                           A Scheduler program object (program)
                                           Another chain (a nested chain)
                                           An event schedule, inline event, or file watcher



/34 Distributed Transactions Concepts

初始化session,仅控制local?














  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值