博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2007年6月26日

摘要: 第六章:load数据 1.loading data using direct_load insert sql> insert /*+append */ into emp nologging sql> select * from emp_old; 2.parallel direct-load insert sql> alter session enable parallel dml; sql> insert /*+parallel(emp,2) */ into emp nologging sql> select * from emp_old; 3.using sql 阅读全文

posted @ 2007-06-26 17:43 徐正柱- 阅读(439) 评论(1) 推荐(0)

摘要: 第四章:索引 1.creating function-based indexes sql> create index summit.item_quantity on summit.item(quantity-quantity_shipped); 2.create a b-tree index sql> create [unique] index index_name on table_name(column,.. asc/desc) tablespace sql> tablespace_name [pctfree integer] [initrans integer] [ma 阅读全文

posted @ 2007-06-26 17:41 徐正柱- 阅读(417) 评论(1) 推荐(0)

摘要: 一、ORACLE的启动和关闭1、在单机环境下要想启动或关闭ORACLE系统必须首先切换到ORACLE用户,如下su-oraclea、启动ORACLE系统oracle>svrmgrlSVRMGR>connectinternalSVRMGR>startupSVRMGR>quitb、关闭ORACLE系统o... 阅读全文

posted @ 2007-06-26 17:37 徐正柱- 阅读(285) 评论(0) 推荐(0)

摘要: 第十二章: BACKUP and RECOVERY 1. v$sga,v$instance,v$process,v$bgprocess,v$database,v$datafile,v$sgastat 2. Rman need set dbwr_IO_slaves or backup_tape_IO_slaves and large_pool_size 3. Monitoring Parallel Rollback > v$fast_start_servers , v$fast_start_transactions 4.perform a closed database backup .. 阅读全文

posted @ 2007-06-26 17:36 徐正柱- 阅读(320) 评论(1) 推荐(0)

摘要: 第一章:日志管理 1.forcing log switches sql> alter system switch logfile; 2.forcing checkpoints sql> alter system checkpoint; 3.adding online redo log groups sql> alter database add logfile [group 4] sql> ('/disk3/log4a.rdo','/disk4/log4b.rdo') size 1m; 4.adding online redo log m 阅读全文

posted @ 2007-06-26 17:30 徐正柱- 阅读(515) 评论(1) 推荐(0)

2007年6月25日

摘要: Commit操作不强制将database buffer内容写到文件;Commit操作后,server process在提示用户“操作已完成”之后才释放相关资源的锁; 创建数据库时,数据文件和日志文件必须用size指定大小,或用reuse指定到某个已有文件,否则命令会失败; 若丢失了所有control file的副本,可以通过重建control file恢复数据库; ... 阅读全文

posted @ 2007-06-25 13:40 徐正柱- 阅读(372) 评论(0) 推荐(0)

2007年6月22日

摘要: 9i有一个新的包 dbms_xplan,对查询plan_table表是一个很有用的工具,相对于以前写一个复杂的SQL语句,然后从plan_table看执行计划,不如调用 dbms_xplan 包,还可以显示格式,这个工具的使用也非常方便。调用的语法类似select * from table(dbms_xplan.display(format=>'BASIC')) 使用 TABLE() 操作符,或者 CAST 操作。DISPLAY 函数有三个参数TABLE_NAME 指出优化计划放在哪个表里面,默认是 PLAN_TABLE. STATEMENT_ID 指的是plan tab 阅读全文

posted @ 2007-06-22 17:20 徐正柱- 阅读(534) 评论(0) 推荐(0)

摘要: buffer busy waits说明buffer cache中有一些buffers被多个进程尝试同时访问。查看V$WAITSTAT观察各种类型buffer wait的统计信息。SELECT class, count FROM V$WAITSTAT WHERE count > 0 ORDER BY count DESC;也可以查看V$SESSION_WAIT观察当前buffer wait信息,其中P1-FILE_ID, P2- BLOCK_ID,再通过DBA_EXTENTS查找哪些SEGMENT被争用。Select * from v$session_wait where event=’b 阅读全文

posted @ 2007-06-22 17:12 徐正柱- 阅读(1021) 评论(0) 推荐(0)

摘要: 1.查询记录相同的其中一笔记录SELECT mat12id, mat12name , bat22id,PRICEFROM (SELECT mat12id, mat12name , bat22id,PRICE, ROW_NUMBER() OVER (PARTITION BY mat12id ORDER BY bat22id DESC) RN FROM bat22)WHERE RN = 12.查询从多少行到多少行的记录SELECT * FROM (SELECT A.*,rownum rFROM(SELECT * FROM TableName )AWHER... 阅读全文

posted @ 2007-06-22 11:24 徐正柱- 阅读(982) 评论(0) 推荐(0)

2007年6月20日

摘要: Q. 1 : When will the rollback information applied in the event of a database crash 1. before the crash occurs 2. after the recovery is complete 3. immediately after re-opening the database bef... 阅读全文

posted @ 2007-06-20 17:54 徐正柱- 阅读(686) 评论(0) 推荐(0)