Multiple customers have asked several times that archive logs of node2 In the RAC environment are written to the archive path of node1. This problem causes some customers to be unable to read logs correctly when using OGG. What causes this problem? Search for and test. If the following conditions are found, archivelog is not recorded
Multiple customers have asked several times that archive logs of node2 In the RAC environment are written to the archive path of node1. This problem causes some customers to be unable to read logs correctly when using OGG. What causes this problem? Search for and test. If the following conditions are found, archive log is not recorded
Multiple customers have asked several times that archive logs of node2 In the RAC environment are written to the archive path of node1.
This problem causes some customers to be unable to read logs correctly when using OGG.
What causes this problem?
Search for and test. If the following conditions are found, archive log does not record the correct node location.
Test Environment
Linux + 11.2.0.4 RACnode1 ALTER SYSTEM SET log_archive_dest_1='location=/home/oracle/archive_log/ valid_for=(all_logfiles,all_roles)' sid='orcl1' scope=spfile; node2 ALTER SYSTEM SET log_archive_dest_1='location=/home/oracle/archive_log/ valid_for=(all_logfiles,all_roles)' sid='orcl2' scope=spfile;
Case 1
When node2 instance is disabled, execute alter system archive log current on node1;
Writes the archive log of node2 to the path of node1.
----------- 10.2.0.5 test --------------
Note: nascds14 is node 1 and nascds15 is node 2.
[Oracle @ nascds14 ~] $ Ls-l/u01/app/database/dbs/-rw-r ----- 1 oracle oinstall 9897472 Dec 1 arch1_66_827745338.dbf-rw-r ----- 1 oracle oinstall 2048 Dec 1 arch1_67_827745338.dbf-rw-r ----- 1 oracle oinstall 1024 dec 1 arch1_68_827742538.dbf [oracle @ nascds14 ~] $ Sqlplus/as sysdbaSQL> alter system archive log current; System altered. [oracle @ nascds14 ~] $ Ls-l/u01/app/database/dbs/-rw-r ----- 1 oracle oinstall 9897472 Dec 1 arch1_66_827745338.dbf-rw-r ----- 1 oracle oinstall 2048 Dec 1 arch1_67_827745338.dbf-rw-r ----- 1 oracle oinstall 1024 dec 1 arch1_68_827745338.dbf-rw-r ----- 1 oracle oinstall 11776 Dec 1 arch1_69_827745338.dbf-rw-r ----- 1 oracle oinstall 128512 Dec 1 arch2_101_827742538.dbf <
Shutdown immediateDatabase closed. Database dismounted. ORACLE instance shut down. [oracle @ nascds15 ~] $ Ls-l/u01/app/database/dbs/-rw-r ----- 1 oracle oinstall 6144 Dec 1 arch2_100_827745338.dbf-rw-r ----- 1 oracle oinstall 17412608 Dec 1 arch2_98_827745338.dbf-rw-r ----- 1 oracle oinstall 1536 dec 1 arch2_99_827742538.dbf [oracle @ nascds15 ~] $ Ls-l/u01/app/database/dbs/-rw-r ----- 1 oracle oinstall 6144 Dec 1 arch2_100_827745338.dbf-rw-r ----- 1 oracle oinstall 17412608 Dec 1 arch2_98_827745338.dbf-rw-r ----- 1 oracle oinstall 1536 dec 1 arch2_99_827742538.dbf
----------- 11.2.0.4 test --------------
Node2 instance closed, log generation result
When node2 instance is disabled, execute alter system archive log current on node1;
It also writes the archive log of node2 to the path of node1.
--- Node2 ---
SQL> create table test1 as select * from dba_users;create table test1 as select * from dba_users;SQL> shutdown abort shutdown abortORACLE instance shut down.
--- Node1 ---
SQL> alter system archive log current;
--- Node1 ---
[Oracle @ node111g archive_log] $ ls-al 2 *-rw ------- 1 oracle asmadmin 148992 December 19 11:22 bytes ------- 1 oracle asmadmin 1024 December 19 11:22 2_177_864642458.dbf <<
The following are the test results and four windows are enabled at the same time.
650) this. width = 650; "src ="/e/u261/themes/default/images/spacer.gif "style =" background: url ("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center; border: 1px solid # ddd; "alt =" spacer.gif "/> 650) this. width = 650; "src =" http://www.68idc.cn/help/uploads/allimg/151111/121Z04131-0.jpg "title =" 2.jpg" alt = "wKiom1STq-bQ0-pjAA3qlGN7Y9w173.jpg"/>
Scenario 2
If node2 runs normally, will the log be written to node1?
After multiple tests, alter system archive log current;
Both node1 and node2 normally write their respective archive logs to their correct locations.
What if we put pressure on node2?
Run the following script on node2 to make node2 in high CPU running status.
DECLAREn NUMBER;BEGINWHILE (TRUE)LOOPn:= dbms_random.random();END LOOP;END;
When the CPU usage exceeds 90%, alter system archive log current is executed multiple times on node1;
There will be an archive of node2 and the path written to node1.
Node1
[Oracle @ node111g archive_log] $ pwd/home/oracle/archive_log [oracle @ node111g archive_log] $ ls-al 2 *-rw ------- 1 oracle asmadmin 1024 December 19 10:32 pai------- 1 oracle asmadmin 1024 July 22, December 19 10:37 2_1__864642458.dbf
Node2
[Oracle @ node211g archive_log] $ ls-ctrl-rw ------- 1 oracle asmadmin 1024 December 19 10:32 ------- 1 oracle asmadmin 1024 December 19 10:32 ------- 1 oracle asmadmin 1024 December 19 10:32 2_1__864642458.dbf <<Open four windows at the same time to start testing
650) this. width = 650; "src ="/e/u261/themes/default/images/spacer.gif "style =" background: url ("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center; border: 1px solid # ddd; "alt =" spacer.gif "/>
650) this. width = 650; "src =" http://www.68idc.cn/help/uploads/allimg/151111/121Z05350-1.jpg "title =" 1.jpg" alt = "wKioL1STrK2Qdn3fAA3qlGN7Y9w211.jpg"/>
To sum up, first understand the difference between alter system switch logfile; and alter system archive log current.
The main difference is:
Alter system switch logfile performs log switching on the current instance in a single instance database or RAC;
Alter system archive log current performs LOG switching on all instances in the database.
Therefore, if you use alter system switch logfile, you will not encounter an archive error node.
The archive log in RAC has an error node. When using log mining applications, you may encounter problems, such as OGG.
Here, we can understand that this is an oracle expected behaviour.
We need to consider the following situations to avoid this problem.
1. Discuss with application developers whether to use alter system archive log current.
2. make the log_archive_dest _ * of the two nodes accessible to each other. In this way, the control file will tell you where to find the required logs and read the logs, no error will be reported.
3. Set the archive path of multiple nodes in RAC to the same shared path.