Log files are useful in troubleshooting issues in Oracle Applications

Oracle R12/12i log file (Patch, Clone, Startup/Shutdown):
=======================================


Log files are useful in troubleshooting issues in Oracle Applications. Here is the list of Log file location in Oracle Applications for Startup/Shutdown, Cloning, Patching, DB & Apps Listener and various components in Apps R12/12i:

A. Startup/Shutdown Log files for Application Tier in R12
Instance Top is new TOP added in R12
Startup/Shutdown error message text files like adapcctl.txt, adcmctl.txt…
$INST_TOP/apps/$CONTEXT_NAME/logs/appl/admin/log

–Startup/Shutdown error message related to tech stack (10.1.2, 10.1.3 forms/reports/web)
$INST_TOP/apps/$CONTEXT_NAME/logs/ora/  (10.1.2 & 10.1.3)
$INST_TOP/apps/$CONTEXT_NAME/logs/ora/10.1.3/Apache/error_log[timestamp]
$INST_TOP/apps/$CONTEXT_NAME/logs/ora/10.1.3/opmn/ (OC4J~…, oa*, opmn.log)$INST_TOP/apps/$CONTEXT_NAME/logs/ora/10.1.2/network/ (listener log)
$INST_TOP/apps/$CONTEXT_NAME/logs/appl/conc/log  (CM log files)





B. Log files related to cloning in R12
=================================
Preclone log files in source instance
i) Database Tier – /$ORACLE_HOME/appsutil/log/$CONTEXT_NAME/(StageDBTier_MMDDHHMM.log)
ii) Application Tier – $INST_TOP/apps/$CONTEXT_NAME/admin/log/ (StageAppsTier_MMDDHHMM.log)
Clone log files in target instance
Database Tier - $ORACLE_HOME/appsutil/log/$CONTEXT_NAME/ApplyDBTier_<time>.log
Apps Tier  – $INST_TOP/apps/$CONTEXT_NAME/admin/log/ApplyAppsTier_<time>.log
—–
If your clone on DB Tier fails while running txkConfigDBOcm.pl  (Check metalink note – 415020.1)
During clone step on DB Tier it prompts for “Target System base directory for source homes” and during this you have to give like /base_install_dirlike ../../r12 and not oracle home like ../../r12/db/tech_st_10.2.0



C. Patching related log files in R12:
==================================
i) Application Tier adpatch log - $APPL_TOP/admin/$SID/log/
ii) Developer (Developer/Forms & Reports 10.1.2) Patch - $ORACLE_HOME/.patch_storage
iii) Web Server (Apache) patch - $IAS_ORACLE_HOME/.patch_storage
iv) Database Tier opatch log – $ORACLE_HOME/.patch_storage




D. Autoconfig related log files in R12:
================================
i) Database Tier Autoconfiglog :
$ORACLE_HOME/appsutil/log/$CONTEXT_NAME/MMDDHHMM/adconfig.log
$ORACLE_HOME/appsutil/log/$CONTEXT_NAME/MMDDHHMM/NetServiceHandler.log
ii) Application Tier Autoconfig log -  $INST_TOP/apps/$CONTEXT_NAME/admin/log/$MMDDHHMM/adconfig.log
Autoconfig context file location in R12 - $INST_TOP/apps/$CONTEXT_NAME/appl/admin/$CONTEXT_NAME.xml




E. R12 Installation Logs:
====================
Database Tier Installation
RDBMS $ORACLE_HOME/appsutil/log/$CONTEXT_NAME/<MMDDHHMM>.logRDBMS $ORACLE_HOME/appsutil/log/$CONTEXT_NAME/ApplyDBTechStack_<MMDDHHMM>.logRDBMS
$ORACLE_HOME/appsutil/log/$CONTEXT_NAME/ohclone.logRDBMS $ORACLE_HOME/appsutil/log/$CONTEXT_NAME/make_<MMDDHHMM>.logRDBMS
$ORACLE_HOME/appsutil/log/$CONTEXT_NAME/installdbf.logRDBMS $ORACLE_HOME/appsutil/log/$CONTEXT_NAME/adcrdb_<SID>.log RDBMS
$ORACLE_HOME/appsutil/log/$CONTEXT_NAME/ApplyDatabase_<MMDDHHMM>.logRDBMS $ORACLE_HOME/appsutil/log/$CONTEXT_NAME/<MMDDHHMM>/adconfig.log    RDBMS
$ORACLE_HOME/appsutil/log/$CONTEXT_NAME/<MMDDHHMM>/NetServiceHandler.log




