[20181031]12c 在线移动数据文件.txt

--//12c以前,移动或者改名数据文件是一项比较麻烦的事情,至少要停一下业务.而12c支持在线移动或者改名数据文件,并且有点不可思议
--//的是这个操作可以在非归档模式下完成.链接有人问这个安全性的问题,链接http://www.itpub.net/thread-2106077-1-1.html,自己也测试看看.
--//没有在linux下安装12c,而且linux下有许多分析工具strace,gdb等等.windows下使用systeminternals的Procmon.exe跟踪看看,直接
--//跟踪tid。

1.环境:
[email protected]> @ver1

PORT_STRING                    VERSION        BANNER                                                                               CON_ID
------------------------------ -------------- -------------------------------------------------------------------------------- ----------
IBMPC/WIN_NT64-9.1.0           12.2.0.1.0     Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production              0

2.建立测试环境:
CREATE TABLESPACE lfree DATAFILE
  ‘D:\APP\ORACLE\ORADATA\TEST\TEST01P\lfree01.dbf‘ SIZE 100M AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED
LOGGING
ONLINE
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON;

[email protected]> select * from v$dbfile ;
     FILE# NAME                                             CON_ID
---------- ------------------------------------------------ ------
         8 D:\APP\ORACLE\ORADATA\TEST\TEST01P\SYSTEM01.DBF       3
         9 D:\APP\ORACLE\ORADATA\TEST\TEST01P\SYSAUX01.DBF       3
        10 D:\APP\ORACLE\ORADATA\TEST\TEST01P\UNDOTBS01.DBF      3
        11 D:\APP\ORACLE\ORADATA\TEST\TEST01P\USERS01.DBF        3
        36 D:\APP\ORACLE\ORADATA\TEST\TEST01P\LFREE01.DBF        3
--//确定fule#=36

[email protected]> create table t tablespace lfree as select rownum id,‘test‘ name from dual connect by level<=100;
Table created.

3.建立一个存储过程:
--//以sys用户执行:
[email protected]> grant execute on dbms_lock to scott;
Grant succeeded.

--//再建立存储过程:
CREATE OR REPLACE PROCEDURE test_proc AS
BEGIN
   FOR J IN 1..26 LOOP
      FOR i IN 1..100 LOOP
          update t set name=chr(64+j)||i where id=i;
          COMMIT;
          dbms_lock.sleep(0.1);
      END LOOP;
   END LOOP;
END;
/
Procedure created.
--//脚本执行至少需要26*100*0.1 = 260秒。

--//session 1:
[email protected]> @ spid

SID    SERIAL# PROCESS                  SERVER    SPID                     PID  P_SERIAL# C50
---------- ---------- ------------------------ --------- -------------------- ------- ---------- --------------------------------------------------
        88      30472 5628:2772                DEDICATED 6624                       9         15 alter system kill session ‘88,30472‘ immediate;
--//记录下spid=6624,然后先输入命令注意先不要回车执行,执行Procmon.exe跟踪TID=6624:
[email protected]> ALTER DATABASE MOVE DATAFILE 36 TO ‘D:\APP\ORACLE\ORADATA\TEST\TEST01P\lfree01x.dbf‘;

--//sesson 2,执行如下,马上切换到session 1,执行以上命令:
[email protected]> exec test_proc

