AAA oracle11g Dataguard Complete Manual (this method only adapts to Oracle, no Golden Gate Good) (database open total flashback) __python

Source: Internet
Author: User
Tags bulk insert oracle database

First, the foreword:
The network on the configuration of Dataguard, but a lot of oracle11g articles are actually only in the 9 10 run, such as Fal_client in the 11g has been abandoned, but now the Web article is not labeled this point. and vague for the specific meaning of the novice can only know it but do not know why. This article I want to let people like me for the Dataguard configuration not only know how to configure, but also know why the need to configure this, this effect is the best.
This article is not just about how to configure, but also about why, and the key points, and I hope this article will serve as a reference manual for Dataguard configuration.

Open: Sql>alter database flashback on;

Second, the premise
1. The main library is the archive mode:
If we don't know why the archive model is, then we don't know what dataguard is for. In many official languages, we need to make it clear that DG (Dataguard, later) actually works to be highly available. The realization principle is from the main library to obtain data from the library, in the main library when the exception, from the library to take over the main library, complete identity changes. Can be a master library, up to 9 from the library. It is also divided into logical standby and physical standby here we are talking about physical standby.
Once created and configured as standby, DG is responsible for transmitting the primary database redo data to the standby database, and standby the database to keep the redo database transactions consistent with the primary data received by the application.
This is clear, you need to ensure that the master-slave library consistent, need to transfer archive log and redo log to from the library, if not the archive mode can not guarantee the data consistency of the master-slave library.

2. From the library only need to install the database software, data from the main library after the completion of the transfer.

3. Many people say that 11g has an active dataguard (ADG), logic standby is actually no longer useful.

4. master-Slave library hardware best consistent. Oracle database versions need to be consistent.
(1) Memory Check entry:
# grep Memtotal/proc/meminfo
Swap partition Check: If the presence of 1-2g,swap is 1.5 times times, 2-16g,1 times more than 16G, set to 16G can be.
# grep Swaptotal/proc/meminfo
To view the shared memory size:
# df-h/DEV/SHM


(2) View System processor architecture, consistent with Oracle installation package
# uname-m


(3) Space/tmp must be greater than 1G
# DF-H/tmp

5. Configure environment database users must have SYSDBA permissions
6. Following environment: Main Library 192.168.215.101 database instance name: ORCL DB_UNIQUE_NAME:ORCL
192.168.215.102 database instance name from library: ORCL DB_UNIQUE_NAME:ORCLDG

Third, the configuration
1. Determine if DG has been installed:
SELECT * from v$option where parameter = ' Oracle Data Guard ';
If True indicates that the installation can be configured, or you need to install the appropriate components.

2. Set the main library as a force logging log.
By default, the database operation records redo log, but in certain cases you can use nologging to not generate redo information
(1) The BULK insert of the table (via/*+APPEND/hint using direct path insertion). or by Sql*loader Direct path loading). Table data does not generate redo, but
All index modifications generate redo, but all index modifications generate redo (although the table does not generate a log, the index on this table generates redo.) )。
(2) LOB operations (updates to large objects do not have to generate a log).
(3) Create table as select by creating table
(4) Various ALTER TABLE operations, such as move and split
(5) In some table migrations and tablespace migrations, ALTER TABLE A nologging can be used, or alter tablespace SNK Nologging, and then back to the logging state after the operation completes.
If you use nologging to import large quantities of data, modifications to these data will be in redo or archive log, but the datum is not, so once the media is corrupted, it cannot be fully recovered. You must make a full standby or level 0 backup after switching back to logging with nologging completion.

(1) Mandatory log: Sql>alter database force logging;
(2) Check status (yes is mandatory): Sql>select name,force_logging from V$database;
(3) If you need to add or delete data files in the main library, these files will also be added or deleted in the backup, using the following:
Sql>alter system set standy_file_management= ' AUTO ';
The default this parameter is manual manual method sql>show parameter standby

3. Create standby log files (alternate log file)
Use standby log files from the library to hold the redo logs received from the Master library. Since it is mainly used from the library, why is it necessary to build on the main library
Standby log files? The reason is mainly from two: first, the main library may be converted to a standby, and the repository is required to have standby log files Two is if the main library
Standby log files are created automatically.
To establish a standby, pay attention to the following points:
The <1>standby log files are the same size as redo log files.
Query redo log files size (default 50m,3): Select group#,bytes/1024/1024 as M from V$log
<2> in general, the number of Standbyredo log file groups is at least one more than the online redo log file group of the primary database.
Recommended Standbyredo number of log groups based on the number of threads in the primary database (the number of threads here can be understood as the RAC in the RAC structure)
Number of nodes).
There is a recommended formula that can be referenced: (Number of log groups per thread +1) * Maximum number of threads
Assuming the node is now 1, then = (3+1) *1=4
If it is a double node = (3+1) *2=8
Here we create 4 standby logfile:
Another: Do not recommend group number group# next to redo, because the follow-up redo is possible to adjust, here we from the establishment from 11 to 14 standby logfile

1 2 3 4 5 6 7 8 # CD $ORACLE _base/oradata/orcl/# mkdir DG # chown ORACLE :d BA DG sql>  alter  database  add  standby logfile  group   11  '/opt/oracle /oradata/orcl/dg/standby11.log '   size  50M; sql>  alter  database  add  standby logfile 
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.