Wednesday, 30 August 2017

Startup and shutdown scripts in Apps Release R12

Application startup and shutdown scripts
[sreenidba@sreenidba scripts]$  cd $ADMIN_SCRIPTS_HOME
1.adalnctl.sh  
2.adautocfg.sh        
3.adformsctl.sh   
4.adoacorectl.sh  
5.adopmnctl.sh   
6.adstpall.sh 
7.adapcctl.sh  
8.adcmctl.sh     
9.adformsrvctl.sh 
10.adoafmctl.sh    
11.adpreclone.pl  
12.adstrtal.sh 
1.adalnctl.sh  : script used to start the application listener services.
logfile located in LOG_HOME or INST_TOP/admin/log
adalnctl.txt
To know the status of apps listner 

[sreenidba@sreenidba log]$ adalnctl.sh status

adalnctl.sh version 120.3

Checking status for listener process APPS_UAT.

LSNRCTL for Linux: Version 10.1.0.5.0 - Production on 30-AUG-2017 12:47:58

Copyright (c) 1991, 2004, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=TCP)(Host=sreenidba)(Port=1600))
STATUS of the LISTENER
------------------------
Alias                     APPS_UAT
Version                   TNSLSNR for Linux: Version 10.1.0.5.0 - Production
Start Date                21-AUG-2017 15:02:36
Uptime                    8 days 21 hr. 45 min. 23 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /d03/UATAPPL/inst/apps/UAT_sreenidba/ora/10.1.2/network/admin/listener.ora
Listener Log File         /d03/UATAPPL/inst/apps/UAT_sreenidba/logs/ora/10.1.2/network/apps_uat.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sreenidba.bw.ltindia.com)(PORT=1639)))
Services Summary...
Service "FNDFS" has 1 instance(s).
  Instance "FNDFS", status UNKNOWN, has 1 handler(s) for this service...
Service "FNDSM" has 1 instance(s).
  Instance "FNDSM", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

adalnctl.sh: exiting with status 0


adalnctl.sh: check the logfile /d03/UATAPPL/inst/apps/UAT_sreenidba/logs/appl/admin/log/adalnctl.txt for more information ...

[sreenidba@sreenidba log]$
FNDFS:
  • FNDFS or the Report Review Agent (RRA) is the default text viewer within Oracle Applications, which allows users to view report output and log files. 
  • Report Review Agent is also referred to by the executable FNDFS.
FNDSM  
  • FND Service Manager is a concurrent manager in GSM( Generic Service Management Framework ), and serves requests like CM’s
[sreenidba@sreenidba ~]$ ps -ef | grep APPS_
sreenidba   5242  5161  0 13:05 pts/1    00:00:00 grep APPS_
sreenidba  22028     1  0 Aug21 ?        00:00:00 /d03/UATAPPL/apps/tech_st/10.1.2/bin/tnslsnr APPS_UAT -inherit
appldev  22274     1  0 Aug29 ?        00:00:00 /d04/DEVAPPL/apps/tech_st/10.1.2/bin/tnslsnr APPS_DEV -inherit
[sreenidba@sreenidba ~]$

adautocfg.sh
  • script used to run the autoconfig, if any changes has been done in context file that time we need to run autoconfig.
  • when you run auto config it wiil update all template files and driver files in oracle applications.
  • logfile located in INST_TOP/admin/log
[sreenidba@sreenidba scripts]$ sh adautocfg.sh
Enter the APPS user password:

The log file for this session is located at: /d03/UATAPPL/inst/apps/UAT_sreenidba/admin/log/08301310/adconfig.log

AutoConfig is configuring the Applications environment...

AutoConfig will consider the custom templates if present.
        Using CONFIG_HOME location     : /d03/UATAPPL/inst/apps/UAT_sreenidba
a       Classpath                   : /d03/UATAPPL/apps/apps_st/comn/java/lib/appsborg2.zip:/d03/UATAPPL/apps/apps_st/comn/java/classes

pps
        Using Context file          : /d03/UATAPPL/inst/apps/UAT_sreenidba/appl/admin/UAT_sreenidba.xml

Context Value Management will now update the Context file
 Updating Context file...COMPLETED

        Attempting upload of Context file and templates to database...COMPLETED

Configuring templates from all of the product tops...
        Configuring AD_TOP........COMPLETED
        Configuring FND_TOP.......COMPLETED
        Configuring ICX_TOP.......COMPLETED
AutoConfig completed successfully.

adformsctl.sh 
  • this script is used to start formservices in servletmode.
  • Log file located at INST_TOP/admin/log
 [sreenidba@sreenidba scripts]$ adformsctl.sh status

You are running adformsctl.sh  version 120.16.12010000.3

Checking status of OPMN managed FORMS OC4J instance ...

Processes in Instance: UAT_sreenidba.sreenidba.bw.ltindia.com
---------------------------------+--------------------+---------+---------
ias-component                    | process-type       |     pid | status
---------------------------------+--------------------+---------+---------
OC4JGroup:default_group          | OC4J:oafm          |   22463 | Alive
OC4JGroup:default_group          | OC4J:forms         |   22385 | Alive
OC4JGroup:default_group          | OC4J:oacore        |   22131 | Alive
OC4JGroup:default_group          | OC4J:oacore        |   22130 | Alive
HTTP_Server                      | HTTP_Server        |   22070 | Alive


adformsctl.sh: exiting with status 0

adformsctl.sh: check the logfile /d03/UATAPPL/inst/apps/UAT_sreenidba/logs/appl/admin/log/adformsctl.txt for more information ...

[sreenidba@sreenidba scripts]$
adopmnctl.sh 
  • this script is used to start and stop all forms and apache services OC4J, oafm, oacore HTTP_Server.
  • to start/stop all services forms and apache services using below cmd.
  • logfile located at INST_TOP/admin/log

[sreenidba@sreenidba scripts]$ adopmnctl.sh start all
[sreenidba@sreenidba scripts]$ adopmnctl.sh stop all

  • [sreenidba@sreenidba scripts]$ adopmnctl.sh status all

You are running adopmnctl.sh version 120.6.12010000.5

Checking status of OPMN managed processes...

Processes in Instance: UAT_ltk1.ltk1.bw.ltindia.com
---------------------------------+--------------------+---------+---------
ias-component                    | process-type       |     pid | status
---------------------------------+--------------------+---------+---------
OC4JGroup:default_group          | OC4J:oafm          |   22463 | Alive
OC4JGroup:default_group          | OC4J:forms         |   22385 | Alive
OC4JGroup:default_group          | OC4J:oacore        |   22131 | Alive
OC4JGroup:default_group          | OC4J:oacore        |   22130 | Alive
HTTP_Server                      | HTTP_Server        |   22070 | Alive


