使用dbms_rowid包获得rowid的详细信息
-- ROWID_INFO breaks ROWID into its components and returns them: -- -- rowid_in - ROWID to be interpreted -- rowid_type - type (restricted/extended) -- object_number - data object number (rowid_object_undefined for restricted) -- relative_fno - relative file number -- block_number - block number in this file -- file_number - file number in this block -- ts_type_in - type of tablespace which this row belongs to -- 'BIGFILE' indicates Bigfile Tablespace -- 'SMAL
dbms_metadata.get_ddl的妙用
-- GET_DDL: Return the metadata for a single object as DDL. -- This interface is meant for casual browsing (e.g., from SQLPlus) -- vs. the programmatic OPEN / FETCH / CLOSE interfaces above. -- PARAMETERS: -- object_type - The type of object to be retrieved. -- name - Name of the object. -- schema - Schema containing the object. Defaults to -- the caller's schema. -- version - The version of the objects' metadata. -- model - The object model for the metadata. -- transform - XSL-T transform to be
DBMS_JOB
DBMS_JOB DBMS_JOB subprograms schedule and manage jobs in the job queue. See Also: For more information on the DBMS_JOB package and the job queue, see Oracle9i Database Administrator's GuideThis chapter discusses the following topics:Requirements Using the DBMS_JOB Package with Oracle Real Application Clusters Summary of DBMS_JOB Subprograms RequirementsThere are no database privileges associated with jobs. DBMS_JOB does not allow a user to touch any jobs except their own.Using the DBMS_JOB Pack
游标的使用1
declarel_dbid number;l_instance_number number;l_db_count number := 0;l_instance_count number := 0;l_dummy varchar2(1);l_cursor integer;l_sql varchar2(2000);update_not_reqd exception;[@more@]begin-- check to see if the PK and HV indexes existselect count(1)into l_dummyfrom dba_ind_columnswhere table_owner = 'PERFSTAT'and table_name = 'STATS$SQL_PLAN_USAGE'and index_name in ('STATS$SQL_PLAN_USAGE_PK','STATS$SQL_PLAN_USAGE_HV')and column_name in ('SNAP_ID','DBID','INSTANCE_NUMBER','HASH_VALUE','TEX
partition examples
range_partitioning hash_partitioning list_partitioningcomposite_partitioning[@more@]Range Partitioning ExampleThe sales table in the sample schema sh is partitioned by range. The following example shows an abbreviated variation of the sales table (constraints and storage elements have been omitted from the example):CREATE TABLE range_sales ( prod_id NUMBER(6) , cust_id NUMBER , time_id DATE , channel_id CHAR(1) , promo_id NUMBER(6) , quantity_sold
日志分析logmnr使用方法【转】
一、安装LogMiner工具,以下两个脚本以SYSDBA身份运行 @$ORACLE_HOMErdbmsadmindbmslm.sql; @ $ORACLE_HOMErdbmsadmindbmslmd.sql; 第一个脚本用来创建DBMS_LOGMNR包,该包用来分析日志文件。 第二个脚本用来创建DBMS_LOGMNR_D包,该包用来创建数据字典文件。[@more@]二、使用LogMiner工具 下面将详细介绍如何使用LogMiner工具。 1、创建数据字典文件(data-dictionary) 1).首先在init.ora初始化参数文件中,指定数据字典文件的位置,也就是添加一个参数UTL_FILE_DIR,该参数值为服务器中放置数据字典文件的目录。如:UTL_FILE_
DATA GURAD物理STANDBY建立【转】
=========================================================== 作者: yangtingkun(http://yangtingkun.itpub.net)发表于: 2007.02.27 19:37分类: ORACLE 出处: http://yangtingkun.itpub.net/post/468/265309--------------------------------------------------------------- [@more@]这两天看完物理STANDBY环境的建立,感觉建立过程还是比较容易的,简单记录一下操作步骤。由于是第一次建立STANDBY环境,就不搞那么复杂了,主库和从库分别在两台服务器上,而且所有的路径完全一致。STANDBY数据库一般都是通过主库的备份建立的。这里只介
绑定变量小例子
PROCEDURE SetAlarmInfoLog(strStcdt in char, strStnm in varchar2, strYMDHM in char, V_Cause in varchar2, AlarmLevel in char, V_AlarmType in varchar2) IS str varchar2(150); V_CURSOR_Id integer; V_RowsUpdate integer; v_Count int; BEGIN select count(0) into v_Count from AlarmLog where stcdt=strStcdt and YMDHM=to_date(strYMDHM,'yyyy-mm-dd hh24:mi:ss') and upper(trim(AlarmType))=upper(trim(V_
statspack report分析[转帖]
虽然不完整,但看看还是很有好处的,关键是中文滴(1) 调整的先后次序 1. Tune the design. -- Application designers 2. Tune the application. -- Application developers 3. Tune memory. 4. Tune I/O. 5. Tune contention. 6. Tune the operating system. 转自:http://bbs.chinaunix.net/viewthread.php?tid=915444[@more@]Statspack分析报告详解: statspack 输出结果中必须查看的十项内容 1、负载间档(Load profile) 2、实例效率点击率(Instance efficiency hit ratios) 3、首要的5个等待事件(Top 5 wait events) 4、
非空闲的等待事件-db file parallel read
与其名称暗示相反,该事件不与任何并行操作相关(如:并行DML操作或并行查询)。 在进行数据库恢复操作期间,一部分需要恢复并且需要更改的数据块从数据文件中并行读取时产生的事件。 参数说明: 事件号:191事件名:db file parallel read参数一:读取文件的号码参数二:读取的总块数参数三:IO请求的总数等待时间:无超时 [@more@]
非空闲的等待事件-db file single write
对数据文件头的更新,以刷新数据文件记录的检查点信息.[@more@]
非空闲的等待事件-SQL*Net message to client
当会话发送一个消息至客户端时,而客户端太忙造成不能接受消息的传送,使得服务器端的会话等待 或 网络层延迟而使消息传送花费更长的时间 参数说明: 参数一:客户端连接使用的网络驱动器的类型参数二:发送到客户端的字节数等待时间:无超时 [@more@]
非空闲的等待事件-SQL*Net message from client
当会话等待来自CLIENT的消息到达时提交该事件。一般而言,这意味着会话处于空闲状态。 在不与用户操作交互的批处理环境中,若此事件上的等待时间过多,则表示在应用程序代码中或网络层存在低效率因素。 但该事件上的过高等待时间并不降低数据的性能的情况下,可以查觉出并不是真正的数据库问题 参数说明: 参数一:显示客户端网络驱动的类型。参数二:来自客户端的字节数等待时间:无超时 [@more@]
非空闲的等待事件-log file sequential read
当进程等待从REDO文件中读入块时会产生该等待事件。 ARCH进程在读取REDO文件时会遭遇此等待事件。 参数说明: 事件号:174事件名:log file sequential read参数一:REDO日志组中重做日志文件的相对序列号。参数二:开始读入的块号参数三:块数等待时间:完成请求读取的IO所占用的实际时间。[@more@]
非空闲的等待事件-log file parallel write
log file parallel write (SYSTEM I/0类) LGWR在该事件上等待写入的完成。2. 3秒写入一次>> 在满足>> 在日志缓冲区有>> 由3.LGWR会等待该事件的完成,用户会话则等待
非空闲的等待事件-log buffer space
log buffer space(Configuration类)当会话由于日志缓冲区空间不足而无法将重做日志条目复制到日志缓冲区时,会话将在log buffer space事件上等待。LGWR负责写出重做条目,腾出日志缓冲区空间。 当会话必须等待日志缓冲区中的空间变成可用以写入新的信息时产生该事件。 LGWR进程周期性地从日志缓冲区写入重做日志文件,使得日志缓冲区可以重复可以。 该等待事件表示:应用程序生成重做日志的速度比LGWR进程将其写入重做日志文件的速度快。[@more@]通过查询v$sesstat和v$sysstat查询统计""可跟踪进程或系统必须等待空间的次数。 -
非空闲的等待事件-log file sync
log file sync(Commit类)ORACLE在SGA中的日志缓冲区中记录事务和块改变,通过以各种时间条件将内容写入到日志文件,LGWR负责这项工作,写入的时间条件是: A. 每隔3秒 B. 当日志缓冲区的1/3已满或具有1MB的重做条目时 C. 当用户提交或回滚事务时 D. 当DBWR进程给LGWR发出信号(当DBWR将脏块写入到数据文件之前写入)由用户提交或回滚的写入称为"同步写入",其他的称为"后台写入"。log file sync只和同步写入有关。用户会话从来不需要等待后台写入的完成。 当用户会话通过提交或回滚完成一个事务时,必须用LGWR进程将会话
非空闲的等待事件-log file switch completion
当日志文件转换完成时产生的等待事件 无参数 等待时间:1秒 [@more@]
非空闲的等待事件-log file switch(checkpoint imcomplete)
由于对REDO的检查点进程未完成而使日志文件的转换变得不可能。 无参数 等待时间:1秒 [@more@]
非空闲的等待事件-log file switch(archiving needed)
日志文件转换,必须归档。在使用归档方式下的数据库时,只有arch进程通过将REDO文件复制到归档日志文件中(完成归档),LGWR进程才可以改写或转换该重做日志文件。 对归档文件的写入失败,可能会中止归档进程,在警告日志中报告。 等待时间:1秒 无参数 [@more@]