Set up Data Guard on a single machine under Red Hat

Source: Internet
Author: User

Build Environment:

Red Hat Linux Enterprise 5.4

Oracle 10g R2

The host operating system information is 192.168.199.128.

Preparation:

The master database (production database) DB_NAME = mustang SID = l already exists.

Start building Data Guard

First, you need to prepare the parameter file and set some necessary parameters. In the master database, the pfile file is generated through spfile:

SQL> create pfile = '/home/oracle/product/10.2initapril.ora' from spfile;

Then modify the inityml. ora parameter file generated by the master database. Add the following content to the original:

 
 
  1. db_unique_name=mustang 
  2.  
  3. log_archive_config='DG_CONFIG=(mustang,standby)' 
  4.  
  5. log_archive_dest_2='service=standby arch async valid_for=(online_logfiles,primary_role) 
  6.  
  7. db_unique_name=standby' 
  8.  
  9. log_archive_dest_1='location=/home/oracle/archive valid_for=(all_logfiles,all_roles) 
  10.  
  11. db_unique_name=mustang' 
  12.  
  13. log_archive_dest_state_1=enable 
  14.  
  15. log_archive_dest_state_2=enable 
  16.  
  17. log_archive_format=%t_%s_%r.arc 
  18.  
  19. log_archive_max_processes=30 
  20.  
  21. fal_server=standby 
  22.  
  23. fal_client=mustang 
  24.  
  25. db_file_name_convert='standby','mustang' 
  26.  
  27. log_file_name_convert='/home/oracle/','/home/oracle/standby/' 
  28.  
  29. standby_file_management=auto 
After modifying the parameter file, you must re-open the master database and then useInistml. oraTo createSpfile. As follows:
 
 
  1. SQL>create spfile=’/home/oracle/product/10.2.0/db_1/dbs/spfileapril.ora’ from pfile=’ 
  2. /home/oracle/product/10.2.0/db_1/dbs/initapril.ora’; 
The next step is to create the parameter files required by the slave database through the parameter files of the master database, and run them on the master database:

 
 
  1. SQL>create pfile=’ /home/oracle/product/10.2.0/db_1/dbs/initstandby.ora’ from spfile; 
EditInitstandby. ora. As follows:
 
 
  1. standby.__db_cache_size=213909504 
  2.  
  3. standby.__large_pool_size=4194304 
  4.  
  5. *.control_files='/home/oracle/standby/standby.ctl' 
  6.  
  7. *.db_file_multiblock_read_count=8 
  8.  
  9. *.db_file_name_convert='standby','mustang' 
  10.  
  11. *.db_files=80 
  12.  
  13. *.db_name='mustang' 
  14.  
  15. *.db_unique_name='standby' 
  16.  
  17. *.fal_client='standby' 
  18.  
  19. *.fal_server='mustang' 
  20.  
  21. *.global_names=TRUE 
  22.  
  23. *.instance_name='standby' 
  24.  
  25. *.log_archive_config='DG_CONFIG=(mustang,standby)' 
  26.  
  27. *.log_archive_dest_1='location=/home/oracle/standby/archive' 
  28.  
  29. *.log_archive_dest_2='service=mustang arch async valid_for=(online_logfiles,primary_role) 
  30.  
  31. db_unique_name=mustang' 
  32.  
  33. *.log_archive_dest_state_1='enable' 
  34.  
  35. *.log_archive_dest_state_2='enable' 
  36.  
  37. *.log_archive_format='%t_%s_%r.arc' 
  38.  
  39. *.log_archive_max_processes=30 
  40.  
  41. *.log_buffer=32768 
  42.  
  43. *.log_checkpoint_interval=10000 
  44.  
  45. *.log_file_name_convert='/home/oracle/','/home/oracle/standby/' 
  46.  
  47. *.max_dump_file_size='10240' 
  48.  
  49. *.parallel_max_servers=5 
  50.  
  51. *.processes=50 
  52.  
  53. *.service_names='standby' 
  54.  
  55. *.sga_max_size=300M 
  56.  
  57. *.sga_target=300M 
  58.  
  59. *.standby_file_management='auto' 
  60.  
  61. *.undo_management='auto' 
  62.   *.undo_tablespace='undotbs' 
SaveInitstandby. oraParameter file. PassInitstandby. oraGenerate dynamic filesSpfilestandby. ora:
 
 
  1. SQL>create spfile=’/home/oracle/product/10.2.0/db_1/dbs/spfilestandby.ora’ from pfile=’ 
  2.  
  3. /home/oracle/product/10.2.0/db_1/dbs/initstandby.ora’; 
Create a password file on the master database:

 
 
  1. [oracle@localhost dbs]$orapwd file=’ /home/oracle/product/10.2.0/db_1/dbs/orapwstandby’ password=oracle  entries=10 
Use the control file of the master database to generate the control file of the slave database:
 
 
  1. SQL>Alter database create standby controlfile as '/home/oracle/standby. ctl '; 
  • 1
  • 2
  • Next Page

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.