adopmnctl.sh: exiting with status 0

adstrtall.sh

  • this script is used to start all services listner, forms,oc4j,oacore,oafm, concurrent managers and apache services.
  • logfile located at INST_TOP/admin/log
  • to start the all services issue the folloing command.

[sreenidba@sreenidba scripts]$ adstrtal.sh

You are running adstrtal.sh version 120.15.12010000.3


Enter the APPS username: apps

Enter the APPS password:
The logfile for this session is located at /d03/UATAPPL/inst/apps/UAT_ltk1/logs/appl/admin/log/adstrtal.log
Executing service control script:
/d03/UATAPPL/inst/apps/UAT_ltk1/admin/scripts/adopmnctl.sh start

.end std out.

.end err out.

****************************************************


Executing service control script:
/d03/UATAPPL/inst/apps/UAT_ltk1/admin/scripts/adalnctl.sh start
script returned:
****************************************************

adalnctl.sh version 120.3

Checking for FNDFS executable.
Starting listener process APPS_UAT.

adalnctl.sh: exiting with status 0


adalnctl.sh: check the logfile /d03/UATAPPL/inst/apps/UAT_ltk1/logs/appl/admin/log/adalnctl.txt for more information ...


.end std out.

.end err out.

****************************************************


Executing service control script:
/d03/UATAPPL/inst/apps/UAT_ltk1/admin/scripts/adapcctl.sh start
script returned:
****************************************************

You are running adapcctl.sh version 120.7.12010000.2

Starting OPMN managed Oracle HTTP Server (OHS) instance ...
opmnctl: opmn is already running.
opmnctl: starting opmn managed processes...

adapcctl.sh: exiting with status 0

adapcctl.sh: check the logfile /d03/UATAPPL/inst/apps/UAT_ltk1/logs/appl/admin/log/adapcctl.txt for more information ...


.end std out.

.end err out.

****************************************************


Executing service control script:
/d03/UATAPPL/inst/apps/UAT_ltk1/admin/scripts/adoacorectl.sh start
script returned:
****************************************************

You are running adoacorectl.sh version 120.13

Starting OPMN managed OACORE OC4J instance  ...

adoacorectl.sh: exiting with status 0

adoacorectl.sh: check the logfile /d03/UATAPPL/inst/apps/UAT_ltk1/logs/appl/admin/log/adoacorectl.txt for more information ...


.end std out.

.end err out.
All enabled services for this node are started.

adstrtal.sh: Exiting with status 0

adstrtal.sh: check the logfile /d03/UATAPPL/inst/apps/UAT_ltk1/logs/appl/admin/log/adstrtal.log for more information ...

Note: status existing with "0" then all services well and started, if the status existing '1" then we need to crosscheck all services.

to stop all services using followning command
[sreenidba@sreenidba scripts]$ adstpall.sh

You are running adstpall.sh version 120.10.12010000.4


Enter the APPS username: apps

Enter the APPS password:
The logfile for this session is located at /d03/UATAPPL/inst/apps/UAT_sreenidba/logs/appl/admin/log/adstpall.log
Executing service control script:
/d03/UATAPPL/inst/apps/UAT_sreenidba/admin/scripts/jtffmctl.sh stop
script returned:
****************************************************

You are running jtffmctl.sh version 120.3

Shutting down Fulfillment Server for UAT on port 9313 ...

jtffmctl.sh: exiting with status 0


.end std out.

.end err out.

****************************************************


Executing service control script:
/d03/UATAPPL/inst/apps/UAT_sreenidba/admin/scripts/adcmctl.sh stop
script returned:
****************************************************

You are running adcmctl.sh version 120.17.12010000.5

Shutting down concurrent managers for UAT ...
ORACLE Password:
Submitted request 59028128 for CONCURRENT FND SHUTDOWN


adcmctl.sh: exiting with status 0





Monitoring Concurrent Programs

Query to find running concurrent programs
SQL>SELECT vs.username,
 vs.osuser,
 vh.sid locking_sid,
 vs.status status,
 vs.module module,
 vs.program program_holding,
 jrh.job_name,
 vsw.username,
 vsw.osuser,
 vw.sid waiter_sid,
 vsw.program program_waiting,
 jrw.job_name,
 'alter system kill session ' || ''''|| vh.sid || ',' || vs.serial# || ''';'  "Kill_Command"
FROM v$lock vh,
 v$lock vw,
 v$session vs,
 v$session vsw,
 dba_scheduler_running_jobs jrh,
 dba_scheduler_running_jobs jrw
WHERE     (vh.id1, vh.id2) IN (SELECT id1, id2
 FROM v$lock
 WHERE request = 0
 INTERSECT
 SELECT id1, id2
 FROM v$lock
 WHERE lmode = 0)
 AND vh.id1 = vw.id1
 AND vh.id2 = vw.id2
 AND vh.request = 0
 AND vw.lmode = 0
 AND vh.sid = vs.sid
 AND vw.sid = vsw.sid
 AND vh.sid = jrh.session_id(+)
 AND vw.sid = jrw.session_id(+);
[oraprod@ltkbwlndb01 Sreeni_Monitoring_Scripts]$ cat rr.sql
set pages 1000 lines 1000 pagesize 1000;
select a.request_id ,decode(a.phase_code,'R','Running','Normal') Phase,
to_char(a.actual_start_date,'DD-MON-RRRR HH24:MI:SS')
Start_time , substr(b.user_concurrent_program_name,1,40) Program , a.ORACLE_SESSION_ID
from apps.fnd_concurrent_requests a, apps.fnd_concurrent_programs_tl b
where a.concurrent_program_id = b.concurrent_program_id and
a.status_code = 'R'
order by Start_time;
REQUEST_ID PHASE   START_TIME           PROGRAM                                  ORACLE_SESSION_ID
---------- ------- -------------------- ---------------------------------------- -----------------
  89896545 Running 30-AUG-2017 03:46:01 sreenidba-sreenidba REGISTER (RECEIPT NO-WISE)
  89896594 Running 30-AUG-2017 03:50:51 sreenidba-sreenidba REGISTER (RECEIPT NO-WISE)
  89896700 Running 30-AUG-2017 03:59:29 sreenidba-sreenidba REGISTER (RECEIPT NO-WISE)
  89898623 Running 30-AUG-2017 05:26:34 sreenidba-Transfer Order Lines to AR Interfa


Tuesday, 29 August 2017

Identifying table locks