--//在procmon.exe 界面上选择过滤 path contains LFREE的条件:
"Time of Day","Process Name","PID","Operation","Path","Result","Detail","TID"
"21:35:46.2364632","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","CreationTime: 2018/10/30 21:24:16, LastAccessTime: 2018/10/30 21:24:16, LastWriteTime: 2018/10/30 21:27:37, ChangeTime: 2018/10/30 21:27:37, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6624"
"21:35:46.2366668","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","CreationTime: 2018/10/30 21:24:16, LastAccessTime: 2018/10/30 21:24:16, LastWriteTime: 2018/10/30 21:27:37, ChangeTime: 2018/10/30 21:27:37, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6624"
"21:35:46.2368618","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","CreationTime: 2018/10/30 21:24:16, LastAccessTime: 2018/10/30 21:24:16, LastWriteTime: 2018/10/30 21:27:37, ChangeTime: 2018/10/30 21:27:37, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6624"
"21:35:46.2370088","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","CreationTime: 2018/10/30 21:24:16, LastAccessTime: 2018/10/30 21:24:16, LastWriteTime: 2018/10/30 21:27:37, ChangeTime: 2018/10/30 21:27:37, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6624"
"21:35:46.2372062","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","Desired Access: Generic Read/Write, Disposition: Open, Options: Write Through, No Buffering, Non-Directory File, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6624"
"21:35:46.2374521","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","Desired Access: Generic Read/Write, Disposition: Open, Options: No Buffering, Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6624"
"21:35:46.2578635","ORACLE.EXE","6808","ReadFile","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","Offset: 8,192, Length: 8,192, I/O Flags: Non-cached, Priority: Normal","6624"
--//读旧数据文件头。
"21:35:46.2751434","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","NAME NOT FOUND","","6624"
"21:35:46.2753602","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","NAME NOT FOUND","","6624"
"21:35:46.2755355","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","NAME NOT FOUND","","6624"
"21:35:46.2758586","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","NAME NOT FOUND","Desired Access: Generic Read, Disposition: Open, Options: No Buffering, Non-Directory File, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a","6624"
"21:35:46.2761353","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","NAME NOT FOUND","","6624"
"21:35:46.2763101","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","NAME NOT FOUND","","6624"
"21:35:46.2764895","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","NAME NOT FOUND","","6624"
"21:35:46.2766853","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","NAME NOT FOUND","","6624"
"21:35:46.2768467","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","NAME NOT FOUND","","6624"
--//检测文件是否存在。
"21:35:46.2770729","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Desired Access: Generic Write, Read Attributes, Disposition: OpenIf, Options: No Buffering, Non-Directory File, Attributes: n/a, ShareMode: Read, Write, AllocationSize: 0, OpenResult: Created","6624"
"21:35:46.2776825","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6624"
"21:35:46.2778262","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","","6624"
"21:35:46.2780766","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6624"
"21:35:46.2782051","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","","6624"
"21:35:46.2784432","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Alert, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6624"
"21:35:46.2786538","ORACLE.EXE","6808","DeviceIoControl","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","INVALID PARAMETER","Control: IOCTL_MOUNTDEV_QUERY_DEVICE_NAME","6624"
"21:35:46.2787145","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","","6624"
"21:35:46.2789604","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","NAME INVALID","Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Open Reparse Point, Attributes: N, ShareMode: Read, Write, AllocationSize: n/a","6624"
"21:35:46.2888654","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Offset: 0, Length: 8,192, I/O Flags: Non-cached, Priority: Normal","6624"
---//写新数据文件的os块。Offset: 0, Length: 8,192
"21:35:46.2896819","ORACLE.EXE","6808","SetPositionInformationFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Position: 104,865,792","6624"
"21:35:46.2897575","ORACLE.EXE","6808","QueryPositionInformationFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Position: 104,865,792","6624"
"21:35:46.2898133","ORACLE.EXE","6808","SetEndOfFileInformationFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","EndOfFile: 104,865,792","6624"
"21:35:46.3006965","ORACLE.EXE","6808","SetAllocationInformationFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","AllocationSize: 104,865,792","6624"
--//分配空间。
"21:35:46.3008295","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","","6624"
"21:35:46.3014917","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","CreationTime: 2018/10/30 21:35:46, LastAccessTime: 2018/10/30 21:35:46, LastWriteTime: 2018/10/30 21:35:46, ChangeTime: 2018/10/30 21:35:46, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6624"
"21:35:46.3018669","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","CreationTime: 2018/10/30 21:35:46, LastAccessTime: 2018/10/30 21:35:46, LastWriteTime: 2018/10/30 21:35:46, ChangeTime: 2018/10/30 21:35:46, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6624"
"21:35:46.3020677","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","CreationTime: 2018/10/30 21:35:46, LastAccessTime: 2018/10/30 21:35:46, LastWriteTime: 2018/10/30 21:35:46, ChangeTime: 2018/10/30 21:35:46, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6624"
"21:35:46.3022306","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","CreationTime: 2018/10/30 21:35:46, LastAccessTime: 2018/10/30 21:35:46, LastWriteTime: 2018/10/30 21:35:46, ChangeTime: 2018/10/30 21:35:46, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6624"
"21:35:46.3024618","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Desired Access: Generic Read, Disposition: Open, Options: No Buffering, Non-Directory File, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6624"
"21:35:46.3026732","ORACLE.EXE","6808","QueryStandardInformationFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","AllocationSize: 104,865,792, EndOfFile: 104,865,792, NumberOfLinks: 1, DeletePending: False, Directory: False","6624"
"21:35:46.3028325","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6624"
"21:35:46.3029478","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","","6624"
"21:35:46.3031436","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6624"
"21:35:46.3032475","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","","6624"
"21:35:46.3035123","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Alert, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6624"
"21:35:46.3037237","ORACLE.EXE","6808","DeviceIoControl","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","INVALID PARAMETER","Control: IOCTL_MOUNTDEV_QUERY_DEVICE_NAME","6624"
"21:35:46.3037738","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","","6624"
"21:35:46.3039897","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","NAME INVALID","Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Open Reparse Point, Attributes: N, ShareMode: Read, Write, AllocationSize: n/a","6624"
"21:35:46.3117120","ORACLE.EXE","6808","ReadFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Offset: 0, Length: 512, I/O Flags: Non-cached, Priority: Normal","6624"
"21:35:46.3120699","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","","6624"
"21:35:46.3123072","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","CreationTime: 2018/10/30 21:35:46, LastAccessTime: 2018/10/30 21:35:46, LastWriteTime: 2018/10/30 21:35:46, ChangeTime: 2018/10/30 21:35:46, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6624"
"21:35:46.3124443","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","CreationTime: 2018/10/30 21:35:46, LastAccessTime: 2018/10/30 21:35:46, LastWriteTime: 2018/10/30 21:35:46, ChangeTime: 2018/10/30 21:35:46, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6624"
"21:35:46.3126726","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","CreationTime: 2018/10/30 21:35:46, LastAccessTime: 2018/10/30 21:35:46, LastWriteTime: 2018/10/30 21:35:46, ChangeTime: 2018/10/30 21:35:46, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6624"
"21:35:46.3128220","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","CreationTime: 2018/10/30 21:35:46, LastAccessTime: 2018/10/30 21:35:46, LastWriteTime: 2018/10/30 21:35:46, ChangeTime: 2018/10/30 21:35:46, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6624"
"21:35:46.3130026","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Desired Access: Generic Read/Write, Disposition: Open, Options: No Buffering, Non-Directory File, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6624"
"21:35:46.3132067","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Desired Access: Generic Read/Write, Disposition: Open, Options: No Buffering, Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6624"
"21:35:46.3134501","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Offset: 8,192, Length: 8,192, I/O Flags: Non-cached, Priority: Normal","6624"
--//写新数据文件的块头。Offset: 8,192, Length: 8,192
"21:35:46.3151172","ORACLE.EXE","6808","FlushBuffersFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","","6624"
"21:35:46.3157203","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","","6624"
"21:35:46.3159666","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","","6624"
"21:35:46.4123677","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","CreationTime: 2018/10/30 21:35:46, LastAccessTime: 2018/10/30 21:35:46, LastWriteTime: 2018/10/30 21:35:46, ChangeTime: 2018/10/30 21:35:46, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6624"
"21:35:46.4124547","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","CreationTime: 2018/10/30 21:35:46, LastAccessTime: 2018/10/30 21:35:46, LastWriteTime: 2018/10/30 21:35:46, ChangeTime: 2018/10/30 21:35:46, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6624"
"21:35:46.4125446","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","CreationTime: 2018/10/30 21:35:46, LastAccessTime: 2018/10/30 21:35:46, LastWriteTime: 2018/10/30 21:35:46, ChangeTime: 2018/10/30 21:35:46, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6624"
"21:35:46.4126349","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","CreationTime: 2018/10/30 21:35:46, LastAccessTime: 2018/10/30 21:35:46, LastWriteTime: 2018/10/30 21:35:46, ChangeTime: 2018/10/30 21:35:46, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6624"
"21:35:46.4127380","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Desired Access: Generic Read/Write, Disposition: Open, Options: Write Through, No Buffering, Non-Directory File, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6624"
"21:35:46.4128751","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Desired Access: Generic Read/Write, Disposition: Open, Options: No Buffering, Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6624"
--//从这里开始以下偏移16,384,读1M,写1M。
"21:35:46.4364983","ORACLE.EXE","6808","ReadFile","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","Offset: 16,384, Length: 1,040,384, I/O Flags: Non-cached, Priority: Normal","6624"
"21:35:46.4421101","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Offset: 16,384, Length: 1,040,384, I/O Flags: Non-cached, Write Through, Priority: Normal","6624"
--//从这里开始偏移16,384+1,040,384=1056768,读1M,写1M。
"21:35:46.4494547","ORACLE.EXE","6808","ReadFile","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","Offset: 1,056,768, Length: 1,048,576, I/O Flags: Non-cached, Priority: Normal","6624"
"21:35:46.4729876","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Offset: 1,056,768, Length: 1,048,576, I/O Flags: Non-cached, Write Through, Priority: Normal","6624"
------------------------------------------------------------------
--//太长截断,奇怪Length: 1,048,576,难道中间过程写脏数据的情况吗?
------------------------------------------------------------------
"21:35:49.9299089","ORACLE.EXE","6808","ReadFile","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","Offset: 102,768,640, Length: 1,048,576, I/O Flags: Non-cached, Priority: Normal","6624"
"21:35:49.9365770","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Offset: 102,768,640, Length: 1,048,576, I/O Flags: Non-cached, Write Through, Priority: Normal","6624"
"21:35:49.9427614","ORACLE.EXE","6808","ReadFile","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","Offset: 103,817,216, Length: 1,048,576, I/O Flags: Non-cached, Priority: Normal","6624"
"21:35:49.9508470","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Offset: 103,817,216, Length: 1,048,576, I/O Flags: Non-cached, Write Through, Priority: Normal","6624"
--//再次出现写新数据文件的块头。Offset: 8,192, Length: 8,192,我估计这个跟以前测试rman的backup as copy一样。
--//参考链接:http://blog.itpub.net/267265/viewspace-2147540/ =>[20171121]rman backup as copy 2.txt
"21:35:49.9696618","ORACLE.EXE","6808","ReadFile","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","Offset: 8,192, Length: 8,192, I/O Flags: Non-cached, Priority: Normal","6624"
"21:35:49.9935072","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Offset: 8,192, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6624"
--//再次出现写新数据文件的块头。Offset: 8,192, Length: 8,192,不过这个过程反过来,从新文件读,写旧数据文件。
"21:35:51.0114127","ORACLE.EXE","6808","ReadFile","D:\app\oracle\oradata\test\test01p\LFREE01X.DBF","SUCCESS","Offset: 8,192, Length: 8,192, I/O Flags: Non-cached, Priority: Normal","6624"
"21:35:51.0119214","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","Offset: 8,192, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6624"

