一个数据记录系统,需要长期性每秒钟记录10个记录。开始性能没有问题,但是当表中数据超过150000行时,插入数据就变得很慢而使系统不可用。我在另一贴问过,http://topic.csdn.net/u/20101208/11/601d1467-cbaa-49c2-926b-7af2237c096e.html我按照里面的提示方法,去掉了所有索引,插入时加了 nologging,但是性能还是没有一点改观。我使用 TOAD的 rebuild table 工具后,性能恢复到开始时的状态。我查看了 rebuild table 的 sql 代码,Toad只是把原来的表rename了,然后重建了 一个同名的表。但是我想,插入一定数据后,肯定还会有性能下降的情况出现。请问各位高手,这种问题我该如何解决呢。系统要求较高的插入性能,但查询性能要求倒不是很高。
解决方案 »
- 遍历游标插入数据最后一条不能插入
- 函数返回的游标,能否直接select显示?
- long raw select 很慢
- oracle里面的/是不是和Sql server的go相当
- ORACLE数据块中的SCN是如何变化的?
- sqlplus中能不能查看数据库中链接?
- 简单的触发器问题,更新时另外一个表的相应字段也跟着更新!请各位帮忙,先行谢过
- ORA-00205: error in identifying controlfile, check alert log for more info在线等待
- trunc的问题
- 在Oracle中如何读外部文本
- 如何查询oracle10中的datafile名称和编号,tablespace名称和编号
- 表分区I/O问题
2、有索引最好先禁掉index 等插入完之后再rebuild
重整之后应该和开始时一样快。
批量数据的DML操作,养成良好的习惯就是批量提交,这很重要,经验告诉我的
有可能?为什么是有可能?原理是什么?
undo_rentention是可配置的吗?
CREATE TABLE TB_PROCESSDATA
(
INSERT_COUNTER NUMBER(28) DEFAULT NULL NOT NULL,
DT TIMESTAMP(3) DEFAULT LOCALTIMESTAMP,
//然后是80多列
...
)
TABLESPACE USERS
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
NOLOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
CREATE OR REPLACE TRIGGER TB_PROCESSDATA_TRIG
BEFORE INSERT
ON TB_PROCESSDATA
REFERENCING NEW AS New OLD AS Old
FOR EACH ROW
WHEN (
NEW.INSERT_COUNTER IS NULL
)
BEGIN
SELECT SEQ_PROCESSDATA.NEXTVAL INTO :NEW.INSERT_COUNTER FROM dual; EXCEPTION
WHEN OTHERS THEN
-- Consider logging the error and then re-raise
RAISE;
END TB_PROCESSDATA_TRIG;
/
SHOW ERRORS;
UNDO_RETENTION specifies (in seconds) the low threshold value of undo retention. For AUTOEXTEND undo tablespaces, the system retains undo for at least the time specified in this parameter, and automatically tunes the undo retention period to satisfy the undo requirements of the queries. For fixed- size undo tablespaces, the system automatically tunes for the maximum possible undo retention period, based on undo tablespace size and usage history, and ignores UNDO_RETENTION unless retention guarantee is enabled.The setting of this parameter should account for any flashback requirements of the system. Automatic tuning of undo retention is not supported for LOBs. The RETENTION value for LOB columns is set to the value of the UNDO_RETENTION parameter.The UNDO_RETENTION parameter can only be honored if the current undo tablespace has enough space. If an active transaction requires undo space and the undo tablespace does not have available space, then the system starts reusing unexpired undo space. This action can potentially cause some queries to fail with a "snapshot too old" message.
在开始时用 Toad 建的表,不小心点了 DEFAULT NULL,后来不知怎么在 TOAD 里就去不掉了,后来也没管它了。:D
1、影响插入性能的因素有哪些,如硬件、数据库系统配置、数据插入代码等。
2、针对这些因素有哪些解决方法?
3、如果在数据库管理层面不能解决,还有别的方法吗,比如说适时rebuild table。