Sunday, March 15, 2015

How to enable Export PDF option in APEX 4.0

STEPS: How to enable Export PDF option in APEX 4.0

Required Software’s: OC4J, JDK 5.0 and Apache FOP war file
(Note – All above software’s are free to use and doesn’t require any license)

Download Links:
FOP.war – It can be found in APEX software directory (apex_install_directory/utlities/fop)

STEPS:
1.       Install and configure JDK as per wizard instructions.

2.       Installation & configuration of OC4J
a.       Unzip oc4j_extended_101350.zip to desired location, it will be the ORACLE_HOME
b.      Open Command Prompt
c.       SET JAVA_HOME environment variable with JDK installation path
d.      SET ORACLE_HOME with unzipped OC4J software directory
e.      Change directory to  “OC4J-unzipped-location\j2ee\home\config”
f.        Edit server.xml and replace 1024 to 256
name="javac" in-process="false" options="-J-Xmx1024m -encoding UTF8"
g.       Change directory to “j2ee\home”, or simply execute cd ..
h.      Run "C:\Program Files (x86)\Java\jdk1.5.0\bin\java" -jar oc4j.jar
It will ask for password of OC4JADMIN and will start OC4J instance
i.         Check if OC4J is running or not by logging into EM Console, using your OC4JADMIN account with the password you set while configuring the OC4J server.

3.       Deploy FOP.war file on OC4J application server. Follow below link
“5. Installing and Configuring Apache FOP” -> “Step 1: Installing the WAR file”

4.       Go to APEX Administration Control-> Instance Settings-> Report Printing and follow below screenshot to set hostname of the OC4J Server and configured port. Default port is 8888


Reference Screenshot:
5.       Grant necessary privileges to database user by executing below script according to your APEX version. Strictly follow the naming convention of database users as per your APEX version before running the script as you may need to replace highlighted text.
FLOWS_XXXXXX for versions 3.0.1 through 3.1.2
APEX_XXXXXX for 3.2 and above

Reference Metalink Note ID - 745695.1 (Visit http://metalink.oracle.com)

DECLARE 
ACL_PATH VARCHAR2(4000);
 
ACL_ID RAW(16);
 
BEGIN
 
-- Look for the ACL currently assigned to '*' and give FLOWS_030100
 
-- the "connect" privilege if FLOWS_030100 does not have the privilege yet.
 

SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
 
WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
 

-- Before checking the privilege, make sure that the ACL is valid
 
-- (for example, does not contain stale references to dropped users).
 
-- If it does, the following exception will be raised:
 
--
 
-- ORA-44416: Invalid ACL: Unresolved principal 'FLOWS_030100'
 
-- ORA-06512: at "XDB.DBMS_XDBZ", line ...
 
--
 
SELECT SYS_OP_R2O(extractValue(P.RES, '/Resource/XMLRef')) INTO ACL_ID
 FROM XDB.XDB$ACL A, PATH_VIEW P WHERE extractValue(P.RES, '/Resource/XMLRef') = REF(A) AND 
EQUALS_PATH(P.RES, ACL_PATH) = 1;
 

DBMS_XDBZ.ValidateACL(ACL_ID);
 
IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'FLOWS_030100',
 
'connect') IS NULL THEN
 DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH, 
'FLOWS_030100', TRUE, 'connect');
 
END IF;
 

EXCEPTION
 
-- When no ACL has been assigned to '*'.
 
WHEN NO_DATA_FOUND THEN
 
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml',
 
'ACL that lets power users to connect to everywhere',
 
'FLOWS_030100', TRUE, 'connect');
 
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
 
END;
 
/
 
COMMIT;

6.       To test, create a Classic report and use “Print Server” option

Friday, December 19, 2014

Troubleshooting of Oracle Dataguard

Troubleshooting of Standby Database

There are many times when we need to troubleshoot dataguard status and we want to know if standby databases are in SYNC or not.