Query to find table locks
SQL>SELECT vs.username,
 vs.osuser,
 vh.sid locking_sid,
 vs.status status,
 vs.module module,
 vs.program program_holding,
 jrh.job_name,
 vsw.username,
 vsw.osuser,
 vw.sid waiter_sid,
 vsw.program program_waiting,
 jrw.job_name,
 'alter system kill session ' || ''''|| vh.sid || ',' || vs.serial# || ''';'  "Kill_Command"
FROM v$lock vh,
 v$lock vw,
 v$session vs,
 v$session vsw,
 dba_scheduler_running_jobs jrh,
 dba_scheduler_running_jobs jrw
WHERE     (vh.id1, vh.id2) IN (SELECT id1, id2
 FROM v$lock
 WHERE request = 0
 INTERSECT
 SELECT id1, id2
 FROM v$lock
 WHERE lmode = 0)
 AND vh.id1 = vw.id1
 AND vh.id2 = vw.id2
 AND vh.request = 0
 AND vw.lmode = 0
 AND vh.sid = vs.sid
 AND vw.sid = vsw.sid
 AND vh.sid = jrh.session_id(+)
 AND vw.sid = jrw.session_id(+);

Compiling JSP files in Apps R12

in Linux:
---------------------------------
take the backup of jsp files in COMMON_TOP/_pages
cd $COMMON_TOP/
[sreenidba@sreenidba comn]$ ls
admin  clone  cz  exclude.xml  java  mvtaglib  _pages  temp  _TldCache  util  webapps
[sreenidba@sreenidba comn]$ mv _pages _pages_backup
create ne directory under common_top
[sreenidba@sreenidba comn]$ mkdir _pages
Now run the ojspCompile.pl script from FND_TOP/patch/115/bin
cd $FND_TOP/patch/115/bin
[sreenidba@sreenidba bin]$ pwd
/d04/sreenidba/apps/apps_st/appl/fnd/12.0.0/patch/115/bin
[sreenidba@sreenidba bin]$ ls ojspCompile.pl
ojspCompile.pl
[sreenidba@sreenidba bin]$ perl ojspCompile.pl -compile -flush -p 2
perl ojspCompile.pl –compile –flush -p 2(here "P" represents number of processes)
Now check the new jsp files created or not in COMMON_TOP/_jsppages
[sreenidba@sreenidba _pages]$ pwd
/d04/sreenidba/apps/apps_st/comn/_pages
[sreenidba@sreenidba _pages]$
csfwAddr.class                              _jtfbCreateParamStr.class                             _pvxEnrlReprtRunMain.class
_csfwAddReqLine.class                        _jtfbGraphColMetadata.class                           _pvxEnrlReprtRunPrz.class
_csfwAdvPartSearch.class                     _jtfbGraphColMetadataSub.class                        _pvxEnrlReprtRunTbl.class
_csfwAdvTaskLOV.class                        _jtfbGraphMetadata.class                              _pvxEnrlViewEnrMain.class
_csfwAdvTaskSearch.class                     _jtfbGraphMetadataSub.class                           _pvxEnrlViewEnrRTbl.class
_csfwainv.class                              _jtfbGraphSummary.class                               _pvxEnrlViewEnrUTbl.class

Monday, 28 August 2017

Find the oracle database 32bit or 64bit

[appldev@sreendba admin]$ sqlplus apps/apps

SQL*Plus: Release 10.1.0.5.0 - Production on Tue Aug 29 11:21:19 2017

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select (case length(address) when 16 then '64-bit Oracle'
when 8 then '32-bit Oracle'
when 32 then '128-bit Oracle'
end) Wordsize
from v$sql
where rownum <2
/
  2    3    4    5    6    7
WORDSIZE
------------------------------------------
64-bit Oracle

SQL>

Tuesday, 22 August 2017

Linux command's for DBA's

findout number of user process
[sreenidba@sreenidba ~]$ ps -ef|grep sreenidba|wc -l
456
[sreenidba@sreenidba ~]$ ps -ef|grep sreenidba|wc -l
266
[sreenidba@sreenidba ~]$
find the disk space
[root@sreenidba ~]# df -h
Filesystem                         Size  Used Avail Use% Mounted on
sreeni/sda2                           25G   17G  7.0G  71% /
tmpfs                               32G  283M   32G   1% sreeni/shm
sreeni/sda1                          788M   46M  702M   7% /boot
sreeni/sda6                          6.9G  224M  6.4G   4% /tmp
sreeni/sda5                           15G  5.9G  8.3G  42% /usr
sreeni/sda7                          487G  327G  137G  71% /d03
sreeni/sreenidba                   1.6T  1.2T  309G  80% /d01
sreeni/sreenidba                   591G  268G  293G  48% /d02
sreeni/sreenidba                     345G  177G  151G  55% /ProdApp
192.168.145.81:/home/ftve0148/H2H   17G  8.5G  7.3G  54% /CE
[root@sreenidba ~]#

Find server performance every 5 seconds 5 times using sar command
[root@sreenidba ~]# sar 5 5
Linux 2.6.32-431.el6.x86_64 (sreenidb01.ltindia.com)   08/21/2017      _x86_64_        (8 CPU)

01:49:39 AM     CPU     %user     %nice   %system   %iowait    %steal     %idle
01:49:44 AM     all      1.03      0.00      0.23      0.08      0.00     98.67
01:49:49 AM     all      2.76      0.00      1.18      0.10      0.00     95.96
01:49:54 AM     all      0.68      0.00      0.30      0.05      0.00     98.97
01:49:59 AM     all      4.02      0.00      0.60      0.13      0.00     95.25
01:50:04 AM     all      5.52      0.00      1.08      0.33      0.00     93.07
Average:        all      2.80      0.00      0.68      0.14      0.00     96.38
[root@sreenidba ~]#

top command
[root@sreenidba ~]#top
top - 01:51:14 up 46 days, 49 min,  2 users,  load average: 0.90, 0.70, 0.83
Tasks: 1032 total,   2 running, 1029 sleeping,   0 stopped,   1 zombie
Cpu(s):  6.2%us,  1.0%sy,  0.0%ni, 90.1%id,  2.7%wa,  0.0%hi,  0.1%si,  0.0%st
Mem:  65863632k total, 65171192k used,   692440k free,   717556k buffers
Swap: 16777208k total,    42268k used, 16734940k free, 49945532k cached

   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