Application Tier Installation
$INST_TOP/logs/<MMDDHHMM>.log
$APPL_TOP/admin/$CONTEXT_NAME/log/ApplyAppsTechStack.log
$INST_TOP/logs/ora/10.1.2/install/make_<MMDDHHMM>.log
$INST_TOP/logs/ora/10.1.3/install/make_<MMDDHHMM>.log
$INST_TOP/admin/log/ApplyAppsTechStack.log
$INST_TOP/admin/log/ohclone.log
$APPL_TOP/admin/$CONTEXT_NAME/log/installAppl.log
$APPL_TOP/admin/$CONTEXT_NAME/log/ApplyAppltop_<MMDDHHMM>.log
$APPL_TOP/admin/$CONTEXT_NAME/log/<MMDDHHMM>/adconfig.log
$APPL_TOP/admin/$CONTEXT_NAME/log/<MMDDHHMM>/NetServiceHandler.log



Inventory Registration:
$Global Inventory/logs/cloneActions<timestamp>.log
$Global Inventory/logs/oraInstall<timestamp>.log
$Global Inventory/logs/silentInstall<timestamp>.log




F. Other log files in R12
1) Database Tier
1.1) Relink Log files :
$ORACLE_HOME/appsutil/log/$CONTEXT_NAME /MMDDHHMM/ make_$MMDDHHMM.log
1.2) Alert Log Files :
$ORACLE_HOME/admin/$CONTEXT_NAME/bdump/alert_$SID.log
1.3) Network Logs :
$ORACLE_HOME/network/admin/$SID.log


1.4) OUI Logs :
OUI Inventory Logs :
$ORACLE_HOME/admin/oui/$CONTEXT_NAME/oraInventory/logs
2) Application Tier
$ORACLE_HOME/j2ee/DevSuite/log
$ORACLE_HOME/opmn/logs
$ORACLE_HOME/network/logs
Tech Stack Patch 10.1.3 (Web/HTTP Server)
$IAS_ORACLE_HOME/j2ee/forms/logs
$IAS_ORACLE_HOME/j2ee/oafm/logs
$IAS_ORACLE_HOME/j2ee/oacore/logs
$IAS_ORACLE_HOME/opmn/logs
$IAS_ORACLE_HOME/network/log
$INST_TOP/logs/ora/10.1.2
$INST_TOP/logs/ora/10.1.3
$INST_TOP/logs/appl/conc/log
$INST_TOP/logs/appl/admin/log


Oracle E-Business Suite uses three OC4J (oacoreoafm & forms) for Java Applications including Forms and HTTP Server for static HTML content.
All these four components are managed (including startup/shutdown) by OPMN (OracleProcess Manager & Notification) .

A. 
Script to start/stop OPMN in R12 $ADMIN_SCRIPTS_HOME/ adopmnctl.sh
B. 
Script to start/stop HTTP Server in R12 - $ADMIN_SCRIPTS_HOME/ adapcctl.sh
C. 
Script to start/stop oacore OC4J in R12 - $ADMIN_SCRIPTS_HOME/adoacorectl.sh
D. 
Script to start/stop oafm OC4J in R12 $ADMIN_SCRIPTS_HOME/ adoafmctl.sh
E. 
Script to start/stop forms OC4J in R12 - $ADMIN_SCRIPTS_HOME/ adformsctl.sh

.
Processes in Instance: VISR12_focusthread.focusthread.com
———————————+——————–+———+———
ias-component                        | process-type       |     pid | status
———————————+——————–+———+———
OC4JGroup:default_group          | OC4J:oafm             |    1032 | Alive
OC4JGroup:default_group          | OC4J:forms            |     933 | Alive
OC4JGroup:default_group          | OC4J:oacore          |     808 | Alive
HTTP_Server                          | HTTP_Server        |     748 | Alive 
.
 How to troubleshoot status code 204  Issue for OC4J ?
1. First check startup log at $LOG_HOME/appl/admin/log/ adoacorectl.txt,adoafmctl.txt, adoaformsctl.txt
2. 
Next check log at  $LOG_HOME/ ora/ 10.1.3/ opmn/ opmn.log

