Oracle 11gR2 create physical Data Guard

Source: Internet
Author: User

Environment: OS: Red Hat Linux As 5DB: 11.2.0.1 11G has greatly improved the volume uard, the slave database can still apply the archive logs uploaded from the master database. Remember to open the slave database to check whether the data has been transmitted at 10 Gb, you must stop the log application first. the following describes how to create a physical standby database. The database adopts the common file management method (the data file paths of the master and slave databases are consistent). The process is a little complicated. -------------------------- operations on the master database -------------------------------------------1.Set master databaseForce loggingModeSQL> alter database force logging;
Database altered. 2. Edit initialization parameters
SQL> create pfile = '/u01/export/home/Oracle/pfile.txt' from spfile;
File created.
Vi pfile.txt add red content
[Oracle @ primary ~] $ More pfile.txt
Else l. _ db_cache_size = 272629760
Else l. _ java_pool_size = 4194304
Else l. _ large_pool_size = 4194304
Else l. _ oracle_base = '/u01/app/oracle' # ORACLE_BASE set from environment
Else l. _ pga_aggregate_target = 276824064
Else l. _ sga_target = 415236096
1_l. _ shared_io_pool_size = 0
1_l. _ shared_pool_size = 125829120
Else l. _ streams_pool_size = 0
*. Audit_file_dest = '/u01/app/oracle/admin/L/adump'
*. Audit_trail = 'db'
*. Compatible = '11. 2.0.0.0'
*. Control_files = '/u01/app/oracle/oradata/oracl/control01.ctl', '/u02/app/oracle/oradata/oracl/control02.ctl'
*. Db_block_size = 8192
*. Db_domain =''
*. Db_name = 'cmdl'
*. Diagnostic_dest = '/u01/app/oracle'
*. Dispatchers = '(PROTOCOL = TCP) (SERVICE = policlxdb )'
*. Memory_target = 692060160
*. Open_cursors = 300
*. Processses = 150
*. Remote_login_passwordfile = 'clusive'
*. Undo_tablespace = 'undotbs1' *. Db_unique_name = CMDL
*. Log_archive_config = 'dg _ config = (L, oraclbak )'
*. Log_archive_dest_1 =
'Location =/u02/archive_log/
Valid_for = (all_logfiles, all_roles)
Db_unique_name = comment L'
*. Log_archive_dest_2 =
'Service = dup_0000l async
Valid_for = (online_logfiles, primary_role)
Db_unique_name = oraclbak'
*. Log_archive_dest_state_1 = enable
*. Log_archive_dest_state_2 = enable
*. Standby_file_management = auto
*. Fal_server = dup_rjl
*. Fal_client = tar_rjl
*. Db_file_name_convert = '/u01/app/oracle/oradata/L/', '/u01/app/oracle/oradata/oracl /'
*. Log_file_name_convert = '/u01/app/oracle/oradata/L/', '/u01/app/oracle/oradata/oracl /', '/u02/app/oracle/oradata/oracl/', '/u02/app/oracle/oradata/oracl /'
 3. Use the parameters modified in step 2 to start the master databaseSQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> create spfile from pfile = '/u01/export/home/oracle/pfile.txt ';
File created.SQL> startup
ORACLE instance started.
Total System Global Area 690503680 bytes
Fixed Size 1338756 bytes
Variable Size 411042428 bytes
Database Buffers 272629760 bytes
Redo Buffers 5492736 bytes
Database mounted.
Database opened. 4. Add the standby log file. The size is the same as that of the log file in v $ log. Here, the log group starts from 4 because three online log groups have been created in the master database.Alter database add standby logfile group 4 ('/u02/app/oracle/oradata/oracl/stdbyredo01.log') SIZE 512 m;
Alter database add standby logfile group 5 ('/u02/app/oracle/oradata/oracl/stdbyredo02.log') SIZE 512 m;
Alter database add standby logfile group 6 ('/u02/app/oracle/oradata/oracl/stdbyredo03.log') SIZE 512 m;
Alter database add standby logfile group 7 ('/u02/app/oracle/oradata/oracl/stdbyredo04.log') SIZE 512 m; 5. Create a standby Control FileSQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.Total System Global Area 690503680 bytes
Fixed Size 1338756 bytes
Variable Size 411042428 bytes
Database Buffers 272629760 bytes
Redo Buffers 5492736 bytes
Database mounted.
SQL> alter database create standby controlfile AS '/u01/export/home/oracle/standby. ctl ';Database altered.SQL> alter database open;Database altered. 6. Configure the tnsnames FileUse netca to configure tnsnames. The file content is as follows:
[Oracle @ primary admin] $ more tnsnames. ora
# Tnsnames. ora Network Configuration File:/u01/app/oracle/product/11.2.0/db_1/n
Etwork/admin/tnsnames. ora
# Generated by Oracle configuration tools.Tar_rjl =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.102) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = CMDL)
)
) Dup_cmdl =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.103) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = oraclbak)
)
) 7. view the directories of data files and log files so that the corresponding directories can be created in the slave database.
SQL> select name from v $ datafile;NAME
--------------------------------------------------
/U01/app/oracle/oradata/oracl/system01.dbf
/U01/app/oracle/oradata/oracl/sysaux01.dbf
/U01/app/oracle/oradata/CMDL/undotbs01.dbf
/U01/app/oracle/oradata/oracl/users01.dbf
/U01/app/oracle/oradata/oracl/hxl001.dbf
/U01/app/oracle/oradata/oracl/hxl002.dbf SQL> select member from v $ logfile;MEMBER
--------------------------------------------------
/U01/app/oracle/oradata/logs L/redo0301.log
/U02/app/oracle/oradata/logs L/redo0302.log
/U01/app/oracle/oradata/logs L/redo0201.log
/U02/app/oracle/oradata/logs L/redo0202.log
/U01/app/oracle/oradata/logs L/redo0101.log
/U02/app/oracle/oradata/logs L/redo0102.log
/U02/app/oracle/oradata/oracl/stdbyredo01.log
/U02/app/oracle/oradata/oracl/stdbyredo02.log
/U02/app/oracle/oradata/oracl/stdbyredo03.log
/U02/app/oracle/oradata/oracl/stdbyredo04.log

SQL> select name from v $ controlfile;

NAME -------------------------------------------/u01/app/oracle/oradata/oracl/control01.ctl
/U02/app/oracle/oradata/oracl/control02.ctl
  • 1
  • 2
  • Next Page

Related Article

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.