"21:35:51.0202771","ORACLE.EXE","6808","FlushBuffersFile","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","","6624"
"21:35:51.0220320","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","","6624"
"21:35:51.0223452","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","","6624"
"21:35:52.0700080","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","CreationTime: 2018/10/30 21:24:16, LastAccessTime: 2018/10/30 21:24:16, LastWriteTime: 2018/10/30 21:35:51, ChangeTime: 2018/10/30 21:35:51, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6624"
"21:35:52.0702186","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","CreationTime: 2018/10/30 21:24:16, LastAccessTime: 2018/10/30 21:24:16, LastWriteTime: 2018/10/30 21:35:51, ChangeTime: 2018/10/30 21:35:51, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6624"
"21:35:52.0703976","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","Desired Access: Read Attributes, Delete, Disposition: Open, Options: Non-Directory File, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened","6624"
"21:35:52.0705479","ORACLE.EXE","6808","QueryAttributeTagFile","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","Attributes: A, ReparseTag: 0x0","6624"
"21:35:52.0706144","ORACLE.EXE","6808","SetDispositionInformationFile","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","Delete: True","6624"
--//删除旧文件,如果执行时没有keep参数。
"21:35:52.0707449","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE01.DBF","SUCCESS","","6624"

--//我看到都是读1M,写1M,并没有看到dml相关操作啊!!仔细思考明白过来,我执行的存储过程仅仅commit,并不一定触发脏数据写盘操作。