If you see error like
—-
09/07/22 18:28:10 [libopmnoc4j] Port information in the ONS notification is incorrect for proc: 1154637034. Some of the reasons for the failure are:
1. ajp, rmi and jms ports could not be bound by the process.
2. If a port value for a certain port ID is handed by OPMN to the OC4J process and this value is not returned back in the ONS notifications. For example, this can happen for certain bad JGroups related configurations.
09/07/22 18:28:10 [libopmnoc4j] Process Start Error: default_group~oafm~default_group~1 (1154637034:26689)09/07/22
18:28:11 [pm-process] Stopping Process: default_group~oafm~default_group~1 (1154637034:26689)09/07/22 18:28:11
[libopmnoc4j] Process Stop Error: default_group~oafm~default_group~1 (1154637034:26689)09/07/22 18:28:11 [libopmnoc4j]
Failed to construct stop command for proc: 115463703409/07/22 18:28:11 [libopmnoc4j] Forcefully Terminating Process:
default_group~oafm~default_group~1 (1154637034:26689)09/07/22 18:28:13 [pm-requests] Request d Completed. Command: /start?process-type=oafm

.
Fix

Clear directory under persistence from below directory and restart all three OC4J
$ORA_CONFIG_HOME/ 10.1.3/ j2ee/ oacore/ persistence
$ORA_CONFIG_HOME/ 10.1.3/ j2ee/ oafm/ persistence
$ORA_CONFIG_HOME/ 10.1.3/ j2ee/ forms/ persistence
This could be because of .lock files and explained in Metalink Note 372412.1 OC4J Fails to startup with “ERROR Failed to set the internal configuration of the OC4J JMS Server”
.
3. If all services are up and running and you still get “Page not found” in Apps R12, then
Check logs in $LOG_HOME/ora/10.1.3/opmn/oacore_default_group_1/oacorestd.err

——-
09/07/22 18:44:20 Exception in static block of jtf.cache.CacheManager. Stack trace is:
oracle. apps. jtf. base. resources. FrameworkException: IAS Cache initialization failed. The Distributed Caching System failed to initialize on port: 12357. The list of hosts in the distributed caching system is: 127.0.0.1 . The port 12357 should be free on each host running the JVMs.
at oracle. apps. jtf. cache. IASCacheProvider.init(IASCacheProvider.java:335)
at oracle. apps. jtf. cache. CacheManager.activateCache(CacheManager.java:1451)   
As error indicates issue is with Java Object Cache (JOC) to knwo more about JOCclick here
To confirm that issue is because of Java Object Cache (JOC), check log file $LOG_HOME/appl/rgf/javacache.log

[2009-07-22T18:44:20.856+01:00] [ias] [NOTIFICATION] [] [cache.Lifecycle] [host: focusthread.com] [nwaddr: X.X.X.X] [tid: 11] [userId: avisr12] [ecid: X.X.X.X:39334:1248284660856:1,1] JOC is shutdown. vid=0
Fix : There are two potential solution (or more depneding on root cause of JOC issue)
1. Check if not other service is using JOC port (JOC port is defind by parameters_java_object_cache_port in context file), run Autoconfig and test again
2. Disable JOC by changing s_long_running_jvm in context file from true to falseand run Autoconfig
.
Log File Location for OACore& JOC in R12
  • $LOG_HOME/ appl/ admin/ log/ adoacorectl.txt, adoafmctl.txt, adoaformsctl.txt
  • $LOG_HOME/ ora/ 10.1.3/ opmn/ opmn.log
  • $LOG_HOME/ ora/ 10.1.3/ opmn/ oacore_default_group_1/ oacorestd.err
  • $LOG_HOME/ appl/ rgf/ javacache.log
  • $LOG_HOME/ ora/ 10.1.3/ j2ee/ oacore/ oacore_default_group_1/ application.log


Migrate a Database from Non-ASM to ASM in Virtual Box

Step by Step Document for Migrate a Database from Non-ASM to ASM in Virtual Box:


Requirements:

1. OEL 5.5

2. 11g Grid Release 2

3. A running stand-alone Database


1.      Creating Standalone ASM instance in Oracle 11gR2 using "Oracle Grid Infrastructure"

                 [root@11g ~]# uname -r
                 2.6.18-194.el5
                 [root@11g ~]#
 
 In my case it is 64bit OEL 5.5 , so I downloaded following rpms to install Oracle ASM Lib

                        oracleasm-support-2.1.7-1.el5.x86_64.rpm
                        oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm
                        oracleasmlib-2.0.4-1.el5.x86_64.rpm

            2.      The rpm's should be applied in the same order, otherwise you will get a dependencies error

