Showing posts with label convert. Show all posts
Showing posts with label convert. Show all posts

Monday, April 5, 2021

LOG_FILE_NAME_CONVERT is not defined, stop clearing ORLs

LOG_FILE_NAME_CONVERT name parameter is used to correct the file location for log files if the database is being created from another database and source database had a different directory structure. This is used in data guard configuration when standby and primary has different file structure. However, there are few limitations to using this parameter and one of them is that it cannot be used with Oracle managed files or OMF (refer 1367014.1).
However, an odd behaviour was observed in a data guard configuration where even when OMF is used there database was looking for LOG_FILE_NAME_CONVERT and if not set stopping the automatic logfile clearing.
The databases (both primary and standby) had following OMF related parameters
NAME                                 TYPE        VALUE
------------------------------------ ----------- -------
db_create_file_dest                  string      +DATA
db_create_online_log_dest_1          string
db_create_online_log_dest_2          string
db_create_online_log_dest_3          string
db_create_online_log_dest_4          string
db_create_online_log_dest_5          string
db_recovery_file_dest                string      +FRA
The *convert* parameters were not set.
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------
db_file_name_convert                 string
log_file_name_convert                string
pdb_file_name_convert                string
During the active database duplication the duplication processed detected use of OMF as seen from below output.
...
sql statement: alter system set  local_listener =  ''LISTENER_DGTEST2'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area    9965665616 bytes

Fixed Size                    12684624 bytes
Variable Size               1543503872 bytes
Database Buffers            8388608000 bytes
Redo Buffers                  20869120 bytes
duplicating Online logs to Oracle Managed File (OMF) location
duplicating Datafiles to Oracle Managed File (OMF) location