4.继续测试:
CREATE OR REPLACE PROCEDURE test_proc AS
BEGIN
   FOR J IN 1..26 LOOP
      FOR i IN 1..100 LOOP
          update t set name=chr(64+j)||i where id=i;
          COMMIT;
          dbms_lock.sleep(0.1);
          execute immediate ‘alter system flush buffer_cache‘;
--//      execute immediate ‘alter system checkpoint‘;
      END LOOP;
   END LOOP;
END;
/

--//注意上面要执行execute immediate ‘alter system checkpoint‘;,必须显示授权,否者执行报错。
[email protected]> grant alter system to scott;
Grant succeeded.

--//重复前面的测试:
--//session 1,先输入命令注意先不要回车执行,执行Procmon.exe跟踪TID=6624:
[email protected]> ALTER DATABASE MOVE DATAFILE 36 TO ‘D:\APP\ORACLE\ORADATA\TEST\TEST01P\lfree02x.dbf‘;

--//sesson 2,执行如下,马上切换到session 1,执行以上命令:
[email protected]> exec test_proc

--//依旧不行。测试看到的结果与上面一样,难道是通过dbwr进程实现的。

5.继续测试:
[email protected]> select spid,pname from V$PROCESS where pname=‘DBW0‘ ;
SPID                 PNAME
-------------------- --------------------
6280                 DBW0

