[20140425]alter database force logging修改那里.txt
链接:http://blog.itpub.net/267265/viewspace-1145697/
昨天有别人问,如果在主库执行alter database force logging,备用库不会也修改吗?实际上这个要看执行这条命令修改那里的信息.
SYS@test> @ver
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
SYS@test> @spid
SPID
------
18319
SYS@test> alter database no force logging;
Database altered.
$ strace -p 18319 -o /tmp/xx1
SYS@test> alter database force logging;
Database altered.
--看看/tmp/xx1记录了什么信息:
$ grep -i write /tmp/xx1
write(10, "write(10, "Fri Apr 25 10:20:04 2014\n", 25) = 25
write(10, "alter database force logging", 29) = 29
write(10, "\n", 1) = 1
write(10, "write(10, "ALTER DATABASE FORCE LOGGING com"..., 111) = 111
write(10, "\n", 1) = 1
pwrite(256, "\25\302\0\0\21\0\0\0\375Og2\377\377\1\4\235H\0\0\0\0\0"..., 16384, 278528) = 16384
pwrite(257, "\25\302\0\0\21\0\0\0\375Og2\377\377\1\4\235H\0\0\0\0\0"..., 16384, 278528) = 16384
pwrite(256, "\25\302\0\0\17\0\0\0\375Og2\377\377\1\4D\1\0\0\0\4\0\0"..., 16384, 245760) = 16384
pwrite(257, "\25\302\0\0\17\0\0\0\375Og2\377\377\1\4D\1\0\0\0\4\0\0"..., 16384, 245760) = 16384
pwrite(256, "\25\302\0\0\1\0\0\0\0\0\0\0\0\0\1\4ST\0\0\0\0\0\0\0\0 "..., 16384, 16384) = 16384
pwrite(257, "\25\302\0\0\1\0\0\0\0\0\0\0\0\0\1\4ST\0\0\0\0\0\0\0\0 "..., 16384, 16384) = 16384
write(10, "write(10, "Completed: alter database force"..., 40) = 40
write(10, "\n", 1) = 1
write(12, "\0\265\0\0\6\0\0\0\0\0\10\6\0\303\226\346\302\0\0\0\0\3"..., 181) = 181
$ cd /proc/18319/fd
$ ll
total 13
lr-x------ 1 oracle11g oinstall 64 2014-04-25 10:22:38 0 -> /dev/null
l-wx------ 1 oracle11g oinstall 64 2014-04-25 10:22:38 1 -> /dev/null
l-wx------ 1 oracle11g oinstall 64 2014-04-25 10:22:38 12 -> pipe:[137955042]
l-wx------ 1 oracle11g oinstall 64 2014-04-25 10:22:38 2 -> /dev/null
lrwx------ 1 oracle11g oinstall 64 2014-04-25 10:22:38 256 -> /u01/app/oracle11g/oradata/test/control01.ctl
lrwx------ 1 oracle11g oinstall 64 2014-04-25 10:22:38 257 -> /u01/app/oracle11g/oradata/test/control02.ctl
lr-x------ 1 oracle11g oinstall 64 2014-04-25 10:22:38 3 -> /dev/null
lr-x------ 1 oracle11g oinstall 64 2014-04-25 10:22:38 4 -> /dev/null
lr-x------ 1 oracle11g oinstall 64 2014-04-25 10:22:38 5 -> /u01/app/oracle11g/product/11.2.0/db_2/rdbms/mesg/oraus.msb
lr-x------ 1 oracle11g oinstall 64 2014-04-25 10:22:38 6 -> /proc/18319/fd
lr-x------ 1 oracle11g oinstall 64 2014-04-25 10:22:38 7 -> /dev/zero
lrwx------ 1 oracle11g oinstall 64 2014-04-25 10:22:38 8 -> socket:[137955061]
lr-x------ 1 oracle11g oinstall 64 2014-04-25 10:22:38 9 -> pipe:[137955041]
--从上面的信息看修改的文件句柄是10,256,257,12.
--很明显写入的信息在控制文件.这些信息不会通过日志传输到备用机器.所以备用库不会跟着变化.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/267265/viewspace-1149160/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/267265/viewspace-1149160/