Linux under oracle11g DG Build (iii): Around the standby library to build operations

Source: Internet
Author: User

Linux under oracle11g DG Build (iii): Around the standby library to build operations


Environment

Name

Main Library

Standby Library

Host Name

Bjsrv

Shsrv

Software version

RedHat Enterprise5.5, Oracle 11g 11.2.0.1

RedHat Enterprise5.5, Oracle 11g 11.2.0.1



Third, around the standby operation: 1, prepare the library-Modify the initialization parameter file

$Cd$oracle_home/dbs

$df-h




$VI Initshdb.ora

To modify a brief description:

*.audit_file_dest= '/u01/app/oracle/admin/sh/adump '

Path to audit file storage

*.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) '//for sharing, deleting

*.log_archive_format= ' Arch_%t_%s_%r.log '

*.memory_target=642006528

*.open_cursors=300

*.processes=150

*.remote_login_passwordfile= ' EXCLUSIVE '

*.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//should be the other side

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 each other, after himself

log_file_name_convert=

'/dsk1/oradata/bj ', '/dsk1/oradata/sh ', '/dsk2/oradata/bj ', '/dsk2/oradata/sh '

Standby_file_management=auto//First party, after himself

Reference Sample:

*.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

*.processes=150

*.remote_login_passwordfile= ' EXCLUSIVE '

*.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. Main Library-Master library backup before starting library

Make a backup of the main library before starting the repository.

Note: DG , make a habit of backing up the main library before starting the repository. To supply the unknown condition that occurs after starting the standby repository.

The main library is in the Mount state:

Sql>selectstatus from V$instance;




$mkdir/dsk4/backup

$rmantarget/




rman> backupdatabase format '/dsk4/backup/%d_%s.bak ';




3. Main Library, standby library-network configuration

Under the main library:

$ Lsnrctlstart //Start monitoring

$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 //Manual creation of tnsnames files

# 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)

)

)

Under the Standby library:

$ Lsnrctlstart //Start monitoring

$cd/u01/app/oracle/product/11.2.0/dbhome_1/network/admin

$ Vilistener.ora //Edit Monitor

# 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 //Manual creation of tnsnames files

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. Standby Library-Network test:

$sqlplussys/[email protected] as SYSDBA




"Supplemental": Oracle Password Modification

If the Oracle password is unknown, you can 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 Master Library's modified password file to the standby repository




sql>showparameter name




Main Library Listening Status:

$lsnrctlstatus




Standby Monitor Status:

$lsnrctlstatus




Test whether the main library can ping the repository

$ tnsping shdb




Repository Launch Instance

$exportoracle_sid=shdb

or modify. bash_profile

$sqlplus '/assysdba '

sql>startupnomount;

sql>Showparameter pfile; //Standby library using Pfile boot





sql>showparameter name; //See if the database parameters are correct




sql>showparameter archive; //Find out if the archive settings are correct






To be continued **************************

Statement:
Original works, from the "Blue Blog" blog, allow the reprint, please be sure to indicate the source (Http://blog.csdn.net/huangyanlong) when reproduced.

The author is entitled to be held liable for copyright related matters.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.