--//跟踪spid = 6280看看。
--//重复前面的测试:
--//session 1,先输入命令注意先不要回车执行,执行Procmon.exe跟踪TID=6280:
[email protected]> ALTER DATABASE MOVE DATAFILE 36 TO ‘D:\APP\ORACLE\ORADATA\TEST\TEST01P\lfree05.dbf‘;

--//sesson 2,执行如下,马上切换到session 1,执行以上命令:
[email protected]> exec test_proc

--//在procmon.exe 界面上选择过滤 path contains LFREE的条件:
"Time of Day","Process Name","PID","Operation","Path","Result","Detail","TID"
"22:47:25.8836412","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
--//这样就对上了。
[email protected]> select rowid,t.* from t where rownum=1;

ROWID                      ID NAME
------------------ ---------- --------------------
AAAFl+AAkAAAACDAAA          1 D1

[email protected]> @ rowid AAAFl+AAkAAAACDAAA
    OBJECT       FILE      BLOCK        ROW ROWID_DBA            DBA                  TEXT
---------- ---------- ---------- ---------- -------------------- -------------------- ----------------------------------------
     22910         36        131          0  0x9000083           36,131               alter system dump datafile 36 block 131

[email protected]> select 8192*131 from dual ;
  8192*131
----------
   1073152
--//偏移在1073152dbw0写脏块。