126620 sreenidba   20   0 20.2g 184m 177m R 98.4  0.3   0:00.86 oracle
123032 sreenidba  20   0 91208  45m  14m S 11.6  0.1   0:46.46 frmweb
126090 sreenidba  20   0 1437m 537m  10m S  7.7  0.8  19:18.66 java
118425 sreenidba   20   0 20.2g 199m 190m S  5.8  0.3   0:01.26 oracle
123040 sreenidba   20   0 20.3g 642m 633m S  3.9  1.0   0:11.96 oracle
126930 root      20   0 15700 1880  836 R  3.9  0.0   0:00.02 top
115545 sreenidba   20   0 20.2g 113m 105m S  1.9  0.2   0:00.33 oracle
119527 sreenidba   20   0 20.2g  61m  56m S  1.9  0.1   0:00.15 oracle
125659 sreenidba   20   0 20.2g  35m  32m S  1.9  0.1  13:20.40 oracle
127227 sreenidba  20   0  719m 179m 7848 S  1.9  0.3   8:05.95 java
127493 sreenidba  20   0 23692  11m 5492 S  1.9  0.0   2:02.28 FNDLIBR
127527 sreenidba  20   0 23928  11m 5484 S  1.9  0.0   2:01.91 FNDLIBR
     1 root      20   0 19356 1536 1228 S  0.0  0.0  11:10.52 init
     2 root      20   0     0    0    0 S  0.0  0.0   0:01.64 kthreadd
     3 root      RT   0     0    0    0 S  0.0  0.0   0:30.14 migration/0
     4 root      20   0     0    0    0 S  0.0  0.0   4:26.00 ksoftirqd/0
     5 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0
     6 root      RT   0     0    0    0 S  0.0  0.0   0:02.17 watchdog/0
     7 root      RT   0     0    0    0 S  0.0  0.0   0:03.07 migration/1
SCP command
copying tarfile (apps.tar) from production.
scp -r 192.168.137.89: /App/appsbkp/apps.tar ./ à(command Execute in dest server only ).

tar command:
tar the apps directory using below command
tar –cvzf /ProdApp/appsbkp/apps.tar apps
for untar using below
tar –xvzf /ProdApp/appsbkp/apps.tar apps
Mounting files from one server to another server uning mount command
mount -t nfs 192.168.137.89:/d03/BACKUP_OLD/prodbackup_1417 /d02/prodbackup -o hard,rw,noac,rsize=32768,wsize=32768,suid,bg,proto=tcp,vers=3
Findout server information using below commands:
[root@sreenidba ~]# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 23
model name      : Intel(R) Xeon(R) CPU           E5430  @ 2.66GHz
stepping        : 6
cpu MHz         : 2660.053
cache size      : 6144 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 4
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes

cache_alignment : 64
address sizes   : 38 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 23
model name      : Intel(R) Xeon(R) CPU           E5430  @ 2.66GHz
stepping        : 6
cpu MHz         : 2660.053
cache size      : 6144 KB
physical id     : 0
siblings        : 4
core id         : 1
cpu cores       : 4
apicid          : 1
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
clflush size    : 64
cache_alignment : 64
address sizes   : 38 bits physical, 48 bits virtual
power management:

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 6
model           : 23
model name      : Intel(R) Xeon(R) CPU           E5430  @ 2.66GHz
stepping        : 6
cpu MHz         : 2660.053
cache size      : 6144 KB
physical id     : 0
siblings        : 4
core id         : 2
cpu cores       : 4
apicid          : 2
initial apicid  : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 23
model name      : Intel(R) Xeon(R) CPU           E5430  @ 2.66GHz
stepping        : 6
cpu MHz         : 2660.053
cache size      : 6144 KB
physical id     : 0
siblings        : 4
core id         : 3
cpu cores       : 4
apicid          : 3
initial apicid  : 3
fpu             : yes
fcx16 xtpr pdcm dca sse4_1 lahf_lm dts tpr_shadow vnmi flexpriority
bogomips        : 5320.10
clflush size    : 64
cache_alignment : 64
address sizes   : 38 bits physical, 48 bits virtual
power management:

[root@sreenidba ~]#
findout memory information
[root@sreenidba ~]# cat /proc/meminfo
MemTotal:       32878880 kB
MemFree:          751404 kB
Buffers:          788148 kB
Cached:         24819976 kB
SwapCached:       264352 kB
Active:         17300548 kB
Inactive:       12643340 kB
Active(anon):    5159516 kB
Inactive(anon):  1048964 kB
Active(file):   12141032 kB
Inactive(file): 11594376 kB
Unevictable:           0 kB
Mlocked:               0 kB
[root@sreenidba ~]#
Find the server 32bit or 64bit using uname command
[root@sreenidba ~]# uname -i
x86_64
[root@sreenidba ~]# uname -a
Linux sreeni.ltindia.com 2.6.32-431.el6.x86_64 #1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@sreenidba ~]#
[root@sreenidba ~]# uname -r
2.6.32-431.el6.x86_64
[root@sreenidba ~]# uname -i
x86_64
[root@sreenidba ~]# uname
Linux
[root@sreenidba ~]# hostname -i
192.162.177.99
[root@sreenidba ~]# hostname
sreeni.ltindia.com
[root@sreenidba ~]#

find the linux version
[root@sreenidba ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)

[root@sreenidba ~]#
(or)
[root@sreenidba ~]# tail /etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)
[root@sreenidba ~]#
References:
---------------------
Oracle Applications Release Notes, Release 12.1.1 ( Doc ID 798258.1 )
Oracle E-Business Suite Release 12 Installation Guidelines ( Doc ID 405565.1 )
Oracle E-Business Suite Installation and Upgrade Notes Release 12 (12.1.1) for Linux x86 ( Doc ID 761564.1 )

Finding Schema size

Query to find schema size in GB
SQL>select
   owner,
   sum(bytes)/1024/1024/1024 schema_size_gig
from
   dba_segments
group by

   owner;
---------------------------------------------------------------------------
OWNER                          SCHEMA_SIZE_GIG
------------------------------ ---------------
APPLSYS                             111.531372
AK                                   .35546875
BSC                                 .297851563
CRP                                 .071289063
IGS                                 4.46289063
OKS                                 .247070313
XNP                                  .19921875
POA                                 .556640625
finding the table size in GB group by owner 
COLUMN TABLE_NAME FORMAT A32
COLUMN OBJECT_NAME FORMAT A32
COLUMN OWNER FORMAT A10

SELECT
   owner,
   table_name,
   TRUNC(sum(bytes)/1024/1024/1024) Geg,
   ROUND( ratio_to_report( sum(bytes) ) over () * 100) Percent
