Oracle uses flashback to activate a standby as read Wirte (10g and up)

Source: Internet
Author: User

Oracle uses flashback to activate the standby as read Wirte (10g and up) environment: Os:centos 6.5 x64db:oracle 10.2.0.5 Main Library Operations:sql> alter SYSTEM switch logfile ; System altered. sql> standby Operation de-archiving application sql> ALTER DATABASE recover managed standby database Cancel;database altered. sql> Create restore points sql> Create restore point RESTORE_POINT_DG guarantee Flashback database; Restore Point created. Sql> Main Library Operations set the archive purpose of the repository to defer (so that the background does not error, preventing the main library from transmitting data to the repository) official explanation deferspecifies that valid destination information and Attributes was preserved, but the destination was excluded from archiving operations until re-enablesql> alter system SE T Log_archive_dest_state_2=defer; Activates the standby as read/wirtesql> ALTER DATABASE activate standby database;database altered. sql> ALTER DATABASE Open;database altered. sql> Standby Status Read/writesql> Select Open_mode from V$database;open_mode----------READ writesql> This allows us to operate the [[email protected] backup]$ expdp directory=backup dumpfile=test1 ' Date +%f ' in the repository export. DMP Logfile=test1 ' Date +%f '. Log schemas=test1export:release 10.2.0.5.0-64bit Production on Monday, September, 22:37:17copyright (c) 2003, Oracle. All rights reserved. Username:/As sysdbaconnected to:oracle Database 10g Enterprise Edition Release 10.2.0.5.0-64bit productionwith the Pa Rtitioning, OLAP, Data Mining and Real application testing optionsstarting "SYS". " Sys_export_schema_01 ":/******** as SYSDBA directory=backup dumpfile=test12014-09-15.dmp Logfile=test12014-09-15.log Schemas=test1 Estimate in progress using BLOCKS method ... Processing object type Schema_export/table/table_datatotal estimation using BLOCKS method:64 kbprocessing Object Type SCH Ema_export/userprocessing Object Type Schema_export/system_grantprocessing Object Type Schema_export/role_ Grantprocessing Object Type Schema_export/default_roleprocessing Object Type Schema_export/pre_schema/procact_ Schemaprocessing Object Type Schema_export/table/tableprocessing Object Type Schema_export/table/statistics/table_ STATISTICS. . Exported "TEST1". "           TEST "                   4.960 KB 5 rowsmaster table "SYS". " Sys_export_schema_01 "Successfully loaded/unloaded************************************************************** Dump file set for SYS. SYS_EXPORT_SCHEMA_01 is:/u01/app/oracle/dump/test12014-09-15.dmpjob "SYS". " Sys_export_schema_01 "successfully completed at 22:37:31[[email protected] backup]$ Main Library Operations Main Library add record sql> insert into test values, 1 row created. sql> INSERT into test values, 1 row created. sql> INSERT into test values, 1 row created. sql> INSERT into test values (one); 1 row created. sql> INSERT into test values (one); 1 row created. Sql> commit; Commit complete. System altered. sql> sql> conn/as sysdbaconnected.sql> alter system switch logfile; System altered.  Sql> Delete table on standby library [[email protected] backup]$ sqlplus/as sysdbasql*plus:release 10.2.0.5.0-production on Mon Sep  22:40:53 2014Copyright (c) 1982, Oracle. All rights reserved.connected to:oracle Database 10g Enterprise Edition Release 10.2.0.5.0-64bit productionwith The partitioning, OLAP, Data Mining and Real application T esting optionssql> conn test1/test1connected.sql> drop table test purge; Table dropped. Sql> ready to re-restore to DG Standby environment sql> Startup Mount Force;oracle instance started. Total System Global area 704643072 bytesfixed size 2098912 bytesvariable size 192940320 bytesdatabase buffers 503316 480 Bytesredo buffers 6287360 bytesdatabase mounted. sql> Flash back database sql> flashback to restore point RESTORE_POINT_DG; Flashback complete. sql> sql> shutdown immediate;ora-01507:database not mountedoracle instance shut down. Sql> Startup Nomount;oracle instance started. Total System Global area 704643072 bytesfixed size 2098912 bytesvariable size 192940320 bytesdatabase buffers 503316 480 Bytesredo buffers 6287360 bytessql> ALTER DATABASE mount standby database; # or ALTER DATABASE convert to physical standby;database altered. Main Library operation Sql> alter system set log_archive_dest_state_2=enable Scope=both; System altered. Sql> Prepare the library operation, check whether the process is normal sql> select Process,status from V$managed_standby; PROCESS STATUS---------------------ARCH connectedarch connectedarch CONNECTEDMRP0 wait_for_logrfs idlerfs IDLE6 R oWS selected. Sql> Main Library Operation switch log sql> alter system switch logfile; System altered. Sql> Library is normal fs[1]: successfully opened standby log 8: '/u01/app/oracle/oradata/netdata/st_redo08a.log ' Mon Sep 15 22:50:22 CST 2014Media Recovery log/u01/app/oracle/archive/netdata/1_79_857898543.arcmedia Recovery waiting for thread 1 Sequence 80

Oracle uses flashback to activate a standby as read Wirte (10g and up)

Related Article

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.