Dataguard read-only and application archive interchange scripts in oracle10g

Source: Internet
Author: User
Tags sqlplus

In Oracle 11g, the standby library can be read-only and synchronized application log, 10g and its previous versions, in the Application log library is not open to read only mode, for some real-time requirements is not particularly high application, For example, they can be implemented in the daytime only read, query business, night Application log. If you do a similar amount of work every day, because there are friends need to write a similar function based on the win platform script, by scheduling task calls to achieve daytime read-only, night Application log function
Database conversion from application archive mode to read-only mode

The code is as follows Copy Code
--change_open.bat
Sqlplus/as SYSDBA @c:\oracle\product\script\change_open.sql

--change_open.sql
ALTER database RECOVER MANAGED STANDBY database cancel;
ALTER DATABASE open read only;
Exit

Database conversion from read-only mode to application archive mode

  code is as follows copy code
--change_ Mount.bat
Sqlplus/as sysdba @c:\oracle\product\script\change_mount.sql
 
--change_mount.sql
Shutdown immediate;
Startup Mount; The
alter system register; The
alter system register;
ALTER database RECOVER MANAGED STANDBY database USING current
LOGFILE DISCONNECT to session;
Conn Sys/orac Le@ntsy as SYSDBA
alter system set LOG_ARCHIVE_DEST_STATE=DEFER;
alter system set log_archive_dest_state=enable;
ALTER system switch logfile;
Exit;

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.