In OCM, the deployment uar configuration is implemented on the same host.
1. Enable the logging function of the primary database.
Alter database force logging;
2. Enable the archiving function of the primary database
Alter database archivelog;
3. Shut down the master database and start it to mount mode.
Alter database add standby logfile group 4'/Oracle/oradata/test/sredo4.dbf' size 20 m;
Alter database add standby logfile group 5'/oracle/oradata/test/sredo5.dbf' size 20 m;
Alter database add standby logfile group 6'/oracle/oradata/test/sredo6.dbf' size 20 m;
Alter database create standby controlfile as '/oracle/oradata/std/control01.dbf ';
Back up data files and control files of the primary database to/oracle/oradata/std/
4. configure network parameters
Listener and TNSNAMES
LISTENER. ORA of the master database and slave Database
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = db) (PORT = 1521 ))
)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = test)
(ORACLE_HOME =/oracle/db10g)
(SID_NAME = test)
)
(SID_DESC =
(GLOBAL_DBNAME = standby)
(ORACLE_HOME =/oracle/db10g)
(SID_NAME = stb)
)
)
TNSNAMES. ORA:
Test =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = db) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = test)
)
)
Stb =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = db) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = stb)
)
)
5. Create a parameter file for the backup database
Create pfile from spfile;
Cp inittest. ora initstb. ora
Create a pfile file for the master TEST database and add the following parameters:
Note: delete all MTS parameters (shared server)
DB_UNIQUE_NAME = test
LOG_ARCHIVE_CONFIG = 'dg _ CONFIG = (test, stb )'
LOG_ARCHIVE_DEST_1 = 'location =/oracle/arch/test VALID_FOR = (ALL_LOGFILES, ALL_ROLES )'
LOG_ARCHIVE_DEST_2 = 'service = stb lgwr async VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE) DB_UNIQUE_NAME = standby'
FAL_SERVER = stb
FAL_CLIENT = test
DB_FILE_NAME_CONVERT = '/oracle/oradata/stb','/oracle/oradata/Test'
LOG_FILE_NAME_CONVERT = '/oracle/oradata/stb','/oracle/oradata/Test'
STANDBY_FILE_MANAGEMENT = AUTO
Modify the following Pfile content from the STANDBY database:
Control_files = '/oracle/oradata/stb/control01.ctl'
Core_dump_dest = '/oracle/admin/stb/cdump'
User_dump_dest = '/oracle/admin/stb/udump'
Background_dump_dest = '/oracle/admin/stb/bdump'
The following are the added parameters:
DB_UNIQUE_NAME = stb
LOG_ARCHIVE_CONFIG = 'dg _ CONFIG = (stb, test )'
LOG_ARCHIVE_DEST_1 = 'location =/oracle/arch/stb VALID_FOR = (ALL_LOGFILES, ALL_ROLES )'
LOG_ARCHIVE_DEST_2 = 'service = test lgwr async VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE) DB_UNIQUE_NAME = Test'
FAL_SERVER = test
FAL_CLIENT = stb
DB_FILE_NAME_CONVERT = '/oracle/oradata/test','/oracle/oradata/stb'
LOG_FILE_NAME_CONVERT = '/oracle/oradata/test','/oracle/oradata/stb'
STANDBY_FILE_MANAGEMENT = AUTO
6. Start the slave database to mount and change the database to the recover managed State. Note the warning log file of the slave database during the process:
SQL> startup mount;
Alter database recover managed standby database disconnect from session;
7. Start the master database, switch logs, and observe the warning log files of the master database. If the archive is successful, the configuration is successful:
SQL> alter system switch logfile;
8. switch between the master and slave roles. Check the status of the master database:
SQL> SELECT SWITCHOVER_STATUS FROM V $ DATABASE;
SWITCHOVER_STATUS
-----------------
TO STANDBY
SQL> alter database commit to switchover to standby;
9. Slave database operations:
SQL> alter database commit to switchover to primary;
10. Switch logs on the master database (note the role conversion at this time). If the master database is archived successfully, the Standby configuration is successful.
For more information about Oracle, see Oracle topics page http://www.bkjia.com/topicnews.aspx? Tid = 12