FROM
(SELECT segment_name table_name, owner, bytes
 FROM dba_segments
 WHERE segment_type IN ('TABLE', 'TABLE PARTITION', 'TABLE SUBPARTITION')
 UNION ALL
 SELECT i.table_name, i.owner, s.bytes
 FROM dba_indexes i, dba_segments s
 WHERE s.segment_name = i.index_name
 AND   s.owner = i.owner
 AND   s.segment_type IN ('INDEX', 'INDEX PARTITION', 'INDEX SUBPARTITION')
 UNION ALL
 SELECT l.table_name, l.owner, s.bytes
 FROM dba_lobs l, dba_segments s
 WHERE s.segment_name = l.segment_name
 AND   s.owner = l.owner
 AND   s.segment_type IN ('LOBSEGMENT', 'LOB PARTITION')
 UNION ALL
 SELECT l.table_name, l.owner, s.bytes
 FROM dba_lobs l, dba_segments s
 WHERE s.segment_name = l.index_name
 AND   s.owner = l.owner
 AND   s.segment_type = 'LOBINDEX')
WHERE owner in UPPER('&owner')
GROUP BY table_name, owner
HAVING SUM(bytes)/1024/1024/1024 > 1
ORDER BY SUM(bytes) desc;

FNDCPASS

Changing Apps Password
/* CHANGE APPLICATION USER PASSWORD USING FNDCPASS*/
FNDCPASS apps/APPS_PASSWORD 0 Y system/SYSTEM_PASSWORD USER USER_WHOSE_PASSWORD_WILL_BE_CHANGED NEWPASSWORD
Example: FNDCPASS apps/apps 0 Y system/manager USER SYSADMIN sysadmin
/* CHANGE "APPS" USER PASSWORD USING FNDCPASS in "R11"*/
FNDCPASS apps/apps 0 Y system/SYSTEM_PASSWORD SYSTEM APPLSYS NEWPASSWORD
Note: Changing apps password will also change applsys password. apps and applsys passwords are always the same..
/* CHANGE "APPS" USER PASSWORD USING FNDCPASS in "R12"*/

FNDCPASS apps/APPS_PASSWORD 0 Y system/SYSTEM_PASSWORD SYSTEM APPLSYS NEW_PASSWORD

Finding active users in Apps R12

Find application accessing users in apps r12.

open apache log file find the user names and server names.
goto log_home cd $LOG_HOME/10.1.3/Apache/
grep the apache log file find out application accessing usernames

access_log.1503100800

[sreenidba@sreenidba Apache]$ grep -i username access_log.1503100800
10.20dfvd fv [19/Aug/2017:08:46:29 +0530] "GET /OA_HTML/AppsLocalLogin.jsp?langCode=US&username=7df1 HTTP/1.1" 302 780 0 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.3sdudedia Center PC 6.0; Tablet PC 2.0; MANM)"
10.20.127.65 - - [19/Aug/2017:08:46:37 +0530] "POST /OA_HTML/OA.jsp?page=/oracle/apps/fnd/sso/login/webui/MainLoginPG&_ri=0&_ti=1542395888&language_code=US&requestUrl=&username=75dpdlangCode=US&oapc=6&oas=XynOEO7BE53L9TLf6mB9jA.. HTTP/1.1" 302 297 1 "http://sreenidba.sreenidbandia.com:sreenidba/OA_HTML/RF.jsp?function_id=29806&resp_id=-1&resp_appl_id=-1&security_group_id=0&lang_code=US&params=8sIY1xh-ORzMo9H-R0we9ZVHSP83hqjYSDh3i.JNgT5I49yw4.skh.8lnlBrLKGt&oas=pEjyMI7xnBlduVEEFwagww.." "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Tablet PC 2.0; MANM)"
10.20.125.164 - - [19/Aug/2017:08:44:37 +0530] "GET /OA_HTML/AppsLocalLogin.jsp?requestUrl=http%3A%2F%2Fsreenidba.sreenidbandia.com%3Asreenidba%2FOA_HTML%2Fjsp%2Ffnd%2Fclose.jsp&cancelUrl=http%3A%2F%2Fsreenidba.sreenidbandia.com%3Asreenidba%2FOA_HTML%2FAppsLogin&langCode=US&username=20677 HTTP/1.1" 302 1422 0 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3)"
10.20.125.164 - - [19/Aug/2017:08:44:43 +0530] "POST /OA_HTML/OA.jsp?page=/oracle/apps/fnd/sso/login/webui/MainLoginPG&_ri=0&_ti=178643341&language_code=US&requestUrl=http%3A%2F%2Fsreenidba.sreenidbandia.com%3Asreenidba%2FOA_HTML%2Fjsp%2Ffnd%2Fclose.jsp&cancelUrl=http%3A%2F%2Fsreenidba.sreenidbandia.com%3Asreenidba%2FOA_HTML%2FAppsLogin&username=20fdfrrCode=US&oapc=2&oas=D6egnq0Hqj5a8BM4kHL9qw.. HTTP/1.1" 302 276 0 "http://sreenidba.sreenidbandia.com:sreenidba/OA_HTML/RF.jsp?function_id=29806&resp_id=-1&resp_appl_id=-1&security_group_id=0&lang_code=US&params=gT7jP8bDs1Ql9RNPkQ.F.PnXL.gtaFgFW8oqODIcnbZPA5k-jLNcomUQTz7PFfLsmBgxZhYXw3a5OXx96z4DtN7nFYn6bjOCmvGUT60dO3.KtZMqgQCbYIEwe5FbhG8rAOkqlKgDHnl.eF1n4WrP5FXpi.WM1atA8WCmrzhrLuUTvp5M61wORZkYsAFEvldnqmSrjXxqph.j5rGU.G5Gqq-

Tablespace and Datafile Management

1.Creating tablespaces, Adding and Resizing datafiles
SQL>create tablespace <Tablespace_name> datafile '<datafilelocation>' size 128m autoextend on next 128m maxsize unlimited;
SQL>create tablespace USERS datafile '/soadev/oradata/soadohr2/datafile/users01.dbf' size 128m autoextend on next 128m maxsize unlimited ;
2.Resing the datafile
SQL> alter database datafile'/d01/oracle/PROD/proddata/apps_ts_tx_idx538.dbf' resize 6144M;
3.adding datafile
SQL>alter tablespace <Tablespace Name> add datafile <path of the datafile> size 500m;
SQL>alter tablespace tbs add datafile '/d01/oracle/prod/tbs05.dbf' size 500m;
4.create tablespace in RAC Environment
SQL>create tablespace <TABLESPACE_NAME> datafile size 128m autoextend on next 128m maxsize unlimited;
SQL>create tablespace USERS datafile '+DATA' size 128m autoextend on next 128m maxsize unlimited ;
5.Add datafile in RAC Environment 
SQL>alter tablespace <Tablespace_name> add datafile '+DATA' size 128m autoextend on next 128m maxsize unlimited;
SQL>alter tablespace UNDOTBS1 add datafile '+DATA' size 128m autoextend on next 128m maxsize unlimited;