rpm -Uvh oracleasm-support-2.1.7-1.el5.x86_64.rpm
rpm -Uvh oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm
rpm -Uvh oracleasmlib-2.0.4-1.el5.x86_64.rpm

or

rpm –ivh –force –nodeps oracleasm*

            3.      Configure Oracle ASM Library driver

 [root@11g ~]# /etc/init.d/oracleasm configure
 Configuring the Oracle ASM library driver.

 This will configure the on-boot properties of the Oracle ASM library
 driver.  The following questions will determine whether the driver is
 loaded on boot and what permissions it will have.  The current values
 will be shown in brackets ('[]').  Hitting <ENTER> without typing an
 answer will keep that current value.  Ctrl-C will abort.

 Default user to own the driver interface []: oracle
 Default group to own the driver interface []: dba
 Start Oracle ASM library driver on boot (y/n) [n]: y
 Scan for Oracle ASM disks on boot (y/n) [y]: y
 Writing Oracle ASM library driver configuration: done
 Initializing the Oracle ASMLib driver:                     [  OK  ]
 Scanning the system for Oracle ASMLib disks:               [  OK  ]

             4.      You can check the Oracle ASM status
 [root@11g ~]# oracleasm status
 Checking if ASM is loaded: yes
 Checking if /dev/oracleasm is mounted: yes


             5.      Before that we need to get the RAW disk for installing ASM,

First we need to create 1 folder in windows level,
c:\ kavirajan\virtualbox\sharedstorage

             6.      Go to the command prompt , In command prompt go to,

c:\ kavirajan\virtualbox\sharedstorage

             7.         Create ASM disk by the following commands,

VBoxManage createhd --filename skr.vdi  --size 8000 --format VDI --variant Fixed

             8.      Connect those disks to virtual machine RAC1.

VBoxManage storageattach ASMfromNONASM --storagectl "SATA" --port 1 --device 0 --type hdd --medium skr.vdi --mtype shareable

VBoxManage modifyhd ocr1.vdi --type shareable

             9.         Power on the virtual machine with the user root. (putty)

            10.  Check the disks are created or not,

#cd /dev
#ls –ltr sd*

            11.  Creating a new Partition for ASM disk

[root@11g ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): p

Disk /dev/sdb: 8388 MB, 8388608000 bytes
255 heads, 63 sectors/track, 1019 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1019, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1019, default 1019):
Using default value 1019

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@11g ~]# fdisk -l

Disk /dev/sda: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14       13054   104751832+  8e  Linux LVM

Disk /dev/sdb: 8388 MB, 8388608000 bytes
255 heads, 63 sectors/track, 1019 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1019     8185086 

              12.   To create a ASM disk using Oracle ASMLib 

[root@11g ~]# oracleasm createdisk DISK1 /dev/sdb1
Writing disk header: done
Instantiating disk: done

              13.   To List and check the Oracle ASM disks

[root@11g ~]# oracleasm listdisks
DISK1
[root@11g ~]# oracleasm querydisk DISK1
Disk "DISK1" is a valid ASM disk


Creating Oracle Standalone ASM instance on Oracle 11gR2 (11.2.0.3)


         1.       Once the Oracle ASM disk is created, We have to create the ASM instance using Oracle Grid   Infrastructure
   
   In Oracle 11gR2, the ASM instance is Installed on new "Grid Infrastructure home".
   
         2.       Download the Grid Infrastructure software from Oracle support site and install it using./runInstaller. 

         3.       Select "Configure Oracle Grid Infrastructure for a Standalone Server"

             




 4.       As you can see the ASM Disk -DISK1, which we created earlier is visible here. Give the Disk Group Name (DATA) and Redundancy select External. 




              5.       In Oracle 11gR2 we have a new "SYSASM" Privilege to manage the ASM instance. Provide the password skr for the same.




              6.       Once the all the prerequisite are met, you will receive the "install" screen





              7.       At the end execute "root.sh" as a root user and complete the installation.




Verify whether the ASM instance is created and
    
