lory 发表于 2013-11-20 10:47:17

create table as 的nologging问题

db:10.2.0.5
OS:windows 2008 64 bit
在网上看到刘大的帖子,关于nologging的操作,里面是
http://www.askmaclean.com/archives/oracle%E4%B8%AD%E5%8F%AF%E4%BB%A5nologging%E6%89%A7%E8%A1%8C%E7%9A%84%E6%93%8D%E4%BD%9C.htmlselect FORCE_LOGGING from v$database;
FORCE_LOGGING
-------------
NO
select f.force_logging from dba_tablespaces f where tablespace_name ='SYSTRAVEL'
FORCE_LOGGING
-------------
NO
create table sajet.test_nolog tablespace systravel nologging as select * from dba_users where rownum=1;

alter system switch logfile;

exec dbms_logmnr.add_logfile('E:\archive\ARC00012_0830619918.001');

PL/SQL procedure successfully completed

SQL> exec dbms_logmnr.start_logmnr;

PL/SQL procedure successfully completed

SQL> select SQL_REDO from v$logmnr_contents l where l.SEG_NAME='TEST_NOLOG';

SQL_REDO
--------------------------------------------------------------------------------
ALTER TABLE "SAJET"."TEST_NOLOG" RENAME CONSTRAINT "SYS_C007061" TO "BIN$4AQRcks
ALTER TABLE "SAJET"."TEST_NOLOG" RENAME CONSTRAINT "SYS_C007062" TO "BIN$yE0XDz+
ALTER TABLE "SAJET"."TEST_NOLOG" RENAME CONSTRAINT "SYS_C007063" TO "BIN$AJGIii5
ALTER TABLE "SAJET"."TEST_NOLOG" RENAME CONSTRAINT "SYS_C007064" TO "BIN$uSggEMX
ALTER TABLE "SAJET"."TEST_NOLOG" RENAME CONSTRAINT "SYS_C007065" TO "BIN$+5PcbEN
ALTER TABLE "SAJET"."TEST_NOLOG" RENAME CONSTRAINT "SYS_C007066" TO "BIN$15I6MV/
ALTER TABLE "SAJET"."TEST_NOLOG" RENAME CONSTRAINT "SYS_C007067" TO "BIN$6j1dwMQ
ALTER TABLE "SAJET"."TEST_NOLOG" RENAME TO "BIN$1XgGTdtARh2/wPSgQ0hczQ==$0" ;
drop table test_nolog

AS "BIN$1XgGTdtARh2/wPSgQ0hczQ==$0" ;

create table sajet.test_nolog tablespace systravel nologging as select * from db

;

10 rows selected
SQL>
使用logminer查看日志
但是日志里面为何还是记录了这个表的创建的redo呢

Maclean Liu(刘相兵 发表于 2013-11-20 10:56:12

你没有理解nologging的含义 , nologging并不能避免 管理字典的基本维护生成的redo, 而是当我批量加载数据时,加载数据这个操作的 日志可以省略, 与后者相比 前者的redo 如九牛一毛
页: [1]
查看完整版本: create table as 的nologging问题