contents of Memory Script:
{
   sql clone "alter system set  control_files =
  ''+DATA/DGTEST2/CONTROLFILE/current.264.1067949389'', ''+FRA/DGTEST2/CONTROLFILE/current.418.1067949389'' comment=
  ...
Data guard consists of two databases.
DGMGRL>Configuration - test_dg

  Protection Mode: MaxAvailability
  Members:
  dgtest  - Primary database
    dgtest2 - Physical standby database

Fast-Start Failover:  Disabled

Configuration Status:
SUCCESS
With these setting on, after a switchover following was seen on the alert log of the old primary (new standby)
2021-03-23T12:55:20.314959+00:00
TT02 (PID:8514): LOG_FILE_NAME_CONVERT is not defined, stop clearing ORLs
Validate of the old primary (new standby) showed that online redo logs are not cleared
DGMGRL> validate database dgtest

  Database Role:     Physical standby database
  Primary Database:  dgtest2

  Ready for Switchover:  Yes
  Ready for Failover:    Yes (Primary Running)

  Managed by Clusterware:
    dgtest2:  YES
    dgtest :  YES

  Log Files Cleared:
    dgtest2 Standby Redo Log Files:  Cleared
    dgtest Online Redo Log Files:    Not Cleared
    dgtest Standby Redo Log Files:   Available
It was the same case when the new primary (old standby) did a switchover as well.
2021-03-23T13:02:25.800263+00:00
TT02 (PID:9657): LOG_FILE_NAME_CONVERT is not defined, stop clearing ORLs

DGMGRL> validate database dgtest2

  Database Role:     Physical standby database
  Primary Database:  dgtest

  Ready for Switchover:  Yes
  Ready for Failover:    Yes (Primary Running)

  Managed by Clusterware:
    dgtest :  YES
    dgtest2:  YES

  Log Files Cleared:
    dgtest Standby Redo Log Files:   Cleared
    dgtest2 Online Redo Log Files:   Not Cleared
    dgtest2 Standby Redo Log Files:  Available


This behaviour was observed even after applying release updates (RU) 19.3, 19.4, 19.5, 19.6 and 19.7. If the databases are in one of those RUs then only way to achieve the automatic ORL clearing is to explicitly set the log file name convert parameter. For example in this case for the primary DB dgtest
alter system set log_file_name_convert='/dgtest2/','/dgtest/' scope=spfile;
Once log_file_name_convert is set the automatic ORL clearence was observed even though MOS doc states log_file_name_convert cannot be used with OMF.

The issue is fixed on RU 19.8 and up (tested on 19.9 , 19.10). Once these RU are applied automatic ORL clearing happens as expected. If previously (in one of the affected RUs) log_file_name_convert was set then it could be removed once RU 19.8 or up is applied.
When automatic ORL clearing happens following could be seen on the alert log of the old primary
2021-03-23T13:20:23.135283+00:00
TT02 (PID:10641): Waiting for all non-current ORLs to be archived
2021-03-23T13:20:23.135414+00:00
TT02 (PID:10641): All non-current ORLs have been archived
2021-03-23T13:20:23.273380+00:00
TT02 (PID:10641): Clearing ORL LNO:1 +DATA/DGTEST/ONLINELOG/group_1.264.1067878075
2021-03-23T13:20:24.512745+00:00
TT02 (PID:10641): Clearing ORL LNO:1 complete
TT02 (PID:10641): Clearing ORL LNO:2 +DATA/DGTEST/ONLINELOG/group_2.262.1067878077
Clearing online log 2 of thread 1 sequence number 34
2021-03-23T13:20:26.525504+00:00
TT02 (PID:10641): Clearing ORL LNO:2 complete
TT02 (PID:10641): Clearing ORL LNO:3 +DATA/DGTEST/ONLINELOG/group_3.261.1067878079
Clearing online log 3 of thread 1 sequence number 35
2021-03-23T13:20:28.163683+00:00
TT02 (PID:10641): Clearing ORL LNO:3 complete
2021-03-23T13:20:33.174192+00:00
TT02 (PID:10641): Waiting for all non-current ORLs to be archived
2021-03-23T13:20:33.174386+00:00
TT02 (PID:10641): All non-current ORLs have been archived
Validating the standby shows no log files to be cleared.
DGMGRL> validate database dgtest2

  Database Role:     Physical standby database
  Primary Database:  dgtest

  Ready for Switchover:  Yes
  Ready for Failover:    Yes (Primary Running)

  Managed by Clusterware:
    dgtest :  YES
    dgtest2:  YES

Useful Metalink notes
Usage and Limitation of db_file_name_convert and log_file_name_convert [ID 1367014.1]

Sunday, November 1, 2015

Convert Single Instance DB to RAC DB - Manual Method

There are many ways to convert a single database to RAC. Using database template, rconfig or the manual method. This post shows the steps for manual method of converting a single instance database to RAC (tested for both 11.2.0.4 and 12.1.0.2). The single database is running out of a non-rac oracle home. Backup of this would be restored using a rac enabled oracle home and then converted to a RAC database.
The database is called "asanga" and will retain the same name when converted to RAC.
1. Create a pfile of the single instance database. The pfile entries are shown below
 more pfile.ora
*.audit_file_dest='/opt/app/oracle/admin/asanga/adump'
*.audit_trail='NONE'
*.compatible='11.2.0.4.0'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_domain=''
*.db_name='ASANGA'
*.db_recovery_file_dest_size=5218762752
*.db_recovery_file_dest='+FLASH'
*.diagnostic_dest='/opt/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=asangaXDB)'
*.open_cursors=300
*.pga_aggregate_target=524288000
*.processes=3000
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=4524
*.sga_target=2147483648
*.undo_tablespace='UNDOTBS1'
2. Create the adump directories in all nodes of the cluster (in this case it is a two node cluster)
mkdir -p /opt/app/oracle/admin/asanga/adump
3. Copy the pfile created earlier to one of the RAC nodes and restore the datababase.
SQL> startup nomount pfile='/home/oracle/backup/pfile.ora';

SQL> create spfile from pfile='/home/oracle/backup/pfile.ora';
SQL> startup force nomount;

RMAN> restore controlfile from '/home/oracle/backup/ctlbkp04qfl69p_1_1.ctl';

Starting restore at 28-AUG-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=2275 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
output file name=+DATA/asanga/controlfile/current.270.888927491
output file name=+FLASH/asanga/controlfile/current.447.888927493
Finished restore at 28-AUG-15

RMAN> alter database mount;

RMAN> catalog start with '/home/oracle/backup/';

RMAN> run {
2> restore database;
3> recover database;
4> }

Starting restore at 28-AUG-15
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to +DATA/asanga/datafile/system.309.888838053
channel ORA_DISK_1: restoring datafile 00002 to +DATA/asanga/datafile/sysaux.308.888838053
channel ORA_DISK_1: restoring datafile 00003 to +DATA/asanga/datafile/undotbs1.307.888838053
channel ORA_DISK_1: restoring datafile 00004 to +DATA/asanga/datafile/users.310.888838053
channel ORA_DISK_1: reading from backup piece /home/oracle/backup/full_bkp_ASANGA_20150827_02qfl697_1_1
channel ORA_DISK_1: piece handle=/home/oracle/backup/full_bkp_ASANGA_20150827_02qfl697_1_1 tag=FULL_BKP
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
Finished restore at 28-AUG-15

Starting recover at 28-AUG-15
using channel ORA_DISK_1

starting media recovery

channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2
channel ORA_DISK_1: reading from backup piece /home/oracle/backup/full_arc_ASANGA_20150827_03qfl69n_1_1
channel ORA_DISK_1: piece handle=/home/oracle/backup/full_arc_ASANGA_20150827_03qfl69n_1_1 tag=FULL_ARC_BKP
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
archived log file name=+FLASH/asanga/archivelog/2015_08_28/thread_1_seq_2.444.888927577 thread=1 sequence=2
channel default: deleting archived log(s)
archived log file name=+FLASH/asanga/archivelog/2015_08_28/thread_1_seq_2.444.888927577 RECID=3 STAMP=888927577
unable to find archived log
archived log thread=1 sequence=3
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 08/28/2015 12:19:38
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 3 and starting SCN of 1483282

RMAN> alter database open resetlogs;

database opened
4. Shutdown and restart the database to see if it opens without any issues.

5. The single instance will have only one redo thread. Add anther redo thread (or more if RAC has more nodes) and enable it.
SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ ---------
         1          1          1   52428800        512          2 NO  CURRENT                1483283 28-AUG-15   2.8147E+14
         2          1          0   52428800        512          2 YES UNUSED                       0                      0
         3          1          0   52428800        512          2 YES UNUSED                       0                      0


alter database add logfile thread 2 group 4 ('+DATA','+FLASH') size 50m ;
alter database add logfile thread 2 group 5 ('+DATA','+FLASH') size 50m ;
alter database add logfile thread 2 group 6 ('+DATA','+FLASH') size 50m ;

SQL> alter database enable public thread 2;

Database altered.

SQL>  select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ ---------
         1          1          1   52428800        512          2 NO  CURRENT                1483283 28-AUG-15   2.8147E+14
         2          1          0   52428800        512          2 YES UNUSED                       0                      0
         3          1          0   52428800        512          2 YES UNUSED                       0                      0
         4          2          1   52428800        512          2 YES INACTIVE               1484502 28-AUG-15      1484512 28-AUG-15
         5          2          0   52428800        512          2 YES UNUSED                       0                      0
         6          2          0   52428800        512          2 YES UNUSED                       0                      0

6 rows selected.
6. The single instance would have had one undo tablespace. Create undo tablespace for each additional instance
create undo tablespace UNDOTBS2 datafile '+DATA(datafile)' SIZE 600M AUTOEXTEND ON NEXT 64M MAXSIZE UNLIMITED;



7. Create a pfile from the spfile and edit it by removing the *.undo_tablespace='UNDOTBS1' and add instance specific entries
*.cluster_database_instances=2
*.cluster_database=true
asanga1.instance_number=1
asanga2.instance_number=2
asanga1.thread=1
asanga2.thread=2
asanga1.undo_tablespace='UNDOTBS1'
asanga2.undo_tablespace='UNDOTBS2'
Also make sure log archive format has thread number
log_archive_format                   string      %t_%s_%r.dbf
8. Shutdown the database and copy the new pfile to all nodes and start each instance using the pfile.
[oracle@rhel6m1 ~]$ export ORACLE_SID=asanga1

[oracle@rhel6m1 backup]$ sqlplus  / as sysdba

SQL> startup pfile='/home/oracle/backup/initasanga.ora';
ORACLE instance started.

Total System Global Area 2137886720 bytes
Fixed Size                  2254952 bytes
Variable Size            1811941272 bytes
Database Buffers          318767104 bytes
Redo Buffers                4923392 bytes
Database mounted.
Database opened.

SQL> select instance_name,status from v$instance;

INSTANCE_NAME    STATUS
---------------- ------------
asanga1          OPEN

[oracle@rhel6m2 ~]$ export ORACLE_SID=asanga2
[oracle@rhel6m2 ~]$ sqlplus  / as sysdba

SQL> startup pfile='/home/oracle/initasanga.ora';
ORACLE instance started.

Total System Global Area 2137886720 bytes
Fixed Size                  2254952 bytes
Variable Size            1811941272 bytes
Database Buffers          318767104 bytes
Redo Buffers                4923392 bytes
Database mounted.
Database opened.

SQL> select instance_name,status from v$instance;

INSTANCE_NAME    STATUS
---------------- ------------
asanga2          OPEN

SQL> select HOST_NAME,INSTANCE_NUMBER,INSTANCE_NAME,STATUS,THREAD# from gv$instance;

HOST_NAME                 INSTANCE_NUMBER INSTANCE_NAME    STATUS          THREAD#
------------------------- --------------- ---------------- ------------ ----------
rhel6m2.domain.net                     2 asanga2          OPEN                  2
rhel6m1.domain.net                     1 asanga1          OPEN                  1
9. Once confirmed that all instances are opening without any issue, create a spfile in a shared location.
SQL> create spfile='+data' from pfile='/home/oracle/backup/initasanga.ora';
Make an alias in ASM for the spfile
ASMCMD> mkalias spfile.283.888929113 spfileasanga.ora
ASMCMD> ls -l
Type           Redund  Striped  Time             Sys  Name
PARAMETERFILE  UNPROT  COARSE   AUG 28 12:00:00  Y    spfile.283.888929113
                                                 N    spfileasanga.ora => +DATA/ASANGA/PARAMETERFILE/spfile.283.888929113
Create instance specific pfile with entries to the spfile alias. Also remove the spfile created earlier from the local node
cat initasanga1.ora
spfile='+DATA/ASANGA/PARAMETERFILE/spfileasanga.ora'

scp initasanga1.ora rhel6m2:`pwd`/initasanga2.ora
10. Create oracle password files for each node

11. Run the following script to create cluster related views
@?/rdbms/admin/catclust.sql
After running this scrip the database registry will show RAC component entry
COMP_ID    COMP_NAME                           STATUS     VERSION
---------- ----------------------------------- ---------- ----------
RAC        Oracle Real Application Clusters    VALID      11.2.0.4.0
12.Add the database to the cluster
srvctl add database -d asanga -o $ORACLE_HOME -p "+DATA/ASANGA/PARAMETERFILE/spfileasanga.ora" 
srvctl add instance -d asanga -i asanga1 -n rhel6m1
srvctl add instance -d asanga -i asanga2 -n rhel6m2

[oracle@rhel6m1 dbs]$ srvctl config database -d asanga -a
Database unique name: asanga
Database name: rhel6m1
Oracle home: /opt/app/oracle/product/11.2.0/dbhome_4
Oracle user: oracle
Spfile: +DATA/ASANGA/PARAMETERFILE/spfileasanga.ora
Domain: local
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: asanga
Database instances: asanga1,asanga2
Disk Groups:
Mount point paths:
Services:
Type: RAC
Database is enabled
Database is administrator managed
13. Shutdown both instances and start the database using srvctl.
srvctl start database -d asanga
srvctl status database -d asanga
Instance asanga1 is running on node rhel6m1
Instance asanga2 is running on node rhel6m2

srvctl config database -d asanga -a
Database unique name: asanga
Database name: rhel6m1
Oracle home: /opt/app/oracle/product/11.2.0/dbhome_4
Oracle user: oracle
Spfile: +DATA/ASANGA/PARAMETERFILE/spfileasanga.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: asanga
Database instances: asanga1,asanga2
Disk Groups: DATA,FLASH
Mount point paths:
Services:
Type: RAC
Database is enabled
Database is administrator managed
14. Verify the database is also listed as a cluster resource
crsctl stat res ora.asanga.db
NAME=ora.asanga.db
TYPE=ora.database.type
TARGET=ONLINE           , ONLINE
STATE=ONLINE on rhel6m1, ONLINE on rhel6m2

Tuesday, September 1, 2015

Converting 12c Standard Cluster to Flex Cluster

An earlier post showed steps for installing a 12c flex cluster. This post shows the steps for converting a standard cluster to a flex cluster. There are two phases to converting a standard cluster to flex cluster. First phase involves converting Oracle ASM to Flex ASM and second phase is to change the cluster mode to flex.
The current setup is a two node standard cluster.
$  crsctl get cluster mode status
Cluster is running in "standard" mode

$ asmcmd
ASMCMD> showclustermode
ASM cluster : Flex mode disabled
There are few per-requisites to converting ASM to flex ASM, these include that OCR, SPFile and password file all stored in a disk group and this group have ASM compatibility (COMPATIBLE.ASM) set to 12.1 or higher. If this is not the case then make the necessary changes to move these files to disk group. As the current setup is a newly installed 12c cluster (as oppose to upgraded to 12c) these files all reside in disk group.
A point to note is that the diskgroup with above mentioned files has the size of 5114MB (below output has been modified by omitting some columns).
ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  1048576     10236     7609             N  DATA/
MOUNTED  EXTERN  N         512   4096  1048576     10236     8609             N  FRA/
MOUNTED  EXTERN  N         512   4096  1048576      5114      475             Y  NEWCLUSTERDG/
This is smaller than the required diskgroup size for new flex cluster being installed. Despite the smaller size diskgroup the conversion to flex cluster succeeded without any issue. The current ASM configuration is
$  srvctl config asm
ASM home: 
Password file: +NEWCLUSTERDG/orapwasm
ASM listener: LISTENER
Another key requirement is that flex cluster requires GNS. If a GNS doesn't exists setup GNS and add the GNS VIP to cluster. The standard cluster was already setup with GNS.
$  srvctl config gns
GNS is enabled.
GNS VIP addresses: 192.168.0.87
Domain served by GNS: rac.domain.net
To start the first phase of converting to flex ASM run asmca and click on ASM instances tab. If role separation is used then make sure grid user has write permission for directory $ORACLE_BASE/cfgtoollogs as the conversion script is generated inside it.
Click convert to Flex ASM button. This would prompt to select a network interface for ASM communication and also to specify a port. The default port is 1521.
However there is a problem in using the port 1521.
The port 1521 is used on the private network (192.168.1.0 in this case) by the management listener.
$ netstat -ntl | grep 1521
tcp        0      0 192.168.0.89:1521           0.0.0.0:*                   LISTEN      3323/tnslsnr
tcp        0      0 192.168.0.96:1521           0.0.0.0:*                   LISTEN      3323/tnslsnr
tcp        0      0 192.168.0.97:1521           0.0.0.0:*                   LISTEN      3323/tnslsnr
tcp        0      0 192.168.0.93:1521           0.0.0.0:*                   LISTEN      3323/tnslsnr
tcp        0      0 192.168.0.95:1521           0.0.0.0:*                   LISTEN      3323/tnslsnr
tcp        0      0 169.254.11.195:1521         0.0.0.0:*                   LISTEN      3323/tnslsnr
tcp        0      0 192.168.1.87:1521           0.0.0.0:*                   LISTEN      3323/tnslsnr

# ps ax | grep 3323
 3323 ?        Ssl    0:00 /opt/app/12.1.0/grid2/bin/tnslsnr MGMTLSNR -no_crs_notify -inherit
Even after stopping the MGMTLSNR
$ srvctl stop listener -l MGMTLSNR
PRCR-1065 : Failed to stop resource ora.MGMTLSNR
CRS-2529: Unable to act on 'ora.MGMTLSNR' because that would require stopping or relocating 'ora.mgmtdb', but the force option was not specified
$ srvctl stop listener -l MGMTLSNR -f

ora.MGMTLSNR
      1        OFFLINE OFFLINE                               169.254.11.195 192.1
                                                             68.1.87,STABLE
and all other listeners (scan_listener and listener) that were using port 1521 (even though they were on a different network) the error did not get resolved. It could be port usage is looked up statically from a config file. There's no problem to use 1521 for both database listener and ASM listener when a new flex cluster is installed. Finally had to proceed using a different port for cluster ASM listener to continue forward.
Conversion to flex ASM will continue restarting one node at time.
When prompted execute the script on the same node ASMCA was run.
Output from converttoFlexASM.sh execution
# /opt/app/oracle/cfgtoollogs/asmca/scripts/converttoFlexASM.sh
CRS-2673: Attempting to stop 'ora.crsd' on 'rhel12c1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rhel12c1'
CRS-2673: Attempting to stop 'ora.mgmtdb' on 'rhel12c1'
CRS-2673: Attempting to stop 'ora.gns' on 'rhel12c1'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN2.lsnr' on 'rhel12c1'
CRS-2673: Attempting to stop 'ora.NEWCLUSTERDG.dg' on 'rhel12c1'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'rhel12c1'
CRS-2673: Attempting to stop 'ora.rac12c1.db' on 'rhel12c1'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN3.lsnr' on 'rhel12c1'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'rhel12c1'
CRS-2673: Attempting to stop 'ora.oc4j' on 'rhel12c1'
CRS-2673: Attempting to stop 'ora.cvu' on 'rhel12c1'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'rhel12c1'
CRS-2677: Stop of 'ora.cvu' on 'rhel12c1' succeeded
CRS-2672: Attempting to start 'ora.cvu' on 'rhel12c2'
CRS-2677: Stop of 'ora.LISTENER_SCAN2.lsnr' on 'rhel12c1' succeeded
CRS-2673: Attempting to stop 'ora.scan2.vip' on 'rhel12c1'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'rhel12c1' succeeded
CRS-2677: Stop of 'ora.DATA.dg' on 'rhel12c1' succeeded
CRS-2677: Stop of 'ora.NEWCLUSTERDG.dg' on 'rhel12c1' succeeded
CRS-2677: Stop of 'ora.FRA.dg' on 'rhel12c1' succeeded
CRS-2677: Stop of 'ora.gns' on 'rhel12c1' succeeded
CRS-2673: Attempting to stop 'ora.gns.vip' on 'rhel12c1'
CRS-2677: Stop of 'ora.LISTENER_SCAN3.lsnr' on 'rhel12c1' succeeded
CRS-2673: Attempting to stop 'ora.scan3.vip' on 'rhel12c1'
CRS-2673: Attempting to stop 'ora.rhel12c1.vip' on 'rhel12c1'
CRS-2676: Start of 'ora.cvu' on 'rhel12c2' succeeded
CRS-2677: Stop of 'ora.scan2.vip' on 'rhel12c1' succeeded
CRS-2672: Attempting to start 'ora.scan2.vip' on 'rhel12c2'
CRS-2677: Stop of 'ora.rac12c1.db' on 'rhel12c1' succeeded
CRS-2677: Stop of 'ora.mgmtdb' on 'rhel12c1' succeeded
CRS-2673: Attempting to stop 'ora.MGMTLSNR' on 'rhel12c1'
CRS-2677: Stop of 'ora.MGMTLSNR' on 'rhel12c1' succeeded
CRS-2672: Attempting to start 'ora.MGMTLSNR' on 'rhel12c2'
CRS-2677: Stop of 'ora.gns.vip' on 'rhel12c1' succeeded
CRS-2672: Attempting to start 'ora.gns.vip' on 'rhel12c2'
CRS-2677: Stop of 'ora.scan3.vip' on 'rhel12c1' succeeded
CRS-2672: Attempting to start 'ora.scan3.vip' on 'rhel12c2'
CRS-2677: Stop of 'ora.rhel12c1.vip' on 'rhel12c1' succeeded
CRS-2672: Attempting to start 'ora.rhel12c1.vip' on 'rhel12c2'
CRS-2676: Start of 'ora.scan2.vip' on 'rhel12c2' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN2.lsnr' on 'rhel12c2'
CRS-2676: Start of 'ora.MGMTLSNR' on 'rhel12c2' succeeded
CRS-2672: Attempting to start 'ora.mgmtdb' on 'rhel12c2'
CRS-2676: Start of 'ora.gns.vip' on 'rhel12c2' succeeded
CRS-2672: Attempting to start 'ora.gns' on 'rhel12c2'
CRS-2677: Stop of 'ora.oc4j' on 'rhel12c1' succeeded
CRS-2672: Attempting to start 'ora.oc4j' on 'rhel12c2'
CRS-2676: Start of 'ora.scan3.vip' on 'rhel12c2' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN3.lsnr' on 'rhel12c2'
CRS-2676: Start of 'ora.rhel12c1.vip' on 'rhel12c2' succeeded
CRS-2676: Start of 'ora.gns' on 'rhel12c2' succeeded
CRS-2676: Start of 'ora.LISTENER_SCAN2.lsnr' on 'rhel12c2' succeeded
CRS-2676: Start of 'ora.LISTENER_SCAN3.lsnr' on 'rhel12c2' succeeded
CRS-2676: Start of 'ora.oc4j' on 'rhel12c2' succeeded
CRS-2676: Start of 'ora.mgmtdb' on 'rhel12c2' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'rhel12c1'
CRS-2677: Stop of 'ora.ons' on 'rhel12c1' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'rhel12c1'
CRS-2677: Stop of 'ora.net1.network' on 'rhel12c1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rhel12c1' has completed
CRS-2677: Stop of 'ora.crsd' on 'rhel12c1' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'rhel12c1'
CRS-2673: Attempting to stop 'ora.evmd' on 'rhel12c1'
CRS-2673: Attempting to stop 'ora.storage' on 'rhel12c1'
CRS-2677: Stop of 'ora.storage' on 'rhel12c1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'rhel12c1'
CRS-2677: Stop of 'ora.ctssd' on 'rhel12c1' succeeded
CRS-2677: Stop of 'ora.evmd' on 'rhel12c1' succeeded
CRS-2677: Stop of 'ora.asm' on 'rhel12c1' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rhel12c1'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rhel12c1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'rhel12c1'
CRS-2677: Stop of 'ora.cssd' on 'rhel12c1' succeeded
CRS-2672: Attempting to start 'ora.evmd' on 'rhel12c1'
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rhel12c1'
CRS-2676: Start of 'ora.cssdmonitor' on 'rhel12c1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'rhel12c1'
CRS-2672: Attempting to start 'ora.diskmon' on 'rhel12c1'
CRS-2676: Start of 'ora.diskmon' on 'rhel12c1' succeeded
CRS-2676: Start of 'ora.evmd' on 'rhel12c1' succeeded
CRS-2676: Start of 'ora.cssd' on 'rhel12c1' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'rhel12c1'
CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'rhel12c1'
CRS-2676: Start of 'ora.ctssd' on 'rhel12c1' succeeded
CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'rhel12c1' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'rhel12c1'
CRS-2676: Start of 'ora.asm' on 'rhel12c1' succeeded
CRS-2672: Attempting to start 'ora.storage' on 'rhel12c1'
CRS-2676: Start of 'ora.storage' on 'rhel12c1' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'rhel12c1'
CRS-2676: Start of 'ora.crsd' on 'rhel12c1' succeeded
Oracle Grid Infrastructure restarted in node rhel12c1
PRCC-1014 : ASMNET1LSNR_ASM was already running
PRCR-1004 : Resource ora.ASMNET1LSNR_ASM.lsnr is already running
PRCR-1079 : Failed to start resource ora.ASMNET1LSNR_ASM.lsnr
CRS-5702: Resource 'ora.ASMNET1LSNR_ASM.lsnr' is already running on 'rhel12c2'
CRS-5702: Resource 'ora.ASMNET1LSNR_ASM.lsnr' is already running on 'rhel12c1'
ASM listener ASMNET1LSNR_ASM running already
CRS-2673: Attempting to stop 'ora.crsd' on 'rhel12c2'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rhel12c2'
CRS-2673: Attempting to stop 'ora.rac12c1.cbx.svc' on 'rhel12c2'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN3.lsnr' on 'rhel12c2'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN2.lsnr' on 'rhel12c2'
CRS-2673: Attempting to stop 'ora.mgmtdb' on 'rhel12c2'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'rhel12c2'
CRS-2673: Attempting to stop 'ora.oc4j' on 'rhel12c2'
CRS-2673: Attempting to stop 'ora.cvu' on 'rhel12c2'
CRS-2673: Attempting to stop 'ora.NEWCLUSTERDG.dg' on 'rhel12c2'
CRS-2673: Attempting to stop 'ora.ASMNET1LSNR_ASM.lsnr' on 'rhel12c2'
CRS-2677: Stop of 'ora.cvu' on 'rhel12c2' succeeded
CRS-2672: Attempting to start 'ora.cvu' on 'rhel12c1'
CRS-2677: Stop of 'ora.NEWCLUSTERDG.dg' on 'rhel12c2' succeeded
CRS-2677: Stop of 'ora.LISTENER_SCAN2.lsnr' on 'rhel12c2' succeeded
CRS-2673: Attempting to stop 'ora.scan2.vip' on 'rhel12c2'
CRS-2677: Stop of 'ora.LISTENER_SCAN3.lsnr' on 'rhel12c2' succeeded
CRS-2673: Attempting to stop 'ora.scan3.vip' on 'rhel12c2'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'rhel12c2' succeeded
CRS-2677: Stop of 'ora.rac12c1.cbx.svc' on 'rhel12c2' succeeded
CRS-2673: Attempting to stop 'ora.rac12c1.db' on 'rhel12c2'
CRS-2677: Stop of 'ora.ASMNET1LSNR_ASM.lsnr' on 'rhel12c2' succeeded
CRS-2676: Start of 'ora.cvu' on 'rhel12c1' succeeded
CRS-2677: Stop of 'ora.scan2.vip' on 'rhel12c2' succeeded
CRS-2672: Attempting to start 'ora.scan2.vip' on 'rhel12c1'
CRS-2677: Stop of 'ora.scan3.vip' on 'rhel12c2' succeeded
CRS-2672: Attempting to start 'ora.scan3.vip' on 'rhel12c1'
CRS-2677: Stop of 'ora.rac12c1.db' on 'rhel12c2' succeeded
CRS-2677: Stop of 'ora.mgmtdb' on 'rhel12c2' succeeded
CRS-2673: Attempting to stop 'ora.MGMTLSNR' on 'rhel12c2'
CRS-2677: Stop of 'ora.MGMTLSNR' on 'rhel12c2' succeeded
CRS-2672: Attempting to start 'ora.MGMTLSNR' on 'rhel12c1'
CRS-2673: Attempting to stop 'ora.rhel12c2.vip' on 'rhel12c2'
CRS-2676: Start of 'ora.scan2.vip' on 'rhel12c1' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN2.lsnr' on 'rhel12c1'
CRS-2677: Stop of 'ora.rhel12c2.vip' on 'rhel12c2' succeeded
CRS-2672: Attempting to start 'ora.rhel12c2.vip' on 'rhel12c1'
CRS-2676: Start of 'ora.scan3.vip' on 'rhel12c1' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN3.lsnr' on 'rhel12c1'
CRS-2676: Start of 'ora.MGMTLSNR' on 'rhel12c1' succeeded
CRS-2672: Attempting to start 'ora.mgmtdb' on 'rhel12c1'
CRS-2677: Stop of 'ora.oc4j' on 'rhel12c2' succeeded
CRS-2672: Attempting to start 'ora.oc4j' on 'rhel12c1'
CRS-2676: Start of 'ora.rhel12c2.vip' on 'rhel12c1' succeeded
CRS-2676: Start of 'ora.LISTENER_SCAN2.lsnr' on 'rhel12c1' succeeded
CRS-2676: Start of 'ora.LISTENER_SCAN3.lsnr' on 'rhel12c1' succeeded
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'rhel12c2'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'rhel12c2'
CRS-2673: Attempting to stop 'ora.gns' on 'rhel12c2'
CRS-2677: Stop of 'ora.FRA.dg' on 'rhel12c2' succeeded
CRS-2677: Stop of 'ora.DATA.dg' on 'rhel12c2' succeeded
CRS-2677: Stop of 'ora.gns' on 'rhel12c2' succeeded
CRS-2673: Attempting to stop 'ora.gns.vip' on 'rhel12c2'
CRS-2677: Stop of 'ora.gns.vip' on 'rhel12c2' succeeded
CRS-2672: Attempting to start 'ora.gns.vip' on 'rhel12c1'
CRS-2676: Start of 'ora.gns.vip' on 'rhel12c1' succeeded
CRS-2672: Attempting to start 'ora.gns' on 'rhel12c1'
CRS-2676: Start of 'ora.gns' on 'rhel12c1' succeeded
CRS-2676: Start of 'ora.oc4j' on 'rhel12c1' succeeded
CRS-2676: Start of 'ora.mgmtdb' on 'rhel12c1' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'rhel12c2'
CRS-2677: Stop of 'ora.ons' on 'rhel12c2' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'rhel12c2'
CRS-2677: Stop of 'ora.net1.network' on 'rhel12c2' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rhel12c2' has completed
CRS-2677: Stop of 'ora.crsd' on 'rhel12c2' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'rhel12c2'
CRS-2673: Attempting to stop 'ora.evmd' on 'rhel12c2'
CRS-2673: Attempting to stop 'ora.storage' on 'rhel12c2'
CRS-2677: Stop of 'ora.storage' on 'rhel12c2' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'rhel12c2'
CRS-2677: Stop of 'ora.ctssd' on 'rhel12c2' succeeded
CRS-2677: Stop of 'ora.evmd' on 'rhel12c2' succeeded
CRS-2677: Stop of 'ora.asm' on 'rhel12c2' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rhel12c2'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rhel12c2' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'rhel12c2'
CRS-2677: Stop of 'ora.cssd' on 'rhel12c2' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rhel12c2'
CRS-2672: Attempting to start 'ora.evmd' on 'rhel12c2'
CRS-2676: Start of 'ora.cssdmonitor' on 'rhel12c2' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'rhel12c2'
CRS-2672: Attempting to start 'ora.diskmon' on 'rhel12c2'
CRS-2676: Start of 'ora.diskmon' on 'rhel12c2' succeeded
CRS-2676: Start of 'ora.evmd' on 'rhel12c2' succeeded
CRS-2676: Start of 'ora.cssd' on 'rhel12c2' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'rhel12c2'
CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'rhel12c2'
CRS-2676: Start of 'ora.ctssd' on 'rhel12c2' succeeded
CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'rhel12c2' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'rhel12c2'
CRS-2676: Start of 'ora.asm' on 'rhel12c2' succeeded
CRS-2672: Attempting to start 'ora.storage' on 'rhel12c2'
CRS-2676: Start of 'ora.storage' on 'rhel12c2' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'rhel12c2'
CRS-2676: Start of 'ora.crsd' on 'rhel12c2' succeeded
Oracle Grid Infrastructure restarted in node rhel12c2
End of the conversion the ASMCA will exit and console will have following output
Unable to establish connection to ASM instance.
 ORA-01034: ORACLE not available
 ASMCA will exit now.
This due to the restart of ASM and ASMCA unable to establish the connection. Rerun ASMCA and verify ASM instances are up an running. Notice the convert to flex ASM button is not there anymore.
List the new ASM configuration
$  srvctl config asm
ASM home: 
Password file: +NEWCLUSTERDG/orapwasm
ASM listener: LISTENER
ASM instance count: ALL
Cluster ASM listener: ASMNET1LSNR_ASM
The instance count is ALL because the option of running database version lower than 12.1 was selected. If this isn't the case the instance count would be
ASM instance count: 3
But only two ASM instances would be running.
The cluster ASM listener is available across the cluster
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr
               ONLINE  ONLINE       rhel12c1                 STABLE
               ONLINE  ONLINE       rhel12c2                 STABLE
Also verify the ASM flex mode with asmcmd
$ asmcmd
ASMCMD> showclustermode
ASM cluster : Flex mode enabled


The second phase is to convert the standard cluster mode to flex. This requires a cluster downtime.
To change the cluster mode to flex as root run the following(only on one of the nodes)
# crsctl set cluster mode flex
CRS-4933: Cluster mode set to "flex"; restart Oracle High Availability Services on all nodes for cluster to run in "flex" mode.
Shutdown clusterware on all nodes and start one node at a time
[root@rhel12c1 oracle]# crsctl stop crs
[root@rhel12c2 oracle]# crsctl stop crs

[root@rhel12c1 oracle]# crsctl start crs -wait
[root@rhel12c2 oracle]# crsctl start crs -wait
Once the cluster has started check the cluster mode and node roles
# crsctl get cluster mode status
Cluster is running in "flex" mode

[root@rhel12c1 oracle]# crsctl get node role config
Node 'rhel12c1' configured role is 'hub'

[grid@rhel12c2 ~]$ crsctl get node role config
Node 'rhel12c2' configured role is 'hub'
Make a note of ASM and network configurations as well
# srvctl config asm -detail
ASM home: 
Password file: +NEWCLUSTERDG/orapwasm
ASM listener: LISTENER
ASM is enabled.
ASM is individually enabled on nodes:
ASM is individually disabled on nodes:
ASM instance count: ALL
Cluster ASM listener: ASMNET1LSNR_ASM

oifcfg getif
eth0  192.168.0.0  global  public
eth1  192.168.1.0  global  cluster_interconnect,asm
This concludes the converting of a standard cluster to a flex cluster.

One of the key features of flex ASM is there's no one-one relationship between ASM instance and database instance. In a non flex ASM configuration failure of ASM instance would mean that database instance on that node will also fail. However with flex ASM in the event of an ASM instance failure the database instance is free to continue using a remaining ASM instance. This could be tested by stopping an ASM instance in one of the nodes
$ srvctl stop asm -node rhel12c1 -force

$ srvctl status asm -detail
ASM is running on rhel12c2
ASM is enabled.
ASM is running only one node 2. But both database instances would be up and running
ora.rac12c1.db
      1        ONLINE  ONLINE       rhel12c1                 Open,STABLE
      2        ONLINE  ONLINE       rhel12c2                 Open,STABLE
There's no restriction to making application connections to the db instance 1
SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
rac12c11
Connect to ASM instance on node 2 and check the asm clients which will list among others the db instance 1
SQL> select db_name,CLUSTER_NAME,STATUS,INSTANCE_NAME from v$asm_client;

DB_NAME  CLUSTER_NAME                    STATUS       INSTANCE_NAME
-------- ------------------------------- ------------ -----------------
_mgmtdb  rhel12c                         CONNECTED    -MGMTDB
+ASM     rhel12c                         CONNECTED    +ASM2
+ASM     rhel12c                         CONNECTED    +ASM2
rac12c1  rhel12c                         CONNECTED    rac12c11
rac12c1  rhel12c                         CONNECTED    rac12c11
rac12c1  rhel12c                         CONNECTED    rac12c12
rac12c1  rhel12c                         CONNECTED    rac12c12
Bringing back the stopped asm instance will not automatically relocate the db instance to it.
srvctl start asm -node rhel12c1
SQL>select db_name,CLUSTER_NAME,STATUS,INSTANCE_NAME from v$asm_client;
no rows selected
This has to be done manually with relocate command. Run this on node 2 by specifying instance_name:db_name
SQL> alter system relocate client 'rac12c11:rac12c1';
System altered.
The ASM alert log will capture the following during relocation
NOTE: Flex client id 0x10002 [rac12c11:rac12c1:rhel12c] attempting to reconnect
NOTE: registered owner id 0x10002 for rac12c11:rac12c1:rhel12c (reconnecting)
NOTE: Flex client rac12c11:rac12c1:rhel12c re-registered, osid 14767, mbr 0x0, asmb 6115 (reg:1427811453)
NOTE: client [rac12c11:rac12c1:rhel12c] declared 0 additional pending writes
Fri Aug 14 10:43:07 2015
NOTE: cleaning stale remote ownerid 0x10002 for client rac12c11:rac12c1:rhel12c (reg:1447305939)
Useful metalink notes
FAQ: Oracle Flex ASM 12c / 12.1 [ID 1573137.1]
Steps to Convert STANDARD ASM to FLEX ASM in 12C [ID 1915814.1]

Thursday, August 15, 2013

Converting 11gR2 RAC from Standard Edition to Enterprise Edition

The existing system is a 11gR2 (11.2.0.3.7) Standard Edition (SE) RAC with role separation on RHEL 6. The blog post lists the steps for converting the SE RAC to Enterprise Edition (EE) RAC. The SE home is dbhome_1 and EE home is dbhome_2.
1.Take a full backup of the database as precaution in case have to revert back to the standard edition setup again.
2. Since the database home will be updated in the OCR take a backup of the OCR and also take copies of backup files created automatically from all cluster nodes.
[root@rhel6m1 grid]# ocrconfig -manualbackup
rhel6m2     2013/08/14 14:57:27     /opt/app/11.2.0/grid/cdata/rhel6m-cluster/backup_20130814_145727.ocr
3. Get the status of registry components, so validity of these components could be compared before and after the conversion. There are no invalid components before the conversion.
SQL> select comp_id,comp_name,version,status,schema from dba_registry;

COMP_ID  COMP_NAME                                VERSION                        STATUS SCHEMA
-------- ---------------------------------------- ------------------------------ ------ ------
XDB      Oracle XML Database                      11.2.0.3.0                     VALID  XDB
OWM      Oracle Workspace Manager                 11.2.0.3.0                     VALID  WMSYS
EXF      Oracle Expression Filter                 11.2.0.3.0                     VALID  EXFSYS
RUL      Oracle Rules Manager                     11.2.0.3.0                     VALID  EXFSYS
CATALOG  Oracle Database Catalog Views            11.2.0.3.0                     VALID  SYS
CATPROC  Oracle Database Packages and Types       11.2.0.3.0                     VALID  SYS
JAVAVM   JServer JAVA Virtual Machine             11.2.0.3.0                     VALID  SYS
XML      Oracle XDK                               11.2.0.3.0                     VALID  SYS
CATJAVA  Oracle Database Java Packages            11.2.0.3.0                     VALID  SYS
RAC      Oracle Real Application Clusters         11.2.0.3.0                     VALID  SYS

10 rows selected.
4. Find out the patch levels on SE Oracle Home and GI Home. Once the EE is installed and before moving the DB to EE home it must be patched to the same level as the SE Home and not to a higher level than the GI home. The current patches on SE home are
[oracle@rhel6m1 ~]$ /opt/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch lsinventory -local | grep Patch
Oracle Interim Patch Installer version 11.2.0.3.4
OPatch version    : 11.2.0.3.4
Patch  16619892     : applied on Wed Jul 31 13:43:23 BST 2013
Unique Patch ID:  16346737
Patch description:  "Database Patch Set Update : 11.2.0.3.7 (16619892)"
Sub-patch  16056266; "Database Patch Set Update : 11.2.0.3.6 (16056266)"
Sub-patch  14727310; "Database Patch Set Update : 11.2.0.3.5 (14727310)"
Sub-patch  14275605; "Database Patch Set Update : 11.2.0.3.4 (14275605)"
Sub-patch  13923374; "Database Patch Set Update : 11.2.0.3.3 (13923374)"
Sub-patch  13696216; "Database Patch Set Update : 11.2.0.3.2 (13696216)"
Sub-patch  13343438; "Database Patch Set Update : 11.2.0.3.1 (13343438)"
Patch  16619898     : applied on Wed Jul 31 13:42:07 BST 2013
Unique Patch ID:  16376391
Patch description:  "Grid Infrastructure Patch Set Update : 11.2.0.3.7 (16742216)"
OPatch succeeded.
Patches on GI home are
[grid@rhel6m1 ~]$ /opt/app/11.2.0/grid/OPatch/opatch lsinventory -local | grep Patch
Oracle Interim Patch Installer version 11.2.0.3.4
OPatch version    : 11.2.0.3.4
Patch  16619892     : applied on Wed Jul 31 13:54:30 BST 2013
Unique Patch ID:  16346737
Patch description:  "Database Patch Set Update : 11.2.0.3.7 (16619892)"
Sub-patch  16056266; "Database Patch Set Update : 11.2.0.3.6 (16056266)"
Sub-patch  14727310; "Database Patch Set Update : 11.2.0.3.5 (14727310)"
Sub-patch  14275605; "Database Patch Set Update : 11.2.0.3.4 (14275605)"
Sub-patch  13923374; "Database Patch Set Update : 11.2.0.3.3 (13923374)"
Sub-patch  13696216; "Database Patch Set Update : 11.2.0.3.2 (13696216)"
Sub-patch  13343438; "Database Patch Set Update : 11.2.0.3.1 (13343438)"
Patch  16619898     : applied on Wed Jul 31 13:52:27 BST 2013
Unique Patch ID:  16376391
Patch description:  "Grid Infrastructure Patch Set Update : 11.2.0.3.7 (16742216)"
OPatch succeeded.
5. Install the EE across the cluster.
Select install software only option.
Select all the nodes where SE was installed
Select Enterprise Edition
Give the EE home a new location (dbhome_2 where as SE is dbhome_1)
Summary Page

6. Copy init file, password file and sqlnet.ora file (if used for COST) to appropriate location in the new EE home.
[oracle@rhel6m2 ~]$ cd /opt/app/oracle/product/11.2.0/dbhome_2/dbs
[oracle@rhel6m2 dbs]$  cp /opt/app/oracle/product/11.2.0/dbhome_1/dbs/orapwstd11g22 .
[oracle@rhel6m2 dbs]$  cp /opt/app/oracle/product/11.2.0/dbhome_1/dbs/initstd11g22.ora .

[oracle@rhel6m2 ~]$ cd /opt/app/oracle/product/11.2.0/dbhome_2/network/admin
[oracle@rhel6m2 dbs]$  cp /opt/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora .
Make sure this is done on all the nodes.




7. Patch the newly installed EE home (refer Case 2.1 section of the metalink note 1494646.1). Use GI_Home to run the opatch auto to avoid the following
Invoking utility "saveconfigurationsnapshot"
 UtilSession failed: This utility only be supported for GI home. Please specify the Oracle Home to the Grid Infrastructure (GI) Home "/opt/app/11.2.0/grid" by option -oh or set it in ORACLE_HOME environment variable
Following could be seen when patch is successfully applied.
/opt/app/11.2.0/grid/OPatch/opatch auto `pwd` -oh /opt/app/oracle/product/11.2.0/dbhome_2 -ocmrf ocm.rsp
 
 Using configuration parameter file: /opt/app/11.2.0/grid/crs/install/crsconfig_params
patch /usr/local/patches/16619898/custom/server/16619898  apply successful for home  /opt/app/oracle/product/11.2.0/dbhome_2
patch /usr/local/patches/16619892  apply successful for home  /opt/app/oracle/product/11.2.0/dbhome_2
Compare the patch applied on EE home is same as SE home checked earlier on step 4
[oracle@rhel6m1 ~]$ $ORACLE_HOME/OPatch/opatch lsinventory -local -oh /opt/app/oracle/product/11.2.0/dbhome_2 | grep Patch
Oracle Interim Patch Installer version 11.2.0.3.4
OPatch version    : 11.2.0.3.4
Patch  16619892     : applied on Thu Aug 15 10:34:09 BST 2013
Unique Patch ID:  16346737
Patch description:  "Database Patch Set Update : 11.2.0.3.7 (16619892)"
Sub-patch  16056266; "Database Patch Set Update : 11.2.0.3.6 (16056266)"
Sub-patch  14727310; "Database Patch Set Update : 11.2.0.3.5 (14727310)"
Sub-patch  14275605; "Database Patch Set Update : 11.2.0.3.4 (14275605)"
Sub-patch  13923374; "Database Patch Set Update : 11.2.0.3.3 (13923374)"
Sub-patch  13696216; "Database Patch Set Update : 11.2.0.3.2 (13696216)"
Sub-patch  13343438; "Database Patch Set Update : 11.2.0.3.1 (13343438)"
Patch  16619898     : applied on Thu Aug 15 10:27:19 BST 2013
Unique Patch ID:  16376391
Patch description:  "Grid Infrastructure Patch Set Update : 11.2.0.3.7 (16742216)"
OPatch succeeded.
8. Verify the oracle executable in the EE home has the correct permissions. The oracle executable permission in the SE home were
oracle@rhel6m1 bin]$ ls -l oracle*
-rwsr-s--x. 1 oracle asmadmin 220193582 Jul 31 13:44 oracle
-rwsr-s--x. 1 oracle asmadmin 220113336 Apr 23 17:37 oracleO
while the newly installed EE had the wrong group ownership.
[oracle@rhel6m1 bin]$ ls -l oracle*
-rwsr-s--x. 1 oracle oinstall 232617534 Aug 15 10:35 oracle
-rwsr-s--x. 1 oracle oinstall 232399041 Aug 14 15:45 oracleO
Having this wrong group permission could result in following error when starting the database with the EE home (output from alert log)
SUCCESS: diskgroup DATA was mounted
NOTE: dependency between database std11g2 and diskgroup resource ora.DATA.dg is established
Errors in file /opt/app/oracle/diag/rdbms/std11g2/std11g21/trace/std11g21_ora_24840.trc  (incident=67209):
ORA-00600: internal error code, arguments: [kfioTranslateIO03], [], [], [], [], [], [], [], [], [], [], []
Incident details in: /opt/app/oracle/diag/rdbms/std11g2/std11g21/incident/incdir_67209/std11g21_ora_24840_i67209.trc
Use ADRCI or Support Workbench to package the incident.
ERROR: unrecoverable error ORA-600 raised in ASM I/O path; terminating process 24840
To fix the issue set correct ownerships on the oracle executable.
[grid@rhel6m1 ~]$ $GI_HOME/bin/setasmgidwrap o=/opt/app/oracle/product/11.2.0/dbhome_2/bin/oracle
[grid@rhel6m1 ~]$ $GI_HOME/bin/setasmgidwrap o=/opt/app/oracle/product/11.2.0/dbhome_2/bin/oracleO