"22:47:26.1317439","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:26.3033216","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:26.4949103","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:26.6944914","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:26.8921476","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:27.0585687","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:27.2483195","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:27.4866166","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:27.6899560","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:27.8798858","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:28.1655702","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:28.5559149","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","CreationTime: 2018/10/30 22:47:28, LastAccessTime: 2018/10/30 22:47:28, LastWriteTime: 2018/10/30 22:47:28, ChangeTime: 2018/10/30 22:47:28, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6280"
--//开始执行ALTER DATABASE MOVE DATAFILE 36 TO ‘D:\APP\ORACLE\ORADATA\TEST\TEST01P\lfree05.dbf‘;
"22:47:28.5560114","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","CreationTime: 2018/10/30 22:47:28, LastAccessTime: 2018/10/30 22:47:28, LastWriteTime: 2018/10/30 22:47:28, ChangeTime: 2018/10/30 22:47:28, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6280"
"22:47:28.5561132","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","CreationTime: 2018/10/30 22:47:28, LastAccessTime: 2018/10/30 22:47:28, LastWriteTime: 2018/10/30 22:47:28, ChangeTime: 2018/10/30 22:47:28, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6280"
"22:47:28.5561973","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","CreationTime: 2018/10/30 22:47:28, LastAccessTime: 2018/10/30 22:47:28, LastWriteTime: 2018/10/30 22:47:28, ChangeTime: 2018/10/30 22:47:28, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6280"
"22:47:28.5563242","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Desired Access: Generic Read, Disposition: Open, Options: No Buffering, Non-Directory File, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6280"
"22:47:28.5564153","ORACLE.EXE","6808","QueryStandardInformationFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","AllocationSize: 104,865,792, EndOfFile: 104,865,792, NumberOfLinks: 1, DeletePending: False, Directory: False","6280"
"22:47:28.5565208","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6280"
"22:47:28.5566066","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","","6280"
"22:47:28.5567417","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6280"
"22:47:28.5568082","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","","6280"
"22:47:28.5569322","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Alert, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6280"
"22:47:28.5570270","ORACLE.EXE","6808","DeviceIoControl","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","INVALID PARAMETER","Control: IOCTL_MOUNTDEV_QUERY_DEVICE_NAME","6280"
"22:47:28.5570545","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","","6280"
"22:47:28.5571813","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","NAME INVALID","Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Open Reparse Point, Attributes: N, ShareMode: Read, Write, AllocationSize: n/a","6280"
"22:47:28.5621531","ORACLE.EXE","6808","ReadFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 0, Length: 512, I/O Flags: Non-cached, Priority: Normal","6280"
"22:47:28.5624503","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","","6280"
"22:47:28.5625928","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","CreationTime: 2018/10/30 22:47:28, LastAccessTime: 2018/10/30 22:47:28, LastWriteTime: 2018/10/30 22:47:28, ChangeTime: 2018/10/30 22:47:28, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6280"
"22:47:28.5626843","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","CreationTime: 2018/10/30 22:47:28, LastAccessTime: 2018/10/30 22:47:28, LastWriteTime: 2018/10/30 22:47:28, ChangeTime: 2018/10/30 22:47:28, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6280"
"22:47:28.5627857","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","CreationTime: 2018/10/30 22:47:28, LastAccessTime: 2018/10/30 22:47:28, LastWriteTime: 2018/10/30 22:47:28, ChangeTime: 2018/10/30 22:47:28, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6280"
"22:47:28.5628732","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","CreationTime: 2018/10/30 22:47:28, LastAccessTime: 2018/10/30 22:47:28, LastWriteTime: 2018/10/30 22:47:28, ChangeTime: 2018/10/30 22:47:28, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6280"
"22:47:28.5629881","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Desired Access: Generic Read/Write, Disposition: Open, Options: Write Through, No Buffering, Non-Directory File, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6280"
"22:47:28.5631269","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Desired Access: Generic Read/Write, Disposition: Open, Options: No Buffering, Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6280"
"22:47:28.5633243","ORACLE.EXE","6808","QueryOpen","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","CreationTime: 2018/10/30 22:47:28, LastAccessTime: 2018/10/30 22:47:28, LastWriteTime: 2018/10/30 22:47:28, ChangeTime: 2018/10/30 22:47:28, AllocationSize: 104,865,792, EndOfFile: 104,865,792, FileAttributes: A","6280"
"22:47:28.5634225","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6280"
"22:47:28.5634898","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","","6280"
"22:47:28.5636109","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6280"
"22:47:28.5636725","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","","6280"
"22:47:28.5637890","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Alert, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened","6280"
"22:47:28.5638699","ORACLE.EXE","6808","DeviceIoControl","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","INVALID PARAMETER","Control: IOCTL_MOUNTDEV_QUERY_DEVICE_NAME","6280"
"22:47:28.5638954","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","","6280"
"22:47:28.5640144","ORACLE.EXE","6808","CreateFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","NAME INVALID","Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Open Reparse Point, Attributes: N, ShareMode: Read, Write, AllocationSize: n/a","6280"
--//写数据文件os块。
"22:47:28.5686767","ORACLE.EXE","6808","ReadFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 0, Length: 8,192, I/O Flags: Non-cached, Priority: Normal","6280"
"22:47:28.5690026","ORACLE.EXE","6808","ReadFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 0, Length: 8,192, I/O Flags: Non-cached, Priority: Normal","6280"
--//可以看出一些细节,先写新数据文件,在写旧数据文件。间隔0.1秒。
"22:47:30.4859339","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:30.4859819","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:31.4623837","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:31.4624679","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:33.1933155","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:33.1933573","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:33.6612641","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:33.6614131","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:34.2625288","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:34.2626437","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:34.7037038","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:34.7038352","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:35.0569077","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:35.0570132","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:35.3842675","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:35.3843631","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:35.7080824","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:35.7081653","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:35.8961936","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:35.8962799","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:36.0512627","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:36.0513522","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:36.2413785","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:36.2414672","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:36.3961598","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:36.3962423","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:36.5580874","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:36.5581325","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:36.6095170","ORACLE.EXE","6808","FlushBuffersFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","","6280"
"22:47:36.6107383","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","","6280"
"22:47:36.6108529","ORACLE.EXE","6808","CloseFile","D:\app\oracle\oradata\test\test01p\LFREE04X.DBF","SUCCESS","","6280"
--//这里关闭旧数据文件,删除操作tid=6624完成,业务继续,这时仅仅修改新数据文件D:\app\oracle\oradata\test\test01p\LFREE05X.DBF。
"22:47:36.7366151","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:36.9199684","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:37.0837297","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:37.2505211","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"
"22:47:37.4077499","ORACLE.EXE","6808","WriteFile","D:\app\oracle\oradata\test\test01p\LFREE05X.DBF","SUCCESS","Offset: 1,073,152, Length: 8,192, I/O Flags: Non-cached, Write Through, Priority: Normal","6280"