Below are few SQL queries which are very useful to troubleshoot any problem with log archives which needs to be applied to standby database

set pages 200
set feedback off
set heading on
Select ('Database named '||name||' is '||open_mode||' and is in '||database_role||' role') as "DATABASE_INFO" from v$database;


set heading off
select ' ' from dual;
select '#################### RECOVERY_INFO ###################' from dual;
set feedback off
set heading on
col host_name for a20
Set lin 135
Select distinct i.instance_name, i.host_name, r.inst_id, r.recovery_mode from gv$archive_dest_status r, gv$instance I where i.inst_id=r.inst_id and r.recovery_mode <> 'IDEL';


set heading off
set feedback off
select ' ' from dual;
select '#################### GAP_INFO ######################' from dual;
set feedback off
set heading on
select process, client_process, status, thread#, sequence# from gv$managed_standby where thread#<>0 and process like 'MRP%';


set heading off
set feedback off
select ' ' from dual;
select '################### LOG_APPLY_INFO ###################' from dual;
set heading on
set feedback off
Select thread#, max(sequence#), applied from v$archived_log where applied = 'YES' group by thread#, applied;


set heading off
set feedback off
select ' ' from dual;
Set feedback off
Set heading off
select '---------------------------------------------------------------------------------' from dual;
Select 'Please apply the log sequence '||sequence#||' of thread '||thread#||'.' from gv$managed_standby where thread#<>0 and status like 'WAIT%';
Select 'MRP0 is '||status||' successfully' from gv$managed_standby where thread#<>0 and status like 'APPL%';
select '---------------------------------------------------------------------------------' from dual;
select 'Archive log sequence '||sequence#||' is not yet archived on primary side also.' from v$archived_log where thread#=(select thread# from v$managed_standby where status like 'WAIT%') and sequence#=(select sequence# from v$managed_standby where status like 'WAIT%');
select 'Archive log sequence '||sequence#||' is not yet archived on primary side also.' from v$archived_log where thread#=(select thread# from v$managed_standby where status like 'WAIT%') and archived='NO';
select ' ' from dual;
select '-----Storage Info----' from dual;


set lin 140
set pages 200
set heading off
set feedbac off
set echo off

Select 'INFO 1: The standby destination '||name||' is of '||round((Total_mb/1024), 0)||' GB, among this '||round((Free_mb/1024), 0)||' GB is free and '||round(((((Total_mb/1024)-(Free_mb/1024))/(Total_mb/1024))*100), 0)||'% is used.' from v$asm_diskgroup where name=(select trim('+' from value) from v$parameter where name='standby_archive_dest');

Select 'INFO 2: Storage if fine.' From v$asm_diskgroup where name=(select trim('+' from value) from v$parameter where name='standby_archive_dest') and free_mb>((Total_mb/100)*8);

Select 'INFO 2: WARNING: Storage has only '||round(100-((((Total_mb/1024)-(Free_mb/1024))/(Total_mb/1024))*100), 0)||'% Percentage free space.' From v$asm_diskgroup where name=(select trim('+' from value) from v$parameter where name='standby_archive_dest') and free_mb<((Total_mb/100)*8);

Select 'INFO 2: CRITICAL: Space need to be freed from storage because standby destination is 100% full.' From v$asm_diskgroup where name=(select trim('+' from value) from v$parameter where name='standby_archive_dest') and total_mb=(total_mb-free_mb);