Monitoring RMAN Backup

1.crosscheck backup
2.crosscheck archivelog all
3.listout expired backup and expired archivelog all

Connect Rman:
[root@ltkbwlndb01 ~]# su - oraprod
[oraprod@ltkbwlndb01 ~]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Mon Aug 21 03:01:09 2017

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

connected to target database: PROD (DBID=191713860)

RMAN>
RMAN> crosscheck backup device type disk;

using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=65 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=175 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=413 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=479 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=699 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=850 device type=DISK
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9dsc58eh_366893_1 RECID=590076 STAMP=952279505
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9dsc58eh_366893_2 RECID=590077 STAMP=952279711
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9dsc58eh_366893_3 RECID=590078 STAMP=952279948
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9dsc58eh_366893_4 RECID=590079 STAMP=952280172
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9dsc58eh_366893_5 RECID=590080 STAMP=952280367
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9dsc58eh_366893_6 RECID=590081 STAMP=952280559
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9dsc58eh_366893_7 RECID=590082 STAMP=952280755
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9dsc58eh_366893_8 RECID=590083 STAMP=952280998
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9dsc58eh_366893_9 RECID=590084 STAMP=952281251
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9dsc58eh_366893_10 RECID=590085 STAMP=952281432
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9dsc58eh_366893_11 RECID=590086 STAMP=952281602
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9dsc58eh_366893_12 RECID=590087 STAMP=952281754
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9dsc58eh_366893_13 RECID=590088 STAMP=952281902
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9dsc58eh_366893_14 RECID=590089 STAMP=952282038
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9dsc58eh_366893_15 RECID=590090 STAMP=952282171
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9fsc58eh_366895_1 RECID=590091 STAMP=952279505
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9fsc58eh_366895_2 RECID=590092 STAMP=952279726
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9fsc58eh_366895_3 RECID=590093 STAMP=952279945
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9fsc58eh_366895_4 RECID=590094 STAMP=952280165
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9fsc58eh_366895_5 RECID=590095 STAMP=952280392
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9fsc58eh_366895_6 RECID=590096 STAMP=952280616
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/d03/backup/prodbackup/BackupPROD_DB_9fsc58eh_366895_7 RECID=590097 STAMP=952280853
backup piece handle=/d03/backup/prodbackup/cntrl_c-191713860-20170819-03 RECID=591007 STAMP=952455505
Crosschecked 524 objects
RMAN> list expired backup;
  469     Full 37119983424 19-AUG-17 /d01/oracle/PROD/proddata/apps_ts_tx_data469.dbf
  479     Full 37119983424 19-AUG-17 /d01/oracle/PROD/proddata/apps_ts_tx_data479.dbf
  490     Full 37119983424 19-AUG-17 /d01/oracle/PROD/proddata/apps_ts_tx_data490.dbf
  500     Full 37119983424 19-AUG-17 /d01/oracle/PROD/proddata/apps_ts_tx_data500.dbf
  510     Full 37119983424 19-AUG-17 /d01/oracle/PROD/proddata/apps_ts_tx_idx510.dbf
  519     Full 37119983424 19-AUG-17 /d01/oracle/PROD/proddata/apps_ts_tx_idx519.dbf
  525     Full 37119983424 19-AUG-17 /d01/oracle/PROD/proddata/apps_ts_tx_idx525.dbf
  535     Full 37119983424 19-AUG-17 /d01/oracle/PROD/proddata/apps_ts_tx_idx535.dbf
  551     Full 37119983424 19-AUG-17 /d01/oracle/PROD/proddata/apps_ts_interface551.dbf
  562     Full 37119983424 19-AUG-17 /d01/oracle/PROD/proddata/apps_ts_queues562.dbf

  Backup Set Copy #1 of backup set 365617
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:50:39     19-AUG-17       YES        TAG20170819T180504

    List of Backup Pieces for backup set 365617 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    590959  1   EXPIRED     /d03/backup/prodbackup/BackupPROD_DB_nbscah6h_367339_1
    590960  2   EXPIRED     /d03/backup/prodbackup/BackupPROD_DB_nbscah6h_367339_2
    590961  3   EXPIRED     /d03/backup/prodbackup/BackupPROD_DB_nbscah6h_367339_3
    590962  4   EXPIRED     /d03/backup/prodbackup/BackupPROD_DB_nbscah6h_367339_4
    590963  5   EXPIRED     /d03/backup/prodbackup/BackupPROD_DB_nbscah6h_367339_5
    590964  6   EXPIRED     /d03/backup/prodbackup/BackupPROD_DB_nbscah6h_367339_6
    590965  7   EXPIRED     /d03/backup/prodbackup/BackupPROD_DB_nbscah6h_367339_7
    590966  8   EXPIRED     /d03/backup/prodbackup/BackupPROD_DB_nbscah6h_367339_8
    590967  9   EXPIRED     /d03/backup/prodbackup/BackupPROD_DB_nbscah6h_367339_9
    590968  10  EXPIRED     /d03/backup/prodbackup/BackupPROD_DB_nbscah6h_367339_10
    590969  11  EXPIRED     /d03/backup/prodbackup/BackupPROD_DB_nbscah6h_367339_11
    590970  12  EXPIRED     /d03/backup/prodbackup/BackupPROD_DB_nbscah6h_367339_12
    590971  13  EXPIRED     /d03/backup/prodbackup/BackupPROD_DB_nbscah6h_367339_13
    590972  14  EXPIRED     /d03/backup/prodbackup/BackupPROD_DB_nbscah6h_367339_14
    590973  15  EXPIRED     /d03/backup/prodbackup/BackupPROD_DB_nbscah6h_367339_15
    590974  16  EXPIRED     /d03/backup/prodbackup/BackupPROD_DB_nbscah6h_367339_16
    590975  17  EXPIRED     /d03/backup/prodbackup/BackupPROD_DB_nbscah6h_367339_17
    590976  18  EXPIRED     /d03/backup/prodbackup/BackupPROD_DB_nbscah6h_367339_18
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
365629  Full    38.05M     DISK        00:00:00     19-AUG-17
        BP Key: 591007   Status: EXPIRED  Compressed: NO  Tag: TAG20170819T185825
        Piece Name: /d03/backup/prodbackup/cntrl_c-191713860-20170819-03
  SPFILE Included: Modification time: 18-AUG-17
  SPFILE db_unique_name: PROD
  Control File Included: Ckp SCN: 37123802958   Ckp time: 19-AUG-17
