Home » Server Options » Data Guard » Data-Guard configuration details
Data-Guard configuration details [message #236474] Thu, 10 May 2007 01:22 Go to next message
california_6_1
Messages: 29
Registered: February 2007
Junior Member
Hello,

I am planning to setup Data-guard for one of my production database and was wondering, what will be the best method to use (Physical vs logical). Also is there a documentation which guide's in detail to achieve the above? Appreciated if someone please share it.

Many thanks in advance,
Cali
Re: Data-Guard configuration details [message #236550 is a reply to message #236474] Thu, 10 May 2007 04:32 Go to previous messageGo to next message
mlgoins
Messages: 116
Registered: March 2007
Location: Denver, CO
Senior Member

I'm setting up Data Guard right now, and the documentation is pretty good (Oracle online documentation, Data Guard Configuration and Data Broker). If you only have one Standby Database, I'd recommend a Physical Standby Database for a couple of reasons (1) setup is more straightforward than a Logical Standby Database; and (2) it makes switchover/failover straighforward as well. The documentation is spread out: be sure to do your reading before you begin. There are 3 services: Redo Transport, Redo Apply, and Role Management Services that you will need to become familiar with. Also, consider which mode (Protection, Availability, Performance).

My favorite link for this effort (besides OraFaq): http://www.oracle.com/pls/db92/db92.docindex?remark=homepage
Re: Data-Guard configuration details [message #236698 is a reply to message #236550] Thu, 10 May 2007 11:41 Go to previous messageGo to next message
california_6_1
Messages: 29
Registered: February 2007
Junior Member
Thank you so much for your answer. I will surely look into the provided link and will make sure to read before i put my hands on the setup.

One last question. what tool will i use to configure data-guard?

thanks again,
Re: Data-Guard configuration details [message #236706 is a reply to message #236698] Thu, 10 May 2007 12:08 Go to previous messageGo to next message
mlgoins
Messages: 116
Registered: March 2007
Location: Denver, CO
Senior Member

Now that's funny Smile

You will use sqlplus, Data Broker (to set up sites/configurations), and -- if you have it available -- Data Guard Manager (a GUI, Oracle Enterprise-Manager type interface). Folks have some trouble with Data Broker and Data Guard Manager sometimes, but Data Broker seems to be pretty straightforward. Much of setting up Data Guard has to do with parameter setting, and creating a Standby Database. Don't forget Standby Redo Logs and ask lots of questions.

Mike
Re: Data-Guard configuration details [message #236859 is a reply to message #236706] Fri, 11 May 2007 03:00 Go to previous messageGo to next message
california_6_1
Messages: 29
Registered: February 2007
Junior Member
Thanks for the answer chief.

Now i am sure you will beat me up. well i am new to Oracle and do not have any hands on with it. I am more on SQL Server side and setting up a standby on SQL server is pretty straight forward.

But i have gone through with your provided link for data-guard setup and i do not see, where it lists step by step guide to do so. i was wondering, if you have a documentation which guide's step by step to setup a physical data guard configuration on oracle 10g.

i would greatly appreciate if you could please share something on this.

again i apolozise and thanks again for all your help.

Cali
Re: Data-Guard configuration details [message #236969 is a reply to message #236859] Fri, 11 May 2007 08:08 Go to previous messageGo to next message
mlgoins
Messages: 116
Registered: March 2007
Location: Denver, CO
Senior Member

Pilgrim, the journey begins. This links to chapter 3 of the Oracle Data Guard Concepts and Administration documentation. The chapter is entitled: "Creating a Physical Standby Database".

http://download-east.oracle.com/docs/cd/B10501_01/server.920/a96653/create_ps.htm#63563

Now, there's no guide which shows EVERYTHING you need to do (at least not in one place), because you also have to set up transport services, apply services. There's no getting around the reading.

The document above, with some lessons learned, is summarized below:

Primary Site:
1. Alter database force logging
2. Alter system set LOG_ARCHIVE_DEST_1=’LOCATION=/data1/oradata/xxxx/arch MANDATORY’ SCOPE=BOTH;
3. Identify data files and locations; select file_name from dba_data_files.
4. Shutdown immediate;
5. Perform a cold backup of the datafiles and tempfiles to a temporary location to the local drives or /backup, etc., no redo logs,
6. Startup;
7. Alter database create standby controlfile as ‘/data1/oracle/admin/xxxx/create/ctl2XXXX.ctl’;
8. Create pfile=’/data1/oracle/admin/xxxx/create/initXXXX2.ora’ from spfile;

Standby Site:
9. Create the following directories:
a. All directories to mirror primary site datafile locations
i. /data1/oradata/xxxx
ii. /data2/oradata/xxxx
iii. Etc.
b. /data1/oradata/xxxx/arch
c. /data1/oradata/xxxx/standby
d. /data1/oracle/admin/xxxx/bdump
e. /data1/oracle/admin/xxxx/cdump
f. /data1/oracle/admin/xxxx/udump
g. /data1/oracle/admin/xxxx/pfile
h. /data1/oracle/admin/xxxx/create
i. /data1/oracle/admin/xxxx/exp
10. Copy the back-up datafiles, tempfiles, standby controlfile, pfile created in step 8, sqlnet.ora, listener.ora and tnsnames.ora files from the primary site to the standby using ftp/sftp.
11. Set the following initialization parameters:
a. Remove the USE_INDIRECT_DATA_BUFFERS parameter,
b. Control_files=’/data1/oradata/xxxx/ctlXXXX2.ctl’
c. Standby_archive_dest=’/data1/oradata/xxxx/standby’
d. Log_archive_dest_1=(‘LOCATION=/data1/oradata/xxxx/standby/’)
e. Standby_file_management=AUTO
f. Remote_archive_enable=TRUE
g. Db_name stays the same but instance_name changes to the new site name (if located on the same server)
h. Local_listener set to the IP for the standby site
i. Service_names set to the new instance_name+.WORLD
j. Modify all occurrences of the primary site instance_name to the new instance_name.

Primary Site:
12. Modify tnsnames.ora file to add an entry for the standby site.

Standby Site:
13. Modify listener.ora for the standby site parameters.
14. Modify the sqlnet.ora file to set SQLNET.EXPIRE_TIME=2
15. Copy the listener.ora, sqlnet.ora and tnsnames.ora to $ORACLE_HOME/network/admin.
16. Copy the init.ora file to /data1/oracle/admin/xxxx/pfile directory and name it according to the new instance_name, i.e. initCNMR.ora.
17. Create a password file:
a. Move to the $ORACLE_HOME/dbs directory,
b. Orapwd file=orapwXXXX password=xxxxxx entries=10
18. Start listener:
a. Lsnrctl
b. Set password
c. Start
19. Sqlplus /nolog
20. Connect / as sysdba
21. Create spfile from pfile=’/data1/oracle/admin/xxxx/pfile/initxxxx.ora’;
22. Startup nomount;
23. Alter database mount standby database;
24. Alter database recover managed standby database parallel 16 disconnect from session;

Primary Site:
25. Alter system set LOG_ARCHIVE_DEST_2=’SERVICE=XXXX.WORLD’ SCOPE=BOTH;
26. Alter system set LOG_ARCHIVE_DEST_STATE_2=ENABLE SCOPE=BOTH;
27. Alter system set “_LOG_ARCHIVE_CALLOUT”='LOCAL_FIRST=TRUE' SCOPE=BOTH;
28. Alter system switch logfile;


Standby Site:
29. Verify that the standby site is receiving and processing log files by issuing the following statements:
a. SELECT SEQUENCE#, FIRST_TIME, NEXT_TIME FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
b. SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
c. SELECT PROCESS, STATUS, THREAD#, SEQUENCE#, BLOCK#, BLOCKS FROM V$MANAGED_STANDBY;
d. SELECT THREAD#, MAX(SEQUENCE#) AS "LAST_APPLIED_LOG" FROM V$LOG_HISTORY GROUP BY THREAD#;

That should get you started.

Re: Data-Guard configuration details [message #237086 is a reply to message #236969] Fri, 11 May 2007 16:35 Go to previous messageGo to next message
california_6_1
Messages: 29
Registered: February 2007
Junior Member
mlgoins,

Thank you so much for providing all the info. i shall look into this and also do my best to setup the configuration. have i run into issues, i might bug you again.

Again thanks a lot and have a wonderful weekend..
Cali
Re: Data-Guard configuration details [message #238117 is a reply to message #236474] Wed, 16 May 2007 14:22 Go to previous messageGo to next message
california_6_1
Messages: 29
Registered: February 2007
Junior Member
Quick question:

If my primary database fail and in a data-guard configuration, i was wondering, how would i bring up the stand-by database as a primary database?

Appreciated if you could please share this.

Many thanks,
Cali
Re: Data-Guard configuration details [message #238122 is a reply to message #238117] Wed, 16 May 2007 14:38 Go to previous messageGo to next message
asadaslam18
Messages: 16
Registered: May 2007
Location: nine
Junior Member

Failover on Physical Standby Database

A Failover can be performed when all or most of the information until the Unavailability of the Primary Database was propageted to the Standby.
The usage of Standby RedoLogs ia a great advantage here. If you have no Standby RedoLogs available, you will always encounter some Data Loss (depending on the Changes since the latest LogSwitch). To perform a Failover just follow these steps:

- The Primary Database is down for any reason
- Verify a Standby RedoLog is in use for Primary current Online
RedoLog.
You then find in the ALERT.LOG of the Standby something like:

RFS: Successfully opened standby logfile
4:'C:\ORACLE\ORADATA\PRIMARY\STBY01.LOG'

- If this is the case run the following commands:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
This cancels the normal managed Recovery. To get the Standby
RedoLog Information is still required. Therefore issue this command:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;

- If a Standby RedoLog is not used for any reason, then run this one:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH SKIP STANDBY LOGFILE;

Please keep in mind that this one causes (Minimal) Data Loss as the latestet information from the down Primary Database is not available anymore.

- Once this is complete (This performs a complete Recovery or incomplete
Recovery until the last SCN included in the latest archived Log
available at the Standby), you can now make the Standby Database a Primary:

SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY

WARNING: This will only succeed if the correct RECOVER FINISH-statement was issued before. If you forgot the 'SKIP STANDBY LOGFILE' although you have no Standby RedoLogs, the COMMIT to Switchover will fail with the error that more Media Recovery is required here.

- If the COMMIT TO SWITCHOVER fails for any reason you have to use the ACTIVATE command which forces the Failover (and may cause Data Loss !!)

SQL> ALTER DATABASE ACTIVATE STANDBY DATABASE;

- Shutdown and restart the Databse after this command ended
successfully:

SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP

- Now the Standby is open as a new Primary Database

In standby parameter file do not forget to mention

FAL_SERVER=primary
FAL_CLIENT=standby
Re: Data-Guard configuration details [message #238132 is a reply to message #236474] Wed, 16 May 2007 16:03 Go to previous message
california_6_1
Messages: 29
Registered: February 2007
Junior Member
Thanks for your detail answer. Really appreciated.

Well somehow working with Oracle is very tedious. i am SQL Server DBA and the standby setup is soo different from Oracle to SQL server. But looks like, Oracle is a completely different beast and to control this beast, you better have some good knowledge of what you doing.

anyway. thanks again. I am going to try all of the steps in my test environment and will come back, if i encounter any issues.

Thanks and take care
Cali
Previous Topic: Urgent ! problem with data guard
Next Topic: Setup Logical Database using Oracle enterprise manager Grid
Goto Forum:
  


Current Time: Fri Mar 29 01:04:47 CDT 2024