总结:
--//还是基本概念不清楚,实际上了解脏块写盘由dbwr进程完成,就没有必要走这么一堆弯路了。

原文地址:https://www.cnblogs.com/lfree/p/9880333.html

时间: 2024-09-30 21:44:59

[20181031]12c 在线移动数据文件.txt的相关文章

12C新功能:在线移动数据文件 (Doc ID 1566797.1)

12C New Feature : Move a Datafile Online (Doc ID 1566797.1) APPLIES TO: Oracle Database - Enterprise Edition - Version 12.1.0.1 and laterOracle Database Cloud Schema Service - Version N/A and laterOracle Database Exadata Cloud Machine - Version N/A a

在线移动oracle 数据文件位置

    在线移动oracle 数据文件 Oracle数据文件可以在数据库OPEN的时候被重命名或移动,但此时表空间必须为只读,这将允许用户从表中查询,但禁止他们这样做的插入,更新和删除,在表空间至于只读状态的时候,冻结数据文件块头.阻止更新数据文件块头,此时才能在线拷贝数据文件 <注:system表空间除外,system 表空间无法offline> 本测试以TEST表空间为例 SQL> select * from v$version; BANNER -------------------

迁移数据文件步骤

select file#,name,status from v$datafile; select * from v$tablespace; 1. alter tablespace AAA offline; 2. shutdown immediate; 3. copy data file  to Destination directory 4. startup mount; alter database rename file 'F:\ORACLE\ORADATA\ORCL\AAA_01.DBF'

