Detailed implementation record of Linux Oracle 10g DataGuard

Source: Internet
Author: User

I. Backup

1. Data Backup (executed on the master database)
Rman> backup full database format '/u01/rmanbak/port_full_backup % U. bk ';


2. database software backup (executed on the master database)
$ Cd/home/Oracle/product/10.2.0/
$ Tar cvf/u01/oraclehomebak/product.tar db_1


3. database parameter backup (executed on the master database)
Sqlplus "/as sysdba"
SQL> create pfile = '/home/oracle/initport1.ora' from spfile;


II. Implementation of the master database (Phase 1)
1. Modify parameters
Alter database force logging;
Alter system set DB_UNIQUE_NAME = port scope = spfile;
Alter system set LOG_ARCHIVE_CONFIG = 'dg _ CONFIG = (port, standby) 'scope = both;
-- Archiving destination of the master database
Alter system set LOG_ARCHIVE_DEST_1 = 'location =/home/oracle/archivelog/VALID_FOR = (ALL_LOGFILES, ALL_ROLES) DB_UNIQUE_NAME = port' scope = both;
-- When the database acts as the master database, set the transmission destination of the physical standby database redo data
Alter system set LOG_ARCHIVE_DEST_2 = 'service = standby lgwr async VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE) DB_UNIQUE_NAME = standby 'scope = spfile;
-- The redo transmission service transfers data to the destination. The default value is enable.
Alter system set LOG_ARCHIVE_DEST_STATE_1 = ENABLE scope = spfile;
Alter system set LOG_ARCHIVE_DEST_STATE_2 = ENABLE scope = spfile;
-- Exclusive or shared. The system passwords of all databases must be consistent. The default value is exclusive.
Alter system set REMOTE_LOGIN_PASSWORDFILE = EXCLUSIVE scope = spfile;
--
Alter system set LOG_ARCHIVE_FORMAT = '% t _ % s _ % r. arc' scope = spfile;
Alter system set LOG_ARCHIVE_MAX_PROCESSES = 4 scope = spfile;
-- Configure the network service name and copy the lost archive file to fal_server.
Alter system set FAL_CLIENT = port SCOPE = SPFILE;
-- Configure the network service name. If it is converted to the standby database role, obtain the lost archive file from here.
Alter system set FAL_SERVER = standby scope = SPFILE;
-- After auto, when the datafiles files of the master database are added or deleted, the slave database also performs automatic operations and transfers the logs to the directory specified by the standby_archive_dest parameter of the slave database,
-- Make sure that the directory exists. If your storage adopts a file system, but you use a bare device, you must set this parameter to manual.
Alter system set STANDBY_FILE_MANAGEMENT = auto scope = SPFILE;
-- The path of the master database after the switchover and the path of the slave database after the switchover. If the directory structure of the master and slave databases is identical, no need to set
Alter system set DB_FILE_NAME_CONVERT = '/u01/oracle/oradata/port/', '/u01/oracle/oradata/port/' SCOPE = SPFILE;
-- Same as above, the two name conversion parameters are the path ing relationship between the master and slave databases, which may be the full name of the path, depending on the situation
Alter system set LOG_FILE_NAME_CONVERT = '/u01/oracle/oradata/port/', '/u01/oracle/oradata/port/' SCOPE = SPFILE;
-- Generally, the location of LOG_ARCHIVE_DEST_1 is the same as that of LOG_ARCHIVE_DEST_1. If the standby database uses ARCH transmission, the master database uploads the archived logs to this directory.
Alter system set STANDBY_ARCHIVE_DEST = '/home/oracle/archivelog/' scope = spfile;


2. Restart the master database
Shutdown immediate;
Startup;


3. Add tnsnames. ora to the master database
STANDBY =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 172.16.3.56) (PORT = 1521 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = standby)
)
)

4. Back up the database
Run {
Allocate channel c1 device type disk format'/u01/rmanbak/forstandby/% u'connect sys/password @ port;
Backup database;
Backup archivelog all;
}

5. Generate the slave Database Control File
Method 1:
SQL> alter database create standby controlfile as '/u01/rmanbak/forstandby/ctl/controlfile. ctl ';
Method 2:
Run {
Allocate channel c1 device type disk format '/u01/rmanbak/forstandby/ctl/CON _ % U ';
Backup current controlfile for standby;
}

6. If the master database does not have a password file, create a password file to log on to the database using OS authentication.
$ Orapwd file = $ ORACLE_HOME/dbs/orapw $ ORACLE_SID password = iamwangnc entries = 5

  • 1
  • 2
  • 3
  • 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.