Yann Neuhaus Blog

All around Open Source and High Availability

September 2007 - Einträge

Dataguard broker setup and Standby Redo Logs

You wanna create an Oracle Dataguard configuration working in Maximum availability. This configuration uses of course standby redo log files. These files must be available on the primary and standby side (because of switchover : primary database becomes standby database). In your setup process you decided to create the standy redo log files before duplicating the primary database. After the creation of the Dataguard configuration, the standby database seems to miss the standby redo log  files.

RFS[3]: No standby redo logfiles created
RFS[3]: Archived Log: '/u00/app/oracle/admin/DG/arch/DG_1_86_599565590.arc'

Below the description of the problem and the solution.

First of all you create the standby redo log files on the primary database :

alter database add standby logfile group 4
('/u00/oradata/DG/sredog4m1DG.dbf',
 '/u01/oradata/DG/sredog4m2DG.dbf') SIZE 6M reuse;
alter database add standby logfile group 5
('/u00/oradata/DG/sredog5m1DG.dbf',
 '/u01/oradata/DG/sredog5m2DG.dbf') SIZE 6M reuse;
alter database add standby logfile group 6
('/u00/oradata/DG/sredog6m1DG.dbf',
 '/u01/oradata/DG/sredog6m2DG.dbf') SIZE 6M reuse;
alter database add standby logfile group 7
('/u00/oradata/DG/sredog7m1DG.dbf',
 '/u01/oradata/DG/sredog7m2DG.dbf') SIZE 6M reuse;


Backup your primary database for standby with RMAN :

RMAN> connect target /
RMAN> backup incremental level 0 database;
RMAN> backup current controlfile for standby;
RMAN> backup archivelog all delete input;

Start (nomount) the standby side :

SQL> startup nomount;
ORACLE instance started.

From the primary server, start RMAN to duplicate for standby :

RMAN> connect target /
connect connected to target database: DG (DBID=1512896598)

RMAN> connect auxiliary sys/manager@DG_SITE2
connected to auxiliary database: DG (not mounted)

RMAN> duplicate target database for standby dorecover nofilenamecheck;

After the duplicate verify the status on the standby database :

SQL> select database_role from v$database;

DATABASE_ROLE
----------------
PHYSICAL STANDBY

The standby redo log files have been correctly duplicated, but the files are NOT created on the filesystem.

SQL> select group# from v$standby_log;

    GROUP#
----------
         4
         5
         6
         7

Now you can create your dataguard configuration with dgmgrl from the primary side :

connect sys/manager

create configuration 'DG' as
  primary database is 'DG_SITE1'
  connect identifier is 'DG_SITE1.trivadistraining.com';
add database 'DG_SITE2' as
  connect identifier is 'DG_SITE2.trivadistraining.com'
  maintained as physical;
edit database 'DG_SITE1' set property StandbyArchiveLocation='/u00/app/oracle/admin/DG/arch';
edit database 'DG_SITE1' set property StandbyFileManagement='AUTO';
edit database 'DG_SITE1' set property LogXptMode='ARCH';
edit database 'DG_SITE2' set property StandbyArchiveLocation='/u00/app/oracle/admin/DG/arch';
edit database 'DG_SITE2' set property StandbyFileManagement='AUTO';
edit database 'DG_SITE2' set property LogXptMode='ARCH';
enable configuration;
show configuration;

On the standby side , following occured (extract of the alert.log file of the standby database) :

Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE  THROUGH ALL SWITCHOVER DISCONNECT  NODELAY
Sun Sep 23 14:52:54 2007
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[3]: Assigned to RFS process 7535
RFS[3]: Identified database type as 'physical standby'
RFS[3]: No standby redo logfiles created
RFS[3]: Archived Log: '/u00/app/oracle/admin/DG/arch/DG_1_85_599565590.arc'
Sun Sep 23 14:52:55 2007
Media Recovery Log /u00/app/oracle/admin/DG/arch/DG_1_85_599565590.arc
Media Recovery Waiting for thread 1 sequence 86
Sun Sep 23 14:54:39 2007
RFS[3]: No standby redo logfiles created
RFS[3]: Archived Log: '/u00/app/oracle/admin/DG/arch/DG_1_86_599565590.arc'
RFS[3]: No standby redo logfiles created
RFS[3]: Archived Log: '/u00/app/oracle/admin/DG/arch/DG_1_87_599565590.arc'
Sun Sep 23 14:54:40 2007
Media Recovery Log /u00/app/oracle/admin/DG/arch/DG_1_86_599565590.arc
Media Recovery Log /u00/app/oracle/admin/DG/arch/DG_1_87_599565590.arc

After having enabled the Dataguard configuration, the standby redo log disappeared :

SQL> select group# from v$standby_log;

no rows selected

The standby database complains in the alert.log file :

