联系:手机/微信(+86 17813235971) QQ(107644445)
作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]
在一次无意中发现mount状态的数据库也有LOCAL=NO的进程,经过分析确定是由于主库连接到备库的nls或者arch进程连接到备库引起的
发现mount库中有LOCAL=NO的进程
[oracle@localhost ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Fri Jul 29 11:59:57 2016
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select database_role ,open_mode from v$database;
DATABASE_ROLE OPEN_MODE
---------------- ----------
PHYSICAL STANDBY MOUNTED
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@localhost ~]$ ps -ef|grep LOCAL
oracle 11394 1 0 Apr27 ? 08:08:41 oracleorcl (LOCAL=NO)
oracle 11398 1 0 Apr27 ? 15:36:29 oracleorcl (LOCAL=NO)
oracle 18854 18752 0 12:00 pts/2 00:00:00 grep LOCAL
[oracle@localhost ~]$ ps -ef|grep pmon
oracle 14374 1 0 2015 ? 00:10:54 ora_pmon_orcl
oracle 18893 18752 0 12:01 pts/2 00:00:00 grep pmon
SQL> select sid,status,username from v$session where paddr in
2 (select addr from v$process where spid in(11394,11398));
SID STATUS USERNAME
---------- -------- ------------------------------
510 INACTIVE PUBLIC
507 INACTIVE PUBLIC
查看备库进程连接
[oracle@localhost ~]$ netstat -natp|grep -E '11394|11398' (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) tcp 0 0 192.168.160.22:1521 192.168.160.23:42783 ESTABLISHED 11394/oracleorcl tcp 0 0 192.168.160.22:1521 192.168.160.23:42785 ESTABLISHED 11398/oracleorcl
主库上查看,确定192.168.160.22是备库
SQL> show parameter log_archive_dest_2;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_2 string service=orcl lgwr async valid_
for=(online_logfiles,primary_r
ole) db_unique_name=orcl
SQL> !tnsping orcl
TNS Ping Utility for Linux: Version 10.2.0.5.0 - Production on 29-JUL-2016 12:20:01
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.160.22)(PORT = 1521))
(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))
OK (0 msec)
查看主库连接
[oracle@localhost ~]$ netstat -natp|grep "192.168.160.22" (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) tcp 0 0 192.168.160.23:42785 192.168.160.22:1521 ESTABLISHED 12394/ora_arc1_orcl tcp 0 0 192.168.160.23:42783 192.168.160.22:1521 ESTABLISHED 12400/ora_lns1_orcl
通过分析确定在mount情况的备库中,会有LOCAL=NO的进程,他们是主库arch和lns进程对应的服务进程