[oracle@rhel6m1 bin]$ ls -l oracle*
-rwsr-s--x. 1 oracle asmadmin 232617534 Aug 15 10:35 oracle
-rwsr-s--x. 1 oracle asmadmin 232399041 Aug 14 15:45 oracleO
More on kfioTranslateIO03 is available on the metalink note ORA-00600 [kfioTranslateIO03] [17090] (Doc ID 1336846.1)
9. Stop all but one instance.
[oracle@rhel6m1 ~]$ srvctl stop instance -d std11g2 -i std11g22
10. Set cluster_database=false to start the database in exclusive mode in the next start up.
SQL> alter system set cluster_database=FALSE scope=spfile sid='*';
System altered.
Once the change is done stop the remaining instance as well.
11. Change the oracle home associated with the database in the OCR.
[oracle@rhel6m1 ~]$ srvctl config database -d std11g2
Database unique name: std11g2
Database name: std11g2
Oracle home: /opt/app/oracle/product/11.2.0/dbhome_1 <--- SE Home

[oracle@rhel6m1 ~]$ srvctl modify database -d std11g2 -o /opt/app/oracle/product/11.2.0/dbhome_2

[oracle@rhel6m1 ~]$ srvctl config database -d std11g2
Database unique name: std11g2
Database name: std11g2
Oracle home: /opt/app/oracle/product/11.2.0/dbhome_2  <--- EE Home
12. Change environment variables (eg. ORACLE_HOME, PATH values) to point to EE home and start the database in exclusive mode. Make sure sqlplus used is from EE home.
[oracle@rhel6m1 ~]$ which sqlplus
/opt/app/oracle/product/11.2.0/dbhome_2/bin/sqlplus

