Monday, October 12, 2020

How can check previous databases in Oracle through command line

Open a command window.

Configure the operating system environment variables.

Ensure that the environment variables ORACLE_HOME and ORACLE_SID are set properly. The commands to use to set these environment variables depend on the shell you use to interface with the operating system. For example:


(bash or ksh) export ORACLE_SID=orcl

(csh or tcsh) setenv ORACLE_SID orcl


You can set these with the scripts coraenv (for the C shell) and oraenv (for other shells). These scripts are typically located in the /usr/local/bin directory.


Ensure that the $ORACLE_HOME/bin directory is in your PATH environment variable.


You can also edit the profile file for your default shell in the home directory of the software owner, for example /home/oracle, so that these environment variables are set every time you log in as that user.


Start SQL*Plus using a command in the following format:

sqlplus {username | /} [as sysdba]

An example of this command is:


$ sqlplus / AS SYSDBA

Enter password: password

For username, you can use the SYS or SYSTEM administrative users. At the prompt, enter the password that you set up during installation. If you use the SYS user, you must include AS SYSDBA after the username.


SQL*Plus connects you to the default database instance (Microsoft Windows) or the database instance specified by environment variables (Linux and UNIX).

Saturday, October 10, 2020

To check Lock on object

 col object_name for a30

col program for a30

col process for a10

col action for a35

set lines 200 pages 300

select p.spid, s.action,s.process, lo.locked_mode , sid, s.serial#, s.LAST_CALL_ET/60, do.object_name,s.status

from  V$session s, V$process p, V$locked_object lo, dba_objects do

  where

  s.paddr = p.addr

  and s.sid=lo.session_id

  and lo.object_id = do.object_id

  and do.object_name in ('OE_ORDER_LINES_ALL','OE_ORDER_HEADERS_ALL')

  and s.LAST_CALL_ET/60 >15


SELECT b.session_id AS sid,

NVL(b.oracle_username, '(oracle)') AS username,

a.owner AS object_owner,

a.object_name,

Decode(b.locked_mode, 0, 'None',

1, 'Null (NULL)',

2, 'Row-S (SS)',

3, 'Row-X (SX)',

4, 'Share (S)',

5, 'S/Row-X (SSX)',

6, 'Exclusive (X)',

b.locked_mode) locked_mode,

b.os_user_name

FROM dba_objects a,

v$locked_object b

WHERE a.object_id = b.object_id

and a.object_name = 'WSH_NEW_DELIVERIES'

ORDER BY 1, 2, 3, 4;


To get Program name for session waiting on Wait event

 set pagesize 24 linesize 200 echo off feedback 1 wrap on verify off

column reqid format 9999999999 heading "Request Id"

column sesid format a10 heading "Session"

column ospid format a10 heading "OS Pid"

column USER_CONCURRENT_PROGRAM_NAME format a45 heading "Program Name"

column user_name format a20 heading "Requestor"

select

   a.request_id reqid,a.status_code,a.phase_code,e.USER_CONCURRENT_PROGRAM_NAME,f.user_name,

   d.sid||','||d.serial# sesid,c.spid ospid,d.event

from

   applsys.fnd_concurrent_requests a,

   applsys.fnd_concurrent_processes b,

   v$process c, v$session d,

   apps.fnd_concurrent_programs_tl e,

   apps.fnd_user f

where

   a.controlling_manager=b.concurrent_process_id

   and c.spid=a.oracle_process_id

   and c.addr=d.paddr

   and e.concurrent_program_id=a.concurrent_program_id

   and a.requested_by = f.user_id

   and d.sid in (select sid from v$session where event like '%&event%')

   and a.phase_code='R'

   and b.instance_number=(select instance_number from v$instance)

   and e.language=USERENV('LANG');


Temp usage by sessions

SELECT   S.sid || ',' || S.serial# sid_serial, S.username, S.osuser, P.spid, S.module,

S.program, SUM (T.blocks) * TBS.block_size / 1024 / 1024 mb_used, T.tablespace,

COUNT(*) sort_ops

FROM   v$sort_usage T, v$session S, dba_tablespaces TBS, v$process P

WHERE  T.session_addr = S.saddr

AND  S.paddr = P.addr

AND   T.tablespace = TBS.tablespace_name

GROUP BY S.sid, S.serial#, S.username, S.osuser, P.spid, S.module,

 S.program, TBS.block_size, T.tablespace having (SUM (T.blocks) * TBS.block_size / 1024 / 1024) > 5000

ORDER BY sid_serial;


checking responsibility of user

 select distinct frtl.responsibility_name,fu.user_name,fu.user_id,furgd.start_date Resp_start,furgd.end_date resp_end,fu.start_date USER_start,fu.end_date USER_end
from
apps.fnd_user fu,
apps.fnd_responsibility_tl frtl,
apps.fnd_user_resp_groups_direct furgd
where
fu.user_id=furgd.user_id and
frtl.responsibility_id=furgd.responsibility_id and
fu.user_name='&User'
and frtl.language='US'
and furgd.end_date is null order by 1;

TO CHECK THE USER PRIVILIGES

 select
lpad(' ', 2*level) || granted_role "User, his roles and privileges"
from
(
/* THE USERS */
select
null grantee,
username granted_role
from
dba_users
where
username like upper('&username')
/* THE ROLES TO ROLES RELATIONS */
union
select
grantee,
granted_role
from
dba_role_privs
/* THE ROLES TO PRIVILEGE RELATIONS */
union
select
grantee,
privilege
from
dba_sys_privs
)
start with grantee is null
connect by grantee = prior granted_role;

To check the locks


select SESSION_ID,OWNER,NAME,MODE_HELD from dba_ddl_locks  where NAME='&obj';  

select SESSION_ID,OWNER,NAME,MODE_HELD from dba_dml_locks  where NAME='&obj';


Find the CPU usage by session

select ss.username, se.SID, VALUE/100 cpu_usage_seconds from v$session ss, v$sesstat se, v$statname sn
where se.STATISTIC# = sn.STATISTIC#
and NAME like '%CPU used by this session%'
and se.SID = ss.SID
and ss.status='ACTIVE' and ss.username is not null
order by VALUE desc;

Check Oracle ACTIVE and INACTIVE Sessions

 Total Count of sessions


select count(s.status) TOTAL_SESSIONS
from gv$session s;


Total Count of Inactive sessions


select count(s.status) INACTIVE_SESSIONS
from gv$session s, v$process p
where
p.addr=s.paddr and
s.status=’INACTIVE’;


SESSIONS WHICH ARE IN INACTIVE STATUS FROM MORE THAN 1HOUR


select count(s.status) “INACTIVE SESSIONS > 1HOUR ”
from gv$session s, v$process p
where
p.addr=s.paddr and
s.last_call_et > 3600 and
s.status=’INACTIVE’;


COUNT OF ACTIVE SESSIONS