[root@11g 11.2.0]# ps -ef | grep pmon
oracle    8228     1  0 14:43 ?        00:00:00 asm_pmon_+ASM
oracle    8313     1  0 14:45 ?        00:00:00 ora_pmon_orcl
root      8434  2955  0 14:46 pts/1    00:00:00 grep pmon
[root@11g 11.2.0]# su - oracle
[oracle@11g ~]$ . oraenv
ORACLE_SID = [orcl] ? +ASM
The Oracle base for ORACLE_HOME=/opt/oracle/product/11.2.0/grid is /opt/oracle
[oracle@11g ~]$ asmcmd
ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  1048576      7993     7934                0            7934              0             N  DATA/
ASMCMD> exit       


[oracle@11g ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.1.0 Production on Fri Jun 14 14:48:16 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Automatic Storage Management option

SQL> select INSTANCE_NAME,VERSION,STATUS from v$instance;

INSTANCE_NAME    VERSION           STATUS
---------------- ----------------- ------------
+ASM             11.2.0.1.0        STARTED

SQL> select NAME,STATE,TOTAL_MB,FREE_MB,COMPATIBILITY from                  V$ASM_DISKGROUP;

NAME                           STATE         TOTAL_MB    FREE_MB
------------------------------ ----------- ---------- ----------
COMPATIBILITY
------------------------------------------------------------
DATA                           MOUNTED           7993       7934
11.2.0.0.0

Now we are ready migrate this database,

1.      Check the database version and status

SQL> select INSTANCE_NAME,VERSION,DATABASE_STATUS from v$instance;

INSTANCE_NAME    VERSION           DATABASE_STATUS
---------------- ----------------- -----------------
orcl             11.2.0.1.0        ACTIVE

We should be able to check the ASM disk available from the instance which we created earlie

SQL> select NAME,STATE,TOTAL_MB,PATH from v$asm_disk;

NAME                           STATE      TOTAL_MB     PATH
----------------------------------------------------------------

DISK1                          NORMAL         7993    ORCL:DISK1


Migrating the SPFILE from Non-asm to ASM


1) If you are using a spfile, take a backup of spfile using rman to restore it to ASM disk

   RMAN>BACKUP AS BACKUPSET SPFILE;

2) Now shutdown the database and start it in Mount stage
   SQL> Shutdown immediate

   SQL> STARTUP MOUNT;

3) Now restore the spfile from the backup to ASM disk as below

  RMAN>RESTORE SPFILE TO '+DATA/spfileorcl.ora';

4) You can see, still the parameter "spfile" is pointing to file system instead of ASM disk

   SQL> show parameter spfile

    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    spfile                               string      /opt/oracle/product/11.2.0/db_1
                                                       /dbs/spfileorcl.ora
5) Shutdowm the instance

    SQL> shutdown immediate

6) Delete "spfile<sid>.ora and init<sid>.ora from the $ORACLE_HOME/dbs directory and create a new init<sid>.ora with the following line of content and start the instance,

    vi initorcl.ora
   SPFILE='+DATA/spfileorcl.ora'

   SQL> Startup (  first it will search for spfile<sid>.ora which we deleted and next it will look for      init<sid>.ora which we have moified with the above content  )

   SQL> show parameter spfile

    NAME                                 TYPE        VALUE
   ------------------------------------ ----------- ------------------------------
   spfile                               string      +DATA/spfileorcl.ora


Migrating Control files from Non-ASM to ASM


1) These are the current control files in non-asm

SQL>show parameter contol_files
         control_files                        string      /opt/oracle/oradata/orcl/control01.ctl,
                                                                 /opt/oracle/oradata/orcl/control02.ctl

2) Start the instance in nomount state

SQL> startup nomount

3) You can move these control files to ASM using RMAN

    [oracle@coltdb04 ~]$ rman target /

    Recovery Manager: Release 11.2.0.3.0 - Production on Fri Jun 29 03:04:39 2012

    Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

    connected to target database: LEARNDB (not mounted)


    RMAN>restore controlfile to '+DATA' from '/opt/oracle/oradata/orcl/control01.ctl';


4) You can check whether the control file are created

   ASMCMD> find -t CONTROLFILE +DATA *
   WARNING:option 't' is deprecated for 'find'
   please use 'type'

   +DATA/ORCL/CONTROLFILE/current.256.787200593

5) Update the spfile with new control file location

   SQL> alter system set control_files='+DATA/ORCL/CONTROLFILE/current.256.787200593' scope=spfile;