[oracle@rhel6m1 ~]$ sqlplus / as sysdba
SQL> startup
SQL> @?/rdbms/admin/catalog.sql
SQL> @?/rdbms/admin/catproc.sql
SQL> @?/rdbms/admin/utlrp
Monitor the alert log for any start up issues. Verify there are no object with errors or issues while compiling during the utrl execute.
SQL> select COUNT(DISTINCT(obj#)) "OBJECTS WITH ERRORS" from utl_recomp_errors;

OBJECTS WITH ERRORS
-------------------
                  0
1 row selected.

SQL> select COUNT(*) "ERRORS DURING RECOMPILATION" from utl_recomp_errors;

ERRORS DURING RECOMPILATION
---------------------------
                          0
1 row selected.
Also verify the registry component status
SQL> select comp_id,comp_name,version,status,schema from dba_registry;

COMP_ID    COMP_NAME                                VERSION                        STATUS     SCHEMA
---------- ---------------------------------------- ------------------------------ ---------- --------
XDB        Oracle XML Database                      11.2.0.3.0                     VALID      XDB
OWM        Oracle Workspace Manager                 11.2.0.3.0                     VALID      WMSYS
EXF        Oracle Expression Filter                 11.2.0.3.0                     VALID      EXFSYS
RUL        Oracle Rules Manager                     11.2.0.3.0                     VALID      EXFSYS
CATALOG    Oracle Database Catalog Views            11.2.0.3.0                     VALID      SYS
CATPROC    Oracle Database Packages and Types       11.2.0.3.0                     VALID      SYS
JAVAVM     JServer JAVA Virtual Machine             11.2.0.3.0                     VALID      SYS
XML        Oracle XDK                               11.2.0.3.0                     VALID      SYS
CATJAVA    Oracle Database Java Packages            11.2.0.3.0                     VALID      SYS
RAC        Oracle Real Application Clusters         11.2.0.3.0                     VALID      SYS
Fix any issues that exists.
13. Set cluster_database to true and shutdown the instance.
SQL> alter system set cluster_database=true scope=spfile sid='*'; 
SQL> shutdown immediate;
Start all the instance using srvctl. Make sure using the srvctl from EE home
[oracle@rhel6m1 ~]$ which srvctl
/opt/app/oracle/product/11.2.0/dbhome_2/bin/srvctl

[oracle@rhel6m1 ~]$ srvctl start database -d std11g2
Once the db is started /etc/oratab will be upated with the new oracle home
std11g2:/opt/app/oracle/product/11.2.0/dbhome_2:N               # line added by Agent
14. Remove standard edition specific settings or configuration that are no longer needed. For example drop any triggers used for enabling use of stored outlines or scheduling of statspack snapshots.
15. If diagnostic and tuning pack license are available make sure it's set
SQL> show parameter control
control_management_pack_access       string      DIAGNOSTIC+TUNING
Also verify that AWR snapshots are taken each hour.
16. Use an EE option to verify EE is being used by the database. Easiest way is to create a bitmap index which only available with EE.
SQL> create bitmap index aidx on x(a);
Index created.
If it is on SE following error message will be shown
SQL> create bitmap index aidx on x(a);
create bitmap index aidx on x(a)
*
ERROR at line 1:
ORA-00439: feature not enabled: Bit-mapped indexes
17. Finally remove the old SE homes either using deinstall tool or detaching from inventory and deleting
$ORACLE_HOME/oui/bin/runInstaller -detachHome ORACLE_HOME=SE HOME
rm -rf SE HOME
Useful metalink notes
How to Convert Database from Standard to Enterprise Edition ? [117048.1]
Converting An Enterprise Edition Database To Standard Edition [139642.1]
How to Convert a RAC database from Standard Edition (SE) to Enterprise Edition (EE)? [451981.1]

Sunday, June 22, 2008

Converting from Standard to Enterprise Edition

1. Install enterprise edition on a separate home
2. create pfile of the existing database and move to enterprise home
3. move the password file to enterprise home or create new password file
4. backup the database.
5. switch paths, sid, and other oracle home related properties to enterprise home
6. startup the database
7. run catalog, catproc and utlrp scripts
8. de-install the standard software

Database version must be same. (ie. if standard is on 10.2.0.3 enterprise should also be on 10.2.0.3

if versions are different then replace steps 6 and 7 with

6. startup the database in upgrade/migrate mode.
7. run catupgrd.sql script of the current patch set level

more on metalink Note:117048.1

The only way to properly convert from an Enterprise Edition back to a Standard Edition is through an Export/Import operation. This way you will get rid of all Enterprise Edition specific Data Dictionary objects, as the SYS schema objects are not exported. The Standard Edition EXP utility is preferred to be used to export the data.

After the Import in the Standard Edition database, you only need to drop all user schemas related to Enterprise Edition features, such as the MDSYS account (used with Oracle Spatial).

more on metalink Note:139642.1