Oracle 12C 新特性之在线重命名、迁移活跃的数据文件

Oracle 数据库 12c 版本中对数据文件的迁移或重命名不再需要太多繁琐的步骤,可以使用 ALTER DATABASE MOVE DATAFILE 这样的 SQL 语句对数据文件进行在线重命名和移动.而当此数据文件正在传输时,终端用户可以执行查询,DML以及 DDL 方面的任务.另外,数据文件可以在存储设备间迁移,如从非 ASM 迁移至 ASM,反之亦然. 一. 重命名数据文件: -- 注意,我这里是在名为 PDB01 的 pdb 容器内演示的. SQL> show con_nameCON_

Oracle 12c RAC 移动MGMTDB 数据库 数据文件方法

注:本文谢绝转载! 在之前的Blog里介绍了Oracle12c RAC 中的MGMTDB的概念,参考: Oracle 12cRAC MGMTDB 说明 http://blog.csdn.net/tianlesoftware/article/details/41804553 而在默认情况下,MGMTDB 的数据文件是存放在OCR voting disk的磁盘组里的,为了节省OCR 磁盘组空间,我们也可以把MGMTDB 转移走. 当然,这里的移动位置,也是从一个共享位置移动到另一个共享位置. 具体

oracle 12c 多租户 pdb 恢复(单个pdb数据文件、非系统pdb表空间、整个pdb数据库)

环境:数据库版本 Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production 实验准备:1.-- 数据库归档模式SQL> select name,log_mode from v$database;NAME  LOG_MODE--------- ------------ANDYCDB   ARCHIVELOG   > 数据库归档模式 2.-- 登录 PDB 中创建实验表空间 与 用户[[email pr

oracle 12c中导入dmp数据文件步骤

oracle版本为12c的导入步骤:1.新建用户:CREATE USER c##zj_szda IDENTIFIED BY zjdaszda DEFAULT TABLESPACE USERS QUOTA 50M ON USERS; 2.授予dba权限给zj_szdagrant dba to zj_szda 3.导入szda.dmp文件$imp c##zj_szda/zjdaszda fromuser=zj_szda touser=c##zj_szda file=f:/szda.dmp 注:1.c

Oracle 12.1新特性:在线rename或relocate数据文件

在Oracle12.1之前的版本中要重命名数据文件或移动数据文件需要关闭数据库或把表空间/数据文件置为offline状态才可以,参考之前总结的Oracle修改数据文件名/移动数据文件.但到了12.1版本,可以直接在数据文件online状态下把数据文件重命名或移动数据文件. 要实现这一功能需要使用ALTER DATABASE MOVE DATAFILE 语句,语法如下 ALTER DATABASE MOVE DATAFILE ( 'filename' | 'ASM_filename' | file

【应用】:shell crontab定时生成oracle表的数据到txt文件,并上传到ftp

一.本人环境描述      1.oracle服务端装在win7 32位上,oracle版本为10.2.0.1.0      2.Linux为centos6.5 32位,安装在Oracle VM VirtualBox虚拟机上      3.win7上装有ftp服务 二.功能实现描述      用shell的crontab命令定时执行某个.sh文件,此文件的功能已实现生成oracle表的数据到本地txt文件,并上传到ftp,必要时可记录执行日志. 三.步骤      1.在centos中安装orac