Wednesday, 31 December 2014

How to migrate an existing pre12c to 12 CDB

Every now and again it is necessary to migrate an existing database to the new version of oracle software and what's more most of the time doing it by leaving offline services the least time possible.

I'm used to migrating pre10g release to 11.2 release and now we are ready to go over the migration to the 12c release though.

To be continued...

Exploring Oracle Data Guard - Part 3

Now It's time to get our hands dirty in the process of creating a physical standby database.

6) Copy the  orapwfile of the primary database to the standby database :

scp orapwTESTDG oracle@oracle10gr2standbybis:$ORACLE_HOME/dbs
     


7) Add the following alias to the tnsnames.ora file of the primary database :

 TESTDGS =
         (DESCRIPTION =
            (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.51)(PORT = 1521))
            (CONNECT_DATA =
               (SERVER = DEDICATED)
               (SERVICE_NAME = TESTDGS)
              )
         )





Nb: The service name TESTDGS is going to be managed by the listener process of standby database
 
To be continued.....

Friday, 19 December 2014

Exploring Oracle Data Guard - Part 2

Let's get the ball rolling, shall we ?

Server : oracle10gr2primary , oracle10gr2standby

Preparing Database :

On primary database server : oracle10gr2primary 

1) Verify if archiving is enabled and verify archive log files :

   SQL> archive log list;
    Database log mode                Archive Mode
    Automatic archival                  Enabled
    Archive destination                 USE_DB_RECOVERY_FILE_DEST
    Oldest online log sequence     1
    Next log sequence to archive   3
    Current log sequence              3


2) If it isn't already enabled... enable 'force logging':

    SQL> alter database force logging;
              Database altered.


3) Configure standby redo logs:

   SQL>alter database add standby logfile group 11 '/u01/oradata/TESTDG/standby_redo01.log' size 50m;
    SQL>alter database add standby logfile group 12 '/u01/oradata/TESTDG/standby_redo02.log' size 50m;
    SQL>alter database add standby logfile group 13 '/u01/oradata/TESTDG/standby_redo03.log' size 50m;
    SQL>alter database add standby logfile group 14 '/u01/oradata/TESTDG/standby_redo04.log' size 50m;



NB1: The standby redo log size must be equal to redo log size.


NB2: The standby redo log groups must be one more than the redo log groups.

NB3: Frankly speaking it isn't necessary to create the standby redo logs on the primary database during this phase, because these logs will be used by the database only in case of a switchover event.

4) Ensure that Flash Recovery Area is enabled :

   SQL> show parameter recovery
   NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
   db_recovery_file_dest                string           /u01/orabackup
   db_recovery_file_dest_size         big integer     8048M


5) Modify the init parameter file of the primary database according to these values:


alter system set db_unique_name='TESTDGP' scope=spfile;
alter system set log_archive_config='DG_CONFIG=(TESTDGP,TESTDGS)' scope=spfile;
alter system set log_archive_dest_1='LOCATION=/u02/oraarch/TESTDG VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=TESTDGP' scope=spfile;
alter system set log_archive_dest_2='SERVICE=TESTDGS LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLES) DB_UNIQUE_NAME=TESTDGS' scope=spfile;
alter system set log_archive_dest_state_1=ENABLE scope=spfile;
alter system set log_archive_dest_state_2=ENABLE scope=spfile;
alter system set log_archive_max_processes=8 scope=spfile;
alter system set log_archive_format='%t_%s_%r.dbf'  scope=spfile;
alter system set standby_file_management='AUTO' scope=spfile;
alter system set fal_server='TESTDGS' scope=spfile;
alter system set fal_client='TESTDGP' scope=spfile;
alter system set standby_archive_dest='/u02/oraarch/TESTDG' scope=spfile;



Tuesday, 9 December 2014

Exploring Oracle Data Guard - Part 1

Every now and again it is necessary to brush up on previous skills in order to resolve problems.

Today I'm going to get down to a handy Oracle features which is called Oracle Data Guard.

Since Oracle database 7.3 version, this features has been introduced and it offers the possibility to protect database from failure, disaster, human error and data corruption.

Since the first version, lots of new options have come out like for example in the 11g, the 'Active Data Guard' and what's more the 'Snapshot Standby'.

In my opinion, the first step to do is the installation of a complete Test environment made up with a Primary and Standby database server and what's more since the last production environment is a Oracle 10GR4 release this post will end up installing a 10GR4 primary and standby databases.

See you soon.

Byeeee