- 浏览: 271376 次
- 性别:
- 来自: 广州
最新评论
-
Yiwu_zh:
步骤清晰,跟着来做,真搭建好了
不过用的是10.5版本,输出有 ...
搭建简单的DB2 HADR -
luogen33:
db2备份单个表 -
gthao:
1 楼正解。。如果schema里面有内容的话,就删除不了,会报 ...
db2建立schema -
znttql:
整理的太好了 非常感谢啊
DB2 日期 时间 -
alvin198761:
能根据schame备份数据库不??
db2备份单个表
原题如下:
if the tablespace is in the NOLOGGING mode, no operation on the tablespace will generate redo.
这句话是错误的。
很容易从字面上误解了他的意思,my support上有解析到:
nologging影响到的操作有:
1.SQL*Loader的直接导入
2.直接的insert操作,或者是create table|index的命令
3.带有NOCACHE NOLOGGING 含有LOB的对象的装载
同样,只能在database,tablespace,object都NO FORCE LOGGING的情况下才能使用
原文如下:
The Gains and Pains of Nologging Operations [ID 290161.1]
--------------------------------------------------------------------------------
Modified 02-NOV-2008 Type BULLETIN Status PUBLISHED
THE GAINS AND PAINS OF NOLOGGING OPERATIONS
Overview
Whereas a logged INSERT operation has to generate redo for every change data or undo block, nologging operations indicate that the database operation is not logged in the online redo log file. Even though a small invalidation redo record¹ is still written to the online redo log file, nologging operations skip the redo generation of the corresponding inserted data. Nologging can be extremely beneficial for the following reasons:
data written to the redo is minimized dramatically
time to insert into a large table or index or LOB can be reduced dramatically
performance improves for parallel creation of large tables or indices
However, NOLOGGING is intended for configurations in which media recovery or the recovery of the corresponding object is not important. Thus, if the disk or tape or storage media fails, you will not be able to recover your changes from the redo because the changes were never logged.
Nologging operations are invoked by any of the following:
SQL*Loader direct load operations
Direct load INSERT operations from CREATE TABLE | INDEX or INSERT commands
Loading into an object containing LOB data when its object’s segment characteristic is NOCACHE NOLOGGING
For databases in ARCHIVELOG mode, nologging operations can only occur for a particular object if and only if:
Database allows for nologging (ALTER DATABASE NO FORCE LOGGING) and
Tablespace allows for nologging (ALTER TABLESPACE <NAME> NO FORCE LOGGING) and
Object allows for nologging (ALTER TABLE <NAME> NOLOGGING)
This paper will cover the following topics:
examples of nologging operations
prevention of nologging operations
detection of nologging operations on the primary and standby databases
repair of nologged changes on the physical and logical standby databases
Examples of nologging operations
Below is a list of examples that can be used for testing purposes. The database must be in ARCHIVELOG mode and must allow nologging operations to see the effect of nologging changes:
1. insert /*+ APPEND */ into scott.emp select * from sys.emp2;
2. create table emp nologging as select * from sys.emp;
3. create index emp_i on emp(empno) nologging;
4. sqlload operation with unrecoverable option
Prevention of nologging operations
When a standby database exists or if you want all transactions to be recoverable on a database, tablespace or object-wide perspective, it is recommended that you prevent nologging operations by issuing the relevant options. These options include:
ALTER DATABASE FORCE LOGGING (database level) or
ALTER TABLESPACE <NAME> FORCE LOGGING (tablespace level) on the relevant tablespaces you want to protect or
[CREATE | ALTER] TABLE <NAME> LOGGING (example of object level) on the relevant objects you want to protect
This ensures that all transactions are logged and can be recovered through media recovery or Redo Apply or SQL Apply assuming appropriate data type support.
Detection of Nologging Operations On the Primary and Standby Databases
On the primary database, you can monitor for the most recent nologging operation that occurred in the database by issuing the following query:
SELECT NAME, UNRECOVERABLE_CHANGE#,
TO_CHAR (UNRECOVERABLE_TIME,'DD-MON-YYYY HH:MI:SS')
FROM V$DATAFILE;
The above primary database’s query dictates when the most recent nologging operation occurred and when the invalidation redo was written to the redo.
Once Redo Apply (or Media Recovery) processes the invalidation redo, it marks all the corresponding data blocks corrupt. You will detect encounter corrupted blocks on the physical standby database when you query any data that references these data blocks. You will receive the following errors:
ORA-01578: ORACLE data block corrupted (file # 3, block # 514)
ORA-01110: data file 3: '/u01/lto_linux9206/dbs/users.dbf'
ORA-26040: Data block was loaded using the NOLOGGING option
You can proactively catch some of these corrupted blocks on Redo Apply (or media recovery) instance by running DBVERIFY on the data files.
$ dbv file=users.dbf
DBVERIFY - Verification starting : FILE = users.dbf
DBV-00200: Block, dba 12583426, already marked corrupted
DBV-00200: Block, dba 12583427, already marked corrupted
DBV-00200: Block, dba 12583428, already marked corrupted
SQL apply ignores the invalidation redo since it cannot convert it to any reasonable SQL; so, the logical standby will not receive any immediate errors. If future transactions reference the missing data, then apply slave will receive an ORA-01403 in the alert.log. For example, the following UPDATE statement failed on the logical standby because it was referencing “nologged” rows that do not exist on the logical standby database.
LOGSTDBY stmt: update "SCOTT"."NOLOG"
set
"SAL" = 810
where
"EMPNO" = 7369 and
"ENAME" = 'SMITH' and
"JOB" = 'CLERK' and
"MGR" = 7902 and
"HIREDATE" = TO_DATE('17-DEC-80', 'DD-MON-RR') and
"SAL" = 800 and
"COMM" IS NULL and
"DEPTNO" = 20 and
ROWID = 'AAAAAAAAEAAAACRAAA'
LOGSTDBY status: ORA-01403: no data found
LOGSTDBY PID 21733, oracle@dlsun1917 (P004)
LOGSTDBY XID 0x0001.010.00000cf3, Thread 1, RBA 0x038b.00000826.1a4
Tue Nov 2 18:26:51 2004
Errors in file /private/oracle/app/admin/tens/bdump/tens_lsp0_20328.trc:
ORA-12801: error signaled in parallel query server P004
ORA-01403: no data found
LOGSTDBY Reader P003 pid=27 OS id=21729 stopped
Currently in Oracle 9i and Oracle 10gR1, only the primary’s database V$DATAFILE view reflects nologging operations.. In 10gR2, the V$DATAFILE view will be enhanced to include information regarding when an invalidation redo is applied and the aforementioned corrupted blocks are written to the corresponding data file on a Redo Apply (or media recovery or standby) instance.
Repair of Nologged Changes on the Physical and Logical Standby Databases
After a nologged operation on the primary is detected, it is recommended to create a backup immediately if you want to recover from this operation in the future. However there are additional steps required if you have an existing physical or logical standby database. This is crucial if you want to preserve the data integrity of your standby databases.
For a physical standby database, Redo Apply will process the invalidation redo and mark the corresponding data blocks corrupt.
For a physical standby database, follow these steps² to reinstantiate the relevant data files .
1. stop Redo Apply (recover managed standby database cancel)
2. offline corresponding datafile(s) (alter database datafile <NAME> offline drop;)
3. start Redo Apply (recover managed standby database disconnect)
4. copy the appropriate backup datafiles over from the primary database (e.g. use RMAN to backup datafiles and copy them)
5. stop Redo Apply (recover managed standby database cancel)
6. online corresponding data files (alter database datafile <NAME> online;)
7. start Redo Apply (recover managed standby database disconnect)
For a logical standby database, SQL Apply skips over the invalidation redo completely; so, the subsequent corresponding table or index will not be updated. However, future reference to missing data will result in ORA-1403 (no data found). In order to resynchronize the table with the primary table, you need to re-create it from the primary database. Follow the steps described in Oracle Data Guard Concepts and Administration, Chapter 'Managing a Logical Standby Database', and Section 'Adding or Re-Creating Tables On a Logical Standby Database' Basically, you will be using the DBMS_LOGSTDBY.INSTANTIATE_TABLE procedure.
¹Invalidation redo containing information about the nologging operation and the range of blocks it affects.
²Please also refer to the Data Guard Concepts & Administration documentation.
Related
--------------------------------------------------------------------------------
Products
--------------------------------------------------------------------------------
Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Enterprise Edition
if the tablespace is in the NOLOGGING mode, no operation on the tablespace will generate redo.
这句话是错误的。
很容易从字面上误解了他的意思,my support上有解析到:
nologging影响到的操作有:
1.SQL*Loader的直接导入
2.直接的insert操作,或者是create table|index的命令
3.带有NOCACHE NOLOGGING 含有LOB的对象的装载
同样,只能在database,tablespace,object都NO FORCE LOGGING的情况下才能使用
原文如下:
The Gains and Pains of Nologging Operations [ID 290161.1]
--------------------------------------------------------------------------------
Modified 02-NOV-2008 Type BULLETIN Status PUBLISHED
THE GAINS AND PAINS OF NOLOGGING OPERATIONS
Overview
Whereas a logged INSERT operation has to generate redo for every change data or undo block, nologging operations indicate that the database operation is not logged in the online redo log file. Even though a small invalidation redo record¹ is still written to the online redo log file, nologging operations skip the redo generation of the corresponding inserted data. Nologging can be extremely beneficial for the following reasons:
data written to the redo is minimized dramatically
time to insert into a large table or index or LOB can be reduced dramatically
performance improves for parallel creation of large tables or indices
However, NOLOGGING is intended for configurations in which media recovery or the recovery of the corresponding object is not important. Thus, if the disk or tape or storage media fails, you will not be able to recover your changes from the redo because the changes were never logged.
Nologging operations are invoked by any of the following:
SQL*Loader direct load operations
Direct load INSERT operations from CREATE TABLE | INDEX or INSERT commands
Loading into an object containing LOB data when its object’s segment characteristic is NOCACHE NOLOGGING
For databases in ARCHIVELOG mode, nologging operations can only occur for a particular object if and only if:
Database allows for nologging (ALTER DATABASE NO FORCE LOGGING) and
Tablespace allows for nologging (ALTER TABLESPACE <NAME> NO FORCE LOGGING) and
Object allows for nologging (ALTER TABLE <NAME> NOLOGGING)
This paper will cover the following topics:
examples of nologging operations
prevention of nologging operations
detection of nologging operations on the primary and standby databases
repair of nologged changes on the physical and logical standby databases
Examples of nologging operations
Below is a list of examples that can be used for testing purposes. The database must be in ARCHIVELOG mode and must allow nologging operations to see the effect of nologging changes:
1. insert /*+ APPEND */ into scott.emp select * from sys.emp2;
2. create table emp nologging as select * from sys.emp;
3. create index emp_i on emp(empno) nologging;
4. sqlload operation with unrecoverable option
Prevention of nologging operations
When a standby database exists or if you want all transactions to be recoverable on a database, tablespace or object-wide perspective, it is recommended that you prevent nologging operations by issuing the relevant options. These options include:
ALTER DATABASE FORCE LOGGING (database level) or
ALTER TABLESPACE <NAME> FORCE LOGGING (tablespace level) on the relevant tablespaces you want to protect or
[CREATE | ALTER] TABLE <NAME> LOGGING (example of object level) on the relevant objects you want to protect
This ensures that all transactions are logged and can be recovered through media recovery or Redo Apply or SQL Apply assuming appropriate data type support.
Detection of Nologging Operations On the Primary and Standby Databases
On the primary database, you can monitor for the most recent nologging operation that occurred in the database by issuing the following query:
SELECT NAME, UNRECOVERABLE_CHANGE#,
TO_CHAR (UNRECOVERABLE_TIME,'DD-MON-YYYY HH:MI:SS')
FROM V$DATAFILE;
The above primary database’s query dictates when the most recent nologging operation occurred and when the invalidation redo was written to the redo.
Once Redo Apply (or Media Recovery) processes the invalidation redo, it marks all the corresponding data blocks corrupt. You will detect encounter corrupted blocks on the physical standby database when you query any data that references these data blocks. You will receive the following errors:
ORA-01578: ORACLE data block corrupted (file # 3, block # 514)
ORA-01110: data file 3: '/u01/lto_linux9206/dbs/users.dbf'
ORA-26040: Data block was loaded using the NOLOGGING option
You can proactively catch some of these corrupted blocks on Redo Apply (or media recovery) instance by running DBVERIFY on the data files.
$ dbv file=users.dbf
DBVERIFY - Verification starting : FILE = users.dbf
DBV-00200: Block, dba 12583426, already marked corrupted
DBV-00200: Block, dba 12583427, already marked corrupted
DBV-00200: Block, dba 12583428, already marked corrupted
SQL apply ignores the invalidation redo since it cannot convert it to any reasonable SQL; so, the logical standby will not receive any immediate errors. If future transactions reference the missing data, then apply slave will receive an ORA-01403 in the alert.log. For example, the following UPDATE statement failed on the logical standby because it was referencing “nologged” rows that do not exist on the logical standby database.
LOGSTDBY stmt: update "SCOTT"."NOLOG"
set
"SAL" = 810
where
"EMPNO" = 7369 and
"ENAME" = 'SMITH' and
"JOB" = 'CLERK' and
"MGR" = 7902 and
"HIREDATE" = TO_DATE('17-DEC-80', 'DD-MON-RR') and
"SAL" = 800 and
"COMM" IS NULL and
"DEPTNO" = 20 and
ROWID = 'AAAAAAAAEAAAACRAAA'
LOGSTDBY status: ORA-01403: no data found
LOGSTDBY PID 21733, oracle@dlsun1917 (P004)
LOGSTDBY XID 0x0001.010.00000cf3, Thread 1, RBA 0x038b.00000826.1a4
Tue Nov 2 18:26:51 2004
Errors in file /private/oracle/app/admin/tens/bdump/tens_lsp0_20328.trc:
ORA-12801: error signaled in parallel query server P004
ORA-01403: no data found
LOGSTDBY Reader P003 pid=27 OS id=21729 stopped
Currently in Oracle 9i and Oracle 10gR1, only the primary’s database V$DATAFILE view reflects nologging operations.. In 10gR2, the V$DATAFILE view will be enhanced to include information regarding when an invalidation redo is applied and the aforementioned corrupted blocks are written to the corresponding data file on a Redo Apply (or media recovery or standby) instance.
Repair of Nologged Changes on the Physical and Logical Standby Databases
After a nologged operation on the primary is detected, it is recommended to create a backup immediately if you want to recover from this operation in the future. However there are additional steps required if you have an existing physical or logical standby database. This is crucial if you want to preserve the data integrity of your standby databases.
For a physical standby database, Redo Apply will process the invalidation redo and mark the corresponding data blocks corrupt.
For a physical standby database, follow these steps² to reinstantiate the relevant data files .
1. stop Redo Apply (recover managed standby database cancel)
2. offline corresponding datafile(s) (alter database datafile <NAME> offline drop;)
3. start Redo Apply (recover managed standby database disconnect)
4. copy the appropriate backup datafiles over from the primary database (e.g. use RMAN to backup datafiles and copy them)
5. stop Redo Apply (recover managed standby database cancel)
6. online corresponding data files (alter database datafile <NAME> online;)
7. start Redo Apply (recover managed standby database disconnect)
For a logical standby database, SQL Apply skips over the invalidation redo completely; so, the subsequent corresponding table or index will not be updated. However, future reference to missing data will result in ORA-1403 (no data found). In order to resynchronize the table with the primary table, you need to re-create it from the primary database. Follow the steps described in Oracle Data Guard Concepts and Administration, Chapter 'Managing a Logical Standby Database', and Section 'Adding or Re-Creating Tables On a Logical Standby Database' Basically, you will be using the DBMS_LOGSTDBY.INSTANTIATE_TABLE procedure.
¹Invalidation redo containing information about the nologging operation and the range of blocks it affects.
²Please also refer to the Data Guard Concepts & Administration documentation.
Related
--------------------------------------------------------------------------------
Products
--------------------------------------------------------------------------------
Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Enterprise Edition
发表评论
-
Oracle Cursor Sharing
2011-05-06 01:57 0上周被问到一个问题:oracle参数cursor_sharin ... -
sqlplus登录自动运行脚本
2011-04-20 00:02 2007如果每次使用sqlplus都要设置如serveroutput或 ... -
被问到的问题,导出DDL
2011-04-15 20:31 887导出DDL定义的几种方法 有时候经常需要导出建表语句,在这 ... -
about RESETLOGS
2010-09-15 22:12 888终于要面对RESETLOGS了, ... -
BLOCK、EXTENT、SEGMENT、TABLESPACE、Data Dictionary
2010-08-14 16:44 1336BlockBlock 可以分为 Header Ta ... -
STATISTICS_LEVEL
2010-07-19 16:15 1058看图说话: Oracle Advisory B ... -
SGA_TARGET
2010-07-19 11:03 1393当SGA_TARGET设置为非零值,oracle 10g会自动 ... -
method of segment space management
2010-07-13 16:40 782Locally Managed Tablespaces有两种管 ... -
oracle sql解析顺序
2010-07-12 16:47 1437今天被问到了一个where rownum与order by的顺 ... -
利用oracle学习DB2
2010-07-01 11:14 876现在开始要接触多一个D ... -
关于RAC failover的实践
2010-05-21 09:19 1103关于之前RAC的failover同事们都有一个猜想,failo ... -
卸载clusterware
2010-05-20 09:32 1343最简单的就是运行以下两个脚本: ./rootdelete. ... -
dataguard成功实现物理switchover
2010-04-26 16:28 1314一直都不能实现switchover,在看了不少文档后终于实现, ... -
使用exp/imp转移大的数据库定义(脚本)
2010-04-23 15:05 934都知道exp rows=n可以不导出具体的数据,但是做全库导出 ... -
oracle 连接解释方法
2010-04-13 14:05 978Easy Connect: 格式: <usern ... -
RMAN-06428
2010-03-25 15:11 1234今天建立新的nbu oracle client 遇到RMAN- ... -
oracle import改表名
2010-03-24 16:23 4880小技巧 现在工作有大量exp/imp工作,其中遇到过需要该表 ... -
dataguard 笔记
2010-03-23 09:50 1106推荐按照三思的文档去做,当然首先要了解dataguard的原理 ... -
fga的教训
2010-03-17 10:30 1241这是一个教训,记录下来 一个简单的需求,监测一个表记录不明被 ... -
ORA-08102
2010-03-11 11:01 1526处理完ORA-600 4193后又来了个ORA-08102 ...
相关推荐
BLOG_Oracle_lhr_【知识点整理】Oracle中NOLOGGING、APPEND、ARCHIVE和PARALLEL下,REDO、UNDO和执行速度的比较BLOG_Oracle_lhr_【知识点整理】Oracle中NOLOGGING、APPEND、ARCHIVE和PARALLEL下,REDO、UNDO和执行...
oracle nologging全面总结,从数据库级别,对象以及表级别都有说明,以及在生产环境的影响,和及时止损的处理方法。
abator 生成ibaties dao xml 生成命令
ORA-14102: 只能指定一个 LOGGING 或 NOLOGGING 子句 安装补丁:8795792补丁 oracle
profile和bashrc比较测试, 结论:bashrc文件可以在nologging状态下生效,而profile文件不可以
org.apache.ibatis.logging.nologging org.apache.ibatis.logging.slf4j org.apache.ibatis.logging.stdout 对象适配器设计模式 2.异常 org.apache.ibatis.exceptions 3.缓存 org.apache.ibatis.cache org.apache...
1. 启动主数据库的强制日志记录功能,避免Nologging子句的影响 ALTER DATABASE FORCE LOGGING; 2. 配置日志传递的安全认证 一般情况,设定remote_login_passwordfile=exclusive,并且配置tnsnames.ora即可 3. 配置主...
oracle 分区表学习及应用示例Create table(创建分区表) ... storage(initial 100k next 100k minextents 1 maxextents unlimited pctincrease 0) nologging; grant all on bill_monthfee_zero to dxsq_dev;
UPDATE 1、先备份数据(安全、提高性能)。2、分批更新,小批量提交,防止锁表。3、如果被更新的自动有索引,更新的数据量很...2、大批量数据删除加上rownum<1000> nologging;)2、使用/*+ append */ 暗示。3、绑定变
Oracle Nologging全面总结 Oracle RAC 集群安装部署 Oracle RMAN 单实例异机迁移恢复(版本:11GR2) Oracle存储过程性能分析案例 Oracle技术加油站:快速处理紧急性能问题的工具与经验 Oracle诊断性能问题时常用...
sql> [logging | nologging] [nosort] storage(initial 200k next 200k pctincrease 0 sql> maxextents 50); <3>.pctfree(index)=(maximum number of rows-initial number of rows)*100/maximum number of ...
在导入时指定参数indexes=n,只导入数据而忽略index,在导完数据后在通过脚本创建index,指定 NOLOGGING选项 导出/导入与字符集 进行数据的导入导出时,我们要注意关于字符集的问题。在EXP/IMP过程中我们需要注意四个...
10.2.6 LOGGING和NOLOGGING 348 10.2.7 INITRANS和MAXTRANS 349 10.3 堆组织表 349 10.4 索引组织表 352 10.5 索引聚簇表 368 10.6 散列聚簇表 376 10.7 有序散列聚簇表 386 10.8 嵌套表 390 10.8.1 嵌套表...
│ │ │ frame-sourcefiles-org.apache.ibatis.logging.nologging.html │ │ │ frame-sourcefiles-org.apache.ibatis.logging.slf4j.html │ │ │ frame-sourcefiles-org.apache.ibatis.logging.stdout.html │ ...
实验52:日志文件管理和nologging的实现 107 数据文件 111 实验53:建立新的表空间 111 实验54:更改表空间的名称,更改数据文件的名称 113 表空间 116 实验55:建立临时表空间 117 实验56:大文件表空间和表空间的...
oracle学习文档 笔记 全面 深刻 详细 通俗易懂 doc word格式 清晰 第一章 Oracle入门 一、 数据库概述 数据库(Database)是按照数据结构来组织、存储和管理数据的仓库,它产生于距今五十年前。...
目录 序 ............................................................................................... 17 前言 ...........................................................................................