move and shrink table
http://www.cnblogs.com/rootq/archive/2009/02/01/1381760.html[@more@]
检查表碎片
select t.table_name, avg_row_len * num_rows / (1 - pct_free / 100) / 8192 actual_block, alloc_block, 1 - ((avg_row_len * num_rows / (1 - pct_free / 100) / 8192) / alloc_block) percen, 'alter table '||t.table_name||'enable row movement'||';' enable_row, 'alter table '||t.table_name||'shrink space'||';' ddl_shrink from (select segment_name, sum(blocks) alloc_block from user_extents having sum(blocks) > 8 group by segment_n
Oracle System Event Triggers
General Data Dictionary Objects dba_triggers all_triggers user_triggers trigger$ Related System Privileges administer database trigger alter any trigger create trigger create any trigger drop any trigger System Event Trigger Types AFTER STARTUP BEF
sys_context
Actions As SYS Note: USERENV is an Oracle provided namespace that describes the current session. Syntax SELECT sys_context('<namespace>', '<parameter>', <length>); FROM dual; Attribute Return Value ACTION Identifies the position in the module (application name) and is set through the DBMS_APPLICATION
wait events
1. What are wait events? Wait events are characteristic parts of the Oracle kernel source code that can contain Oracle sessions during execution. Oracle provides statistical information on the wait events, which comprises the following components: Name of the wait eventOptional: Up to three parameters of different importance depending on the wait event. 2. What is the connection between wait events and database performance? The database response time is largely determined by th
perl教程
http://man.ddvip.com/web/perl/index.htm[@more@]
oracle 11g rman backup script
CONFIGURE CONTROLFILE AUTOBACKUP on;CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO COMPRESSED BACKUPSET;CONFIGURE CHANNEL 1 DEVICE TYPE DISK MAXPIECESIZE 1G;CONFIGURE CHANNEL 2 DEVICE TYPE DISK MAXPIECESIZE 1G;CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 4 DAYS;SHOW ALL;CROSSCHECK BACKUP DEVICE TYPE DISK;CROSSCHECK BACKUP OF CONTROLFILE;CROSSCHECK ARCHIVELOG ALL;DELETE NOPROMPT EXPIRED BACKUP DEVICE TYPE DISK COMPLETED BEFORE 'SYSDATE-5';DELETE FORCE NOPROMPT EXPIRED BACKUP OF CONTR
ORACLE11GR2 For Linux RAC安装笔记
操作系统开发包栏全都安装 公共,私有网卡全都在安装操作系统的时候进行ip地址的设置 开启telnet ftp 安装中不使用防火墙和selinux gateway地址要设置对 时间要矫正 私有网卡不可以用反线连接 rsh rlogin 要选装 环境 oracle 11.2.0.1.0 grid+database 64bit oracle enterprise server linux 5.4 64bit 设置到init 3 取消sendmail 设置root到中文 #################################### 安装中需要选择的栏 Desktop Environments GNOME Desktop Environment Applications Editors
oracle10g shrink space 降低HWM
常用指令: alter table xxx shrink space; 收缩表 alter table xxx shrink space compact;保持HWM alter table xxx shrink space cascade; 收缩表及相关索引 alter index xxx shrink space; 收缩索引 但有几个条件需要注意: 1)该段所位的表空间必须使用ASSM管理,即自动段空间管理 2)必须启用表的ROW MOVEMENT 可能带来的影响: 1) 由于在收缩期间,在块之间移动的行,ROWID可能会改变,所以对于依赖ROWID编码语句或者应用,则会出问题 2)索引不受影响
Troubleshooting Oracle ClusterwareThis appendix introduces
F Troubleshooting Oracle ClusterwareThis appendix introduces monitoring the Oracle Clusterware environment and explains how you can enable dynamic debugging to troubleshoot Oracle Clusterware processing, and enable debugging and tracing for specific components and specific Oracle Clusterware resources to focus your troubleshooting efforts.This appendix contains the following topics:•Monitoring Oracle Clusterware•Dynamic Debugging•Component Level Debugging•Oracle Clusterwa
oracle 11g 11.1.0.6.0升级到11g 11.1.0.7.0 for aix 5L操作步骤
1.运行收集信息工具,里面会记录相关信息,比如用到的系统表空间是否足够 Start the database, either in normal mode or in upgrade mode:SQL> STARTUPorSQL> STARTUP UPGRADESet the system to spool results to a log file for later analysis:SQL> SPOOL upgrade_info.logRun the Pre-Upgrade Information Tool:SQL> @?/rdbms/admin/utlu111i.sqlTurn off the spooling of script. results to the log file:SQL> SPOOL OFF输出的信息如下:Oracle Database 11.1 Pre-Upgrade Information Tool 06-15-2007 09:14:02
mount windows shared disk
# mount -t cifs -o username=xxx,password=xxx //hostname/dir /mnt/tmp[@more@]# mount -t cifs -o username=xxx,password=xxx //hostname/dir /mnt/tmp
PL/SQL
create or replace package csiowner.LINE_OF_BALANCE authid current_user as g_column CONSTANT NUMBER := 50; p_part_nbr VARCHAR2(100); p_from_date VARCHAR2(50); p_to_date VARCHAR2(50); FUNCTION check_shared_part(p_part_nbr VARCHAR2) RETURN VARCHAR2; PROCEDURE insert_parent_part; PROCEDURE gen_report_summary; PROCEDURE gen_report_details; PROCEDURE cal_order_qty; PROCEDURE update_total_qty; PROCEDURE update_qty_for_abs;
Flashback New Features and Enhancements in Oracle Database 10g
http://www.oracle-base.com/articles/10g/Flashback10g.php[@more@]
windows drop em
DECLARE CURSOR c1 IS SELECT owner, synonym_name name FROM dba_synonyms WHERE table_owner = 'SYSMAN'; BEGIN FOR r1 IN c1 LOOP IF r1.owner = 'PUBLIC' THEN EXECUTE IMMEDIATE 'DROP PUBLIC SYNONYM '||r1.name; ELSE EXECUTE IMMEDIATE 'DROP SYNONYM '||r1.owner||'.'||r1.name; END IF; END LOOP; END; DROP ROLE mgmt_user; drop user mgmt_view cascade; drop user sysman cascade;[@more@]
oracle asm 10g
ASM_POWER_LIMIT specifies the maximum power on an Automatic Storage Management instance for disk rebalancing. The higher the limit, the faster rebalancing will complete. Lower values will take longer, but consume fewer processing and I/O resources.http://www.oracle-base.com/articles/10g/AutomaticStorageManagement10g.php[@more@]
standby database to primary database.
alter database activate standby database[@more@]
http://www.hellodba.com/index.php?class=doc&lang=cn
http://www.hellodba.com/index.php?class=doc&lang=cn[@more@]
Oracle性能调整的十大要点.doc
Normal 0 7.8 pt 0 2 false false false MicrosoftInternetExplorer4 st1:*{behavior:url(#ieooui) } /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.
oracle index monitoring
alter index DB_USER_INDEX monitoring usageSELECT index_name, table_name, monitoring, used, start_monitoring, end_monitoringFROM v$object_usageWHERE index_name = 'DB_USER_INDEX'ORDER BY index_name;alter index DB_USER_INDEX nomonitoring usage[@more@]