- 博客(40)
- 收藏
- 关注
原创 logmnr
<br />exec sys.dbms_logmnr.add_logfile(LogFileName=>'/u01/app/oracle/archivelog/1_82239_700244171.dbf',options=>dbms_logmnr.new); <br />exec sys.dbms_logmnr.add_logfile(LogFileName=>'/u01/app/oracle/archivelog/1_82246_700244171.dbf'); <br />exec dbms_logmn
2011-04-13 17:07:00 365
转载 为了食油,声讨百度(2011-03-25 14:25:09)转载标签: 杂谈 --韩寒啊!
<br />为了食油,声讨百度(2011-03-25 14:25:09)转载标签: 杂谈 昨天,我的几个作为行业代表的朋友们和百度的谈判破裂了。在最早的时候,沈浩波,路金波以及侯小强都在各种不同的时间场合和我说过百度对整个出版行业造成的伤害。我说,告百度啊。他们说,都告过了,没一个告的赢。百度很有钱很有门路,据说很多法院他们都能搞的定。百度的公关又很强大,据说很多媒体他们也都搞的定。我当时就感叹,莫非李彦宏他爸才是李刚。于是就有了315的作家维权。在昨天谈判的时候,我就觉得文著协应该出面,因为上次文著协和谷
2011-03-25 21:50:00 681
原创 corrupt block
<br />/* <br /> This script prompts for an owner and a tbale name. It then created two new tables <br /> - orignal_table_name_BAD and orignal_table_name_SAVED. If either if these tables exist, <br /> they are dropped and then recreated. The script th
2011-03-17 17:29:00 505
转载 raid
RAIDRAID is an acronym for Redundant Arrays of Inexpensive Disks. These provide a mechanism for load balancing and securing your data across multiple disks. In this article I'll give a brief explanation of the most commonly used RAID levels and how they sh
2011-03-11 11:54:00 535
转载 Brief introduction into Materialized Views
Brief introduction into Materialized Views<br />This week, I am teaching an Oracle Database 11g Data Warehouse Administration course in Munich. One of the focus areas of that course are Materialized Views, and I have developed some examples for that course
2011-02-23 16:59:00 382
原创 Active Session History at work
Performance Monitoring: Active Session History at work<br />Teaching an Oracle Database 10g Performance Tuning course this week, I introduced the 10g New Feature Active Session History (ASH) to the students. That was one major improvement – together with t
2011-02-23 16:49:00 284
原创 top n
<br />On Top-n and Pagination Queries<br />By Tom Kyte<br /> <br />Our technologist gets more results using ROW_NUMBER, RANK, and DENSE_RANK.<br />In a recent Ask Tom column (September/October 2006), I wrote about using ROWNUM to perform top-n queries, get
2011-02-18 19:12:00 582
原创 delete duplicate rows in a table
<br />Purpose:<br />========<br />The purpose of this article is to provide you with an example of how to <br />delete duplicate rows in a table.<br /> <br />Scope & Application:<br />====================<br />This article is most useful for Oracle Develop
2011-02-18 19:11:00 666
原创 正则表达式
<br />4 new functions has been introduced:-<br />REGEXP_LIKE<br />REGEXP_REPLACE<br />REGEXP_INSTR<br />REGEXP_SUBSTR<br /><br />The following data types are supported with REGEXP functions:<br />- CHAR<br />- VARCHAR2<br />- NCHAR<br />- NVARCHAR2 <br />-
2011-02-18 19:06:00 600
原创 for
<br />Declare <br /> V_1 Varchar2(100);<br /> i Integer:=0;<br />Begin<br /> For c1 In(Select * From tb_tmp) Loop<br /> <br /> i:=I+1;<br /> If Mod(i,100)=0 Then<br /> Commit;<br /> End If;<br /> End Loop;<br />Commit;<br />End;
2011-02-18 15:00:00 251
原创 rac restore to single instance
<br />Solution<br />1) Take appropriate RMAN backup of the production RAC database. Note that you should turn on the CONTROLFILE AUTOBACKUP configuration so that we have the controlfile backed up after the database backup. When we restore the controlfile o
2011-02-14 14:34:00 499
原创 外部表
Drop Table tb_sql_ldr_fei;CREATE TABLE tb_sql_ldr_fei(SERVICEIDITEM number(12),AREAIDITEM Number(12),GROUPIDITEM Number(12), CONTEXTID varchar2(50), ORDERID varchar2(50),ITEMID Number(12),ITEMNUM Number(12),ITEMAMOUNT Nu
2011-01-19 16:59:00 348
原创 表空间使用率
<br />SELECT c.tablespace_name "表空间", ROUND(a.bytes/1048576,2) "表空间大小",ROUND((a.bytes-b.bytes)/1048576,2) "已使用空间",ROUND(b.bytes/1048576,2) "剩余空间",<br />ROUND(b.bytes/a.bytes * 100,2)||'%' "剩余百分比" FROM<br />(SELECT tablespace_name,SUM(a.bytes) bytes<br />FR
2011-01-08 20:21:00 521
原创 归档日志的切换频率
<br />SELECT TRUNC (first_time) "Date", TO_CHAR (first_time, 'Dy') "Day",<br /> COUNT (1) "Total",<br /> SUM (DECODE (TO_CHAR (first_time, 'hh24'), '00', 1, 0)) "h0",<br /> SUM (DECODE (TO_CHAR (first_time, 'hh24'), '01', 1, 0)) "
2011-01-03 09:29:00 4143
原创 查询正在后台进行的SQL查询
<br />select sid,v$session.username 用户名,last_call_et 持续时间,status 状态,LOCKWAIT 等待锁,machine 用户电脑名,logon_time 开始登入时间,sql_text <br />from v$session,v$process ,v$sqlarea<br />where paddr=addr and sql_hash_value=hash_value<br />and status='ACTIVE' and v$session.u
2010-12-01 20:04:00 789
原创 split partition
<br />alter table tbparttest split partition POTHERS at (TO_DATE(' 2011-12-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))<br />into (partition p201111, partition pothers);
2010-11-30 10:37:00 828
转载 How to Split Partition of Heavily Used Table
PURPOSE This document details methods of splitting a large table partition that will minimize downtime.SCOPE & APPLICATION InstructionalRELATED DOCUMENTS Oracle8 Server Administrator's Guide, Chapter 11.How to Split Partition of Heavily Used Table:====
2010-11-12 17:10:00 619
转载 How to Backup Partition of Range Partitioned Table with Local Indexes
<br />Goal<br />You have a range partitioned table with local indexes on it. As a part of policy or to save disk space being used by the tables, you would like to archive the data so that if needed you can restore the data back.<br /><br />Note: - This doc
2010-11-12 13:49:00 796
转载 How To Move Or Rebuild A Lob Partition
<br /> <br />How To Move Or Rebuild A Lob Partition [ID 761388.1] <br /> <br /> 修改时间 29-JUN-2010 类型 HOWTO 状态 MODERATED <br />In this Document<br /> Goal<br /> Solution<br /> References<br /> <br />Platforms: 1-914CU; <br /> <br />This
2010-11-11 10:09:00 2100
转载 How To Partition Existing Table Using DBMS_Redefinition
How To Partition Existing Table Using DBMS_Redefinition [ID 472449.1] -------------------------------------------------------------------------------- 修改时间 28-SEP-2010 类型 HOWTO 状态 MODERATED In this Document Goal Solution-----------------------
2010-11-11 09:56:00 391
转载 分区交换exchange
How to move or transport table partition using Transportable Table Space (TTS)? [ID 731559.1] -------------------------------------------------------------------------------- 修改时间 03-AUG-2009 类型 HOWTO 状态 MODERATED In this Document
2010-11-10 18:43:00 583
原创 job运行时间日志保留
<br />CREATE OR REPLACE PACKAGE BODY is<br /> <br /> procedure joblog(v_job varchar2,<br /> v_starttime timestamp,<br /> v_endtime timestamp,<br /> v_comments varchar2) is<br /> <br /> p
2010-11-09 17:27:00 677
原创 分页
<br /> select /*+first_rows*/<br /> cid,pid,cname,cnt,rn<br /> from <br /> (select t.* ,row_number() over(order by t.cid desc) rn<br /> from tb_jff t<br /> )<br /> where rn <=3* 2<br /> and rn >(2-1)*3;<br />
2010-11-08 14:48:00 191
原创 接口日志跟踪
<br />create table DBAPROCLOG ( PROCEDURENAME VARCHAR2(60), PARAMS VARCHAR2(500), CALLTIME DATE default sysdate ) <br /> <br />insert into dbaproclog (procedurename, params, calltime) <br />values ('fn_xxx_get', ' Sip=' || sys_context('userenv', 'ip_addres
2010-11-08 14:30:00 323
原创 sql调整一
<br />一个查询:<br />open outcurlist for<br /> select t.*<br /> from tbcharge t<br /> where t.state=-1<br /> and not exists<br /> (<br /> select 1 from<br /> (<br /> select t13.ptid from tbcharge t13<br
2010-11-08 14:13:00 228
原创 分区表(1)
<br />drop table tb_part_test;<br />drop table tb_part_test_singe1;<br /><br />create table tb_part_test(id number,name char(20),hire_date date)<br />partition by range (hire_date)<br />(<br /> partition P1 values less than (TO_DATE('2010-09-01 00:00:00',
2010-11-01 13:38:00 238
转载 Logmnr分析重做日志文件
<br />有三种方法能得到数据字典的方法:<br />1)、将数据字典提取到一个平面数据字典文件(DBMS_LOGMNR_D.STORE_IN_FLAT_FILE)<br />2)、将数据字典提取到重做日志文件(DBMS_LOGMNR_D.STORE_IN_REDO_LOGS)<br />3)、使用当前的数据库的联机数据字典(DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG),只能分析当前数据库的重做日志文件,此时就不需要平面字典文件。<br /><br />例子:<br />1
2010-10-30 17:46:00 840
原创 oradebug
RAC checking - Hanganalyze and System State dump on 9iIf on 9i run the following on one instance 2-3 times - 1 minute apart:<br />------------------------------------------------------------------------------<br />SQL> oradebug setmypid<br />SQL> oradebug
2010-10-28 12:15:00 331
转载 Restore n Recover Production DB to Point In Time on new machine
<br />1.Install Oracle RDBMS Server Software on destination host.<br />2.Patch it to same release which is installed on source host.<br />3.Copy Datafile Backups , Archivelog Backups , Controlfile backup and spfile backup on to destination host ( test2 ) t
2010-10-27 16:19:00 449
转载 Understanding the SCN
<br />Understanding the SCN<br />In order to understand how Oracle performs recovery, it's first necessary to understand Oracle's SCN in terms of the various places where it can be stored and how it's used for instance and media recovery.<br />The SCN is a
2010-10-27 16:05:00 401
原创 redo
<br /><br />查看redo等待<br />Select Wait_Class, Event, Total_Waits, Total_Timeouts, Time_Waited, Round(Time_Waited / 100 / 60, 1) Time_Wait_Minutes,Average_Wait<br />From V$system_Event<br />Where Lower(Event) Like '%log%' Or Lower(Event) Like '%redo%'<br /
2010-10-27 10:22:00 473
转载 Oracdebug ( Undocumented Utility )
Oracdebug ( Undocumented Utility )<br /> <br />改天读~<br /> September 11th, 2008 | Author: admin<br />Reading time: 4 - 6 minutes<br />Oradebug utility is veryA useful for all the DBA.<br />Oradebug is mainly useful in case of hang analysis , tracing perti
2010-10-26 18:03:00 337
转载 Disaster Recovery Planning For Oracle DB
<br />Planning DR is essential for any DBA because DBA will be first one to get under the gun if something goes wrong with database.<br />You have two options available ,Plan the DR Look for new job. <br />I will focus on first one only as i love to get pa
2010-10-26 17:59:00 402
转载 AWR - Automatic Workload Repository
存档下,有时间再读~The AWR<br />To properly collect database statistics, the parameter statistics_level should be set to TYPICAL (the default) or ALL.<br />The Oracle database uses AWR for problem detection and analysis as well as for self-tuning. A number of diffe
2010-10-26 17:40:00 1358
原创 CPU used by this session
<br /> select<br /> a.SID, c.serial#, c.username, c.osuser, c.MODULE, c.status, d.spid AS<br /> "PROCESS_ID", DECODE(c.username, NULL, 0, c.last_call_et) AS<br /> "SCNDS_IDLE", ((SYSDATE - c.logon_time) * 60 * 60 * 24) AS<br />
2010-10-26 16:59:00 1973
转载 Rman switch to copy
With RMAN you can create copy of live Database and perform the switch to copy when main database is not available due to any problem.First of all make the proper configuration with RMAN and then proceed,RMAN>CONFIGURE BACKUP OPTIMIZATION ON;ARMAN >CONFIGUR
2010-10-25 23:06:00 2497
转载 RMAN Backup and Recovery Scenarios
Complete Closed Database Recovery. System tablespace is missingIf the system tablespace is missing or corrupted the database cannot be started up so a complete closed database recovery must be performed.Pre requisites: A closed or open database backup and
2010-10-25 22:53:00 510
翻译 11G Online Duplicate
<br />从11g数据库开始,可以在线克隆一个数据库了,标记下~<br />RMAN > DUPLICATE TARGET DATABASE<br />TO db_duplicate<br />FROM ACTIVE DATABASE<br />SPFILE PARAMETER_VALUE_CONVERT '/u02', 'u03'<br />SET SGA_MAX_SIXE = '500m'<br />SET SGA_TARGET = '250M'<br />SET LOG FILE_NAME_CONV
2010-10-25 22:24:00 320
原创 迷失工作
工作这么多年,到今天越做越差,丢失了自我,心已经开始滴血了。老纪你tmd的給我记住:记住你做过的事情做完你今天的工作把思想和行动结合起来做个对得起今天起点的人!!
2010-10-25 01:45:00 269
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人