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:
- db_unique_name=mustang
-
- log_archive_config='DG_CONFIG=(mustang,standby)'
-
- log_archive_dest_2='service=standby arch async valid_for=(online_logfiles,primary_role)
-
- db_unique_name=standby'
-
- log_archive_dest_1='location=/home/oracle/archive valid_for=(all_logfiles,all_roles)
-
- db_unique_name=mustang'
-
- log_archive_dest_state_1=enable
-
- log_archive_dest_state_2=enable
-
- log_archive_format=%t_%s_%r.arc
-
- log_archive_max_processes=30
-
- fal_server=standby
-
- fal_client=mustang
-
- db_file_name_convert='standby','mustang'
-
- log_file_name_convert='/home/oracle/','/home/oracle/standby/'
-
- standby_file_management=auto
After modifying the parameter file, you must re-open the master database and then useInistml. oraTo createSpfile. As follows:
- SQL>create spfile=’/home/oracle/product/10.2.0/db_1/dbs/spfileapril.ora’ from pfile=’
- /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:
- SQL>create pfile=’ /home/oracle/product/10.2.0/db_1/dbs/initstandby.ora’ from spfile;
EditInitstandby. ora. As follows:
- standby.__db_cache_size=213909504
-
- standby.__large_pool_size=4194304
-
- *.control_files='/home/oracle/standby/standby.ctl'
-
- *.db_file_multiblock_read_count=8
-
- *.db_file_name_convert='standby','mustang'
-
- *.db_files=80
-
- *.db_name='mustang'
-
- *.db_unique_name='standby'
-
- *.fal_client='standby'
-
- *.fal_server='mustang'
-
- *.global_names=TRUE
-
- *.instance_name='standby'
-
- *.log_archive_config='DG_CONFIG=(mustang,standby)'
-
- *.log_archive_dest_1='location=/home/oracle/standby/archive'
-
- *.log_archive_dest_2='service=mustang arch async valid_for=(online_logfiles,primary_role)
-
- db_unique_name=mustang'
-
- *.log_archive_dest_state_1='enable'
-
- *.log_archive_dest_state_2='enable'
-
- *.log_archive_format='%t_%s_%r.arc'
-
- *.log_archive_max_processes=30
-
- *.log_buffer=32768
-
- *.log_checkpoint_interval=10000
-
- *.log_file_name_convert='/home/oracle/','/home/oracle/standby/'
-
- *.max_dump_file_size='10240'
-
- *.parallel_max_servers=5
-
- *.processes=50
-
- *.service_names='standby'
-
- *.sga_max_size=300M
-
- *.sga_target=300M
-
- *.standby_file_management='auto'
-
- *.undo_management='auto'
- *.undo_tablespace='undotbs'
SaveInitstandby. oraParameter file. PassInitstandby. oraGenerate dynamic filesSpfilestandby. ora:
- SQL>create spfile=’/home/oracle/product/10.2.0/db_1/dbs/spfilestandby.ora’ from pfile=’
-
- /home/oracle/product/10.2.0/db_1/dbs/initstandby.ora’;
Create a password file on the master database:
- [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:
- SQL>Alter database create standby controlfile as '/home/oracle/standby. ctl ';