Oracle dual hot backup method

xiaoxiao2021-03-06  83

First, create a Standby Database requirement

1. The Oracle Server on the host in the host and the Standby database is the system version must be the same, and has the same patches;

2, the primary database must be Archive Mode; Standby Database must also be Archive Mode;

Second, create a StandBy database

1. First see the archive mode of PRIMARY DATABASE (SVRMGR> Archive LOST) If the non-invasive mode, convert the database to the automatic archive, the method is as follows:

Turn off Primary Database first:

SVRMGR> Shutdown Immediate

Start Primary Database in a mount:

SVRMGR> Connect Internal / Password

SVRMGR> Startup Mount

SVRMGR> ALTER DATABASE ArchiveLog

SVRMGR> Shutdown

2, modify the parameters in the init% Oracle_sid%. ORA file, join:

LOG_ARCHIVE_START = True # if you want Automatic Archiving

LOG_ARCHIVE_DEST =% Oracle_Home% / Database / Archive

LOG_ARCHIVE_FORMAT =% Oracle_sid %% S.% T these log_archive_dest

It means that the location of the archive log file is stored, and can be set according to the actual situation, such as the E disk space

Large, can be set to: log_archive_dest = E: / Oracle / Database / Archive

3. Copy the primary database's init% Oracle_SID%. Oracle_SID%. Oracle_Home% / Database on Standby Database; modify the corresponding init% Oracle_sid%. Orac% in Standby Database according to the actual situation:

Log_archive_dest;

4. Create an instance on the host located in Standby Database, instance names with Primary Database, for example:

ORADIM80 -NEW -SID SID_NAME -INTPWD ORACLE -STARTMODE AUTO - PFILE = C: /oant/database/init%OrAcle_sid%.ora;

5. Creating ControlFile for Standby on Primary Database, copying the controlfile to Standby Database, * as follows:

SVRMGR> ALTER DATABASE CREATE STANDBY ControlFile AS ;

6. Archive online logs on Primary Database,

SVRMGR> ALTER SYSTEM ARCHIVE LOG CURRENT;

7, close Primary Database,

SVRMGR> Shutdown Immediate

8. Copy all data files, log files, archive log files (excluding control files) from Primary Database; confirmed to StandBy Database;

9. Start STANDBY DATABASE in a Nomount method:

SVRMGR> Startup Nomount

SVRMGR> Alter Database Mount Standby Database [Execlusive / Parallel] 10, Synchronous Standby Database:

SVRMGR> Recover Standby Database;

11. Restore the Primary Database boot state.

Third, maintain the Standby database

1. Send the Archive log file generated by the Primary database to the determined position of the StandBy database; hand-made recovery, keep the Standby database with the primary database synchronized.

SVRMGR> Set Autorecovery On;

SVRMGR> Connect INTERNAL / Password;

SVRMGR> Startup Nomount Pfile = ;

SVRMGR> ALTER DATABASE MOUNT Standby Database;

SVRMGR> Recover Standby Database;

SVRMGR> Shutdown

2, when the primary database fails, activate the Standby database: Cancel recovery to perform the following *:

SVRMGR> Connect INTERNAL / Password;

SVRMGR> Startup Nomount Pfile = ;

SVRMGR> ALTER DATABASE MOUNT Standby Database;

Svrmgr> ALTER DATABASE ACTIVATE STANDBY DATABASE;

Shutdown Standby database;

SVRMGR> Shutdown Immediate

Rootby Standby Database;

SVRMGR> Startup

转载请注明原文地址:https://www.9cbs.com/read-95046.html

New Post(0)