Managing Snapshot : Dropping Snapshots
You can drop a range of snapshots using the DROP_SNAPSHOT_RANGE procedure. To view a list of the snapshot Ids along with database Ids, check the DBA_HIST_SNAPSHOT view. For example, you can drop the following range of snapshots:BEGIN DBMS_WORKLOAD_REPOSITORY.DROP_SNAPSHOT_RANGE (low_snap_id => 22, high_snap_id => 32, dbid => 3310949047);END;/In the example, the range of snapshot Ids to drop is specified from 22 to 32. The optional database identifier is 33109
Managing Snapshot : Creating Snapshots
You can manually create snapshots with the CREATE_SNAPSHOT procedure if you want to capture statistics at times different than those of the automatically generated snapshots. For example:BEGIN DBMS_WORKLOAD_REPOSITORY.CREATE_SNAPSHOT ();END;/In this example, a snapshot for the instance is created immediately with the flush level specified to the default flush level of TYPICAL. You can view this snapshot in the DBA_HIST_SNAPSHOT view.[@more@]
Interpreting Statistics
Some pitfalls are discussed in the following sections:■ Hit ratios■ Wait events with timed statistics■ Comparing Oracle statistics with other factors■ Wait events without timed statistics■ Idle wait events■ Computed statistics[@more@]
UNIX下收集操作系统统计数据
CPU : sar, vmstat, mpstat, iostatMemory : sar, vmstatDisk : sar, iostatNetwork : netstat[@more@]
Disk Statistics
Measure the normal performance of the I/O system; typical values for a single block read range from 5 to 20 milliseconds, depending on the hardware used. If the hardware shows response times much higher than the normal performance value, then it is performing badly or is overworked. This is your bottleneck. If disk queues start to exceed two, then the disk is a potential bottleneck of the system. 正常的磁盘读取单个数据块在5-20毫秒之间.如果disk queues超过2个,那么磁盘有可能成为系统的瓶颈[@more@]
操作系统统计数据分类
Operating system statistics include the following:■ CPU Statistics■ Virtual Memory Statistics■ Disk Statistics■ Network Statistics[@more@]
CPU Statistics
On an Oracle data server system, where there is generally only one application running, the server runs database activity in user space. Activities required to service database requests (such as scheduling, synchronization, I/O, memory management, and process/thread creation and tear down) run in kernel mode. In a system where all CPU is fully utilized, a healthy Oracle system runs between 65% and 95% in user space. The V$OSSTAT view captures machine level information in the database, making it
V$STATNAME 视图中各class的含义
■ 1 - User■ 2 - Redo■ 4 - Enqueue■ 8 - Cache■ 16 - OS■ 32 - Real Application Clusters■ 64 - SQL■ 128 - Debug不明白我自己机器上还有class为40,72的是什么意思[@more@]
V$ACTIVE_SESSION_HISTORY 视图中包含的信息
The data present in ASH can be rolled up on various dimensions that it captures, including the following:■ SQL identifier of SQL statement■ Object number, file number, and block number■ Wait event identifier and parameters■ Session identifier and session serial number■ Module and action name■ Client identifier of the session■ Service hash identifier[@more@]
DB Time小结
This statistics represents the total time spent in database calls and is a indicator of the total instance workload. It is calculated by aggregating the CPU and wait times of all sessions not waiting on idle wait events (non-idle user sessions). DB time is measured cumulatively from the time that the instance was started. Because DB time it is calculated by combining the times from all non-idle user sessions, it is possible that the DB time can exceed the actual time elapsed since the instance s
Time Model Statistics
可从V$SESS_TIME_MODEL或者V$SYS_TIME_MODEL动态视图中获得时间类指标的统计数据.V$SESS_TIME_MODEL displays the session-accumulated time for various operations. The time reported is the total elapsed or CPU time (in microseconds). Any timed operation will buffer at most 5 seconds of time data. Specifically, this means that if a timed operation (such as SQL execution) takes a long period of time to perform, the data published to this view is at most missing 5 seconds of the time accumulated for the op
Wait Events的分类及分类依据
To enable easier high-level analysis of the wait events, the events are grouped into classes. The wait event classes include: Administrative, Application, Cluster, Commit, Concurrency, Configuration, Idle, Network, Other, Scheduler, System I/O, and User I/O.The wait classes are based on a common solution that usually applies to fixing a problem with the wait event. For example, exclusive TX locks are generally an application level issue and HW locks are generally a configuration issue. The follo
Restrictions on Altering Temporary Tables
You can modify, drop columns from, or rename a temporary table. However, for a temporary table you cannot:■ Add columns of nested table type. You can add columns of other types.■ Specify referential integrity (foreign key) constraints for an added or modified column.■ Specify the following clauses of the LOB_storage_clause for an added or modified LOB column: TABLESPACE, storage_clause, logging_clause, allocate_extent_clause, or deallocate_unused_clause.■ Specify the physical_attributes_clau
Building a Dynamic Oracle ETL Procedure
参阅http://www.orafaq.com/node/1902[@more@]
cache buffers chains vs cache buffers lru chain
http://luckysea.itpub.net/post/5481/323246cache buffers chains当一个数据块读入sga区,相应的buffer header会被放置到hash列表上,我们称其这hash chains,chain在中文的意为链条或串的意思,表达就是关连性.如果一个进程想访问或修改hash chain上的block,它首先要获得"cache buffers chains" latch。cache buffers chains latch等待高大体有两个方面:1、写的比较差的sqlcache buffers chains latch很大程度与逻辑读有关,所以要观注v$sql中BUFFER_GETS/EXECUTIONS大的语句。同时每一个逻辑读需要一个latch get 操作及一个cp
序列可以使用及不能使用的场合
可以在下列场合中使用:1. VALUES clause of INSERT statements2. The SELECT list of a SELECT statement3. The SET clause of an UPDATE statement而不能在下列场合使用:■ A subquery■ A view query or materialized view query■ A SELECT statement with the DISTINCT operator■ A SELECT statement with a GROUP BY or ORDER BY clause■ A SELECT statement that is combined with another SELECT statement with the UNION, INTERSECT, or MINUS set operator■ The WHERE clause of a SELECT statement■ DEFAULT value of a
DBMS SCHEDULER
http://www.orafaq.com/wiki/DBMS_SCHEDULERDBMS SCHEDULER is a more sophisticated job scheduler introduced in Oracle 10g. The older job scheduler, DBMS_JOB, is still available.Contents * 1 Create a job * 2 Remove a job * 3 Run a job now * 4 Change job attributes * 5 Monitoring jobsCreate a jobBEGIN DBMS_SCHEDULER.CREATE_JOB ( job_name => 'my_java_job', job_type => 'EXECUTABLE', job_action => '/usr/bin/java myClass', repeat_interv
Rename Tablespace in Oracle database 10g
Renaming permanent and temporary tablespaces is now allowed in Oracle 10g (except for SYSTEM and SYSAUX) using the following command. ALTER TABLESPACE ts_current_name RENAME TO ts_new_name;The tablespace and all it's datafiles must be online and the database must have a COMPATIBLE setting of 10.0.0 or greater.If the tablespace is read-only the datafile headers are not altered to reflect the name change and a message is written to the alert log to notify you of this fact. The impact on recover
RMAN progress and what it is waiting for scripts
Link From : http://www.dba-village.com/village/dvp_scripts.ScriptDetails?ScriptIdA=4688REM RMAN Progressalter session set nls_date_format='dd/mm/yy hh24:mi:ss'/select SID, START_TIME,TOTALWORK, sofar, (sofar/totalwork) * 100 done,sysdate + TIME_REMAINING/3600/24 end_atfrom v$session_longopswhere totalwork > sofarAND opname NOT LIKE '%aggregate%'AND opname like 'RMAN%'/REM RMAN wiatsset lines 120column sid format 9999column spid format 99999column client_info format a25column event format a30c
Speedup Datapump Import
use parameter exclude=statistics没有实验 暂且记录[@more@]