Tuesday, July 18, 2006

Creating a Physical Standby Database - Log transport services


Ref: http://download-west.oracle.com/docs/cd/

Checklist
3.2.1 Identify the Primary Database Datafiles (Primary)
3.2.2 Make a Copy of the Primary Database (Primary)
3.2.3 Create a Control File for the Standby Database (Primary)
3.2.4 Prepare the Initialization Parameter File to be Copied to the Standby Database (Primary)
3.2.5 Copy Files from the Primary System to the Standby System (Primary)
3.2.6 Set Initialization Parameters on a Physical Standby Database (Standby)
3.2.7 Create a Windows Service (Standby)
3.2.8 Configure Listeners for the Primary and Standby Databases (Primary and Standby)
3.2.9 Enable Dead Connection Detection on the Standby System (Standby)
3.2.10 Create Oracle Net Service Names (Primary and Standby)
3.2.11 Create a Server Parameter File for the Standby Database (Standby)
3.2.12 Start the Physical Standby Database (Standby)
3.2.13 Initiate Log Apply Services (Standby)
3.2.14 Enable Archiving to the Physical Standby Database (Primary)


7/19/06 11:57 AM Practice

- While primary database is runing, to start the standby database and verify everything is working, do the following:

(1) Start the Physical Standby Database (in the same system as the primary)

c:> set ORACLE_SID=oemrep2
c:> sqlplus /nolog
SQL> connect /as sysdba
SQL> startup nomount;
(DS: if just type 'startup;', will see 'ORA-01666: controlfile is for a standby database'.
And the database is not mounted)
SQL> alter database mount standby database;

(2) To test: on the primary db, under scott, create a tab mytab1 and insert some rows
SQL> select * from mytab1;
A B
---------- ----------
1 1
2 2
3 3

(3) initiate the Log Apply services
SQL> alter database recover managed standby database disconnect from session

(4) On the primary db, verifying
LOG_ARCHIVE_DEST_2=oemrep2
LOG_ARCHIVE_DEST_STATE_2=ENABLE

(5) start remote archiving (not remote in this case) on the primary db
ALTER system archive log current

(6) Verifying the physcal standby database

step 1 Identify the existing archived redo logs
SQL> select sequence#, first_time, next_time
2 > from v$archived_log order by sequence#;

step 2 Archiving the current log
SQL> alter system archive log current

step 3 Verify that the new archived redo log was received
SQL> select sequence#, first_time, next_time
2 from v$archived_log order by sequence#;

step 4 Verify that the new archived redo log was applied
SQL> select sequence#, applied from v$archived_log order by sequence#;

(??> Notes: there can be duplicate entries with one shows 'NO', the other shows 'Yes' under 'applied' column; note the creator column is different)

SQL> select sequence#, applied, creator from v$archived_log where sequence#=73;
SEQUENCE# APP CREATOR
---------- --- -------
73 NO FGRD
73 YES ARCH

(note: when trying to shutdown standby db recieve:ORA-16175: cannot shut down database when media recovery is active
--------- Practicse Ends Here --------------------------------------

Log transport services
Log apply services
role management services


Log transport services, related concepts:
- Redo logs
- Redo log destinations
- Transmission and reception of redo log
- Data protection

A Data Guard configuration in one of three data protection mode:
- Maximum protection
- Maximum availability
- Maximum performance

Size of online redo logs
- most important factor: the amount of appliaction data that needs to be applied to a standby database during a database failover operation

REMOTE_ARCHIVE_ENABLE initialization parameter
- permission for archiving of online redo logs to remote destination
- TRUE, FALSE, SEND, RECEIVE

CONTROL_FILE_RECORD_KEEP_TIME initialization parameter
- minimum number of days that must pass before a reusable record in the conntrol file can be resued



5.3.3 Standby Redo Logs
- similar to online redo logs
- required for physical standby databases running in maximum protection mode and maximum availability mode



Remote file server process

The following parameters limit the number of standby redo log groups that you can add to a database:


- MAXLOGFILES clause of the CREATE DATABASE statement for the primary database determines the maximum number of groups of standby redo logs per physical standby database. The only way to override this limit is to re-create the primary database or control file.
- LOG_FILES parameter can temporarily decrease the maximum number of groups of standby redo logs for the duration of the current instance.


- MAXLOGMEMBERS clause of the CREATE DATABASE statement used for the primary database determines the maximum number of members per group. The only way to override this limit is to re-create the primary database or control file.






1 comment:

yds said...

whenever possible, the standby database should be started up first