Set lin 80
Set pages 20000
Set heading off
Set feedback off
Set echo off
!rm create_space_standby.rcv
!rm create_space_standby.sql
select 'NOTE: System is About to create Rman rcv file "create_space_standby.rcv".' from dual;
Spool create_space_standby.rcv
Select 'run {' from dual;
Select 'crosscheck archivelog all;' from dual;
select 'delete noprompt archivelog sequence between '||min(sequence#)||' and '||max(sequence#)||' thread '||thread#||';' from v$archived_log where applied='YES' and deleted='NO' group by thread#, applied, deleted;
select '}' from dual;
select 'exit' from dual;


spool off
set lin 140
select 'Rman will automatically start creating the space if archive destination usage is above 50%.' From v$asm_diskgroup where name=(select trim('+' from value) from v$parameter where name='standby_archive_dest') and free_mb<((total_mb/100)*50);


set heading off
set feedback off
set echo off
alter session set nls_date_format='ddmmyyyy_HHMI';
spool create_space_standby.sql
select '!rman target / cmdfile create_space_standby.rcv log Log_standby_purge_'||sysdate||'.log' From v$asm_diskgroup where name=(select trim('+' from value) from v$parameter where name='standby_archive_dest') and free_mb<((total_mb/100)*50);
spool off
@create_space_standby.sql
select ' To manually create space in Standby destination execute latest RMAN file create_space_standby.rcv' from v$asm_diskgroup where name=(select trim('+' from value) from v$parameter where name='standby_archive_dest') and total_mb=(total_mb-free_mb);
select ' To manually create space in Standby destination execute latest RMAN file create_space_standby.rcv' from v$asm_diskgroup where name=(select trim('+' from value) from v$parameter where name='standby_archive_dest') and free_mb<((Total_mb/100)*8);


set feedback off
set heading on
col name for a10
PROMPT ***** Disk Group Details under ASM control ****
select NAME , TYPE, TOTAL_MB, FREE_MB, round(FREE_MB/TOTAL_MB * 100,1) PCT_FREE,BLOCK_SIZE, SECTOR_SIZe, OFFLINE_DISKS, STATE from v$asm_diskgroup;
set feedback on



###############################
# BACKUP_INFO
###############################
set feedback off
ALTER SESSION SET NLS_DATE_FORMAT='yyyymmdd HH:MI';
Set pages 5000
Set lin 135
Col tag for a10
Col COMPRESSED for a11
Col DEVICE_TYPE for a12
Set feedback off
set heading off
set verify off
Select '-----Tags--------' from dual;
Select distinct tag from V$BACKUP_PIECE_DETAILS where tag like 'ARCH%' or tag like '%LEV1' or tag like '%LEV0' or tag like 'CNTR%' or tag like 'SP%';
Select ' ' from dual;
Select ' ' from dual;
Select '--------PLEASE CHOOSE Tag FROM ABOVE:-------' from dual;
Select ' ' from dual;
set heading on
col Media for a10
col START_TIME for a14
col COMPLETION_TIME for a14
set lin 140
select BS_KEY, DEVICE_TYPE, nvl(media,'---X---') as "Media" , TAG, STATUS status, START_TIME, COMPLETION_TIME, round((ELAPSED_SECONDS/60/60), 0) Hours, round((bytes/1024/1024/1024), 0) as "GB", COMPRESSED, DELETED from V$BACKUP_PIECE_DETAILS where tag=upper('&Tag') and deleted='NO' order by device_type, COMPLETION_TIME, deleted;
set heading off
Select ' ' from dual;
select '-------BACKUP INFO FOR L0, L1, AO BACKUPS-------' from dual;
select ' Last Level0 backup is completed on "'||completion_time||'.' from V$BACKUP_PIECE_DETAILS where BS_KEY=(select max(BS_KEY) from V$BACKUP_PIECE_DETAILS where tag='DB_LEV0');
Select ' ' from dual;
select ' Last Level1 backup is completed on "'||completion_time||'.' from V$BACKUP_PIECE_DETAILS where BS_KEY=(select max(BS_KEY) from V$BACKUP_PIECE_DETAILS where tag='DB_LEV1');
Select ' ' from dual;
select ' Last ARCHIVE Only backup is completed on "'||completion_time||'.' from V$BACKUP_PIECE_DETAILS where BS_KEY=(select max(BS_KEY) from V$BACKUP_PIECE_DETAILS where tag='ARCH_ONLY');
select ' ' from dual;
Select ' ' from dual;
select '>>>>>>>>This information is only for reference purpose.<<<<<<<<' from dual;
Select ' ' from dual;
select '>>>>>>>>FINISH<<<<<<<<<<' from dual;
set heading off
set feedback off
select ' ' from dual;
select '******************************' from dual;

How to change Hostname or IP address on Oracle Server

How to change Hostname or IP address on Oracle Server

Scenario:

You want to change Hostname or IP Address or DNS configuration on server where Oracle is running on ASM.
The steps have been written for an installation that splits the ownership of the “Grid Infrastructure” and the database between a user named ORAGRID and a user named ORADB respectively. Make sure you run below given commands from right user.

Environment:

Operating System – Redhat Enterprise Linux 6.4
Database Version – Oracle 11.2.0.4
ASM – Yes
Databases – 7 DB Instances

Step 1:
Check existing configured resources with Oracle home

[oragrid@litms#### ~]$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.ASMDATA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....ER.lsnr ora....er.type ONLINE    ONLINE    litm...-new
ora....DATA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....2FRA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....DATA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....4FRA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....DATA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....6FRA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....DATA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....8FRA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....DATA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....0FRA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....DATA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....1FRA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....DATA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....2FRA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora.asm        ora.asm.type   ONLINE    ONLINE    litm...-new
ora.cssd       ora.cssd.type  ONLINE    ONLINE    litm...-new
ora.diskmon    ora....on.type OFFLINE   OFFLINE
ora.evmd       ora.evm.type   ONLINE    ONLINE    litm...-new
ora.ons        ora.ons.type   OFFLINE   OFFLINE
ora.rpst02.db  ora....se.type ONLINE    ONLINE    litm...-new

Step 2:
Before start with the Oracle Restart process you must stop the listener:

[oragrid@litms#### ~]$ lsnrctl stop listener
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 19-DEC-2014 09:50:57
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
The command completed successfully

Step 3:
Confirm if listener is stopped

[oragrid@litms#### ~]$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.ASMDATA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....ER.lsnr ora....er.type OFFLINE   OFFLINE
ora....DATA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....2FRA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....DATA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....4FRA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....DATA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....6FRA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....DATA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....8FRA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....DATA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....0FRA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....DATA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....1FRA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....DATA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora....2FRA.dg ora....up.type ONLINE    ONLINE    litm...-new
ora.asm        ora.asm.type   ONLINE    ONLINE    litm...-new
ora.cssd       ora.cssd.type  ONLINE    ONLINE    litm...-new
ora.diskmon    ora....on.type OFFLINE   OFFLINE
ora.evmd       ora.evm.type   ONLINE    ONLINE    litm...-new
ora.ons        ora.ons.type   OFFLINE   OFFLINE
ora.rpst02.db  ora....se.type ONLINE    ONLINE    litm...-new

Step 4:
Login as ROOT
Set ORACLE_HOME as grid home
Execute below command to remove the existing oracle grid infra configuration.

[root@litms#### ~]# $ORACLE_HOME/perl/bin/perl -I $ORACLE_HOME/perl/lib -I $ORACLE_HOME/crs/install $ORACLE_HOME/crs/install/roothas.pl -deconfig
Using configuration parameter file: /u01/app/grid/product/11.2.0.4/crs/install/crsconfig_params
CRS resources for listeners are still configured
PRKO-2573 : ONS daemon is already stopped.
CRS-2529: Unable to act on 'ora.cssd' because that would require stopping or relocating 'ora.asm', but the force option was not specified
CRS-4000: Command Stop failed, or completed with errors.
CRS-2586: Deletion of a running resource 'ora.cssd' requires the force option
CRS-4000: Command Delete failed, or completed with errors.
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'litmsj614-new'
CRS-2673: Attempting to stop 'ora.ASMDATA.dg' on 'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST04DATA.dg' on 'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST04FRA.dg' on 'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST06DATA.dg' on 'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST06FRA.dg' on 'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST08DATA.dg' on 'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST08FRA.dg' on 'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST10DATA.dg' on 'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST10FRA.dg' on 'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST11DATA.dg' on 'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST11FRA.dg' on 'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST12DATA.dg' on 'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST12FRA.dg' on 'litmsj614-new'
CRS-2673: Attempting to stop 'ora.rpst02.db' on 'litmsj614-new'
CRS-2677: Stop of 'ora.RPST11FRA.dg' on 'litmsj614-new' succeeded
CRS-2677: Stop of 'ora.RPST11DATA.dg' on 'litmsj614-new' succeeded
CRS-2677: Stop of 'ora.ASMDATA.dg' on 'litmsj614-new' succeeded
CRS-2677: Stop of 'ora.rpst02.db' on 'litmsj614-new' succeeded
CRS-2673: Attempting to stop 'ora.RPST02DATA.dg' on 'litmsj614-new'
CRS-2673: Attempting to stop 'ora.RPST02FRA.dg' on 'litmsj614-new'
CRS-2677: Stop of 'ora.RPST02FRA.dg' on 'litmsj614-new' succeeded
CRS-5017: The resource action "ora.RPST12DATA.dg stop" encountered the following error:
ORA-01013: user requested cancel of current operation
. For details refer to "(:CLSN00108:)" in "/u01/app/grid/product/11.2.0.4/log/litmsj614-new/agent/ohasd/oraagent_oragrid/oraagent_oragrid.log".
CRS-5017: The resource action "ora.RPST10FRA.dg stop" encountered the following error:
ORA-01013: user requested cancel of current operation
. For details refer to "(:CLSN00108:)" in "/u01/app/grid/product/11.2.0.4/log/litmsj614-new/agent/ohasd/oraagent_oragrid/oraagent_oragrid.log".
CRS-5017: The resource action "ora.RPST12FRA.dg stop" encountered the following error:
ORA-01013: user requested cancel of current operation
. For details refer to "(:CLSN00108:)" in "/u01/app/grid/product/11.2.0.4/log/litmsj614-new/agent/ohasd/oraagent_oragrid/oraagent_oragrid.log".
CRS-5022: Stop of resource "ora.RPST10DATA.dg" failed: current state is "UNKNOWN"
CRS-2675: Stop of 'ora.RPST10DATA.dg' on 'litmsj614-new' failed
CRS-2679: Attempting to clean 'ora.RPST10DATA.dg' on 'litmsj614-new'
CRS-5022: Stop of resource "ora.RPST04DATA.dg" failed: current state is "UNKNOWN"
CRS-2675: Stop of 'ora.RPST04DATA.dg' on 'litmsj614-new' failed
CRS-2679: Attempting to clean 'ora.RPST04DATA.dg' on 'litmsj614-new'
CRS-5022: Stop of resource "ora.RPST06DATA.dg" failed: current state is "UNKNOWN"
CRS-2675: Stop of 'ora.RPST06DATA.dg' on 'litmsj614-new' failed
CRS-2679: Attempting to clean 'ora.RPST06DATA.dg' on 'litmsj614-new'
CRS-5022: Stop of resource "ora.RPST04FRA.dg" failed: current state is "UNKNOWN"
CRS-2675: Stop of 'ora.RPST04FRA.dg' on 'litmsj614-new' failed
CRS-2679: Attempting to clean 'ora.RPST04FRA.dg' on 'litmsj614-new'
CRS-5022: Stop of resource "ora.RPST06FRA.dg" failed: current state is "UNKNOWN"
CRS-2675: Stop of 'ora.RPST06FRA.dg' on 'litmsj614-new' failed
CRS-2679: Attempting to clean 'ora.RPST06FRA.dg' on 'litmsj614-new'
CRS-5022: Stop of resource "ora.RPST08FRA.dg" failed: current state is "UNKNOWN"
CRS-2675: Stop of 'ora.RPST08FRA.dg' on 'litmsj614-new' failed
CRS-2679: Attempting to clean 'ora.RPST08FRA.dg' on 'litmsj614-new'
CRS-5022: Stop of resource "ora.RPST08DATA.dg" failed: current state is "UNKNOWN"
CRS-2675: Stop of 'ora.RPST08DATA.dg' on 'litmsj614-new' failed
CRS-2679: Attempting to clean 'ora.RPST08DATA.dg' on 'litmsj614-new'
CRS-2681: Clean of 'ora.RPST10DATA.dg' on 'litmsj614-new' succeeded
CRS-2681: Clean of 'ora.RPST04DATA.dg' on 'litmsj614-new' succeeded
CRS-2681: Clean of 'ora.RPST06DATA.dg' on 'litmsj614-new' succeeded
CRS-2681: Clean of 'ora.RPST04FRA.dg' on 'litmsj614-new' succeeded
CRS-2681: Clean of 'ora.RPST06FRA.dg' on 'litmsj614-new' succeeded
CRS-2681: Clean of 'ora.RPST08DATA.dg' on 'litmsj614-new' succeeded
CRS-2681: Clean of 'ora.RPST08FRA.dg' on 'litmsj614-new' succeeded
CRS-2675: Stop of 'ora.RPST10FRA.dg' on 'litmsj614-new' failed
CRS-2679: Attempting to clean 'ora.RPST10FRA.dg' on 'litmsj614-new'
CRS-2675: Stop of 'ora.RPST12FRA.dg' on 'litmsj614-new' failed
CRS-2679: Attempting to clean 'ora.RPST12FRA.dg' on 'litmsj614-new'
CRS-2675: Stop of 'ora.RPST12DATA.dg' on 'litmsj614-new' failed
CRS-2679: Attempting to clean 'ora.RPST12DATA.dg' on 'litmsj614-new'
CRS-2681: Clean of 'ora.RPST12FRA.dg' on 'litmsj614-new' succeeded
CRS-2681: Clean of 'ora.RPST12DATA.dg' on 'litmsj614-new' succeeded
CRS-2681: Clean of 'ora.RPST10FRA.dg' on 'litmsj614-new' succeeded
CRS-2677: Stop of 'ora.RPST02DATA.dg' on 'litmsj614-new' succeeded
CRS-2679: Attempting to clean 'ora.RPST02DATA.dg' on 'litmsj614-new'
CRS-2681: Clean of 'ora.RPST02DATA.dg' on 'litmsj614-new' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'litmsj614-new'
CRS-2675: Stop of 'ora.asm' on 'litmsj614-new' failed
CRS-2679: Attempting to clean 'ora.asm' on 'litmsj614-new'
CRS-2681: Clean of 'ora.asm' on 'litmsj614-new' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'litmsj614-new'
CRS-2677: Stop of 'ora.cssd' on 'litmsj614-new' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'litmsj614-new'
CRS-2677: Stop of 'ora.evmd' on 'litmsj614-new' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'litmsj614-new' has completed
CRS-4133: Oracle High Availability Services has been stopped.

Can't exec "/usr/bin/lsb_release": No such file or directory at /u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 542.
Use of uninitialized value $LSB_RELEASE in split at /u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 547.
Can't exec "/usr/bin/lsb_release": No such file or directory at /u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 542.
Use of uninitialized value $LSB_RELEASE in split at /u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 547.
Can't exec "/usr/bin/lsb_release": No such file or directory at /u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 542.
Use of uninitialized value $LSB_RELEASE in split at /u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 547.
Can't exec "/usr/bin/lsb_release": No such file or directory at /u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 542.
Use of uninitialized value $LSB_RELEASE in split at /u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 547.
Can't exec "/usr/bin/lsb_release": No such file or directory at /u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 542.
Use of uninitialized value $LSB_RELEASE in split at /u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 547.
Can't exec "/usr/bin/lsb_release": No such file or directory at /u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 542.
Use of uninitialized value $LSB_RELEASE in split at /u01/app/grid/product/11.2.0.4/lib/osds_acfslib.pm line 547.
Successfully deconfigured Oracle Restart stack

Step 5:
After removing oracle configuration you can change the hostname of your Server

Edit /etc/sysconfig/network file

NETWORKING=yes
HOSTNAME=<New Hostname>

Edit /etc/hosts file

cat /etc/hosts
127.0.0.1         localhost localhost.localdomain localhost4 localhost4.localdomain4
::1               localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.50.4    <New Hostname>

Edit network adapters IP Address configuration i.e. ifcfg-ethX

[root@### ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
HWADDR="##:##:4C:02:A3:02"
ONBOOT="yes"
IPADDR=<New IP Address>
NETMASK=255.255.255.0
GATEWAY=192.168.50.1

Step 6:
Edit Listener.ora file with new Hostname

Step 7:
Login as ROOT
Set ORACLE_HOME as grid home.
Execute below command to recreate grid infra configuration:

[root@litms####~]# $ORACLE_HOME/perl/bin/perl -I $ORACLE_HOME/perl/lib -I $ORACLE_HOME/crs/install $ORACLE_HOME/crs/install/roothas.pl
Using configuration parameter file: /u01/app/grid/product/11.2.0.4/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user 'oragrid', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node litmsj614 successfully pinned.
Adding Clusterware entries to upstart
litmsj614     2014/12/19 10:51:46     /u01/app/grid/product/11.2.0.4/cdata/litmsj614/backup_20141219_105146.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server

Step 8:
Add Listener  and start it
[oragrid@litms### ~]$ srvctl add listener
[oragrid@litms#### ~]$ srvctl start listener

Step 9:
Create ASM and add Disks, and mount all diskgroups manually

[oragrid@litms#### disks]$ srvctl add asm -d '/dev/oracleasm/disks/*'
[oragrid@litms#### disks]$ srvctl start asm
[oragrid@litmsj614 disks]$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.4.0 Production on Fri Dec 19 10:58:39 2014
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Automatic Storage Management option
SQL> alter diskgroup rpst02data mount;
SQL> alter diskgroup rpst04data mount;
SQL> alter diskgroup rpst06data mount;
SQL> alter diskgroup rpst08data mount;
SQL> alter diskgroup rpst10data mount;
SQL> alter diskgroup rpst12data mount;
SQL> alter diskgroup rpst11data mount;
alter diskgroup rpst02fra mount;
alter diskgroup rpst04fra mount;
alter diskgroup rpst06fra mount;
alter diskgroup rpst08fra mount;
alter diskgroup rpst10fra mount;
alter diskgroup rpst12fra mount;
alter diskgroup rpst11fra mount;

Check Status of all mounted diskgroup, like below:

[oragrid@litms#### disks]$ srvctl status diskgroup -g rpst02data
Disk Group rpst02data is running on litmsj614

Step 10:
Configure all databases with SRVCTL (Oracle Restart), Configure and Start your database:

[oragrid@litms#### disks]$ srvctl add database -d RPST02 -o $ORACLE_HOME -n RPST02 -p +rpst02data/rpst02/parameterfile/spfile.279.850066205 -a RPST02DATA,RPST02FRA

[oragrid@litms#### disks]$ srvctl config database -d DB11G
Database unique name: RPST02
Database name: RPST02
Oracle home: /u01/app/grid/product/11.2.0.4
Oracle user: oragrid
Spfile: +rpst02data/rpst02/parameterfile/spfile.279.850066205a
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Database instance: RPST02
Disk Groups: RPST02DATA,RPST02FRA
Services:

[oragrid@litms#### disks]$  srvctl start database -d DB11G