RFS[3]: No standby redo logfiles created
RFS[3]: Archived Log: '/u00/app/oracle/admin/DG/arch/DG_1_86_599565590.arc'

The solution is easy, stop the log apply mode and create the standby redo log files on the standby database :

On the primary database (in dgmgrl) :

DGMGRL> edit database 'DG_SITE2' set state = 'LOG-APPLY-OFF';
Succeeded.

On standby side (see the script above) :

SQL> @create_standy_log.sql

Database altered.
Database altered.
Database altered.
Database altered.

On the primary database (in dgmgrl) acivate the standby site again :

DGMGRL> edit database 'DG_SITE2' set state = 'ONLINE';
Succeeded.

To verify, in sqlplus on the primary side :

SQL> alter system archive log current;

System altered.


On the standby side , the database doesn't complain anymore and uses the standby redo log files :

RFS[5]: Successfully opened standby log 4: '/u00/oradata/DG/sredog4m1DG.dbf'
Sun Sep 23 14:57:28 2007
Media Recovery Log /u00/app/oracle/admin/DG/arch/DG_1_91_599565590.arc
Media Recovery Waiting for thread 1 sequence 92

Note also that even if the mode is still Maximum Performance and the transport mode ARCH, the standby redo log files will be used to store the archived files from the primary.

xv - An image viewer on Ubuntu 7.04

Sometimes, when switching to new technologies/environments, it is still nice to be able to use some old software. Although there may be equivalents ;-) . In my case, a 6 year SuSE user, I just finished installing a really nice Linux variant on my laptop: Ubuntu 7.04. Although Ubuntu offers all the stuff an IT consultant requires, I missed one tool I really got used to: xv. To check and modify pictures and grab parts of the screen.




I could not find an xv package for Ubuntu, even after installing the nice extension coming along with automatix2 (http://www.getautomatix.com):
'apt-cache search xv' revelaed nothing...

After googling the internet a bit, I found some information about how to create an xv package on Ubuntu (for instance on http://bok.fas.harvard.edu/debian/xv/index.html). I try to consolidate them in this blog entry and hope you find the useful.

Before installing xv on Ubuntu, you will need some preparation. First of all, install the libraries required during the xv compilation and installation.

If your computer is behind a proxy, set the following variables to use the proxy:

export http_proxy=http://myproxy:8080
export ftp_proxy=http://myproxy:8080

Then install the required packages:

sudo apt-get install xlibs-dev
sudo apt-get install dpkg-dev
sudo apt-get install libc6-dev
sudo apt-get install libtiff3g-dev
sudo apt-get install libjpeg62-dev
sudo apt-get install libpng-dev zlib1g-dev
sudo apt-get install libtiff-dev
sudo apt-get install zlib-bin
sudo apt-get install zlibc
sudo apt-get install zlib1g-dev
sudo apt-get install zlib1g
sudo apt-get install libpng3
sudo apt-get install libpng12-dev
sudo apt-get install libpng12-0


After that, download the xv source, the jumbo patches and the debian patch (remember, Ubuntu is a Debian decendant):

ftp://ftp.cis.upenn.edu/pub/xv/xv-3.10a.tar.gz
http://prdownloads.sourceforge.net/png-mng/xv-3.10a-jumbo-patches-20050501.tar.gz
http://bok.fas.harvard.edu/debian/xv/xv-3.10a-jumbo20050501-1.diff.gz


During installation of xv, the bash shell will be needed. On Ubuntu 7.04, the default shell (/bin/sh) is linked to /bin/dash. Change that link so that it points to bash (There may be other solutions, but this worked for me most easily)

ls -lrt /bin/sh
lrwxrwxrwx 1 root root 4 2007-09-14 10:49 /bin/sh -> bash


No we start the real stuff:

tar xvzf xv-3.10a.tar.gz
tar xvzf xv-3.10a-jumbo-patches-20050501.tar.gz
gzip -d xv-3.10a-jumbo20050501-1.diff.gz
cd xv-3.10a


Apply the patches:

patch -p1 < ../xv-3.10a-jumbo-fix-patch-20050410.txt
patch -p1 < ../xv-3.10a-jumbo-enh-patch-20050501.txt
patch -p1 < ../xv-3.10a-jumbo20050501-1.diff
chmod 755 debian/rules


Build the package:

dpkg-buildpackage -rfakeroot -uc -b


Install the package:

sudo dpkg -i xv_3.10a-jumbo20050501-1_i386.deb
sudo dpkg -i xv-doc_3.10a-jumbo20050501-1_all.deb


That was it! I hope I could help you. If you do not want to build the packages by yourself, just send me a note.

Posted: Sep 19 2007, 06:59 von Yann Neuhaus | mit 7 comment(s)
Abgelegt unter: , ,