Building oracle11G DG in linux (III): Building a slave Database
Environment
Name |
Master Database |
Slave Database |
Host Name |
Bjsrv |
Shsrv |
Software Version |
RedHat performanise5.5, Oracle 11g 11.2.0.1 |
RedHat performanise5.5, Oracle 11g 11.2.0.1 |
Iii. operations around the standby Database: 1. Backup database-Modify the initialization parameter file
$Cd $ ORACLE_HOME/dbs
$Df-h
$Vi initshdb. ora
Brief description of modification:
*. Audit_file_dest = '/u01/app/oracle/admin/Sh/Adump'
// Audit file storage path
*. Audit_trail = 'db'
*. Compatible = '11. 2.0.0.0'
*. Control_files ='/U01/app/oracle/oradata/sh/sh_control01.ctl'
*. Db_block_size = 8192
*. Db_name = 'testdb12'
*. Db_recovery_file_dest = '/u01/app/oracle/fast_recovery_area'
*. Db_recovery_file_dest_size = 4322230272
*. Diagnostic_dest = '/u01/app/oracle'
*. Dispatchers = '(PROTOCOL = TCP) (SERVICE = TestDB12XDB )'// Used for sharing and Deletion
*. Log_archive_format = 'arch _ % t _ % s _ % r. Log'
*. Memory_target = 642006528
*. Open_cursors = 300
*. Processses = 150
*. Remote_login_passwordfile = 'clusive'
*. Undo_tablespace = 'undotbs1'
DB_UNIQUE_NAME =Shdb
LOG_ARCHIVE_CONFIG = 'dg _ CONFIG = (bjdb, shdb )'
LOG_ARCHIVE_DEST_1 =
'Location =/dsk4/arch _Sh
VALID_FOR = (ALL_LOGFILES, ALL_ROLES)
DB_UNIQUE_NAME =Shdb'
LOG_ARCHIVE_DEST_2 =
'Service =BjdbASYNC // It should be the other party
VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE)
DB_UNIQUE_NAME =Bjdb'
LOG_ARCHIVE_DEST_STATE_1 = ENABLE
LOG_ARCHIVE_DEST_STATE_2 = ENABLE
LOG_ARCHIVE_MAX_PROCESSES = 3
FAL_SERVER =Bjdb
DB_FILE_NAME_CONVERT ='/U01/app/oracle/oradata/testdb12','/u01/app/oracle/oradata/Sh'// First the other party and then the other party
LOG_FILE_NAME_CONVERT =
'/Dsk1/oradata/bj', '/dsk1/oradata/Sh','/dsk2/oradata/bj ','/dsk2/oradata/Sh'
STANDBY_FILE_MANAGEMENT = AUTO // first, and then
Example:
*. Audit_file_dest = '/u01/app/oracle/admin/Sh/Adump'
*. Audit_trail = 'db'
*. Compatible = '11. 2.0.0.0'
*. Control_files ='/U01/app/oracle/oradata/sh/sh_control01.ctl'
*. Db_block_size = 8192
*. Db_name = 'testdb12'
*. Db_recovery_file_dest = '/u01/app/oracle/fast_recovery_area'
*. Db_recovery_file_dest_size = 4322230272
*. Diagnostic_dest = '/u01/app/oracle'
*. Log_archive_format = 'arch _ % t _ % s _ % r. Log'
*. Memory_target = 642006528
*. Open_cursors = 300
*. Processses = 150
*. Remote_login_passwordfile = 'clusive'
*. Undo_tablespace = 'undotbs1'
DB_UNIQUE_NAME =Shdb
LOG_ARCHIVE_CONFIG = 'dg _ CONFIG = (bjdb, shdb )'
LOG_ARCHIVE_DEST_1 =
'Location =/dsk4/arch _Sh
VALID_FOR = (ALL_LOGFILES, ALL_ROLES)
DB_UNIQUE_NAME =Shdb'
LOG_ARCHIVE_DEST_2 =
'Service =BjdbASYNC
VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE)
DB_UNIQUE_NAME =Bjdb'
LOG_ARCHIVE_DEST_STATE_1 = ENABLE
LOG_ARCHIVE_DEST_STATE_2 = ENABLE
LOG_ARCHIVE_MAX_PROCESSES = 3
FAL_SERVER =Bjdb
DB_FILE_NAME_CONVERT ='/U01/app/oracle/oradata/testdb12','/u01/app/oracle/oradata/Sh'
LOG_FILE_NAME_CONVERT =
'/Dsk1/oradata/bj', '/dsk1/oradata/Sh','/dsk2/oradata/bj ','/dsk2/oradata/Sh'
STANDBY_FILE_MANAGEMENT = AUTO
2. master database-backup of the master database before the slave database is enabled
Before the slave database starts, back up the master database.
Note: Under DG, the habit of backing up the master database before the slave database is started. To supply unknown information generated after the slave database is started.
The master database is in the mount status:
SQL>Selectstatus from v $ instance;
$Mkdir/dsk4/backup
$Rmantarget/
RMAN>Backupdatabase format'/dsk4/backup/% d _ % s. bak ';
3. master and slave databases-Network Configuration
Under the master database:
$Lsnrctlstart// Start the listener
$Cd/u01/app/oracle/product/11.2.0/dbhome_1/network/admin
$Vilistener. ora
# Listener. oraNetwork Configuration File:/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener. ora
# Generated byOracle configuration tools.
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.6.71) (PORT = 1521 ))
)
ADR_BASE_LISTENER =/u01/app/oracle
$Vi tnsnames. ora// Create a tnsnames file manually
# Tnsnames. oraNetwork Configuration File:/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames. ora
# Generated byOracle configuration tools.
Bjdb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.4.71) (PORT = 1521 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = bjdb)
)
)
Shdb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.4.72) (PORT = 1521 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = shdb)
)
)
Slave database:
$Lsnrctlstart// Start the listener
$Cd/u01/app/oracle/product/11.2.0/dbhome_1/network/admin
$Vilistener. ora// Edit the listener
# Listener. oraNetwork Configuration File:/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener. ora
# Generated byOracle configuration tools.
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.6.72) (PORT = 1521 ))
)
ADR_BASE_LISTENER =/u01/app/oracle
$Vi tnsnames. ora// Create a tnsnames file manually
BJDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.4.71) (PORT = 1521 ))
)
(CONNECT_DATA = (SERVER = DEDICATED)
(SERVICE_NAME = bjdb)
)
)
SHDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.4.72) (PORT = 1521 ))
)
(CONNECT_DATA = (SERVER = DEDICATED)
(SERVICE_NAME = shdb)
)
)
4. Slave database-network test:
$Sqlplussys/oracle @ bjdb as sysdba
[Supplement]: oracle password Modification
If the oracle password is unknown, modify the oracle password as follows:
$ Cd/u01/app/oracle/product/11.2.0/dbhome_1/dbs
$Orapwd file = orapwTestDB12 password = oracle entries = 3 force = y
$Scp orapwTestDB12 shsrv: $ ORACLE_HOME/dbs/orapwshdb
// Copy the modified password file of the master database to the slave database.
SQL>Showparameter name
Master database listening status:
$Lsnrctlstatus
Standby database listening status:
$Lsnrctlstatus
Test whether the master database can be pinged to the slave Database
$Tnsping shdb
Slave database start instance
$ExportORACLE_SID = shdb
// Or modify. bash_profile
$Sqlplus '/assysdba'
SQL>Startupnomount;
SQL>Showparameter pfile;// Use pfile to start the standby Database
SQL>Showparameter name;// Check whether the database parameters are correct
SQL>Showparameter archive;// Check whether the archive settings are correct.
****************** ********
Statement:
Original works, from "Deep Blue blog" blog, allow reprint, reprint please be sure to indicate the source (http://blog.csdn.net/huangyanlong ).
The author has the right to pursue legal liability for copyright issues.