RE: Data Guard Follow-up

  • From: Scott Canaan <srcdco@xxxxxxx>
  • To: Niall Litchfield <niall.litchfield@xxxxxxxxx>
  • Date: Mon, 03 Jun 2013 13:44:00 -0400

I started with nothing and created the primary database from scratch  - 
LNX8TEST.  By default, it is not in archivelog mode and does not have a 
password file.
I created the empty directories for LNX9TEST, in another window.
- Created password file.
- changed remote_login_passwordfile=exclusive initLNX8TEST.ora file
- restared database
- turned on archiving
- alter database force logging;
- added 6 standby redo log groups
- added the following to the initLNX8TEST.ora file:
log_archive_config='DG_CONFIG=(LNX8TEST,LNX9TEST)'
log_archive_dest_1  'location=/oracle/data/LNX8TEST/arch
  valid_for=(all_logfiles,all_roles)
  db_unique_name=LNX8TEST'
log_archive_dest_2  'service=LNX9TEST LGWR SYNC
  valid_for=(online_logfiles,primary_role)
  db_unique_name=LNX9TEST'

log_archive_dest_state_1=ENABLE
log_archive_dest_state_2=ENABLE
log_archive_max_processes 
db_unique_name='LNX8TEST'
fal_server=LNX9TEST
fal_client=LNX8TEST
standby_file_management=auto
log_file_name_convert='/oracle/data/LNX8TEST/','/oracle/data/LNX8TEST/','/oracle/data/LNX8TEST/mirror_files/','/oracle/data/LNX8TEST/mirror_files/'
- shutdown LNX8TEST
- startup nomount LNX8TEST
- create spfile from pfile;
- shutdown LNX8TEST
- startup mount LNX8TEST
- alter database create standby controlfile as 
'/oracle/data/LNX9TEST/control01.ctl';
- alter database open;
- in /oracle/data/LNX9TEST, copy control01.ctl to control02.ctl and 
mirror_files/control03.ctl
- copy /oracle/data/admin/LNX8TEST/pfile/orapwLNX8TEST to 
/oracle/data/admin/LNX9TEST/pfile/orapwLNX9TEST
- copy /oracle/data/admin/LNX8TEST/pfile/initLNX8TEST.ora to 
/oracle/data/admin/LNX9TEST/pfile/initLNX9TEST.ora
- change audit_file_dest, controlfiles, and diagnostic_dest to point to LNX9TEST
- Change above to:
log_archive_config='DG_CONFIG=(LNX8TEST,LNX9TEST)'
log_archive_dest_1   ='LOCATION=/oracle/data/admin/LNX9TEST/arch/ 
valid_for=(all_logfiles,all_roles) db_unique_name=LNX9TEST'
log_archive_dest_2='service=LNX8TEST LGWR SYNC 
valid_for=(online_logfiles,primary_role) db_unique_name=LNX8TEST'
log_archive_dest_state_1=ENABLE
log_archive_dest_state_2=ENABLE
log_archive_max_processes 
db_unique_name='LNX9TEST'
fal_server=LNX8TEST
fal_client=LNX9TEST
standby_file_management=auto
log_file_name_convert='/oracle/data/LNX8TEST/','/oracle/data/LNX8TEST/','/oracle/data/LNX8TEST/mirror_files/','/oracle/data/LNX8TEST/mirror_files/'

-          create links to /oracle/data/admin/LNX9TEST/initLNX9TEST.ora and 
orapwLNX9TEST in $ORACLE_HOME/dbs

-          update /var/opt/oracle/oratab, adding an entry for LNX9TEST

-          update /var/opt/oracle/tnsnames.ora, changing LNX8TEST to 
service_name (from SID), and adding an entry for LNX9TEST

-          update /var/opt/oracle/listener.ora, adding an entry to LNX9TEST

-          bounce the listener

-          log out and back in on LNX9TEST to set the environment correctly

-          shutdown LNX8TEST (primary)

