|
Operation and maintenance of the process is the continuous generation of new problems, and the need to continue research process forward. November holiday just after Oracle customers to synchronize the data before the phone telling inconsistencies need to be addressed, but they can not stop business.
Here studies using RMAN initializing
- Do not need to shut down the source database.
1. Environment Introduction:
Three customer database, mutual synchronization between the three DDL, DML
2. Introduction:
Availability of each scene is not the same, the process is different, but generally similar step. My fault can not go directly to handle such a failure, you need to analyze the differences of each library, which library data is normal at initialization to other database, start the synchronization. Because it is the production environment, real-time data in the database changes, the source extraction process needs to open (transfer process can be opened), the recovery target side is stopped, and then open until initialization is complete.
3. The steps are as follows:
Production side ===============================================
1) Use the oracle user, execute rman backup
- Backup database:
mkdir -p / data / backup / data / dbback / gpofullbak
chown -R oracle.oinstall / data / backup / data / dbback / gpofullbak
rman target /
run {
allocate channel ch00 type disk maxpiecesize 30g;
allocate channel ch01 type disk maxpiecesize 30g;
crosscheck backupset;
delete noprompt expired backupset;
sql 'alter system archive log current';
backup as backupset skip inaccessible tag hot_db_bk_level0
full database
format '/ data / backup / bk_% s_% p_% t';
release channel ch00;
release channel ch01;
}
- Backup and archive control file:
run {
ALLOCATE CHANNEL ch00 TYPE DISK MAXPIECESIZE 30g;
ALLOCATE CHANNEL ch01 TYPE DISK MAXPIECESIZE 30g;
sql 'alter system switch logfile';
sql 'alter system switch logfile';
sql 'alter system switch logfile';
sql 'alter system archive log current';
BACKUP ARCHIVELOG ALL FORMAT '/ data / backup / ARCH_% U';
BACKUP CURRENT CONTROLFILE FORMAT '/ data / backup / bk_controlfile';
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
}
- Perform the source machine
SQL> select * from Gv $ log;
INST_ID GROUP # THREAD # SEQUENCE # BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE # FIRST_TIM NEXT_CHANGE # NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ----------- ----------- ------------ ---------
1 1 1 795 52428800 512 1 YES INACTIVE 17689009 09-OCT-15 17689018 09-OCT-15
1 2 1 796 52428800 512 1 YES INACTIVE 17689018 09-OCT-15 17689026 09-OCT-15
1 3 1 797 52428800 512 1 NO CURRENT 17689026 09-OCT-15 2.8147E + 14
The record SCN number 17689018
========================================
SQL> create pfile = '/ tmp / initora11g.ora' from spfile;
scp -rp /tmp/initora11g.ora root@192.168.80.71: /u01/app/oracle/product/11.2.0/db_1/dbs/
scp -rp / data / backup / / data / dbback / root@192.168.80.71: / data
Target end ===============================================
2) Start the database to the state nomount
SQL> startup nomount
3) Start RMAN to restore the control file
rman target /
RMAN> restore controlfile from '/ data / backup / bk_controlfile';
4) Change the database to mount state
sqlplus / as sysdba
SQL> alter database mount;
5) Start RMAN to restore the database
rman target /
RMAN> restore database;
RMAN>
run
{
set archivelog destination to '/ u01 / app / oracle / flash_recovery_area';
SET UNTIL SCN 17689018; # Note the use of the previous record number of scn
RECOVER DATABASE;
}
6) View
SQL> SELECT CHECKPOINT_CHANGE #, CHECKPOINT_TIME FROM V $ DATAFILE_HEADER;
CHECKPOINT_CHANGE # CHECKPOIN
------------------ ---------
17689018 09-OCT-15
17689018 09-OCT-15
17689018 09-OCT-15
17689018 09-OCT-15
17689018 09-OCT-15
17689018 09-OCT-15
17689018 09-OCT-15
17689018 09-OCT-15
8 rows selected.
SQL> alter database open resetlogs;
Here backup and recovery has been completed.
7) Start Recovery
start rini_1, aftercsn 17689018 |
|
|
|