Document Type | Technical Information
Category | Administration
Applicable Product Version | T6, T7
Document Number | TADTI134
Overview
This article explains how to build a standby using only archive logfiles without backing up online redo logfiles.
Previously, it was necessary to suspend the standby and stop LGWR I/O unconditionally to copy the online redo logfile and build the standby. However, to avoid I/O suspension that could burden the primary DB, you can recover up to the existing archive logfiles and then generate the online redo logfiles in reverse from the archive logfiles.
However, the online logfiles corresponding to the archive logfile seqno that has already been recovered should be created just before the current logfile,
and the current logfile should be created as a new state immediately after the switch.
and the current logfile should be created as a new state immediately after the switch.
Other logfiles should be left in their initialized state.
NotePatch 309100 is required.
Method
1. Perform HOT BACKUP
SQL> alter database begin backup;
Database altered.
SQL> select a.name, b.status From v$datafile a, v$backup b where a.file#=b.file#;
NAME STATUS
-------------------------------------------------- ----------
/home/data/tibero_tsc/system01.dtf ACTIVE
/home/data/tibero_tsc/undo001.dtf ACTIVE
/home/data/tibero_tsc/usr01.dtf ACTIVE
/home/data/tibero_tsc/syssub01.dtf ACTIVE
SQL> exit
OS> cp /home/data/tibero_tsc/system01.dtf /home/data/tibero_tsc/hot/.
OS> cp /home/data/tibero_tsc/undo001.dtf /home/data/tibero_tsc/hot/.
OS> cp /home/data/tibero_tsc/usr01.dtf /home/data/tibero_tsc/hot/.
OS> cp /home/data/tibero_tsc/syssub01.dtf /home/data/tibero_tsc/hot/.
SQL> alter database backup controlfile to trace as '/home/data/tibero_tsc/hot/con.sql';
Database altered.
SQL> alter database end backup;
Database altered.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> select sequence#,archived,status from v$log;
SEQUENCE# ARCHIVED STATUS
---------- -------- --------
22 YES INACTIVE
23 YES INACTIVE
24 NO CURRENT 2. Transfer HOT BACKUP and Archive to Standby Server
OS> scp -p22 /home/data/tibero_tsc/hot/* tibero7@STANDBY_SERVER_IP:/home/data/tibero_tsc/. tibero7@STANDBY_SERVER_IP's password: con.sql 100% 3738 5.1MB/s 00:00 syssub01.dtf 100% 200MB 127.1MB/s 00:01 system01.dtf 100% 400MB 114.6MB/s 00:03 undo001.dtf 100% 250MB 126.6MB/s 00:01 usr01.dtf 100% 100MB 113.5MB/s 00:00 OS> scp -p22 /home/data/tibero_tsc_arch/* tibero7@STANDBY_SERVER_IP:/home/data/tibero_tsc_arch/. tibero7@STANDBY_SERVER_IP's password: log-t0-r0-s21.arc 100% 137KB 51.4MB/s 00:00 log-t0-r0-s22.arc 100% 512 754.6KB/s 00:00 log-t0-r0-s23.arc 100% 1024 851.9KB/s 00:00
3. Data Entry for Data Synchronization Test After HOT BACKUP
SQL> create table tibero.test (no number, name varchar(100));
Table 'TIBERO.TEST' created.
SQL> insert into tibero.test select level,'NAME'||level from dual connect by level<10001;
10000 rows inserted.
SQL> commit;
Commit completed.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> select sequence#,archived,status from v$log;
SEQUENCE# ARCHIVED STATUS
---------- -------- --------
25 YES INACTIVE
26 YES INACTIVE
27 NO CURRENT4. Transfer Control File to Standby Server Before Standby Server Recovery
OS> scp -p22 /home/data/tibero_tsc/c1.ctl tibero7@STANDBY_SERVER_IP:/home/data/tibero_tsc/. tibero7@STANDBY_SERVER_IP's password: c1.ctl 100% 94MB 128.6MB/s 00:00 100% 1024 851.9KB/s 00:00
5. Start Standby Server in Mount Mode
OS> tbboot mount Change core dump dir to /home/tibero7/tibero7/bin/prof. Listener port = 8629 Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero instance started up (MOUNT mode).
6. Recover Only Up to the Archive File Sent to the Standby Server
SQL> alter database standby controlfile; Database altered. SQL> alter database recover automatic for standby init; Database altered.
7. Start Standby Server in Recovery Mode
OS> tbdown immediate Tibero instance terminated (NORMAL mode). OS> tbboot recovery Change core dump dir to /home/tibero7/tibero7/bin/prof. Listener port = 8629 Tibero 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Tibero instance started up (RECOVERY mode). SQL> select primary_addr, status,primary_tsn,recovered_tsn,open_seq from v$standby; PRIMARY_ADDR STATUS PRIMARY_TSN RECOVERED_TSN OPEN_SEQ ------------------------ ------------------------------- ----------- ------------- ---------- STANDBY_SERVER_IP:20273 STANDBY, RECOVERY IN PROGRESS 47961 47960 27