How to set up Oracle 10g DATA GUARD on the same server

Source: Internet
Author: User
Tags mkdir thread

To test the creation of a data guard environment on the same server.

The main library is in a normal state and there are available backups, and the force logging and associated initialization parameters for the main library are set below:

sql> ALTER DATABASE force logging;

Database altered.

To modify the initialization parameters of the main library:

Sql> alter system set Log_archive_config = ' dg_config= (primary,standby) ';

System altered.

Sql> alter system set log_archive_dest_1 = ' Location=/data/oradata/primary/archivelog valid_for= (ALL_LOGFILES,ALL_ ROLES) Db_unique_name=primary ';

System altered.

Sql> alter system set log_archive_dest_2 = ' Service=standby lgwr SYNC valid_for= (online_logfiles,primary_role) DB_ Unique_name=standby ';

System altered.

Sql> alter system set fal_server = Standby;

System altered.

Sql> alter system set fal_client = primary;

System altered.

Sql> alter system set standby_file_management = auto;

System altered.

Establish Standby_logfile in the main library:

Sql> Select group#, thread#, sequence#, bytes/1024/1024 from V$log;

group# thread# sequence# bytes/1024/1024

---------- ---------- ---------- ---------------

1 1 4 500

2 1 5 500

3 1 3 500

Sql> Select member from V$logfile;

Member

------------------------------------------------------------------------------------

/data/oradata/primary/redo01.log

/data/oradata/primary/redo02.log

/data/oradata/primary/redo03.log

sql> ALTER DATABASE Add standby logfile '/data/oradata/primary/standby_redo01.log ' size500m;

Database altered.

sql> ALTER DATABASE Add standby logfile '/data/oradata/primary/standby_redo02.log ' size500m;

Database altered.

sql> ALTER DATABASE Add standby logfile '/data/oradata/primary/standby_redo03.log ' size500m;

Database altered.

sql> ALTER DATABASE Add standby logfile '/data/oradata/primary/standby_redo04.log ' size500m;

Database altered.

For standby logfile should be more than redo logfile a group.

The following creates the directory structure required by the standby database:

Sql> host Mkdir-p/data/oradata/standby/archivelog

Sql> host Mkdir-p/opt/ora10g/admin/standby/bdump

Sql> Host Mkdir/opt/ora10g/admin/standby/cdump

Sql> Host Mkdir/opt/ora10g/admin/standby/adump

Sql> Host Mkdir/opt/ora10g/admin/standby/udump

To create the initialization files required by the standby database:

sql> create pfile= '/home/oracle/initstandby.ora ' from SPFile;

File created.

Edit the initialization file, modify the associated path, and set initialization parameters for the corresponding standby database:

[Oracle@yans1 ~]$ VI Initstandby.ora

primary.__db_cache_size=1644167168

primary.__java_pool_size=16777216

primary.__large_pool_size=16777216

primary.__shared_pool_size=452984832

Primary.__streams_pool_size=0

*.audit_file_dest= '/opt/ora10g/admin/standby/adump '

*.audit_trail= ' NONE '

*.background_dump_dest= '/opt/ora10g/admin/standby/bdump '

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.