RMAN>
RMAN> delete expired backup;
590996  365618  20  1   EXPIRED     DISK        /d03/backup/prodbackup/BackupPROD_DB_ngscah6h_367344_20
590997  365619  1   1   EXPIRED     DISK        /d03/backup/prodbackup/BackupPROD_DB_nuscak9d_367358_1
590998  365620  1   1   EXPIRED     DISK        /d03/backup/prodbackup/BackupPROD_DB_npscak9d_367353_1
590999  365621  1   1   EXPIRED     DISK        /d03/backup/prodbackup/BackupPROD_DB_nqscak9d_367354_1
591000  365622  1   1   EXPIRED     DISK        /d03/backup/prodbackup/BackupPROD_DB_nlscak9d_367349_1
591001  365623  1   1   EXPIRED     DISK        /d03/backup/prodbackup/BackupPROD_DB_nrscak9d_367355_1
591002  365624  1   1   EXPIRED     DISK        /d03/backup/prodbackup/BackupPROD_DB_nsscak9d_367356_1
591003  365625  1   1   EXPIRED     DISK        /d03/backup/prodbackup/BackupPROD_DB_ntscak9d_367357_1
591004  365626  1   1   EXPIRED     DISK        /d03/backup/prodbackup/BackupPROD_DB_nnscak9d_367351_1
591005  365627  1   1   EXPIRED     DISK        /d03/backup/prodbackup/BackupPROD_DB_noscak9d_367352_1
591006  365628  1   1   EXPIRED     DISK        /d03/backup/prodbackup/BackupPROD_DB_nmscak9d_367350_1
591007  365629  1   1   EXPIRED     DISK        /d03/backup/prodbackup/cntrl_c-191713860-20170819-03

Do you really want to delete the above objects (enter YES or NO)?YES
backup piece handle=/d03/backup/prodbackup/cntrl_c-191713860-20170819-03 RECID=591007 STAMP=952455505
Deleted 524 EXPIRED objects

RMAN> crosscheck archivelog all;
validation succeeded for archived log
archived log file name=/d02/oracle/PROD/archive/1_60914_779875526.dbf RECID=59712 STAMP=952555371
validation succeeded for archived log
archived log file name=/d02/oracle/PROD/archive/1_60915_779875526.dbf RECID=59713 STAMP=952563970
validation succeeded for archived log
archived log file name=/d02/oracle/PROD/archive/1_60916_779875526.dbf RECID=59714 STAMP=952567317
validation succeeded for archived log
archived log file name=/d02/oracle/PROD/archive/1_60917_779875526.dbf RECID=59715 STAMP=952568949
validation succeeded for archived log
archived log file name=/d02/oracle/PROD/archive/1_60918_779875526.dbf RECID=59716 STAMP=952570798
Crosschecked 1100 objects
RMAN>
RMAN> list expired archivelog all;
specification does not match any archived log in the repository
If you found any expired archive logs delete using below command
RMAN> list expired archivelog all;
RMAN> delete expired archivelog all;

released channel: ORA_DISK_1
released channel: ORA_DISK_2
released channel: ORA_DISK_3
released channel: ORA_DISK_4
released channel: ORA_DISK_5
released channel: ORA_DISK_6
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=65 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=175 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=413 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=479 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=699 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=850 device type=DISK
specification does not match any archived log in the repository

RMAN>




Sunday, 20 August 2017

Oracle Architecture



Description:
user process and server processes
when ever user connnect's to the oracle server, then it will create one session. that session is colled as user session. session is nothing but user and server prosesses transactons between is colled as a session.
Oracle instance:  An Oracle Instance consists of two different sets of components:
SGA:System Global Area
SGA(system global area or shared global area) contains memory structures and background processes.
Memory Structures
1.Dabase Buffer cache
2.Redolog Buffer
3.Shared pool
4.javapool and largepool

Background Processes
1.DBwn 2.ckpt 3.smon 4.pmon 5.arcn 6.lgwr

Memory structures:
1.Database Buffer Cache:

  • The database buffer cache holds blocks of data from disk that have been recently read to satisfy a SELECT statement or that contain modified blocks that have been changed or added from a DMLstatement. 

2.Redo Log guffer
  • The redo log buffer holds the most recent changes to the data blocks in the datafiles.
  • When the redo log buffer is one-third full, or every three seconds, Oracle writes redo log records to the redo log files. the LGWR process will write the redo log records to the redo log files.
  • A user’s committed transaction is not considered complete until the redo log entries have been successfully written to the redo log files.
  • whenever user's perform's any DML Operations like update, delete that statemnts will be strored under redolog buffer. if the user gives any commit operations the log writer (LGWR) writes the statemts into redolog files.  
Shared pool:
  • The shared pool contains two major sub caches: the library cache and the data dictionary cache.
  • The shared pool is sized by the SHARED_POOL_SIZE initialization parameter. 
Lirary cache
  • The library cache holds information about SQL and PL/SQL statements that are run against the database.
  • In the library cache, because it is shared by all users, many different 
    database users can potentially share the same SQL statement.
  • The second time an identical SQL statement is run, by the same user or a different user, the execution plan and parse tree are already computed, improving the execution time of the query or DML statement.

DATA Dictionary Cache:
  • it is a part of sharedpool memory structure, data dictionary is a collection of database tables and views containing reference information about the database, its structures, and its users. Oracle accesses the data dictionary frequently during SQL statement parsing. 
The data dictionary has three primary uses:
  • Oracle accesses the data dictionary to find information about users, schema objects, and storage structures.
  • Oracle modifies the data dictionary every time that a data definition language (DDL) statement is issued.
  • Any Oracle user can use the data dictionary as a read-only reference for information about the database.
  • The data dictionary is always available when the database is open. It resides in the SYSTEM tablespace, which is always online.
Logical And Physical database structures


Tablespaces monitoring

Scripts To Check Tablespace used and free space 
set lines 132
set pages 60
set feedback on
column name format a15
SELECT
a.tablespace_name,
(a.BYTES / 1024/1024)  AS total_MB,
ROUND(((a.BYTES-b.BYTES)/1024/1024) ,2) AS used_MB,
(b.BYTES / 1024/1024)  AS free_MB,
ROUND (((a.BYTES - b.BYTES) / a.BYTES) * 100, 2) AS percent_used,
ROUND (100 - ((a.BYTES - b.BYTES) / a.BYTES) * 100, 2) AS percent_free
FROM (SELECT   tablespace_name, SUM (BYTES) BYTES
FROM dba_data_files
GROUP BY tablespace_name) a,
(SELECT   tablespace_name, SUM (BYTES) BYTES, MAX (BYTES) largest
FROM dba_free_space
GROUP BY tablespace_name) b
WHERE a.tablespace_name = b.tablespace_name
union
select sh.tablespace_name,
sum(sh.bytes_used + sh.bytes_free)/1048576 total,
sum(sh.bytes_used)/1048576 used,
sum(sh.bytes_free)/1048576 free,
sum(sh.bytes_used) /sum(sh.bytes_used + sh.bytes_free) *100 percent_used,
sum(sh.bytes_free) /sum(sh.bytes_used + sh.bytes_free) *100 percent_free
from v$temp_space_header sh
group by tablespace_name

