Oracle RAC CRS、OCR、Voting破坏重建
1、主机名:#Public Network - (eth0)192.168.10.11 rac1192.168.10.12 rac2#Private Interconnect - (eth1)10.10.10.11 rac1priv10.10.10.12 rac2priv#Public Virtual IP (VIP) addresses - (eth0)192.168.10.21 rac1vip192.168.10.22 rac2vip2、生成listener的cap文件,用于重建ocr后注册监听(也可以用后面的netca)crs_stat -p ora.rac1.LISTENER_RAC1.lsnr > /oracle/backup/ora.rac1.LISTENER_RAC1.lsnr.capcrs_stat -p ora.rac2.LISTENER_RAC2.lsnr > /oracle/backup/ora.rac2.LISTENER_RAC2.lsnr.cap3、停掉所
oracle 11gr2 drop asm
1 drop diskgroup DATA including contents;2 drop diskgroup FLA including contents;3 srvctl remove diskgroup -g DATA4 srvctl remove diskgroup -g FLA5 srvctl remove asm6 Remove the directory of $ORACLE_BASE/admin/+ASM7 vi /etc/oratab--remove this line--+ASM:/opt/oracle/product/10.2.0/db_1:N[@more@]
Parallel Execution of SQL Statements
Introduction to Parallel Execution Parallelismis the idea of breaking down a task so that, instead of one process doing all of the work in a query, many processes do part of the work at the same time. An example of this is when 12 processes handle 12 different months in a year instead of one process handling all 12 months by itself. The improvement in performance can be quite high. Parallel execution is useful for many types of operations that access significant amounts of data.
Checkpoint Tuning and Troubleshooting Guide
Checkpoint Tuning and Troubleshooting Guide [ID 147468.1] Modified 17-FEB-2011 Type BULLETIN Status PUBLISHED Purpose: This bulletin provides the Database Administrator a better understanding of incremental checkpoint and a description of four initialization parameters used for checkpoint tuning: - FAST_START_MTTR_TARGET - LOG_CHECKPOINT_INTER
Oracle Hidden Parameters
SELECTa.ksppinm "Parameter",b.ksppstvl "Session Value",c.ksppstvl "Instance Value"FROMx$ksppi a,x$ksppcv b,x$ksppsv cWHEREa.indx = b.indxANDa.indx = c.indxANDa.ksppinm LIKE '/_%' escape '/'[@more@]
Transparent Data Encryption
sqlnet.oraENCRYPTION_WALLET_LOCATION = (SOURCE = (METHOD = FILE) (METHOD_DATA = (DIRECTORY = /oracle/app/product/11.2.0/dbhome_1/admin/testasm/wallet) ) )startup mountalter system set wallet open identified by ***alter database open;[@more@]
How to enable trace in Oracle
How to enable trace in Oracle 1. Enable trace at instance levelPut the following line in init.ora. It will enable trace for all sessions and the backgroundprocessessql_trace = TRUEto disable trace:sql_trace = FALSE- or -to enable tracing without restarting database run the following command in sqlplusSQLPLUS> ALTER SYSTEM SET trace_enabled = TRUE;to stop trace run:SQLPLUS> ALTER SYSTEM SET trace_enabled = FALSE;2. Enable trace at session levelto start trace:ALTER SESSION SET
WAITEVENT:
WAITEVENT: "latch free" Reference Note [ID 34576.1] Modified 11-NOV-2002 Type REFERENCE Status PUBLISHED "latch free" Reference NoteThis is a reference note for the wait event "latch free" which includes the following subsections: * Brief definition * Individual wait details (eg: For waits seen in <<View:V$SESSION_WAIT>>) * Systemwide wait details (eg: For waits seen in <<View:V$SYSTEM_EVENT>>) * Reducing waits /
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
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;