===========================================================
对部分表空间作不完全恢复
===========================================================
对部分表空间作不完全恢复
ft,前两天因为程序的bug,有个服务人员把客户的资料给删了,3天后才知道。然后他们领导找到我,让我搞定。
整个库有170g,他们提供了一个机器只有50g的空间,做全库的不完全恢复是不可能了。后来大师在metalink上找到了这么一个方法,
可以只恢复被删除记录的表所在的表空间,偶搞了一把,比TSPITR 好用多了。
查看全文
grassbell
发表于:2005.06.16 00:52
::分类:
(
Oracle
)
::阅读:(66581次)
::
评论
(717)
===========================================================
今天忒牛
===========================================================
大灰狼去参加培训了,我下午到支付宝帮他顶着数据库。环境还没熟悉呢,就过来一堆需求,修改数据,review sql。。。一头汗。。。
忽然收到报警,偶管的crm 数据库down 了,一身汗。一会不在,怎么就这样了,平时再怎么折腾,也不至于搞死的?!赶紧打电话问。。。
狂晕,原来是另外一个部门的哥们和dell 的哥们在机房不小心把俺的数据库电源拔错了!down机几分钟,据说一个季度的down 机时间指标才12点几分钟,faint
唉。。。
作dba这段时间来,学到的最深刻的东西的就是做事之前要确定,三思,认真,虽然现在作的不能说很好,可是比原来进步了很多。这次事故,又给自己了一个警示。
grassbell
发表于:2005.05.10 23:09
::分类:
(
Oracle
)
::阅读:(25234次)
::
评论
(238)
===========================================================
婚礼归来
===========================================================
果真没有顶住,喝大了。婚礼安排的有点乱,表姐看起来不是很高兴。毕竟出嫁的感觉本来就不好,加上又累,事情又杂,真够她受的。其实熬过去就好了,小两口都在北京,也买了房子,工作又有很稳定,靠,基本上没啥烦的了,只有令人羡慕Ing。
回家后,研究了一下给老爸买的手机。长这么大,头回给老爸买礼物。看得出来,他很高兴。晚上,老姐就带着她的小baby过来了。盼了很久,终于又可以见到了。小宝宝叫高宇宸,老爸姓高,老妈姓陈,哈哈。我们家的孩子,名字都很好听。比如我的名字是栋,我姐叫茜,一个东,一个西,呵呵。对了,也给baby买了件裙子,穿起来肯定很pp!
哦,该去迷糊一会了,脑袋晕晕的。
grassbell
发表于:2005.05.01 19:35
::分类:
(
Oracle
)
::阅读:(14974次)
::
评论
(123)
===========================================================
给standby数据文件做软link
===========================================================
primary 和 standby 两边磁盘空间不对称,有时候需要调整standby上数据文件的目录,以腾出空间。
可以使用一个简单的办法,给数据文件做软link:
recover managed standby database cancel;
alter database open read only;
mv /disk3/oradata/crmcn/donnyts01.df /disk5/oradata/crmcn/donnyts01.df
ln [OPTION]... TARGET [LINK_NAME]
ln -s /disk5/oradata/crmcn/donnyts01.df /disk3/oradata/crmcn/donnyts01.df
recover managed standby database disconnect;
grassbell
发表于:2005.04.12 15:00
::分类:
(
Oracle
)
::阅读:(475次)
::
评论
(0)
===========================================================
一次小教训
===========================================================
昨天优化了一个sql,逻辑读从1600减小到16,并提交给工程师修改程序,晚上发布。
今天中午抓了一次report,惊奇地发现那个sql排在第一位,并且buffer gets是原来的10倍,%total = 60.
马上汗流浃背。
把这个sql按照修改后的样子又做了一次sql trace,真的是挺好的。
在回到report里面才发现,原来工程师没有按照我的意思修改:
因为我用了ordered use_nl 的hint,他们却把from 后面的顺序颠倒了。
看来,工程师修改后,我们最好能在double check以下,或者强调一定按照我们建议的修改,一点都不能差。
grassbell
发表于:2005.03.17 14:18
::分类:
(
Oracle
)
::阅读:(4367次)
::
评论
(5)
===========================================================
Data Guard中rename a datafile的步骤小计
===========================================================
需要注意的是:
如果你想让primary 和standby 上的数据文件结构保持一致的话,在primary 上rename a datafile后,即使STANDBY_FILE_MANAGEMENT = auto,也需要在standby上手工执行相同的操作。当然,如果不想保持一致,standby上可以不作任何动作。
查看全文
grassbell
发表于:2005.02.21 17:12
::分类:
(
Oracle
)
::阅读:(688次)
::
评论
(7)
===========================================================
4层的索引,可以索引多少rows?
===========================================================
比如一个index entry 是18bytes,一个8k的block,PCTFREE=10%,则可以存放8*1024*0.9/18=410,约为400个index entries
查看全文
grassbell
发表于:2005.01.21 15:03
::分类:
(
Oracle
)
::阅读:(2044次)
::
评论
(4)
===========================================================
Transport Tablespaces
===========================================================
grassbell
发表于:2005.01.21 11:12
::分类:
(
Oracle
)
::阅读:(2215次)
::
评论
(11)
===========================================================
redo log中记录的信息
===========================================================
redo log中记录的信息是转化后的最终的对数据文件的dml操作过程。通过 trigger 试验验证。
查看全文
grassbell
发表于:2005.01.20 15:59
::分类:
(
Oracle
)
::阅读:(2014次)
::
评论
(4)
===========================================================
模拟跨平台迁移数据试验小记
===========================================================
步骤:
1)在master 中创建表的mv log,用于增量刷新
2)在target(winnt)数据库先创建存在于主库中的表。
3)通过db link 创建与表同名的on prebuilt table 物化视图,定时增量刷新(fast refresh)
4)满足条件后停掉master(Linux) 应用,目标刷新成功,删除所有的mv,数据保留在了相应的表中。
参考:http://www.itpub.net/309939.html
查看全文
grassbell
发表于:2005.01.20 12:12
::分类:
(
Oracle
)
::阅读:(4571次)
::
评论
(6)
===========================================================
Hierarchical Queries(等级查询)
===========================================================
关键字:START WITH / CONNECT BY / PRIOR / LEVEL / SYS_CONNECT_BY_PATH / ORDER BY SIBLINGS
查看全文
grassbell
发表于:2005.01.17 15:34
::分类:
(
Oracle
)
::阅读:(2103次)
::
评论
(2)
===========================================================
关于job 的小记
===========================================================
grassbell
发表于:2005.01.11 18:23
::分类:
(
Oracle
)
::阅读:(2083次)
::
评论
(3)
===========================================================
设置listener 的安全机制
===========================================================
设置listener password后,在LSNRCTL中执行stop或者save_config之前,需要使用set password指定密码。
查看全文
grassbell
发表于:2005.01.10 21:04
::分类:
(
Oracle
)
::阅读:(2871次)
::
评论
(8)
===========================================================
理解几个初始化参数
===========================================================
grassbell
发表于:2005.01.10 17:37
::分类:
(
Oracle
)
::阅读:(2248次)
::
评论
(2)
===========================================================
工作小记:一次断电和standby故障
===========================================================
早上收到后台数据库报的错误:
ORA-12560: TNS:protocol adapter error
查看全文
grassbell
发表于:2005.01.10 13:41
::分类:
(
Oracle
)
::阅读:(1024次)
::
评论
(0)
===========================================================
关于ORDERED 和 USE_NL() hint
===========================================================
grassbell
发表于:2005.01.06 18:22
::分类:
(
Oracle
)
::阅读:(1416次)
::
评论
(7)
===========================================================
Logic Truth Table 逻辑运算真值表
===========================================================
Logic Truth Table 逻辑运算真值表
查看全文
grassbell
发表于:2004.12.22 16:08
::分类:
(
Oracle
)
::阅读:(1013次)
::
评论
(0)
===========================================================
piner出的那个SQL题目小记
===========================================================
grassbell
发表于:2004.12.22 16:06
::分类:
(
Oracle
)
::阅读:(1779次)
::
评论
(12)
===========================================================
如何查看隐含参数的相关信息
===========================================================
grassbell
发表于:2004.12.18 14:49
::分类:
(
Oracle
)
::阅读:(773次)
::
评论
(0)
===========================================================
在Intel Pentium4 processor 的系统上安装oracle的问题。
===========================================================
grassbell
发表于:2004.12.17 19:09
::分类:
(
Oracle
)
::阅读:(726次)
::
评论
(0)
===========================================================
偶初学ORACLE时的一些笔记
===========================================================
今天在家没事,整理了一些刚开始接触ORACLE时的一些笔记,传上来和大家一起学习。
http://www.itpub.net/300366.html
grassbell
发表于:2004.12.13 13:35
::分类:
(
Oracle
)
::阅读:(629次)
::
评论
(0)
===========================================================
关于SQLNET. AUTHENTICATION_SERVICES
===========================================================
============Metalink============
If you log on to a winNT or win2000 machine as a domain user but there is
currently no network connection, you will still be logged on to the machine
if you've been logged on before. Windows will use cached credentials to check your username/password etc.
If you've got SQLNET.AUTHENTICATION_SERVICES=(NTS) set in your sqlnet.ora you're asking oracle to authenticate you with the domain server when you log on to oracle.
This combination of things can lead to oracle trying to ask the NT domain
controler to validate you when there is no actual network connection, the
result is an ORA-3113 error.
grassbell
发表于:2004.11.30 20:14
::分类:
(
Oracle
)
::阅读:(723次)
::
评论
(0)
===========================================================
ORACLE管理员认证方法小记
===========================================================
grassbell
发表于:2004.11.30 10:36
::分类:
(
Oracle
)
::阅读:(1605次)
::
评论
(2)
===========================================================
VI 手册 (VI FAST REFERENCE GUIDE)
===========================================================
grassbell
发表于:2004.11.24 20:15
::分类:
(
Oracle
)
::阅读:(880次)
::
评论
(0)
===========================================================
才弄明白Number(p,s)的意义
===========================================================
number(p,s)
p:1~38
s:-84~127
查看全文
grassbell
发表于:2004.10.26 10:39
::分类:
(
Oracle
)
::阅读:(46076次)
::
评论
(3271)
===========================================================
SQL优化涉及到的基本概念(一)
===========================================================
grassbell
发表于:2004.10.18 10:02
::分类:
(
Oracle
)
::阅读:(1272次)
::
评论
(0)
===========================================================
Oracle内存分配与使用小记(三)Log buffer/ PGA
===========================================================
配置和使用Redo Log Buffer(没什么好写的)
配置PGA
查看全文
grassbell
发表于:2004.10.10 17:54
::分类:
(
Oracle
)
::阅读:(1418次)
::
评论
(0)
===========================================================
装了GMailFS as a windows virtual driver
===========================================================
安装后在我的电脑里面生成一个GMail Driver,可以像普通的Driver一样管理文件,方便备份.可是目前bug 和限制还很多.比如有时候桌面会死掉一端时间,还有就是对文件名长度有限制.
查看全文
grassbell
发表于:2004.10.09 18:20
::分类:
(
Oracle
)
::阅读:(904次)
::
评论
(0)
===========================================================
Oracle内存分配与使用小记(二)Shared Pool and Large Pool
===========================================================
配置和使用Shared Pool and Large Pool
查看全文
grassbell
发表于:2004.10.09 14:47
::分类:
(
Oracle
)
::阅读:(1910次)
::
评论
(0)
===========================================================
order by 使用索引的情况
===========================================================
1)ORDER BY中所有的列必须包含在相同的索引中并保持在索引中的排列顺序.
2)ORDER BY中所有的列必须定义为非空.
参考:http://www.itpub.net/showthread.php?threadid=238785&pagenumber=
查看全文
grassbell
发表于:2004.10.09 13:43
::分类:
(
Oracle
)
::阅读:(2635次)
::
评论
(2)
===========================================================
COUNT or SUM of NULL values will result in 0
===========================================================
以v$archive_dest为例,destination 有null值.
查看全文
grassbell
发表于:2004.10.09 11:37
::分类:
(
Oracle
)
::阅读:(802次)
::
评论
(1)
===========================================================
Oracle内存分配与使用小记(一)Buffer Cache
===========================================================
grassbell
发表于:2004.09.30 18:00
::分类:
(
Oracle
)
::阅读:(3939次)
::
评论
(2)
===========================================================
关于sequential/scattered read 一个很好的解释
===========================================================
Why is a random-access operation known as “db file sequential read” and a sequential-access operation known as “db file scattered read”?
(不知道具体出处)
查看全文
grassbell
发表于:2004.09.30 11:45
::分类:
(
Oracle
)
::阅读:(1019次)
::
评论
(1)
===========================================================
对wait events 和statistics 的理解小记(五)
===========================================================
grassbell
发表于:2004.09.28 13:50
::分类:
(
Oracle
)
::阅读:(936次)
::
评论
(2)
===========================================================
对wait events 和statistics 的理解小记(四)
===========================================================
关于IO,包括db file scattered/sequential/direct read and write
查看全文
grassbell
发表于:2004.09.28 13:47
::分类:
(
Oracle
)
::阅读:(1075次)
::
评论
(0)
===========================================================
对wait events 和statistics 的理解小记(三)
===========================================================
grassbell
发表于:2004.09.28 13:46
::分类:
(
Oracle
)
::阅读:(874次)
::
评论
(0)
===========================================================
对wait events 和statistics 的理解小记(二)
===========================================================
grassbell
发表于:2004.09.28 13:43
::分类:
(
Oracle
)
::阅读:(1049次)
::
评论
(0)
===========================================================
对wait events 和statistics 的理解小记(一)
===========================================================
grassbell
发表于:2004.09.28 13:38
::分类:
(
Oracle
)
::阅读:(1073次)
::
评论
(0)
===========================================================
一致读( consistent read )的步骤
===========================================================
grassbell
发表于:2004.09.27 15:12
::分类:
(
Oracle
)
::阅读:(3828次)
::
评论
(83)
===========================================================
备份点后建立的表空间如何恢复(丢失该数据文件及控制文件)?
===========================================================
grassbell
发表于:2004.09.15 20:03
::分类:
(
Oracle
)
::阅读:(1062次)
::
评论
(0)
===========================================================
对allow_resetlogs_corruption的新尝试
===========================================================
grassbell
发表于:2004.09.15 19:49
::分类:
(
Oracle
)
::阅读:(1020次)
::
评论
(1)
===========================================================
调优时常用的view和script(六)Session
===========================================================
包括:V$SESSION / V$PROCESS
查看全文
grassbell
发表于:2004.09.13 14:23
::分类:
(
Oracle
)
::阅读:(862次)
::
评论
(0)
===========================================================
查找数据位于哪个分区?
===========================================================
grassbell
发表于:2004.09.09 22:49
::分类:
(
Oracle
)
::阅读:(727次)
::
评论
(0)
===========================================================
调优时常用的view和script(五)Sql
===========================================================
grassbell
发表于:2004.09.08 16:32
::分类:
(
Oracle
)
::阅读:(2721次)
::
评论
(0)
===========================================================
调优时常用的view和script(四)Locks
===========================================================
grassbell
发表于:2004.09.08 14:44
::分类:
(
Oracle
)
::阅读:(1161次)
::
评论
(0)
===========================================================
关于Cache hit and miss rate
===========================================================
如果Cache hit rate过小通常有可能在暗示你要增加db_block_buffers(9i,DB_CACHE_SIZE)
查看全文
grassbell
发表于:2004.09.06 17:36
::分类:
(
Oracle
)
::阅读:(1356次)
::
评论
(2)
===========================================================
调优时常用的view和script(三)Latch
===========================================================
grassbell
发表于:2004.09.06 15:45
::分类:
(
Oracle
)
::阅读:(786次)
::
评论
(0)
===========================================================
调优时常用的view和script(二)Statistics
===========================================================
grassbell
发表于:2004.09.03 11:53
::分类:
(
Oracle
)
::阅读:(832次)
::
评论
(0)
===========================================================
调优时常用的view和script(一)Events
===========================================================
目的:不要死记硬背script,深入理解view的含义,才能自如运用它们。
包括:V$SYSTEM_EVENT/ V$SESSION_EVENT/ V$SESSION_WAIT / V$WAITSTAT
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96533/sqlviews.htm#17389
查看全文
grassbell
发表于:2004.09.02 15:36
::分类:
(
Oracle
)
::阅读:(1085次)
::
评论
(2)
===========================================================
经典问题:Moving tables accross tablespaces
===========================================================
Moving tables accross tablespaces
1.EXP the user account.
2.drop all of the objects this user owns. You can 'select' the drop statements you need (script attached) in much the same way we 'select' the alter table/index statements
3.revoke UNLIMITED TABLESPACE from the user
4.alter the users default tablespace to the target tablespace
5.give the user an unlimited quota on this new tablespace and their temporary tablespace
6.IMP this users data.
查看全文
grassbell
发表于:2004.08.31 09:43
::分类:
(
Oracle
)
::阅读:(950次)
::
评论
(1)
===========================================================
对RBO/CBO运行机制的中度理解,请指正!(二)
===========================================================
grassbell
发表于:2004.08.31 09:07
::分类:
(
Oracle
)
::阅读:(934次)
::
评论
(1)
===========================================================
对RBO/CBO运行机制的中度理解,请指正!(一)
===========================================================
本文为Tim Gorman关于CBO一篇文章的读后感。
主要分为两部分:
1)RBO如何工作的:
工作原理;举例论证;得到的结论
2)CBO如何工作的:
cost的计算;physical and logical I/O的比较;
部分参数的介绍;
其中也包含了本人的一些疑问,请大家指正并解惑,谢谢!
参考:http://www.evdbt.com/SearchIntelligenceCBO.doc
查看全文
grassbell
发表于:2004.08.31 00:14
::分类:
(
Oracle
)
::阅读:(896次)
::
评论
(2)
===========================================================
偷窥Data block 的物理结构
===========================================================
最近整理了一下Data block 的物理结构。但是其中对某些点介绍的比较模糊,或者甚至有出入,请大家及时指出。也欢迎大家针对某个概念展开并提出自己的看法,我们共同探讨和学习,谢谢!
查看全文
grassbell
发表于:2004.08.30 14:16
::分类:
(
Oracle
)
::阅读:(846次)
::
评论
(2)
===========================================================
重现ORA-01555 (snapshot too old)
===========================================================
这个实验重现了ORA-01555 (snapshot too old)的错误。
环境:8i
建议:首先学习biti_rainy 的 关于回滚段的探讨
http://www.itpub.net/showthread.php...%D8%B9%F6%B6%CE 查看全文
grassbell
发表于:2004.08.30 13:50
::分类:
(
Oracle
)
::阅读:(27517次)
::
评论
(259)
===========================================================
热备份(hot backup)期间到底做了什么?
===========================================================
热备期间最大的特点就是产生了比平常更多的日志文件,为什么会这样?在恢复的时候有什么用呢?
查看全文
grassbell
发表于:2004.08.30 13:36
::分类:
(
Oracle
)
::阅读:(1019次)
::
评论
(0)
===========================================================
恢复 using backup controlfile 后,不用resetlogs打开数据库的方法
===========================================================
使用recover database using backup controlfile 后,oracle要求
必须使用resetlogs打开数据库,这样之前做的全备份就实效了。
为了避免这种情况,可以采用如下方法。
查看全文
grassbell
发表于:2004.08.30 13:33
::分类:
(
Oracle
)
::阅读:(1220次)
::
评论
(2)
===========================================================
怎样找到chained rows
===========================================================
已经通过analyse list chained rows知道一个表中的一行记录被链接到了其它块,怎么得到被链接的块号呢?
查看全文
grassbell
发表于:2004.08.30 11:45
::分类:
(
Oracle
)
::阅读:(686次)
::
评论
(0)
===========================================================
大量无谓的commits 对性能的影响
===========================================================
1. 产生大量的redo,并引发redo allocation latch 竞争。
事务的开始和结束都会产生大量的redo:
事务开始,分配rollback segment,改变transaction table,和rbs header的事务控制记录信息。
事务提交,改变事务状态,记录commit scn到rbs header.
这些变化都会产生redo
引发的以下情况都需要获得redo allocation latch,从而形成竞争:
在log buffer中分配空间时.
在将log buffer blocks写入logfile 之前获得,用来判断哪些blocks需要写入.
同样,将log buffer blocks写入logfile 后获得,用来释放log buffer.
2。lgwr要为每一次事务提交执行physical I/O,形成等待
每次事务提交后,都要等待LGWR将log buffer中的数据写入log file 以后,才会响应用户.这种等待称为 log file sync wait.
如果在多用户下存在大量事务提交,则这种等待会很显著.
3。引发不必要的行清除(commit cleanout),引发CPU争用和等待。
频繁的commit导致相同的blocks被重复的cleaned out,这种动作将消耗大量的CPU
查看全文
grassbell
发表于:2004.08.30 11:26
::分类:
(
Oracle
)
::阅读:(734次)
::
评论
(0)
===========================================================
关于索引(index)的中度理解,请指正!
===========================================================
本文主要侧重于索引的物理结构,探究了:
1)索引的root,branch,leaf;
2)索引的分裂;
3)索引的重用;
更多评论:http://www.itpub.net/237710.html
查看全文
grassbell
发表于:2004.08.30 10:36
::分类:
(
Oracle
)
::阅读:(793次)
::
评论
(0)
===========================================================
Over committed
===========================================================
Many applications commit more frequently than necessary, and their performance suffers as a result. In isolation a commit is not a very expensive operation, but lots of unnecessary commits can nevertheless cause severe performance problems. While a few extra commits may not be noticed, the cumulative effect of thousands of extra commits is very noticeable. Try this test. Insert 1,000 rows into a test table -- first as a single transaction, and then committing after every row. Your mileage may vary, but
these results on an otherwise idle system show a performance blowout of more than 100% when committing after every row.
The performance difference observed in such tests may be due three possible factors. Each of these factors can have a major performance impact, particularly in high concurrency environments. First, unnecessary commits cause extra redo generation and can trigger contention for the redo allocation latch. Second, users may have to wait for LGWR to perform physical I/O each time the application commits rather than just once per user transaction. And third, extra commits normally cause unnecessary commit cleanout activity, and thus much higher CPU usage and associated delays.
查看全文
grassbell
发表于:2004.08.30 10:21
::分类:
(
Oracle
)
::阅读:(678次)
::
评论
(0)