ORDER by 6;

(OR)
set linesize 121
column dummy noprint
column  pct_used format 999.9       heading "%|Used"
column  name    format a19      heading "Tablespace Name"
column  Kbytes   format 999,999,999    heading "KBytes"
column  used    format 999,999,999   heading "Used"
column  free    format 999,999,999  heading "Free"
column  largest    format 999,999,999  heading "Largest"
column  max_size format 999,999,999 heading "MaxPoss|Kbytes"
column  pct_max_used format 999.9       heading "%|Max|Used"
break   on report
compute sum of kbytes on report
compute sum of free on report
compute sum of used on report

select (select decode(extent_management,'LOCAL','*',' ') ||
               decode(segment_space_management,'AUTO','a ','m ')
          from dba_tablespaces where tablespace_name = b.tablespace_name) ||
nvl(b.tablespace_name,
             nvl(a.tablespace_name,'UNKOWN')) name,
       kbytes_alloc kbytes,
       kbytes_alloc-nvl(kbytes_free,0) used,
       nvl(kbytes_free,0) free,
       ((kbytes_alloc-nvl(kbytes_free,0))/
                          kbytes_alloc)*100 pct_used,
       nvl(largest,0) largest,
       nvl(kbytes_max,kbytes_alloc) Mgax_Size,
       decode( kbytes_max, 0, 0, (kbytes_alloc/kbytes_max)*100) pct_max_used
from ( select sum(bytes)/1024 Kbytes_free,
              max(bytes)/1024 largest,
              tablespace_name
       from  sys.dba_free_space
       group by tablespace_name ) a,
     ( select sum(bytes)/1024 Kbytes_alloc,
              sum(maxbytes)/1024 Kbytes_max,
              tablespace_name
       from sys.dba_data_files
       group by tablespace_name
       union all
      select sum(bytes)/1024 Kbytes_alloc,
              sum(maxbytes)/1024 Kbytes_max,
              tablespace_name
       from sys.dba_temp_files
       group by tablespace_name )b
where a.tablespace_name (+) = b.tablespace_name

order by 5 ;

Thursday, 17 August 2017

Recovery Catalog

Creating Recovery catalog:
Catalog database is :UAT
Target database is :DEV
Enter the Tns entries in DEV and UAT.
Tns entries in DEV
$cd $TNS_ADMIN
edit tnsname.ora
Here enter the tns entries of UAT instance
[oradev@sreenidba DEV_sreenidba]$vi tnsnames.ora
UAT=
        (DESCRIPTION=
                (ADDRESS=(PROTOCOL=tcp)(HOST=sreeni.dba.sreenidba.com)(PORT=1532))
            (CONNECT_DATA=
                (SERVICE_NAME=UAT)
                (INSTANCE_NAME=UAT)
            )
        )
TNS Entries in UAT:
here enter the tns entries DEV instance
[orauat@sreenidba UAT_sreenidba]$vi tnsnames.ora
DEV=
        (DESCRIPTION=
                (ADDRESS=(PROTOCOL=tcp)(HOST=sreenidba..sreenidba.com)(PORT=1529))
            (CONNECT_DATA=
                (SERVICE_NAME=DEV)
                (INSTANCE_NAME=DEV)
            )
        )
creating catalog user and tablespace in UAT
SQL>create tablespace ract_tab datafile'/d01/oradata/UAT/ract_tab01.dbf' size 2g;

tablespace created.
SQL>create user rcat identified by rcat default tablecpace rcat_tab quota unlimited on rcat_tab;

User created.

Grant RECOVERY_CATALOG_OWNER role to recovery catlog user

SQL> grant recovery_catalog_owner to rcat;

Grant succeeded.

Connect to target DB (DEV) and recovery catlog DB (UAT) to create catalog:
[oradev@sreenidba DEV_sreenidba]$ rman target / catalog rcat/rcat@UAT

Recovery Manager: Release 11.2.0.3.0 - Production on Wed Aug 16 15:02:41 2017

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

connected to target database: DEV (DBID=4028789387)
connected to recovery catalog database

RMAN>

NOW create catalog Run the CREATE CATALOG command to create the catalog. The creation of the catalog can take several minutes. 
If the catalog tablespace is this user's default tablespace, then you can run this command:

RMAN> create catalog;

recovery catalog created

Regiter the database in recovery catalog database;
RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

Monitoring Cost Manager

Log on sysadmin user
Navigate:à Setup Mfg Responsibility


















àClick on Setup<Inventory>Transactionsà

àInterface Managers

















Click on interface Managersà





Wednesday, 16 August 2017

Applying patch in oracle applications using adpatch utility

Step1: Check Database invalids and take the backup of database invalid objects.
SQL>select count(*) from dba_objects where status like’INVALID’;
SQL>create table dba_objects_backup as select * from dba_objects where status like ‘INVALID’;
Step 2:Check The given patch applied or not from ad_bugs table.
SQL>select creation_date, bug_number from ad_bugs where bug_number like’<Patch_Number>’;
Step 3:Down the Application services.
adstpall.sh
Check FNDLIBR executable  $ps –ef|grep FNDLIBR
$ps –ef|grep applprod|grep FNDLIBR
Step 4:Enable maintenance mode using adadmin.

  • By Enabling maintenance mode workflow bussiness events will be disabled auotmatically and end user's can't access the business.
  • During a Maintenance mode downtime, user login is restricted. 
  • Users are redirected to a system downtime URL, which informs them that the maintenance session is in progress.


 $adadmin



























Step 5: Open Readme.txt, read the instructions and Apply the patch.













Now check the database invalids, and compile.
SQL>select count(*) from dba_objects where status like'INVALID';
Disable maintenance mode and start the apps services.
cd $ADMIN_SCRIPTS

$adstrtall.sh

How to change Apps Password in R12.1

  /* CHANGE APPLICATION USER PASSWORD USING FNDCPASS*/ FNDCPASS apps/APPS_PASSWORD 0 Y system/SYSTEM_PASSWORD USER USER_WHOSE_PASSWORD_WILL_...