Archive gradual application of secondary database migrations (for large databases)

Source: Internet
Author: User

La La la

  1. Determine the source database information, mainly query the source database archive, confirm the archive log;

    Select name from V$archived_log;

    NAME

    --------------------------------------------------------------------------------

    +flash/orcl/onlinelog/group_1.257.856384971

    +data/orcl/onlinelog/group_2.262.856384971

    +flash/orcl/onlinelog/group_2.258.856384971

    +data/orcl/onlinelog/group_3.263.856384971

    +flash/orcl/onlinelog/group_3.259.856384973

    +flash/orcl/archivelog/2014_08_25/thread_1_seq_5.276.856492209

    +flash/orcl/archivelog/2014_08_25/thread_1_seq_3.286.856492209

    +flash/orcl/archivelog/2014_08_25/thread_1_seq_4.287.856492209

    ?

    Selected rows.

    ?

    sql> alter system switch logfile;

  2. Back up the database and make a hot backup of the source database with the following script:

    ALTER TABLESPACE system begin backup;

    Host copy E:\ORACLE\ORADATA\MARK\SYSTEM01. Dbf

    Alter TABLESPACE system end backup;

    .....

  3. Change data and archive part of the log, do not test the purpose, modify part of the data, and continue to archive, the database continues to provide services.

    Begin

    For I in 1.. 4 loop

    INSERT into Mark values (I,sysdate,dbms_flashback.get_system_change_number);

    Execute immediate ' alter system switch logfile ';

    Dbms_lock.sleep (15);

    End Loop;

    End

    /

    Commit;

  4. Perform recovery, during the migration process, you can transfer the backup files to the target host, restore the backed up data files on the target host, and start the database.

    Sql>startup Mount;

    Sql>recover database using Backup controlfile until cancel;

    After all the archived log files have been applied, you can open the database read-only;

    Sql>alter database open Read only;

    ?

    Because the modification of the original database continues, close the database, boot to mount state, and then copy the archive log from the source database to continue applying the archive. By continually applying archived logs, it is recommended that the database and the source database be in a synchronized state. When the migration is reached for a specified time, the source database is archived, then shut down, and the online logs are copied. Then migrate the database application log.

    This method is similar to Dagaguard, but more controllable.

Archive gradual application of secondary database migrations (for large databases)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.