1. 备库 192.168.0.1 oracle 10g
$ lsnrctl status 查询监听
$ lsnrctl stop 停止监听
$ sqlplus / as sysdba # 进备库
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Sep 11 10:48:43 2018
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 8539602944 bytes
Fixed Size 2110000 bytes
Variable Size 2197818832 bytes
Database Buffers 6325010432 bytes
Redo Buffers 14663680 bytes
Database mounted.
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> select message from v$dataguard_status;
MESSAGE
--------------------------------------------------------------------------------
ARC0: Archival started
ARC1: Archival started
ARC2: Archival started
ARC3: Archival started
ARC2: Becoming the 'no FAL' ARCH
ARC2: Becoming the 'no SRL' ARCH
ARC0: Becoming the heartbeat ARCH
Attempt to start background Managed Standby Recovery process
MRP0: Background Managed Standby Recovery process started
Managed Standby Recovery not using Real Time Apply
Clearing online redo logfile 1 /oradata/orcl/redo01.log
MESSAGE
--------------------------------------------------------------------------------
Clearing online redo logfile 1 complete
Media Recovery Waiting for thread 1 sequence 713386
13 rows selected.
SQL> select thread#,max(sequence#) from v$archived_log group by thread#;
THREAD# MAX(SEQUENCE#)
---------- --------------
1 713385
SQL> select sequence#,applied from v$archive_log order by sequence#;
2. 主库 192.168.0.2 oracle 10g
# su - oracle
$ lsnrctl stop
$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Thu May 31 17:56:57 2018
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> alter system checkpoint;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
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
$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Thu May 31 17:59:12 2018
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 1.7180E+10 bytes
Fixed Size 2126544 bytes
Variable Size 1224740144 bytes
Database Buffers 1.5938E+10 bytes
Redo Buffers 14647296 bytes
Database mounted.
Database opened.
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
$ lsnrctl start
LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.5.0 - Production on 31-MAY-2018 17:59:41
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Starting /oracle/app/product/10.2/db_1/bin/tnslsnr: please wait...
TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.5.0 - Production
System parameter file is /oracle/app/product/10.2/db_1/network/admin/listener.ora
Log messages written to /oracle/app/product/10.2/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=BZZD_DB2)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=BZZD_DB2)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.5.0 - Production
Start Date 31-MAY-2018 17:59:41
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /oracle/app/product/10.2/db_1/network/admin/listener.ora
Listener Log File /oracle/app/product/10.2/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=BZZD_DB2)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
3. 备库
# su - oracle
$ cd /oracle
$ ./startdb
4. 主库
$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Sep 11 12:31:53 2018
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> show parameter log_archive_dest_state_2;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_state_2 string enable
SQL> alter system set log_archive_dest_state_2='defer';
System altered.
SQL> alter system set log_archive_dest_state_2='enable';
System altered.
5. 备库 查看日志
$ tail -f $ORACLE_BASE/admin/orcl/bdump/alert_orcl.log
...............................................................
MRP0: Background Managed Standby Recovery process started (orcl)
Managed Standby Recovery not using Real Time Apply
parallel recovery started with 3 processes
Tue Sep 11 12:34:22 BEIST 2018
Waiting for all non-current ORLs to be archived...
Tue Sep 11 12:34:22 BEIST 2018
Errors in file /oracle/app/admin/orcl/bdump/orcl_mrp0_696554.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/oradata/orcl/redo01.log'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3
Tue Sep 11 12:34:22 BEIST 2018
Errors in file /oracle/app/admin/orcl/bdump/orcl_mrp0_696554.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/oradata/orcl/redo01.log'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3
Clearing online redo logfile 1 /oradata/orcl/redo01.log
Clearing online log 1 of thread 1 sequence number 713386
Tue Sep 11 12:34:22 BEIST 2018
Errors in file /oracle/app/admin/orcl/bdump/orcl_mrp0_696554.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/oradata/orcl/redo01.log'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3
Tue Sep 11 12:34:22 BEIST 2018
Errors in file /oracle/app/admin/orcl/bdump/orcl_mrp0_696554.trc:
ORA-19527: physical standby redo log must be renamed
ORA-00312: online log 1 thread 1: '/oradata/orcl/redo01.log'
Clearing online redo logfile 1 complete
Media Recovery Waiting for thread 1 sequence 713386
Fetching gap sequence in thread 1, gap sequence 713386-713485
Tue Sep 11 12:34:23 BEIST 2018
Completed: alter database recover managed standby database disconnect from session
Tue Sep 11 12:34:52 BEIST 2018
FAL[client]: Failed to request gap sequence
GAP - thread 1 sequence 713386-713485
DBID 1288437796 branch 760657060
FAL[client]: All defined FAL servers have been attempted.
-------------------------------------------------------------
Check that the CONTROL_FILE_RECORD_KEEP_TIME initialization
parameter is defined to a value that is sufficiently large
enough to maintain adequate log switch information to resolve
archivelog gaps.
-------------------------------------------------------------
Tue Sep 11 12:38:49 BEIST 2018
Using STANDBY_ARCHIVE_DEST parameter default value as /oradata/archive/
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[1]: Assigned to RFS process 127054
RFS[1]: Identified database type as 'physical standby'
Tue Sep 11 12:38:49 BEIST 2018
RFS LogMiner: Client disabled from further notification
Tue Sep 11 12:39:04 BEIST 2018
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[2]: Assigned to RFS process 1540310
RFS[2]: Identified database type as 'physical standby'