oracle10g Physical Standby Database notes

Source: Internet
Author: User
Tags commit copy modify sessions
oracle| notes
Test Environment Primary Server:



Windows2000 Server + Oracle 10.0.1.0.2



Oracle_sid:dgtest



Oracle_home:d:\oracle\product\10.1.0\db_1standby Server:



Windows XP Pro + Oracle 10.0.1.0.2oracle_sid:dgtestoracle_home:d:\oracle\product\10.1.0\db_1







Configuration steps First, install Oracle on Primary and standby, build SIDs as dgtest libraries, and all settings are identical. Then stop Oracle on the shutdown two, and copy all the data files, control files, redo files, and password files on the primary to the corresponding location in the standby machine. (You can also use hot standby, Rman, etc. to create the initial standby library) so that we have two identical Oracle servers







1. Set up Force Loggingsql>alter database force logging on primary database;



2. Modify the initialization parameters of the primary databse db_unique_name= ' primary ' control_files= ' d:\oracle\product\oradata\control01.ctl ', ' d:\ Oracle\product\oradata\control02.ctl ', ' d:\oracle\product\oradata\control03.ctl ' log_archive_dest_1= ' location= D : \oracle\product\arch ' log_archive_dest_2= ' Service=standby ' log_archive_dest_state_1=enablelog_archive_dest_ state_2=enableremote_login_passwordfile=exclusivelog_archive_format= ' Arc%s%t%r.arc ' FAL_SERVER=standbyFAL_ Client=primarystandby_file_management=autolock_name_space----This is to set this argument when the primary and standby data are on the same machine, set to the SID of the standby database



3. Set primary database as Archivelog mode sql>shutdown immediate; Sql>startup Mount; Sql>alter database Archivelog; Sql>alter Database open:



4. Create the control file of standby database on primary database Sql>shutdown Immedaite; Sql>startup Mount; Sql>alter Database Create standby controlfile as ' D:\oracle\product\oradata\controlstandby.ctl ' Sql>alter Database open, and then copy the Controlfile to the corresponding location in standby server



5. Modify the initialization parameters of the standby databse db_unique_name= ' standby ' control_files= ' D:\oracle\product\oradata\controlstandby.ctl ' log_archive_dest_1= ' location= d:\oracle\product\arch ' log_archive_dest_2= ' service=primary ' log_archive_dest_state _1=enablelog_archive_dest_state_2=enablestandby_archive_dest= ' D:\oracle\product\arch '



Remote_login_passwordfile=exclusivefal_server=primaryfal_client=standbystandby_file_management=autodb_file_ Name_convert----Use Log_file_name_convert when the data file paths for primary and standby are inconsistent----use primary when the data file paths for standby and lock_name_ are inconsistent Space----The SID of the standby database when the primary and standby data are on the same computer



Refer to the Oracle online documentation for a description of the specific parameters



6. Set primary database and standby database Tnsnames.oraprimary = (DESCRIPTION = (Address_list = (address = (prot Ocol = TCP) (HOST = primary_server) (PORT = 1521))) (Connect_data = (service_name = dgtest))) standby = (D Escription = (Address_list = (address = (PROTOCOL = TCP) (HOST = standby_server) (PORT = 1521)) (Connect_dat A = (service_name = dgtest))



7. Launch standby database Sql>startup nomount pfile= ' d:\oracle\product\initdgtest.ora ' sql>alter database Mount Stan Dby database;



8. Start primary databasesql>startup pfile= ' D:\oracle\product\initdgtest.ora '



9. Launch standby database to recover manage mode Sql>alter database recover managed standby database disconnect from session;







Switchover



On the primary.



1. The value of Sql>select switchover_status from V$database Switchover_status is to standby, which can be directly switchover if sessions active , you need to add the with session shutdown after the switchover command



2. Sql>alter database commits to switchover to physical standby;



3. SQL>SHUTDOWM immediate;



4. Sql>startup Mount;



On the standby.



1. sql> Select Switchover_status from V$database



Switchover_status value is to primary, can be directly switchover, if it is sessions active, you need to switchover after the command Plus with the session shutdown



2. Sql>alter database commits to switchover to primary;



3. Sql>shutdown immediate;



4. sql>startup;



To successfully implement switchover, it is a good idea to set some initialization parameters for both primary and standby at the same time on each server, although some of these parameters only work on one of primary or standby



Failover



On the standby.



1. Sql>alter database recover managed standby database finish; or Sql>alter database recover managed standby database finish skip standby logfile;



2. Sql>alter database commits to switchover to primary;



3. Sql>shutdown immediate;



4. sql>startup;







Related views



V$archive_dest



V$archive_dest_status v$log_history v$archvied_log V$managed_standby v$archive_gap







Problems



1. The log could not transmit sql>select dest_name,status,error from V$archive_dest; Check that the status of the appropriate archive path is valid, otherwise it will be handled according to the error information



2. Cannot use ALTER DATABASE rename data file on standby, the following actions are not allowed for ALTER DATABASE renamealter when setting standby_file_management as Auto: Databa SE add/drop logfilealter database add/drop standby logfile memberalter database create datafile as



3. Switchover failed Sql>alter database commit to switchover to physical Standbyora-01093:alter database close only Perm    Itted with no session connected view the activity that caused the error sessionsql> select Sid,process,program from v$session where type= ' USER ' and sid<> (select distinct SID from V$mystat), disconnect the session, or use the following command to do Switchoversql>lter database commit to Switchover to physical standby and session shutdown;




Large-Scale Price Reduction
  • 59% Max. and 23% Avg.
  • Price Reduction for Core Products
  • Price Reduction in Multiple Regions
undefined. /
Connect with us on Discord
  • Secure, anonymous group chat without disturbance
  • Stay updated on campaigns, new products, and more
  • Support for all your questions
undefined. /
Free Tier
  • Start free from ECS to Big Data
  • Get Started in 3 Simple Steps
  • Try ECS t5 1C1G
undefined. /

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.