select count(s.status) ACTIVE_SESSIONS
from gv$session s, v$process p
where
p.addr=s.paddr and
s.status=’ACTIVE’;


TOTAL SESSIONS COUNT ORDERED BY PROGRAM


col program for a30
select s.program,count(s.program) Total_Sessions
from gv$session s, v$process p
where p.addr=s.paddr
group by s.program;


TOTAL COUNT OF SESSIONS ORDERED BY MODULE


col module for a30
prompt TOTAL SESSIONS
select s.module,count(s.sid) Total_Sessions
from gv$session s, v$process p
where p.addr=s.paddr
group by s.module;


TOTAL COUNT OF SESSIONS ORDERED BY ACTION


col action for a30
prompt TOTAL SESSIONS
select s.action,count(s.sid) Total_Sessions
from gv$session s, v$process p
where p.addr=s.paddr
group by s.action;


INACTIVE SESSIONS


prompt INACTIVE SESSIONS
select p.spid, s.sid,s.last_call_et/3600 last_call_et ,s.status,s.action,s.module,s.program
from gv$session s, v$process p
where
p.addr=s.paddr and
s.status=’INACTIVE’;


INACTIVE

prompt INACTIVE SESSIONS
select count(s.status) INACTIVE
from gv$session s, gv$sqlarea t,v$process p
where s.sql_address =t.address and
s.sql_hash_value =t.hash_value and
p.addr=s.paddr and
s.status=’INACTIVE’;


INACTIVE PROGRAMS


col module for a40
prompt INACTIVE SESSIONS
col INACTIVE_PROGRAMS FOR A40
select distinct (s.program) INACTIVE_PROGRAMS,s.module
from gv$session s, v$process p
where p.addr=s.paddr and
s.status=’INACTIVE’;


INACTIVE PROGRAMS with disk reads


prompt INACTIVE SESSIONS
select distinct (s.program) INACTIVE_PROGRAMS,SUM(T.DISK_READS)
from gv$session s, gv$sqlarea t,v$process p
where s.sql_address =t.address and
s.sql_hash_value =t.hash_value and
p.addr=s.paddr and
s.status=’INACTIVE’
GROUP BY S.PROGRAM;


INACTIVE SESSIONS COUNT WITH PROGRAM


col program for a30
prompt TOTAL INACTIVE SESSIONS
col INACTIVE_PROGRAMS FOR A40
select s.program,count(s.program) Total_Inactive_Sessions
from gv$session s,v$process p
where p.addr=s.paddr AND
s.status=’INACTIVE’
group by s.program
order by 2 desc;


TOTAL INACTIVE SESSIONS MORE THAN 1HOUR


col program for a30
col INACTIVE_PROGRAMS FOR A40
select s.program,count(s.program) Inactive_Sessions_from_1Hour
from gv$session s,v$process p
where p.addr=s.paddr AND
s.status=’INACTIVE’
and s.last_call_et > (3600)
group by s.program
order by 2 desc;


TOTAL INACTIVE SESSIONS GROUP BY MODULE

col program for a60
COL MODULE FOR A30
prompt TOTAL SESSIONS
col INACTIVE_PROGRAMS FOR A40
select s.module,count(s.module) Total_Inactive_Sessions
from gv$session s,v$process p
where p.addr=s.paddr AND
s.status=’INACTIVE’
group by s.module;


INACTIVE SESSION DETAILS MORE THAN 1 HOUR


set pagesize 40
col INST_ID for 99
col spid for a10
set linesize 150
col PROGRAM for a10
col action format a10
col logon_time format a16
col module format a13
col cli_process format a7
col cli_mach for a15
col status format a10
col username format a10
col last_call_et_Hrs for 9999.99
col sql_hash_value for 9999999999999col username for a10
set linesize 152
set pagesize 80
col “Last SQL” for a60
col elapsed_time for 999999999999
select p.spid, s.sid,s.last_call_et/3600 last_call_et_Hrs ,s.status,s.action,s.module,s.program,t.disk_reads,lpad(t.sql_text,30) “Last SQL”
from gv$session s, gv$sqlarea t,gv$process p
where s.sql_address =t.address and
s.sql_hash_value =t.hash_value and
p.addr=s.paddr and
s.status=’INACTIVE’
and s.last_call_et > (3600)
order by last_call_et;


INACTIVE PROGRAM –ANY–


select p.spid, s.sid,s.last_call_et/3600 last_call_et_Hrs ,s.status,s.action,s.module,s.program,t.disk_reads,lpad(t.sql_text,30) “Last SQL”
from gv$session s, gv$sqlarea t,gv$process p
where s.sql_address =t.address and
s.sql_hash_value =t.hash_value and
p.addr=s.paddr and
s.status=’INACTIVE’
And s.program=’&PROGRAM_NAME’
order by last_call_et;


INACTIVE MODULES –ANY–

select p.spid, s.sid,s.last_call_et/3600 last_call_et_Hrs ,s.status,s.action,s.module,s.program,t.disk_reads,lpad(t.sql_text,30) “Last SQL”
from gv$session s, gv$sqlarea t,gv$process p
where s.sql_address =t.address and
s.sql_hash_value =t.hash_value and
p.addr=s.paddr
And s.module like ‘%order_cleanup_hazmat_v3.sql’
order by last_call_et;


INACTIVE JDBC SESSIONS


set pagesize 40
col INST_ID for 99
col spid for a10
set linesize 150
col PROGRAM for a10
col action format a10
col logon_time format a16
col module format a13
col cli_process format a7
col cli_mach for a15
col status format a10
col username format a10
col last_call_et for 9999.99
col sql_hash_value for 9999999999999col username for a10
set linesize 152
set pagesize 80
col “Last SQL” for a60
col elapsed_time for 999999999999
select p.spid, s.sid,s.last_call_et/3600 last_call_et ,s.status,s.action,
s.module,s.program,t.disk_reads,lpad(t.sql_text,30) “Last SQL”
from gv$session s, gv$sqlarea t,gv$process p
where s.sql_address =t.address and
s.sql_hash_value =t.hash_value and
p.addr=s.paddr and
s.status=’INACTIVE’
and s.program=’JDBC Thin Client’
and s.last_call_et > 3600
order by last_call_et;


COUNT OF INACTIVE SESSIONS MORE THAN ONE HOUR


SELECT COUNT(P.SPID)
from gv$session s, gv$sqlarea t,gv$process p
where s.sql_address =t.address and
s.sql_hash_value =t.hash_value and
p.addr=s.paddr and
s.status='INACTIVE'
and s.program=’JDBC Thin Client’
and s.last_call_et > 3600
order by last_call_et;


FORMS TOTAL FORM SESSIONS


SELECT COUNT(S.SID) INACTIVE_FORM_SESSIONS FROM V$SESSION S
WHERE S.STATUS=’INACTIVE’ and
s.action like (‘%FRM%’);