-          copy /oracle/data/LNX8TEST/*.dbf to /oracle/data/LNX9TEST

-          copy /oracle/data/LNX8TEST/*.log to /oracle/data/LNX9TEST (redo and 
standby redo logs)

-          copy /oracle/data/LNX8TEST/mirror_files/*.log to 
/oracle/data/LNX9TEST/mirror_files (redo and standby logs)

-          copy /oracle/data/admin/LNX8TEST/arch/*.* to 
/oracle/data/admin/LNX9TEST/arch (existing archive log files)

-          startup LNX8TEST (primary)

-          startup nomount LNX9TEST (standby)

-          create spfile from pfile (on LNX9TEST)

-          shutdown LNX9TEST

-          startup mount LNX9TEST

-          on LNX9TEST - ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING 
CURRENT LOGFILE DISCONNECT FROM SESSION;

At this point, I checked the alert logs to see if there were any errors and 
noticed that both databases were trying to use the same set of physical files.

Scott Canaan '88 (srcdco@xxxxxxx<mailto:Scott.Canaan@xxxxxxx>)
(585) 475-7886 - work           (585) 339-8659 - cell
"Life is like a sewer, what you get out of it depends on what you put into it." 
- Tom Lehrer.

From: Niall Litchfield [mailto:niall.litchfield@xxxxxxxxx]
Sent: Monday, June 03, 2013 12:12 PM
To: Scott Canaan
Cc: oracle-l@xxxxxxxxxxxxx
Subject: Re: Data Guard Follow-up

Can you post what *you* have done.

By the way if you are trying to learn this I'd definitely recommend using a 
couple of vms

On Mon, Jun 3, 2013 at 4:51 PM, Scott Canaan 
<srcdco@xxxxxxx<mailto:srcdco@xxxxxxx>> wrote:
I'm really getting confused on this data guard thing.  I've followed several 
different people's steps and I cannot get it to work.  This is the second time 
that I've ended up with the standby database trying to open the primary 
databases physical files (yes, they are on the same server, just so I can get 
the steps down).  I don't understand why it is doing that.
The two databases are LNX8TEST and LNX9TEST, with LNX8TEST being the primary.  
This is what I'm seeing in LNX9TEST:
SQL> select * from v$dbfile;

     FILE#                NAME
----------  
--------------------------------------------------------------------------------
         4                     /oracle/data/LNX8TEST/users01.dbf
         3                     /oracle/data/LNX8TEST/undotbs01.dbf
         2                     /oracle/data/LNX8TEST/sysaux01.dbf
         1                     /oracle/data/LNX8TEST/sys01.dbf

SQL>

Then, in the alert log for LNX9TEST, I see the following errors:

Mon Jun 03 11:22:29 2013
Errors in file 
/oracle/data/admin/LNX9TEST/diag/rdbms/lnx9test/LNX9TEST/trace/LNX9TEST_dbw0_32404.trc:
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: '/oracle/data/LNX8TEST/sys01.dbf'
ORA-27086: unable to lock file - already in use
Linux-x86_64 Error: 11: Resource temporarily unavailable
Additional information: 8
Additional information: 32359
Errors in file 
/oracle/data/admin/LNX9TEST/diag/rdbms/lnx9test/LNX9TEST/trace/LNX9TEST_dbw0_32404.trc:
ORA-01157: cannot identify/lock data file 2 - see DBWR trace file
ORA-01110: data file 2: '/oracle/data/LNX8TEST/sysaux01.dbf'
ORA-27086: unable to lock file - already in use
Linux-x86_64 Error: 11: Resource temporarily unavailable
Additional information: 8
Additional information: 32359
Errors in file 
/oracle/data/admin/LNX9TEST/diag/rdbms/lnx9test/LNX9TEST/trace/LNX9TEST_dbw0_32404.trc:
ORA-01157: cannot identify/lock data file 3 - see DBWR trace file
ORA-01110: data file 3: '/oracle/data/LNX8TEST/undotbs01.dbf'
ORA-27086: unable to lock file - already in use
Linux-x86_64 Error: 11: Resource temporarily unavailable
Additional information: 8
Additional information: 32359
Errors in file 
/oracle/data/admin/LNX9TEST/diag/rdbms/lnx9test/LNX9TEST/trace/LNX9TEST_dbw0_32404.trc:
ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: '/oracle/data/LNX8TEST/users01.dbf'
ORA-27086: unable to lock file - already in use
Linux-x86_64 Error: 11: Resource temporarily unavailable
Additional information: 8
Additional information: 32359
MRP0: Background Media Recovery terminated with error 1110
Errors in file 
/oracle/data/admin/LNX9TEST/diag/rdbms/lnx9test/LNX9TEST/trace/LNX9TEST_pr00_32544.trc:
ORA-01110: data file 1: '/oracle/data/LNX8TEST/sys01.dbf'
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: '/oracle/data/LNX8TEST/sys01.dbf'
Managed Standby Recovery not using Real Time Apply
Slave exiting with ORA-1110 exception
Errors in file 
/oracle/data/admin/LNX9TEST/diag/rdbms/lnx9test/LNX9TEST/trace/LNX9TEST_pr00_32544.trc:
ORA-01110: data file 1: '/oracle/data/LNX8TEST/sys01.dbf'
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: '/oracle/data/LNX8TEST/sys01.dbf'
Recovery Slave PR00 previously exited with exception 1110
MRP0: Background Media Recovery process shutdown (LNX9TEST)

I've verified several times throughout the process that the environment is 
correct.

What is going on?

Scott Canaan '88 
(srcdco@xxxxxxx<mailto:srcdco@xxxxxxx><mailto:Scott.Canaan@xxxxxxx<mailto:Scott.Canaan@xxxxxxx>>)
(585) 475-7886<tel:%28585%29%20475-7886> - work           (585) 
339-8659<tel:%28585%29%20339-8659> - cell
"Life is like a sewer, what you get out of it depends on what you put into it." 
- Tom Lehrer.


--
//www.freelists.org/webpage/oracle-l




--
Niall Litchfield
Oracle DBA
http://www.orawin.info

--
//www.freelists.org/webpage/oracle-l


Other related posts: