Oracle中行迁移和行链接的清除及检测
Oracle中行迁移和行链接的清除及检测一、行迁移和行链接的介绍 在实际的工作中我们经常会碰到一些Oracle数据库性能较低的问题,当然,引起Oracle数据库性能较低的原因是多方面的,我们能够通过一些正确的设计和诊断来尽量的避免一些Oracle数据库性能不好,Row Migration (行迁移) & Row Chaining (行链接)就是其中我们可以尽量避免的引起Oracle数据库性能低下的潜在问题。通过合理的诊断行迁移和行链接,我们可以较大幅度上提高Oracle数据库的性能。 那究竟什么是行迁移和行链接呢,先让我们从Oracle的block开始谈起。 操作系统的最小
linux lost password
一、1、重新启动系统。待系统启动到grub或lilo(现在一般是grub)引导菜单时,找到系统当前引导项(可以按方向键展开隐藏的菜单); 2、把光标定位在该选项上按下字母“e”键进入这个引导的编辑状态; 3、该选项有三行语句,请用光标选中第二行,也就是“Kernel”开头的那一行; 4、在这一行再按下字母“e”键进入这一行的编辑状态; 5、在该行行尾加个空格,写上数字1,类似这样: kernel /boot/vmlinuz-2.6.9-11.19 ro root=LABEL=/ 1 6、修改以后,按下“回车”键回到原来的界面; 7、按下字母“b”键开始引导。
oracle controlfile template;
alter database backup controlfile to trace;CREATE CONTROLFILE REUSE DATABASE "TEST" NORESETLOGS ARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 292 LOGFILE GROUP 1 'D:ORACLEPRODUCT10.2.0ORADATATESTREDO01.LOG' SIZE 50M, GROUP 2 'D:ORACLEPRODUCT10.2.0ORADATATESTREDO02.LOG' SIZE 50M, GROUP 3 'D:ORACLEPRODUCT10.2.0ORADATATESTREDO03.LOG' SIZE 50M -- STANDBY LOGFILE DATAFILE 'D:ORACLEPRODUCT10.2.0ORADATATESTSYSTEM01.DBF', 'D:ORACLEPRODUCT10.2.0ORADATAT
RAC backup
run {allocate channel d1 type disk;backup incremental level 0 as compressed backupset format '/u04/backup/ausabo2/%d_LEVEL0_%T_%U' database;backup as compressed backupset format '/u04/backup/ausabo2/%d_ARCH_%T_S%s_P%p_C%c' archivelog all not backed up;release channel d1;}run {allocate channel d1 type disk connect 'sys/zebra@node1';allocate channel d2 type disk connect 'sys/zebra@node2';delete noprompt archivelog until time 'sysdate - 1' backed up 1 times to device type disk;delete noprompt obsol
Creating Physical Standby using RMAN Duplicate Without Shutting down The Primary [ID 789370.1]
Creating Physical Standby using RMAN Duplicate Without Shutting down The Primary [ID 789370.1] -------------------------------------------------------------------------------- Modified 03-JUL-2010 Type HOWTO Status MODERATED In this Document Goal Solution References--------------------------------------------------------------------------------Platforms: 1-914CU; This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process and therefore has not bee
RMAN SET UNTIL不完全恢复
RMAN> run{2> set until time "to_date('2010/07/20 21:10:00','yyyy/mm/dd hh24:mi:ss')";3> restore database;4> recover database;5> }[@more@]
alter database create datafile '' as ''
之前有控制文件的备份,数据文件全部丢失,online redo file和archived redo是连续的,恢复如下。 我们要用noresetlogs因为日志文件全都是完好的。 SQL> CREATE CONTROLFILE REUSE DATABASE "ICMNLSDB"NORESETLOGS ARCHIVELOG 2 -- SET STANDBY TO MAXIMIZE PERFORMANCE 3 MAXLOGFILES 5 4 MAXLOGMEMBERS 3 5 MAXDATAFILES 100 6 MAXINSTANCES 1 7 MAXLOGHISTORY 226 8 LOGFILE 9 GROUP 1 'D:ORACLEORADATAICMNLSDBREDO01.LOG' SIZE 100M, 10 GROUP 2 'D:ORACLEORADATAICMNLSDBREDO02.LOG' SIZE 100M, 11 GROUP 3 'D:ORACLEO
ALTER DATABASE DATAFILE OFFLINE
NOTE: The ALTER DATABASE DATAFILE OFFLINE DROP command, is not meant to allow you to remove a datafile. What the command really means is that you are offlining the datafile with the intention of dropping the tablespace. If you are running in archivelog mode, you can also use: ALTER DATABASE DATAFILE OFFLINE; instead of OFFLINE DROP. Once the datafile is offline, Oracle no longer attempts to access it, but it is still considered part of that tablespace. This datafile is marked only as offline in
从Undo, Redo, DataFile看Oracle中的事务过程
这篇文章中,我们将通过Undo, Redo, DataFile的dump来看看Oracle中一个transaction过程。1:提交当前session中的pending transaction,SQL> show autocommit;autocommit OFFSQL> commit;Commit complete.2:确定transaction前的scn,SQL> connect sys/coffee@testdb as sysdba;Connected.SQL> select max(ktuxescnw * power(2, 32) + ktuxescnb) from x$ktuxe;MAX(KTUXESCNW*POWER(2,32)+KTUXESCNB)------------------------------------416835883:数据更新 SQL> connect system/coffee@testdb;Connected.SQL> update u
Oracle的redo 和undo的区别
写的次序: redo--> undo-->datafile insert一条记录时, 表跟undo的信息都会放进 redo 中, 在commit 或之前, redo 的信息会放进硬盘上. 故障时, redo 便可恢复那些已经commit 了的数据. redo->每次操作都先记录到redo日志中,当出现实例故障(像断电),导致数据未能更新到数据文件,则数据库重启时须redo,重新把数据更新到数据文件 undo->记录更改前的一份copy,但你系统rollback时,把这份copy重新覆盖到原来的数据 redo->记录所有操作,用于恢复(redo records all the database transaction used for recovery) undo-
Complete Checklist for Manual Upgrades to 11gR2
Complete Checklist for Manual Upgrades to 11gR2 [ID 837570.1] Modified 29-JUL-2010 Type BULLETIN Status PUBLISHED In this Document Purpose Scope and Application Complete Checklist for Manual Upgrades to 11gR2 ReferencesApplies to: Oracle Server - Standard Edition - Version: 9.2.0.8 to 11.2.0.1 - Release: 9.2 to 11.2Oracle Server - Enterprise Edition - Version: 9.2.0.8 to 11.2.0.1.0 [Release: 9.2 to 11.2]Information in this document applies to any platform.PurposeThis document is c
Linux find command
find . -mtime +7 -exec ls -al {} ; --7 days agofind . -mtime +7 -exec ls -al {} ; --less 7 daysfind . -type f|xargs grep -i "hello"find . -name "hello*"[@more@]
Linux系统中增加Swap分区大小
1、检查当前的分区情况: [root@localhost]#free -m2、增加交换分区文件及大小,如果要增加2G大小的交换分区,则命令写法如下,其中的 count 等于想要的块大小。 [root@localhost]# dd if=/dev/zero of=/home/swap bs=1024 count=20480003、设置交换文件: [root@localhost]# mkswap /home/swap4、立即启用交换分区文件 [root@localhost]# swapon /home/swap5、如果要在引导时自动启用,则编辑 /etc/fstab 文件,添加行: /home/swap swap swap defaults 0 0系统下次引导时,它就会启用新建的交换文件,再查看SWAP分区大小
PL/SQL cursor
CURSOR1 declarecursor a(i number) is select * from test where id=i;b test%rowtype;beginopen a(i=>1) ;loop fetch a into b;exit when a%notfound;dbms_output.put_line(b.name);end loop;close a;end;2 declarebeginfor a in (select * from test) loopdbms_output.put_line(a.name);end loop;end;3 declarecursor b(i number) is select * from test where id=i;beginfor c in b(i=>1) loopdbms_output.put_line(c.name);end loop;end;4declarecursor a is select * from mao where rownum<100;b mao%rowtype;beginfor b
Linux change date time
Linux修改时间的方法 修改linux的时间可以使用date指令在命令行输入:date显示当前时间 Fri Aug 3 14:15:16 CST 2007date -s 按字符串方式修改时间可以只修改日期,不修改时间,输入: date -s 2007-08-03只修改时间,输入:date -s 14:15:00同时修改日期时间,注意要加双引号,日期与时间之间有一空格,输入:date -s "2007-08-03 14:15:00"修改完后,记得输入:clock -w 把系统时间写入CMOS 硬件时钟:hwclock --systohc set the hardware clock to the current system timehwclock --httosys set the system time from hardware clockhwc
RMAN
rman nocatalog target =/ --using controlfile CONTROL_FILE_RECORD_KEEP_TIME: default value 7rman target sys/test@pro catalog rman/rman@rman--install catalog database1.需要在catalog数据库test上建立表空间:create tablespace rman_catalog size 20M;需要用sysdba的权限连接到数据库上,表空间的名字可以自己设置。2.创建用户并制:create user rman identified by rman default tablesapce rman_catalog quota unlimited on rman_ts;建立用户,名称、密码可以自己设置,默认表空间为上面我们刚建立的表空间名称,不受限制。3.
ORACLE 10G expdp/impdp
--两库tablespace要一样c:>expdp help=y c:>impdp help=y SQL> create directory exp_dump as 'd:exp_dump';SQL> grant read, write on directory exp_dump to ...Importing Full Dump FileIf you want to Import all the objects in a dump file then you can type the following command. $impdp hr/hr DUMPFILE=dpump_dir1:expfull.dmp FULL=y LOGFILE=dpump_dir2:full_imp.logImporting Objects of One Schema to another SchemaThe following example loads all tables belonging to hr schema to scott schema$impdp SY
HELLO
Hello, EveryoneStarting today, I will record my feeling during my life, work, and so on ... [@more@]