FORMS SESSIONS DETAILS


col "Last SQL" for a30
select p.spid,s.sid,s.status,s.last_call_et/3600 last_call_et_hrs ,
s.sid,t.disk_reads, t.elapsed_time,lpad(t.sql_text,30) "Last SQL"
from gv$session s, gv$sqlarea t,gv$process p
where s.sql_address =t.address and
s.sql_hash_value =t.hash_value and
p.addr=s.paddr and
s.action like ('FRM%) and
s.last_call_et > 3600
order by spid;


col machine for a15
col “Last SQL” for a30
select p.spid,s.sid,s.status,s.last_call_et/3600 last_call_et_hrs ,
S.ACTION,s.process Client_Process,s.machine
from gv$session s, gv$sqlarea t,gv$process p
where s.sql_address =t.address and
s.sql_hash_value =t.hash_value and
p.addr=s.paddr and
s.action like ('FRM%') and
s.last_call_et > 3600;
order by 4;


INACTIVE FORMS SESSIONS DETAILS


col program for a15
col last_call_et for 999.99
select p.spid, s.sid, s.process,s.last_call_et/3600 last_call_et ,s.status,s.action,s.module,s.program,t.disk_reads,lpad(t.sql_text,30) “Last SQL”
from gv$session s, gv$sqlarea t,gv$process p
where s.sql_address =t.address and
s.sql_hash_value =t.hash_value and
p.addr=s.paddr and
s.status=’INACTIVE’
and s.action like 'FRM:%'
and s.last_call_et > 3600
order by last_call_et desc;


UNIQUE SPID


select unique(p.spid)
from gv$session s, gv$sqlarea t,gv$process p
where s.sql_address =t.address and
s.sql_hash_value =t.hash_value and
p.addr=s.paddr and
s.status=’INACTIVE’
and s.action like 'FRM:%'
and s.last_call_et > 3600;


COUNT FORMS


select COUNT(p.spid)
from gv$session s, gv$sqlarea t,gv$process p
where s.sql_address =t.address and
s.sql_hash_value =t.hash_value and
p.addr=s.paddr and
s.status=’INACTIVE’
and s.action like 'FRM:%'
and s.last_call_et > 3600;


ZERO HASH VALUE


select COUNT(p.spid)
from gv$session s,gv$process p
where
p.addr=s.paddr and
s.status=’INACTIVE’
and s.action like ‘FRM:%’
and s.last_call_et > 3600
AND S.SQL_HASH_VALUE=0;


INACTIVE FORM BY NAME


select count(s.sid) from v$session S
where s.action like ('%&ACTION%')
AND S.STATUS='INACTIVE';


GROUP BY ACTION


SELECT S.ACTION,COUNT(S.SID) FROM V$SESSION S
WHERE S.STATUS=’INACTIVE’ and
s.action like (‘%FRM%’)
group by s.action;


FROM A SPECIFIC USERNAME


SET LINSIZE 152
col spid for a10
col process_spid for a10
col user_name for a20
col form_name for a20
select a.pid,a.spid,a.process_spid, c.user_name,to_char(a.start_time,’DD-MON-YYYY HH24:MI:SS’) “START_TIME” ,
d.user_form_name “FORM_NAME”
from apps.fnd_logins a, apps.fnd_login_resp_forms b, apps.fnd_user c,
apps.fnd_form_tl d
where
a.login_id=b.login_id
and c.user_name like ‘JROMO’
and a.user_id=c.user_id
and trunc(b.start_time) >trunc(sysdate -11)
and trunc(b.end_time) is null
and b.form_id=d.form_id
and d.language=’US’;


INACTIVE FORM


set pagesize 40
col INST_ID for 99
col spid for a10
set linesize 150
col PROGRAM for a10
col action format a10
col logon_time format a16
col module format a13
col cli_process format a7
col cli_mach for a15
col status format a10
col username format a10
col last_call_et for 9999.99
col sql_hash_value for 9999999999999col username for a10
set linesize 152
set pagesize 80
col “Last SQL” for a30
col elapsed_time for 999999999999
select p.spid, s.sid,s.process cli_process,s.last_call_et/3600 last_call_et ,
s.status,s.action,s.module,s.program,t.disk_reads,lpad(t.sql_text,30) “Last SQL”
from gv$session s, gv$sqlarea t,gv$process p
where s.sql_address =t.address and
s.sql_hash_value =t.hash_value and
p.addr=s.paddr and
s.status=’INACTIVE’
and s.action like (‘FRM%’)
and s.last_call_et > (3600*3)
order by last_call_et;


INACTIVE FORM SESSIONS


col cli_proc for a9
COL AUDSID FOR A6
COL PID FOR A6
COL SID FOR A5
COL FORM_NAME FOR A25
COL USER_NAME FOR A15
col last_call_et for 9999.99
SELECT
— /*+ ORDERED FULL(fl) FULL(vp) USE_HASH(fl vp) */
( SELECT SUBSTR ( fu.user_name, 1, 20 )
FROM apps.fnd_user fu
WHERE fu.user_id = fl.user_id
) user_name,vs.status,
TO_CHAR ( fl.start_time, ‘DD-MON-YYYY HH24:MI’ ) login_start_time,
TO_CHAR ( fl.end_time, ‘DD-MON-YYYY HH24:MI’ ) login_end_time,
vs.last_call_et/3600 last_call_et,
SUBSTR ( fl.process_spid, 1, 6 ) spid,
SUBSTR ( vs.process, 1, 8 ) cli_proc,
SUBSTR ( TO_CHAR ( vs.sid ), 1, 3 ) sid,
SUBSTR ( TO_CHAR ( vs.serial#), 1, 7 ) serial#,
SUBSTR ( TO_CHAR ( rf.audsid ), 1, 6 ) audsid,
SUBSTR ( TO_CHAR ( fl.pid ), 1, 3 ) pid,
SUBSTR ( vs.module || ‘ – ‘ ||
( SELECT SUBSTR ( ft.user_form_name, 1, 40 )
FROM apps.fnd_form_tl ft
WHERE ft.application_id = rf.form_appl_id
AND ft.form_id = rf.form_id
AND ft.language = USERENV(‘LANG’)
), 1, 40 ) form_name
FROM apps.fnd_logins fl,
gv$process vp,
apps.fnd_login_resp_forms rf,
gv$session vs
WHERE fl.start_time > sysdate – 7 /* login within last 7 days */
AND fl.login_type = ‘FORM’
AND fl.process_spid = vp.spid
AND fl.pid = vp.pid
AND fl.login_id = rf.login_id
AND rf.end_time IS NULL
AND rf.audsid = vs.audsid
and vs.status=’INACTIVE’
ORDER BY
vs.process,
fl.process_spid;


ACTIVE


prompt ACTIVE SESSIONS
select count(s.status) ACTIVE
from gv$session s, gv$sqlarea t,v$process p
where s.sql_address =t.address and
s.sql_hash_value =t.hash_value and
p.addr=s.paddr and
s.status=’ACTIVE’;


MODULE


set pagesize 40
col INST_ID for 99
col spid for a10
set linesize 150
col PROGRAM for a10
col action format a10
col logon_time format a16
col module format a13
col cli_process format a7
col cli_mach for a15
col status format a10
col username format a10
col last_call_et for 9999.99
col sql_hash_value for 9999999999999col username for a10
set linesize 152
set pagesize 80
col “Last SQL” for a30
col elapsed_time for 999999999999
select p.spid, s.sid,s.process cli_process,s.last_call_et/3600 last_call_et ,
s.status,s.action,s.module,s.program,t.disk_reads,lpad(t.sql_text,30) “Last SQL”
from gv$session s, gv$sqlarea t,gv$process p
where s.sql_address =t.address and
s.sql_hash_value =t.hash_value and
p.addr=s.paddr
and s.MODULE like (‘&MODULE_NAME_1HR%’)
and s.last_call_et > (‘&TIME_HRS’ * 3600)
order by last_call_et;


select p.spid, s.sid,s.process cli_process,s.last_call_et/3600 last_call_et ,
s.status,s.action,s.module,s.program
from gv$session s, gv$sqlarea t,gv$process p
where s.sql_address =t.address and
p.addr=s.paddr
and s.MODULE like (‘%TOAD%’)
Order by last_call_et;


TOAD SESSIONS


select p.spid, s.sid,s.process cli_process,s.last_call_et/3600 last_call_et ,
s.status,s.action,s.module,s.program
from gv$session s, gv$process p
where
p.addr=s.paddr
and s.MODULE like (‘%TOAD%’)
Order by last_call_et;


CLIENT MACHINE SESSIONS COUNT


select count(s.process) TOTAL from v$session S
where s.machine like (‘%&CLIENT_MACHINE%’);
select count(s.process) INACTIVE from v$session S
where s.machine like (‘%&CLIENT_MACHINE%’)
and s.status=’INACTIVE’;


Hash value=0


select count(s.process) from v$session S
where s.machine like (‘%&CLIENT_MACHINE%’)
AND S.SQL_HASH_VALUE=0;
select count(s.process) from v$session S
where s.machine like (‘%&CLIENT_MACHINE%’)
AND S.SQL_HASH_VALUE=0
AND S.LAST_CALL_ET > 3600;


Unique Actions


col module for a40
prompt INACTIVE SESSIONS
col INACTIVE_PROGRAMS FOR A40
select distinct (s.program) INACTIVE_PROGRAMS,s.module
from gv$session s, gv$sqlarea t,v$process p
where s.sql_address =t.address and
s.sql_hash_value =t.hash_value and
s.machine like (‘%&CLIENT_MACHINE%’) AND
p.addr=s.paddr and
s.status='INACTIVE';


GROUP BY program


col program for a60
prompt TOTAL SESSIONS
col INACTIVE_PROGRAMS FOR A40
select s.program,count(s.program) Total_Inactive_Sessions
from gv$session s, gv$sqlarea t,v$process p
where s.sql_address =t.address and
s.sql_hash_value =t.hash_value and
p.addr=s.paddr AND
s.machine like (‘%&CLIENT_MACHINE%’) AND
s.status=’INACTIVE’
group by s.program;


Show the top 10 longest-active user sessions

 col osuser format a10 trunc

col LastCallET format 99,999
col sid format 9999
col spid formar 999999
col username format a10 trunc
col uprogram format a25 trunc
col machine format a10 trunc
set linesize 132
set verify off
select * from (
select to_char(s.logon_time, ‘mm/dd hh:mi:ssAM’) loggedon,
s.sid, s.status,
floor(last_call_et/60) “LastCallET”,
s.username, s.osuser,
p.spid, s.module || ‘ – ‘ || s.program uprogram,
s.machine, s.sql_hash_value
from v$session s, v$process p
where p.addr = s.paddr
and s.type = ‘USER’
and module is not null
and s.status = ‘ACTIVE’
order by 4 desc)
where rownum < 11;

Find and Clear INACTIVE SESSIONS

select 'alter system kill session '||' '||""||s.sid||','||s.serial# ||"' immediate;' FROM v$session s
WHERE s.type!= 'BACKGROUND'
AND S.TYPE='USER'
AND S.USERNAME='<SCHEMA NAME>'
AND TRUNC(S.LOGON_TIME) < '28-JUN-2018'
AND S.STATUS='INACTIVE'
— and last_call_et > 30 — more than 30 mins inactive 

To check INACTIVE sessions with HIGH DISK IO

 select p.spid,s.username, s.sid,s.status,t.disk_reads, s.last_call_et/3600 last_call_et_Hrs,s.action,s.program,s.machine cli_mach,s.process cli_process,lpad(t.sql_text,30) “Last SQL”
from gv$session s, gv$sqlarea t,v$process p
where s.sql_address =t.address and
s.sql_hash_value =t.hash_value and
p.addr=s.paddr and
t.disk_reads > 5000
and s.status=’INACTIVE’
and s.process=’1234′
order by S.PROGRAM;

Query to find out the Disk Group Details in RAC

Very Useful Oracle ASM query for day to day activities for Oracle database administrator

Conn as sqlplus / as sysasm
set lines 255
col path for a35
col Diskgroup for a15
col DiskName for a20
col disk# for 999
col total_mb for 999,999,999
col free_mb for 999,999,999
compute sum of total_mb on DiskGroup
compute sum of free_mb on DiskGroup
break on DiskGroup skip 1 on report
set pages 255
select a.name DiskGroup, b.disk_number Disk#, b.name DiskName, b.os_mb,b.total_mb, b.free_mb, b.path, b.header_status
from v$asm_disk b, v$asm_diskgroup a
where a.group_number (+) =b.group_number
order by b.group_number, b.disk_number, b.name
/

Query to find the session that is generating more Archives

 col program for a10

col username for a10

select to_char(sysdate,’hh24:mi’), username, program , a.sid, a.serial#, b.name, c.value
from v$session a, v$statname b, v$sesstat c

where b.STATISTIC# =c.STATISTIC#
and c.sid=a.sid and b.name like ‘redo%’
order by value;

To check the standby sync status with primary

 SELECT ARCH.THREAD# “Thread”, ARCH.SEQUENCE# “Last Sequence Received”, APPL.SEQUENCE# “Last Sequence Applied”, (ARCH.SEQUENCE# – APPL.SEQUENCE#) “Difference” FROM (SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH,(SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL WHERE ARCH.THREAD# = APPL.THREAD# ORDER BY 1;

ADOP Prepare Phase Fails With Error determining status of Internal Concurrent Manager

 ERROR:-

/R12APPROD/oracle/PROD/fs_ne/EBSapps/log/adop/32/20201009_174221/prepare/validate/remote_execution_result_level1.xml: 
---------------------------------------------------------------------------------------------------------------------
/R12APPROD/oracle/PROD/fs_ne/EBSapps/log/adop/32/20201009_174221/prepare/validate/remote_execution_result_level2.xml: 
---------------------------------------------------------------------------------------------------------------------
/R12APPROD/oracle/PROD/fs_ne/EBSapps/log/adop/32/20201009_174221/prepare/panserver/adop.log: 
------------------------------------------------------------------------------------------
Lines #(206-212):
    [STATEMENT] ICM status cannot be determined.
    [STATEMENT] [END   2020/10/09 17:50:21] Check if ICM is running
    [UNEXPECTED]Error determining status of Internal Concurrent Manager
    [UNEXPECTED]Error calling runConcurrentProgram subroutine.
    [ERROR]     Prepare phase has failed.
    [PROCEDURE] [START 2020/10/09 17:50:22] Updating adop session status
    [STATEMENT] SQL statement : "  update ad_adop_sessions
/R12APPROD/oracle/PROD/fs_ne/EBSapps/log/adop/32/20201009_174221/prepare/panserver1/adop.log: 
------------------------------------------------------------------------------------------
Lines #(149-155):
    Will wait for another minute and retry.
    [UNEXPECTED]Detected a failed session on another node(s): panserver and 
    [UNEXPECTED]This session will fail as no patch edition exists.
    [ERROR]     Prepare phase has failed.
    [PROCEDURE] [START 2020/10/09 17:50:42] Updating adop session status
    [STATEMENT] SQL statement : "  update ad_adop_sessions
/R12APPROD/oracle/PROD/fs_ne/EBSapps/log/adop/32/20201009_174221/prepare/remote_execution_result_level1.xml: 
------------------------------------------------------------------------------------------------------------
Status of remote command on Node panserver1 is failed.
Error string was found in the above file.
Please check the adoplog files created in panserver1 for more details.
Status of remote command on Node panserver1 is failed.
/R12APPROD/oracle/PROD/fs_ne/EBSapps/log/adop/32/20201009_174221/prepare/validate/remote_execution_result_level1.xml: 
---------------------------------------------------------------------------------------------------------------------
/R12APPROD/oracle/PROD/fs_ne/EBSapps/log/adop/32/20201009_174221/prepare/validate/remote_execution_result_level2.xml: 
---------------------------------------------------------------------------------------------------------------------
/R12APPROD/oracle/PROD/fs_ne/EBSapps/log/adop/32/20201009_174221/prepare/panserver/adop.log: 
------------------------------------------------------------------------------------------
Lines #(206-212):
    [STATEMENT] ICM status cannot be determined.
    [STATEMENT] [END   2020/10/09 17:50:21] Check if ICM is running
    [UNEXPECTED]Error determining status of Internal Concurrent Manager
    [UNEXPECTED]Error calling runConcurrentProgram subroutine.
    [ERROR]     Prepare phase has failed.
    [PROCEDURE] [START 2020/10/09 17:50:22] Updating adop session status
    [STATEMENT] SQL statement : "  update ad_adop_sessions
/R12APPROD/oracle/PROD/fs_ne/EBSapps/log/adop/32/20201009_174221/prepare/panserver1/adop.log: 
------------------------------------------------------------------------------------------
Lines #(149-155):
    Will wait for another minute and retry.
    [UNEXPECTED]Detected a failed session on another node(s): panserver and 
    [UNEXPECTED]This session will fail as no patch edition exists.
    [ERROR]     Prepare phase has failed.
    [PROCEDURE] [START 2020/10/09 17:50:42] Updating adop session status
    [STATEMENT] SQL statement : "  update ad_adop_sessions
/R12APPROD/oracle/PROD/fs_ne/EBSapps/log/adop/32/20201009_174221/prepare/remote_execution_result_level1.xml: 
------------------------------------------------------------------------------------------------------------
Status of remote command on Node panserver1 is failed.
Error string was found in the above file.
Please check the adoplog files created in panserver1 for more details.


Status of remote command on Node panserver1 is failed.

Solution:-

In the current directory from where you are running the adop parepare command check if any older DBC file exist, if so remove or move it to some backup folder.
And retry the command.

applprod@panserver:/home/applprod>> mkdir dbc_backup
applprod@panserver:/home/applprod>> mv pansoft_prod.dbc_1202 PROD.dbc dbc_backup
applprod@panserver:/home/applprod>>
applprod@panserver:/home/applprod>> mkdir dbc_backup
applprod@panserver:/home/applprod>> mv pansoft_prod.dbc_1202 PROD.dbc dbc_backup
applprod@panserver:/home/applprod>>

Friday, October 9, 2020

Change Weblogic admin password in Oracle E-Business Suite R12.2.x

Pre-requisite:

R12.AD.C.Delta.7 and R12.TXK.C.Delta.7 or later.

Solution:

Shut down all application tier services except the Admin Server.

 On the primary node, run the command:

$ /adstpall.sh -skipNM -skipAdmin

On all secondary nodes, run the command:

$ /adstpall.sh

perl $FND_TOP/patch/115/bin/txkUpdateEBSDomain.pl -action=updateAdminPassword


[applprod@pandba security]$ perl $FND_TOP/patch/115/bin/txkUpdateEBSDomain.pl -action=updateAdminPassword

AdminServer will be re started after changing WebLogic Admin Password
All Mid Tier services should be SHUTDOWN before changing WebLogic Admin Password
Confirm if all Mid Tier services are in SHUTDOWN state. Enter "Yes" to proceed or anything else to exit: Yes

Enter the full path of Applications Context File [DEFAULT - /u01/oracle/EBSPROD/fs1/inst/apps/EBSPROD_pandba/appl/admin/EBSPROD_pandba.xml]:
Enter the WLS Admin Password:
Enter the new WLS Admin Password:
Enter the APPS user password:

Executing: /u02/oracle/EBSPROD/fs1/FMW_Home/webtier/perl/bin/perl /u02/oracle/EBSPROD/fs1/EBSapps/appl/ad/12.0.0/patch/115/bin/adProvisionEBS.pl ebs-get-serverstatus -contextfile=/u01/oracle/EBSPROD/fs1/inst/apps/EBSPROD_pandba/appl/admin/EBSPROD_pandba.xml -servername=AdminServer -promptmsg=hide -logfile=/u01/oracle/EBSPROD/fs1/inst/apps/EBSPROD_pandba/logs/appl/rgf/TXK/txkUpdateEBSDomain_Mon_OCT_12_23_34_03_2019/EBSProvisioner.log

Updating Weblogic Domain in online mode
---------------------------------------
Backup Location : /u01/oracle/EBSPROD/fs1/inst/apps/EBSPROD_pandba/logs/appl/rgf/TXK/txkUpdateEBSDomain_Mon_OCT_12_23_34_03_2019
Logfile Location: /u01/oracle/EBSPROD/fs1/inst/apps/EBSPROD_pandba/logs/appl/rgf/TXK/txkUpdateEBSDomain_Mon_OCT_12_23_34_03_2019/updateAdminPassword.log

Executing: /u02/oracle/EBSPROD/fs1/EBSapps/comn/util/jdk32/jre/bin/java -classpath :/u02/oracle/EBSPROD/fs1/FMW_Home/wlserver_10.3/server/lib/weblogic.jar:/u02/oracle/EBSPROD/fs1/FMW_Home/Oracle_EBS-app1/oui/jlib/srvm.jar:/u02/oracle/EBSPROD/fs1/EBSapps/comn/java/classes:/u02/oracle/EBSPROD/fs1/EBSapps/comn/shared-libs/ebs-3rdparty/WEB-INF/lib/ebs3rdpartyManifest.jar:/u02/oracle/EBSPROD/fs1/FMW_Home/Oracle_EBS-app1/shared-libs/ebs-appsborg/WEB-INF/lib/ebsAppsborgManifest.jar oracle.apps.ad.util.UpdateEBSDomain updateAdminPassword -contextfile /u01/oracle/EBSPROD/fs1/inst/apps/EBSPROD_pandba/appl/admin/EBSPROD_pandba.xml -promptmsg hide -logdir /u01/oracle/EBSPROD/fs1/inst/apps/EBSPROD_pandba/logs/appl/rgf/TXK/txkUpdateEBSDomain_Mon_OCT_12_23_34_03_2019 -logfile /u01/oracle/EBSPROD/fs1/inst/apps/EBSPROD_pandba/logs/appl/rgf/TXK/txkUpdateEBSDomain_Mon_OCT_12_23_34_03_2019/updateAdminPassword.log
 
Domain updated successfully
Restarting AdminServer with new Admin Password.
 
You are running adadminsrvctl.sh version 120.10.12020000.10
 
Stopping WLS Admin Server...
Refer /u01/oracle/EBSPROD/fs1/inst/apps/EBSPROD_pandba/logs/appl/admin/log/adadminsrvctl.txt for details
 
AdminServer logs are located at /u02/oracle/EBSPROD/fs1/FMW_Home/user_projects/domains/EBS_domain_EBSPROD/servers/AdminServer/logs
 
adadminsrvctl.sh: exiting with status 0
 
adadminsrvctl.sh: check the logfile /u01/oracle/EBSPROD/fs1/inst/apps/EBSPROD_pandba/logs/appl/admin/log/adadminsrvctl.txt for more information ...

 
You are running adnodemgrctl.sh version 120.11.12020000.12

 
NodeManager log is located at /u02/oracle/EBSPROD/fs1/FMW_Home/wlserver_10.3/common/nodemanager/nmHome1
 
adnodemgrctl.sh: exiting with status 0
 
adnodemgrctl.sh: check the logfile /u01/oracle/EBSPROD/fs1/inst/apps/EBSPROD_pandba/logs/appl/admin/log/adnodemgrctl.txt for more information ...
 
 
You are running adadminsrvctl.sh version 120.10.12020000.10
 
Starting WLS Admin Server...
Refer /u01/oracle/EBSPROD/fs1/inst/apps/EBSPROD_pandba/logs/appl/admin/log/adadminsrvctl.txt for details
 
AdminServer logs are located at /u02/oracle/EBSPROD/fs1/FMW_Home/user_projects/domains/EBS_domain_EBSPROD/servers/AdminServer/logs
 
adadminsrvctl.sh: exiting with status 0
 
adadminsrvctl.sh: check the logfile /u01/oracle/EBSPROD/fs1/inst/apps/EBSPROD_pandba/logs/appl/admin/log/adadminsrvctl.txt for more information ...
 
 
*************** IMPORTANT ****************
WebLogic Admin Password is changed.
Restart all application tier services using control scripts.
********************************************


Start all the application services using adstrtal.sh script.
 
Try to login to the Weblogic Console using the new weblogic admin password.

Sunday, October 4, 2020

How to add space in existing disk group ASM


[root@pansoftrules.d]# rescan-scsi-bus.sh -s

 Scanning SCSI subsystem for new devices
Searching for resized LUNs
0 new or changed device(s) found.
0 remapped or resized device(s) found.
0 device(s) removed.
[root@pansoftrules.d]# multipath -ll
crs4 (360002ac00000000009002625000157e7) dm-6 3PARdata,VV
size=10G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:6 sdi               8:128  active ready running
  |- 3:0:0:6 sdaa              65:160 active ready running
  |- 2:0:1:6 sdr               65:16  active ready running
  `- 3:0:1:6 sdaj              66:48  active ready running
crs3 (360002ac00000000009002626000157e7) dm-9 3PARdata,VV
size=10G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:7 sdj               8:144  active ready running
  |- 3:0:0:7 sdab              65:176 active ready running
  |- 2:0:1:7 sds               65:32  active ready running
  `- 3:0:1:7 sdak              66:64  active ready running
crs2 (360002ac00000000009002627000157e7) dm-8 3PARdata,VV
size=10G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:8 sdk               8:160  active ready running
  |- 3:0:0:8 sdac              65:192 active ready running
  |- 2:0:1:8 sdt               65:48  active ready running
  `- 3:0:1:8 sdal              66:80  active ready running
crs1 (360002ac00000000009002622000157e7) dm-3 3PARdata,VV
size=10G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:2 sde               8:64   active ready running
  |- 3:0:0:2 sdw               65:96  active ready running
  |- 2:0:1:2 sdn               8:208  active ready running
  `- 3:0:1:2 sdaf              65:240 active ready running
mpathk (360002ac0000000000900d2cf000157e7) dm-5 3PARdata,VV
size=300G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:1:3 sdo               8:224  active ready running
  |- 3:0:0:3 sdx               65:112 active ready running
  |- 2:0:0:3 sdf               8:80   active ready running
  `- 3:0:1:3 sdag              66:0   active ready running
fra (360002ac000000000090025b3000157e7) dm-4 3PARdata,VV
size=300G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:1 sdd               8:48   active ready running
  |- 3:0:0:1 sdv               65:80  active ready running
  |- 2:0:1:1 sdm               8:192  active ready running
  `- 3:0:1:1 sdae              65:224 active ready running
data (360002ac000000000090025b2000157e7) dm-2 3PARdata,VV
size=900G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:0 sdc               8:32   active ready running
  |- 3:0:0:0 sdu               65:64  active ready running
  |- 2:0:1:0 sdl               8:176  active ready running
  `- 3:0:1:0 sdad              65:208 active ready running
crs5 (360002ac00000000009002623000157e7) dm-7 3PARdata,VV
size=10G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:4 sdg               8:96   active ready running
  |- 3:0:0:4 sdy               65:128 active ready running
  |- 2:0:1:4 sdp               8:240  active ready running
  `- 3:0:1:4 sdah              66:16  active ready running
mpathf (360002ac00000000009002624000157e7) dm-10 3PARdata,VV
size=10G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:5 sdh               8:112  active ready running
  |- 3:0:0:5 sdz               65:144 active ready running
  |- 2:0:1:5 sdq               65:0   active ready running
  `- 3:0:1:5 sdai              66:32  active ready running

[root@pansoftrules.d]# systemctl status multipathd

 multipathd.service - Device-Mapper Multipath Device Controller
   Loaded: loaded (/usr/lib/systemd/system/multipathd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2020-01-12 13:26:23 +03; 3 months 6 days ago
  Process: 6287 ExecStart=/sbin/multipathd (code=exited, status=0/SUCCESS)
  Process: 6230 ExecStartPre=/sbin/multipath -A (code=exited, status=0/SUCCESS)
  Process: 6183 ExecStartPre=/sbin/modprobe dm-multipath (code=exited, status=0/SUCCESS)
 Main PID: 6353 (multipathd)
   CGroup: /system.slice/multipathd.service
Jan 12 13:27:16 pansoft.dba.com multipathd[6353]: ofsctl: add path (uevent)
Jan 12 13:27:16 pansoft.dba.com multipathd[6353]: ofsctl: spurious uevent, path already in pathvec
Jan 12 13:27:16 pansoft.dba.com multipathd[6353]: ofsctl: HDIO_GETGEO failed with 25
Jan 12 13:27:16 pansoft.dba.com multipathd[6353]: ofsctl: failed to get path uid
Jan 12 13:27:16 pansoft.dba.com multipathd[6353]: uevent trigger error
Jan 12 13:27:26 pansoft.dba.com multipathd[6353]: ofsctl: add path (uevent)
Jan 12 13:27:26 pansoft.dba.com multipathd[6353]: ofsctl: spurious uevent, path already in pathvec
Jan 12 13:27:26 pansoft.dba.com multipathd[6353]: ofsctl: HDIO_GETGEO failed with 25
Jan 12 13:27:26 pansoft.dba.com multipathd[6353]: ofsctl: failed to get path uid
Jan 12 13:27:26 pansoft.dba.com multipathd[6353]: uevent trigger error
[root@pansoftrules.d]# systemctl restart multipathd
[root@pansoftrules.d]# systemctl status multipathd
multipathd.service - Device-Mapper Multipath Device Controller
   Loaded: loaded (/usr/lib/systemd/system/multipathd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2020-04-19 12:06:59 +03; 2s ago
  Process: 4134 ExecStart=/sbin/multipathd (code=exited, status=0/SUCCESS)
  Process: 4131 ExecStartPre=/sbin/multipath -A (code=exited, status=0/SUCCESS)
  Process: 4129 ExecStartPre=/sbin/modprobe dm-multipath (code=exited, status=0/SUCCESS)
 Main PID: 4137 (multipathd)
   CGroup: /system.slice/multipathd.service
           


Apr 19 12:07:00 pansoft.dba.com multipathd[4137]: data: event checker started
Apr 19 12:07:00 pansoft.dba.com multipathd[4137]: fra: event checker started
Apr 19 12:07:00 pansoft.dba.com multipathd[4137]: crs1: event checker started
Apr 19 12:07:00 pansoft.dba.com multipathd[4137]: mpathk: event checker started
Apr 19 12:07:00 pansoft.dba.com multipathd[4137]: crs5: event checker started
Apr 19 12:07:00 pansoft.dba.com multipathd[4137]: mpathf: event checker started
Apr 19 12:07:00 pansoft.dba.com multipathd[4137]: crs4: event checker started
Apr 19 12:07:00 pansoft.dba.com multipathd[4137]: crs3: event checker started
Apr 19 12:07:00 pansoft.dba.com multipathd[4137]: crs2: event checker started
Apr 19 12:07:00 pansoft.dba.com multipathd[4137]: path checkers start up
[root@pansoftrules.d]#

[root@pansoftrules.d]# multipath -ll

crs4 (360002ac00000000009002625000157e7) dm-6 3PARdata,VV
size=10G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:6 sdi               8:128  active ready running
  |- 3:0:0:6 sdaa              65:160 active ready running
  |- 2:0:1:6 sdr               65:16  active ready running
  `- 3:0:1:6 sdaj              66:48  active ready running
crs3 (360002ac00000000009002626000157e7) dm-9 3PARdata,VV
size=10G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:7 sdj               8:144  active ready running
  |- 3:0:0:7 sdab              65:176 active ready running
  |- 2:0:1:7 sds               65:32  active ready running
  `- 3:0:1:7 sdak              66:64  active ready running
crs2 (360002ac00000000009002627000157e7) dm-8 3PARdata,VV
size=10G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:8 sdk               8:160  active ready running
  |- 3:0:0:8 sdac              65:192 active ready running
  |- 2:0:1:8 sdt               65:48  active ready running
  `- 3:0:1:8 sdal              66:80  active ready running
crs1 (360002ac00000000009002622000157e7) dm-3 3PARdata,VV
size=10G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:2 sde               8:64   active ready running
  |- 3:0:0:2 sdw               65:96  active ready running
  |- 2:0:1:2 sdn               8:208  active ready running
  `- 3:0:1:2 sdaf              65:240 active ready running
mpathk (360002ac0000000000900d2cf000157e7) dm-5 3PARdata,VV
size=300G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:1:3 sdo               8:224  active ready running
  |- 3:0:0:3 sdx               65:112 active ready running
  |- 2:0:0:3 sdf               8:80   active ready running
  `- 3:0:1:3 sdag              66:0   active ready running
fra (360002ac000000000090025b3000157e7) dm-4 3PARdata,VV
size=300G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:1 sdd               8:48   active ready running
  |- 3:0:0:1 sdv               65:80  active ready running
  |- 2:0:1:1 sdm               8:192  active ready running
  `- 3:0:1:1 sdae              65:224 active ready running
data (360002ac000000000090025b2000157e7) dm-2 3PARdata,VV
size=900G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:0 sdc               8:32   active ready running
  |- 3:0:0:0 sdu               65:64  active ready running
  |- 2:0:1:0 sdl               8:176  active ready running
  `- 3:0:1:0 sdad              65:208 active ready running
crs5 (360002ac00000000009002623000157e7) dm-7 3PARdata,VV
size=10G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:4 sdg               8:96   active ready running
  |- 3:0:0:4 sdy               65:128 active ready running
  |- 2:0:1:4 sdp               8:240  active ready running
  `- 3:0:1:4 sdah              66:16  active ready running
mpathf (360002ac00000000009002624000157e7) dm-10 3PARdata,VV
size=10G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:5 sdh               8:112  active ready running
  |- 3:0:0:5 sdz               65:144 active ready running
  |- 2:0:1:5 sdq               65:0   active ready running
  `- 3:0:1:5 sdai              66:32  active ready running

[root@pansoftrules.d]# multipathd resize fra

multipath-tools v0.4.9 (05/33, 2016)
CLI commands reference:
 list|show paths
 list|show paths format $format
 list|show paths raw format $format
 list|show status
 list|show daemon
 list|show maps|multipaths
 list|show maps|multipaths status
 list|show maps|multipaths stats
 list|show maps|multipaths format $format
 list|show maps|multipaths raw format $format
 list|show maps|multipaths topology
 list|show maps|multipaths json
 list|show topology
 list|show map|multipath $map topology
 list|show map|multipath $map json
 list|show config
 list|show blacklist
 list|show devices
 list|show wildcards
 reset maps|multipaths stats
 reset map|multipath $map stats
 add path $path
 remove|del path $path
 add map|multipath $map
 remove|del map|multipath $map
 switch|switchgroup map|multipath $map group $group
 reconfigure
 suspend map|multipath $map
 resume map|multipath $map
 resize map|multipath $map
 reset map|multipath $map
 reload map|multipath $map
 disablequeueing map|multipath $map
 restorequeueing map|multipath $map
 disablequeueing maps|multipaths
 restorequeueing maps|multipaths
 reinstate path $path
 fail path $path
 quit|exit
 shutdown
 map|multipath $map getprstatus
 map|multipath $map setprstatus
 map|multipath $map unsetprstatus
 map|multipath $map getprkey
 map|multipath $map setprkey key $key
 map|multipath $map unsetprkey
 forcequeueing daemon
 restorequeueing daemon

[root@pansoftrules.d]# multipath -ll

crs4 (360002ac00000000009002625000157e7) dm-6 3PARdata,VV
size=10G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:6 sdi               8:128  active ready running
  |- 3:0:0:6 sdaa              65:160 active ready running
  |- 2:0:1:6 sdr               65:16  active ready running
  `- 3:0:1:6 sdaj              66:48  active ready running
crs3 (360002ac00000000009002626000157e7) dm-9 3PARdata,VV
size=10G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:7 sdj               8:144  active ready running
  |- 3:0:0:7 sdab              65:176 active ready running
  |- 2:0:1:7 sds               65:32  active ready running
  `- 3:0:1:7 sdak              66:64  active ready running
crs2 (360002ac00000000009002627000157e7) dm-8 3PARdata,VV
size=10G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:8 sdk               8:160  active ready running
  |- 3:0:0:8 sdac              65:192 active ready running
  |- 2:0:1:8 sdt               65:48  active ready running
  `- 3:0:1:8 sdal              66:80  active ready running
crs1 (360002ac00000000009002622000157e7) dm-3 3PARdata,VV
size=10G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:2 sde               8:64   active ready running
  |- 3:0:0:2 sdw               65:96  active ready running
  |- 2:0:1:2 sdn               8:208  active ready running
  `- 3:0:1:2 sdaf              65:240 active ready running
mpathk (360002ac0000000000900d2cf000157e7) dm-5 3PARdata,VV
size=300G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:1:3 sdo               8:224  active ready running
  |- 3:0:0:3 sdx               65:112 active ready running
  |- 2:0:0:3 sdf               8:80   active ready running
  `- 3:0:1:3 sdag              66:0   active ready running
fra (360002ac000000000090025b3000157e7) dm-4 3PARdata,VV
size=300G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:1 sdd               8:48   active ready running
  |- 3:0:0:1 sdv               65:80  active ready running
  |- 2:0:1:1 sdm               8:192  active ready running
  `- 3:0:1:1 sdae              65:224 active ready running
data (360002ac000000000090025b2000157e7) dm-2 3PARdata,VV
size=900G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:0 sdc               8:32   active ready running
  |- 3:0:0:0 sdu               65:64  active ready running
  |- 2:0:1:0 sdl               8:176  active ready running
  `- 3:0:1:0 sdad              65:208 active ready running
crs5 (360002ac00000000009002623000157e7) dm-7 3PARdata,VV
size=10G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:4 sdg               8:96   active ready running
  |- 3:0:0:4 sdy               65:128 active ready running
  |- 2:0:1:4 sdp               8:240  active ready running
  `- 3:0:1:4 sdah              66:16  active ready running
mpathf (360002ac00000000009002624000157e7) dm-10 3PARdata,VV
size=10G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 2:0:0:5 sdh               8:112  active ready running
  |- 3:0:0:5 sdz               65:144 active ready running
  |- 2:0:1:5 sdq               65:0   active ready running
  `- 3:0:1:5 sdai              66:32  active ready running

[oragrid@pansoft~]$ . grid.env
[oragrid@pansoft~]$ asmca
[oragrid@pansoft~]$ asmca
[oragrid@pansoft~]$ sqlplus / as sysasm
SQL*Plus: Release 12.1.0.2.0 Production on Sun Apr 19 11:53:07 2020
Copyright (c) 1982, 2014, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> desc v$asm_diskgroup;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 GROUP_NUMBER                                       NUMBER
 NAME                                               VARCHAR2(30)
 SECTOR_SIZE                                        NUMBER
 BLOCK_SIZE                                         NUMBER
 ALLOCATION_UNIT_SIZE                               NUMBER
 STATE                                              VARCHAR2(11)
 TYPE                                               VARCHAR2(6)
 TOTAL_MB                                           NUMBER
 FREE_MB                                            NUMBER
 HOT_USED_MB                                        NUMBER
 COLD_USED_MB                                       NUMBER
 REQUIRED_MIRROR_FREE_MB                            NUMBER
 USABLE_FILE_MB                                     NUMBER
 OFFLINE_DISKS                                      NUMBER
 COMPATIBILITY                                      VARCHAR2(60)
 DATABASE_COMPATIBILITY                             VARCHAR2(60)
 VOTING_FILES                                       VARCHAR2(1)
 CON_ID                                             NUMBER
SQL> select name, total_mb/1024 "Total GiB" from v$asm_diskgroup;
NAME                            Total GiB
------------------------------ ----------
FRA                                   250
DATA                                  900
CRS                                    50
SQL> alter diskgroup FRA resize all;
Diskgroup altered.
NAME                            Total GiB
------------------------------ ----------
FRA                                   300
DATA                                  900
CRS                                    50
SQL>


SQL>  select name, total_mb/1024 "Total GiB" from v$asm_diskgroup;

Featured post

Migrate OCR & vote from external to normal or High redundancy in ASM

How to Move OCR & Vote from external to Normal or high. 1)  Create New diskgroup(CRS) with suitable redundancy for OCR and Voting files....

Popular Posts