6) Now shutdown the instance and startup in mount stage and check for the control file location
  
   SQL> shutdown immediate

   SQL> startup mount

   SQL> show parameter control_files

       NAME                                 TYPE        VALUE
     ------------------------------------ ----------- ------------------------------
     control_files                        string      +DATA/orcl/controlfile/curr
                                                      ent.256.787200593


Migrating the Datafiles from Non-ASM to ASM

1) Keep the database is in mount stage

2) Use RMAN "BACKUP AS COPY" method to migrate the datafiles from filesystem to ASM

   [oracle@coltdb04 ~]$  rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Fri Jun 14 16:35:39 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL (DBID=1345860456)
                                            
   RMAN> BACKUP AS COPY DATABASE FORMAT '+DATA';

3)  Switch the database to the copy created using the following RMAN command

   RMAN> SWITCH DATABASE TO COPY;

   datafile 1 switched to datafile copy "+DATA/orcl/datafile/system.258.787201633"
   datafile 2 switched to datafile copy "+DATA/orcl/datafile/sysaux.257.787201553"
   datafile 3 switched to datafile copy "+DATA/orcl/datafile/undotbs1.259.787201713"
   datafile 4 switched to datafile copy "+DATA/orcl/datafile/users.261.787201725"

4) Migrate the tempfile to ASM using RMAN

run
{
set newname for tempfile '/opt/oracle/oradata/orcl/temp01.dbf' to '+DATA';
switch tempfile all;
}

   executing command: SET NEWNAME

   using target database control file instead of recovery catalog

   renamed tempfile 1 to +DATA in control file

5) Now open the Database

   RMAN> ALTER DATABASE OPEN;

   database opened

6) You can now check the datafiles created in ASM
  
   SQL> select FILE_NAME from dba_data_files;

   FILE_NAME
   --------------------------------------------------------------------------------
   +DATA/orcl/datafile/users.261.787201725
   +DATA/orcl/datafile/undotbs1.259.787201713
   +DATA/orcl/datafile/sysaux.257.787201553
   +DATA/orcl/datafile/system.258.787201633


Migrating the Redo log files from Non-ASM to ASM

1) Identify the currently available redo log files using the following command

   SQL> SELECT a.group#, b.member, a.status FROM v$log a, v$logfile b WHERE a.group#=b.group#;

    GROUP#           MEMBER                STATUS
   ----------       ---------              -----------
  
        3    /opt/oracle/oradata/orcl/redo03.log INACTIVE

        2    /opt/oracle/oradata/orcl/redo02.log CURRENT

        1    /opt/oracle/oradata/orcl/ INACTIVE

2) Add the new logfiles to ASM using following command

   ALTER DATABASE ADD LOGFILE MEMBER '+DATA' TO GROUP 1; 
   ALTER DATABASE ADD LOGFILE MEMBER '+DATA' TO GROUP 2;
   ALTER DATABASE ADD LOGFILE MEMBER '+DATA' TO GROUP 3;

3) Now drop the old logfiles, A redo log member can only be dropped after being archived and being in INACTIVE mode. If needed, switch logfile multiple times until the logfile is ready for dropping.

   ALTER DATABASE DROP LOGFILE MEMBER '/opt/oracle/oradata/orcl/redo01.log';
   ALTER SYSTEM SWITCH LOGFILE;
   ALTER DATABASE DROP LOGFILE MEMBER '/opt/oracle/oradata/orcl/redo02.log';
   ALTER SYSTEM SWITCH LOGFILE;
   ALTER DATABASE DROP LOGFILE MEMBER '/opt/oracle/oradata/orcl/redo03.log';

4) You can check the logfiles created now in ASM

     GROUP#           MEMBER                STATUS
   ----------       ---------              -----------
         1    +DATA/orcl/onlinelog/group_1.264.787205393   CURRENT

         2    +DATA/orcl/onlinelog/group_2.265.787205405   INACTIVE

         3    +DATA/orcl/onlinelog/group_3.266.787205417   INACTIVE



Now your database is migrated to ASM

SQL> select file_name from dba_data_files;

FILE_NAME
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+DATA/orcl/datafile/users.263.818092087
+DATA/orcl/datafile/undotbs1.260.818092069
+DATA/orcl/datafile/sysaux.259.818092043
+DATA/orcl/datafile/system.258.818092009
+DATA/orcl/datafile/example.261.818092077