I will not talk about the principle of DataGuard here. Here I will just talk about the project process I have implemented.
1. Create a database on the physical host
Operating System: RedHat5.4
This project installs a primary and a standby. Therefore, you must prepare two machines named DG1 and DG2.
1. Install database software
Oracle10.2.0.1 is installed here. We are familiar with the installation process. Remember to install only the database software. (This will simplify the subsequent upgrade process)
2. If you directly use 10.2.0.1 for replica uard, some bugs may occur. To avoid these bugs, we need to upgrade the database software to 10.2.0.5.
3. Create a database: Use DBCA to create a database on DG1, and do not create a database on DG2.
4. primary terminal settings
4.1 set the master database to force logging mode.
1. SQL> alter database force logging;
2. create a Password file
[Oracle @ localhost dbs] $ orapwd file =/u01/app/oracle/product/10.2.0/db_1/dbs/orapworcl password = oracle
4.2 set the master database to archive
SQL> shutdown immediate;
SQL> startup mount;
SQL> alter database archivelog;
SQL> archive log list;
4.3 add redo log file
1) Add a new standby redolog group and specify members for the Group.
SQL> alter database add standby logfile group 4 ('/u01/app/oracle/oradata/oradg/redo04.log') size 50 M;
SQL> alter database add standby logfile group 5 ('/u01/app/oracle/oradata/oradg/redo05.log') size 50 M;
SQL> alter database add standby logfile group 6 ('/u01/app/oracle/oradata/oradg/redo06.log') size 50 M;
SQL> alter database add standby logfile group 7 ('/u01/app/oracle/oradata/oradg/redo07.log') size 50 M;
2) Confirm that the standby redo log file groups has been created:
SQL> SELECT GROUP #, THREAD #, SEQUENCE #, ARCHIVED, STATUS FROM V $ STANDBY_LOG;
4.4 initialization parameters
DB_NAME = testdb
DB_UNIQUE_NAME = testdb
LOG_ARCHIVE_CONFIG = 'dg _ CONFIG = (testdb, testdbst )'
LOG_ARCHIVE_DEST_1 =
'Location =/u01/oradata/arch/testdb
VALID_FOR = (ALL_LOGFILES, ALL_ROLES)
DB_UNIQUE_NAME = testdb'
LOG_ARCHIVE_DEST_2 =
'Service = boston LGWR ASYNC
VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE)
DB_UNIQUE_NAME = testdbst'
LOG_ARCHIVE_DEST_STATE_1 = ENABLE
LOG_ARCHIVE_DEST_STATE_2 = ENABLE
REMOTE_LOGIN_PASSWORDFILE = EXCLUSIVE
LOG_ARCHIVE_FORMAT = % t _ % s _ % r. arc
LOG_ARCHIVE_MAX_PROCESSES = 30
FAL_SERVER = testdbst
FAL_CLIENT = testdb
STANDBY_FILE_MANAGEMENT = AUTO