Странице

Ознаке

петак, 29. март 2013.

Citrix Xen 6 add new disk

First check the new added disk with command
fdisk -l
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 499 4008186 83 Linux
/dev/sda2 500 998 4008217+ 83 Linux
/dev/sda3 999 30401 236179597+ 83 Linux

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table

So you see wee have one raw disk /dev/sdb.

Now you have to check the ID of the host:
xe host-list
uuid ( RO) : ba3d140c-3de5-499b-b831-7c40d82958a8
name-label ( RW): xen_test
name-description ( RO): Default install of XenServer

You have 3 options to create new disk in Citrix Xen
1. Create normal LVHD storage repository:
xe sr-create host-uuid=ba3d140c-3de5-499b-b831-7c40d82958a8
content-type=user type=lvm device-config:device=/dev/sdb
shared=false name-label="Local storage 2"
2.Create a LVHD storage repository with thin provisioning support.
xe sr-create host-uuid=ba3d140c-3de5-499b-b831-7c40d82958a8
content-type=user type=lvm device-config:device=/dev/sdb
shared=false name-label="Local storage 2" smconfig:allocation=thin
3.Create a EXT storage repository with thin provisioning support and direct access to
the vhd files.
xe sr-create host-uuid=ba3d140c-3de5-499b-b831-7c40d82958a8
content-type=user type=ext device-config:device=/dev/sdb
shared=false name-label="Local storage 2"

Remove Disk from XEN server 

Find the SR uuid of the disk:
xe sr-list name-label=<NAME OF DISK>
Find the PBD of the disk(search by UUID)
xe pbd-list sr-uuid=<SR UUID>
Unplug the disk by PBD
xe pbd-unplug uuid=<UUID of PBD>
Forget the disk:
sr-forget uuid=<UUID of SR>

четвртак, 28. март 2013.

Extract FND Log per user

1. Get the user ID
select USER_ID
from fnd_user
where user_name= <'USERNAME'>
2. Get the starting Max log sequence for user
select max(LOG_SEQUENCE)
FROM FND_LOG_MESSAGES
where user_id =<USER_ID>
3. Reproduce the issue
N/A

4. Get the ending Max log sequence for user
SELECT module, message_text
FROM FND_LOG_MESSAGES LOG
WHERE user_id = 1360
AND LOG_SEQUENCE between <LOG_SEQUENCE> and <LOG_SEQUENCE>
ORDER BY LOG.LOG_SEQUENCE;

R12 Tablespace maintanance

How to maintain tablespaces in Oracle Apps R12

--check the segment size in specific tablespace
-----------------------------------------------------------------
col username format a8 justify c heading 'Username'
col extents format 999,999,990 justify c heading '# of Extents'
col segment_type format a15 justify c heading 'Segment Type'
col segment_name format a28 justify c heading 'Segment Name'
col kbytes format 999,999,990 justify c heading 'KB Used'
select
owner username,
segment_name segment_name,
segment_type segment_type,
bytes/1024 kbytes,
extents extents
from
dba_segments
where
tablespace_name = 'APPS_TS_TX_DATA'
order by
kbytes asc
/

select extent_id, file_id, block_id, blocks from dba_extents
where owner=upper('APPLSYS') and segment_name = upper('WF_ITEM_ATTRIBUTE_VALUES');

--check if segments are QUEUE type or if they have type LONG columns. If this queries return results then you should not touch this segments.
-----------------------------------------------------------------
select queue_table from dba_queue_tables
where owner=upper('APPLSYS') and queue_table = upper('WF_ITEM_ATTRIBUTE_VALUES');
select table_name, column_name,data_type from dba_tab_columns
where owner=upper('APPLSYS') and table_name = upper('WF_ITEM_ATTRIBUTE_VALUES')
and data_type in ('LONG','LONG RAW');
--Check the segment type
-----------------------------------------------------------------
select segment_name, segment_type from dba_segments
where owner=upper('APPLSYS') and segment_name = upper('WF_ITEM_ATTRIBUTE_VALUES');
--If segment type is table them move it and rebuild indexes
-----------------------------------------------------------------
alter table APPLSYS.WF_ITEM_ATTRIBUTE_VALUES move;
select owner, index_name, status from dba_indexes
where table_owner = upper('APPLSYS') and
table_name = upper('WF_ITEM_ATTRIBUTE_VALUES');
alter index APPLSYS.WF_ITEM_ATTRIBUTE_VALUES_PK rebuild;

уторак, 26. март 2013.

Script to find database locks

Here is one script for finding database locks:
set linesize 150;
set head on;
col sid_serial form a13
col ora_user for a15;
col object_name for a35;
col object_type for a10;
col lock_mode for a15;
col last_ddl for a8;
col status for a10;
break on sid_serial;
SELECT l.session_id||','||v.serial# sid_serial,
       l.ORACLE_USERNAME ora_user,
       o.object_name,
       o.object_type,
       DECODE(l.locked_mode,
          0, 'None',
          1, 'Null',
          2, 'Row-S (SS)',
          3, 'Row-X (SX)',
          4, 'Share',
          5, 'S/Row-X (SSX)',
          6, 'Exclusive',
          TO_CHAR(l.locked_mode)
       ) lock_mode,
       o.status,
       to_char(o.last_ddl_time,'dd.mm.yy') last_ddl
FROM dba_objects o, gv$locked_object l, v$session v
WHERE o.object_id = l.object_id
      and l.SESSION_ID=v.sid
order by 2,3;

And here is the example on how to kill a session
alter system kill session '60,13';
or
alter system disconnect session '60,13' 
You can add POST_TRANSACTION or IMMEDIATE options after SID with DISCONNECT. With KILL session you can add only IMMEDIATE; 

Incomplete recoveries

3 types of recoveries: timed based recovery, log-sequence recovery,
Recover database until time ‘2008-10-23:13:00:00’
Recover database until sequence 34;
Recover database until change 226250;
Opening database after incomplete recovery:
alter database open resetlogs;
Recovering from the Loss of a Tempfile:
ALTER TABLESPACE TEMP ADD TEMPFILE ‘<FILE_LOCATION>/temp01.dbf’SIZE 200m  REUSE AUTOEXTEND ON;
Recovering from the Loss of an Online Redo Log Group

1. Dealing with the Loss of an Inactive Online Redo Log Group Member
Just recreate redo log group member:

alter database add logfile ‘D:\ORACLE\ORADATA\ORCL\REDO02.LOG’ reuse to
group 2;
2. Dealing with the Loss of an Inactive Online Redo Log Group

  • During database startup - Drop the log file group then recreate online redo log group 
alter database drop logfile group 2;
alter database add logfile group 2 ‘c:\oracle\oradata\orcl\redo02.log’ size 50m;
alter database add logfile group 2 ‘c:\oracle\oradata\orcl\redo02.log’ size 50m;

  • When database is running - force the checkpoint and then clear the log group
alter system checkpoint;
alter database clear logfile group 1;
          If you receive the the following error:
          ERROR at line 1:
          ORA-00350: log 1 of instance orcl (thread 1) needs to be archived
          ORA-00312: online log 1 thread 1: ‘/oracle01/oradata/orcl/redo01.log’ 

          Then you need to clear unarchived log file:
alter database clear unarchived logfile ‘/oracle01/oradata/orcl/redo01.log’;
          then again you issue:
alter database clear logfile group 1; 
3. Dealing with the Loss of an Active but Not Current Online Redo Log Group
alter database clear unarchived logfile ‘/oracle01/oradata/orcl/redo01.log’;
 4. Dealing with the Loss of the Current Online Redo Log Group
alter system checkpoint;
shutdown;
startup mount;
alter database clear unarchived logfile ‘/oracle01/oradata/orcl/redo01.log’;
alter database open


Recovering Lost Control Files with a Backup Control File
recovery from the loss of all control files using backup control file.

1. Restore backup control file to the location where control files should reside(check CONTROL_FILES parameter).
2. mount the database
startup mount;
3. Recover the database with:
recover database using backup controlfile 
4. At the prompt type AUTO to apply all archived logs.
5. If you get an error please run again:
recover database using backup controlfile 
6. At the prompt choose one of the online redo logs .
7. Issue:
alter database open resetlogs;
Recovering Lost Control Files Using the create control file Command 

1. Assuming that you created control file creation script:

alter database backup controlfile to trace;
2.  Manually issue the create control file command but first modify the RESETLOGS or NORESETLOGS parameter.

Recovering from the Loss of the Password File

If you have backup, please restore it to $ORACLE_HOME/dbs

If no backup then:
cd $ORACLE_HOME/dbs
orapwd file=orapw<SID> entries=20 password=acid
where password is the password for SYS user     

Restore views, parameter, commands

Put the data file offline
alter database datafile 4 offline; - data file ID used to identify datafile.

alter database datafile ’<DATA_FILE_LOCATION>\DATAF01.DBF’ offline;
From this view  you can get data file id`s
select file_id, file_name from dba_data_files;
Renaming data file name is used when changing data file location:
alter database rename file ’<DATA_FILE_OLD_LOCATION>/system01.dbf’ to ’<DATA_FILE_NEW_LOCATION>/system01.dbf’;
Recovering database:
recover database
recover tablespace
recover datafile

Figuring Out Which archived Redo logs You need from views:
V$RECOVER_FILE
V$LOG_HISTORY
Select a.file#, a.change#, b.first_change#, b.next_change#, b.sequence# from v$recover_file a, v$log_history b
To find the a name of the archived log use the V$ARCHIVED_LOG view:

Select a.file#, a.change#, b.first_change#, b.next_change#,
b.sequence#, b.name
from v$recover_file a, v$archived_log b
where a.change#<=b.next_change#;






Backup views,statements, parameters...

V$DATABASE - Provides basic database-related information, including the
logging mode
SQL> Select log_mode from v$database;
LOG_MODE
V$INSTANCE - Provides basic instance information
V$DATAFILE - Provides database datafile information stored in the control file
V$LOGFILE - Provides information on the individual redo log file members from
the control file
V$LOG - Provides information on the redo log groups from the control file
V$ARCHIVED_LOG - Provides archive log information from the control file
V$LOG_HISTORY - Provides information on redo log switches in the database
DBA_DATA_FILES - Provides datafile information from the data dictionary
DBA_TABLESPACES-  Provides information on tablespaces in the database
---------------------------------------------------------------------------------------------------------

LOG_ARCHIVE_DEST Indicates the destination to copy archived redo logs to.
Typically this parameter is not set and the LOG_ARCHIVE_DEST_N parameter is set instead.
LOG_ARCHIVE_DEST_n Indicates one of up to 10 destinations to copy archived
redo logs to. The first destination starts with 1 (LOG_ARCHIVE_DEST_01).
LOG_ARCHIVE_DEST_STATE_n Indicates the state of LOG_ARCHIVE_DEST_N (ENABLED,
DEFERRED, or ALTERNATE).]
LOG_ARCHIVE_FORMAT Indicates the format of the archived redo log filenames.
Alter system set log_archive_format=’<SID>_%s_%t_%r_%d.arc’;
%s represents the sequence number

%t is the thread number that represents an individual node on a cluster when your database is running on Oracle’s RAC.

%r represents the resetlogs number
%d represents the DBID that should be unique for each database

---------------------------------------------------------------------------------------------------------
To force an archive-log switch :
alter system switch logfile; 
ARCHIVE LOG MODE DATA DICTIONARY VIEWS

V$ARCHIVE - provides information on redo logs that are
in need of being archived.
V$ARCHIVE_DEST - provides information on each individual
archive-log destination. Used for Data Guard.
V$ARCHIVE_DEST_STATE - provides status information  on each of the individual archive-log destination directories.
V$ARCHIVE_PROCESSES - provides information on the different ARCH processes running on your system.
V$ARCHIVED_LOG - view provides information on individual
archived redo logs.
V$LOG - provides information on the online redo log groups
V$LOGFILE - provides information on specific online redo logs.
V$LOG_HISTORY - provides historical information on all online/archived redo logs.
------------------------------------------------------------------------------------------------------------
Recreate temp files
Alter tablespace test_temp
Add tempfile ’/u01/u01/testtempfile01.dbf’ size 100m;
Begin/End online backup:
alter database begin backup
alter database end backup 
Backup control file:
alter database backup controlfile to ‘<BACKUP+LOCATION>\backup_ctrl.ctl’;
or
alter database backup controlfile to trace
Trace file will be generated in DIAGNOSTIC_DEST folder.

понедељак, 25. март 2013.

Linux backup/restore from TAR

Today i had a situation with one linux (Debian) machine. The HD retired. As i did not have spare HD at me, i had to transfer the whole backup on the another machine. Here are the steps from the start.

Backup is generated with the following command:

su -c 'time /bin/tar --totals -cf - --directory=/ --exclude=proc --exclude=sys --exclude=dev/pts --exclude=backups . | /bin/gzip -1c | cat > <BACKUP_LOCATION>/tarball.tar.gz'
1. Install Linux on the new machine with default settings
2. After installation is complete go to the /etc folder and type the following command:
cp fstab fstab.backup
, then go to /boot/grub and type:
cp grub.cfg grub.cfg.backup
Optionally backup net rules file
cp /etc/udev/rules.d/70-persistent-net.rules  /etc/udev/rules.d/70-persistent-net.rules.backup
3. Copy the previously create tarball.tar.gz to a location of your choice.
4. Go to that location and issue the command:
tar -zxvpf tarball.tar.gz -C /
This command will override all the files in the root directory.

5. Now you have to restore the backup files from step 2. First remove the existing fstab and grub.cfg that you previously extracted. Then rename the backup files:
mv fstab.backup fstab
mv grub.cfg.backup grub.cfg
mv  /etc/udev/rules.d/70-persistent-net.rules.backup /etc/udev/rules.d/70-persistent-net.rules
6. Restart the server and hopefully after the restart you will have a fully restored system on your target machine.


R12 startup/shutdown of App and DB

Manual on how to start up or shutdown App or Db server in R12.

Startup/Shutdown App Server
1. Source the App env. Usually location of the env file is in folder <Folder where you installed R12>/oracle/<SID>/apps/apps_st/appl/APPS<SID_Hostname>.env
2. Go to folder $ADMIN_HOME_SCRIPTS
3. To shutdown App server
./adstpall.sh apps/apps
4. To startup App server
./adstrtal apps/apps
Startup/Shutdown DB server
1. Source the DB env. Usually location of the env file is in folder <Folder where you installed R12>/oracle/<SID>/db/tech_st/<DB_VERSION>/<SID_Hostname>.env
2. Go to folder $ORACLE_HOME/appsutil/scripts/<SID_hostname>/
3. To shutdown database immediate:
./addbctl.sh stop immediate
or if you want to shutdown database with option NORMAL just go without IMMEDIATE clause.

4. To shutdown listener:
 ./addlnctl.sh stop
5. To startup a database:
./addbctl.sh start
Be aware that you should source env files in separate Terminal sessions, not to source db/app env files one after another!

петак, 22. март 2013.

Alias in Linux

Basic usage:
alias newcommand='yourcommand -arguments'
If you want to start aterm according to your preferences with the command term, do something like:
alias term='aterm -ls -fg gray -bg black'
If you want a quick alias like ll for a more informative file listing:
ls -al --color=yes
Starting alias without any options lists the current aliases:
alias
alias ls='ls -la'
alias ls -al --color=yes
alias term='aterm -ls -fg gray -bg black'
Use unalias to remove an alias.
unalias term
You can also make aliases for existing commands. If you want ls to show colors by default, do:
alias ls='ls --color=yes'
These aliases can be put in your login script (.bash_profile or .profile depending on what shell you are using).

Alias with variables
You can not make aliases with variables. But you can make functions, having a function in your .profile/.bashrc will work just like an alias. To use ssh to copy files to a location on a server you can use
sendpic () { scp $* mina@foo.bar.ca:/www/misc/Pictures/; }

R12 Cleaning various files


When you clean log files be careful as some of them might still be used  or could contain some kind of errors that system will need for some reason. Leave the logs which are 2-3 days old if you dont really need to delete them...

App server files:
$INST_TOP/logs/ora/10.1.2/forms - Forms dump files :
$INST_TOP/logs/ora/10.1.2/reports/cache - Reports Cache :
$INST_TOP/logs/ora/10.1.3/Apache - Apache logs
$INST_TOP/logs/ora/10.1.3/opmn - OPMN Logs

Its advisable not to remove any logs under $INST_TOP/logs/ora/10.1.3/j2ee directory since these are very important logs and are required frequently for debugging.

$INST_TOP/logs/appl/admin/log - Logs for service management
$INST_TOP/logs/appl/conc/log - Concurrent Manager logs
$INST_TOP/logs/appl/conc/out - Concurrent Manager out files

Also, please delete any of the applied patch directories and archives.

Database server
background_dump_dest,
user_dump_dest
core_dump_dest directories as they are full of trace files.

Check the location of ORACLE_HOME using du -sh command. Usually the size of ORACLE_HOME should be aounr 3-4G. If size of ORACLE_HOME (other then datafiles) is abnormally large like 7-8G or more then you need to investigate which directory is consuming more space and accordingly clean up that directory if appropriate.

In some situation if it becomes impossible to clean up the space (because there are no trace files to cleanup) and you desperately want the space to be available on the file system, then you can connect to database as sysdba and try to reduce the size of temp files using “alter database tempfile .. resize” comamnd. This will release some space and prevent database from crashing in case file system is reaching 100% full.

and finally one useful Linux command...
find . -mtime +1 -exec rm {} \ - delete log more than one day old.

emctl error with cloned r12 instance

After cloning r12 instance i had a problem starting EM on target instance.

Problems was solved by changing paths in following files:
vi $ORACLE_HOME/bin/emca
vi $ORACLE_HOME/bin/emctl
vi $ORACLE_HOME/bin/EMDeploy
vi $ORACLE_HOME/bin/emtgtctl
vi $ORACLE_HOME/bin/emutil
vi $ORACLE_HOME/bin/eusm
vi $ORACLE_HOME/bin/emagentdeploy.pl
vi $ORACLE_HOME/sysman/config/emomslogging.properties
vi $ORACLE_HOME/sysman/config/emca.properties
vi $ORACLE_HOME/sysman/config/emd.properties
vi $ORACLE_HOME/sysman/config/emd.properties.emca
vi $ORACLE_HOME/sysman/config/emagentlogging.properties
vi $ORACLE_HOME/sysman/lib/env_emagent.mk
vi $ORACLE_HOME/bin/targetdeploy.pl
There are various paths with the old SID. New SID needs to be inserted.

Regards!

Script to Report Tablespace Free and Fragmentation

ttitle -
   center  'Database Freespace Summary'  skip 2

comp sum of nfrags totsiz avasiz on report
break on report

col tsname  format         a16 justify c heading 'Tablespace'
col nfrags  format     999,990 justify c heading 'Free|Frags'
col mxfrag  format 999,999,990 justify c heading 'Largest|Frag (KB)'
col totsiz  format 999,999,990 justify c heading 'Total|(KB)'
col avasiz  format 999,999,990 justify c heading 'Available|(KB)'
col pctusd  format         990 justify c heading 'Pct|Used'

select
  total.tablespace_name                       tsname,
  count(free.bytes)                           nfrags,
  nvl(max(free.bytes)/1024,0)                 mxfrag,
  total.bytes/1024                            totsiz,
  nvl(sum(free.bytes)/1024,0)                 avasiz,
  (1-nvl(sum(free.bytes),0)/total.bytes)*100  pctusd
from
  dba_data_files  total,
  dba_free_space  free
where
  total.tablespace_name = free.tablespace_name(+)
  and total.file_id=free.file_id(+)
group by
  total.tablespace_name,
  total.bytes

Show invalids in Oracle DB

select * from all_objects where status='INVALID' order by object_name desc;
 select owner, object_name, object_type, status from dba_objects where status='INVALID';

четвртак, 21. март 2013.

Recompile pll and fmb in r12

The manual on how to recompile pll and fmb files in r12

1. Source apps env variable
2. Rename existing pll/fmb to pll.<DATE> and fmb.<DATE>
3. Create FORMS_PATH as
export FORMS_PATH=$APPL_TOP/au/12.0.0/resource:$APPL_TOP/au/12.0.0/resource/US
   If you have more  than 1 language installed on r12 please add those path as well

4. Recompile pll
frmcmp_batch module=<Source PLL> userid=APPS/APPS output_file=<Target PLX> module_type=library batch=yes compile_all=special
5. Recompile fmb
frmcmp_batch module=<Source FMB> userid=APPS/APPS output_file=<Target FMX> module_type=form batch=yes compile_all=special
Location of files:

Plx i pll - $APPL_TOP/au/12.0.0/resource/

fmb - $APPL_TOP/au/12.0.0/forms/US/ or some other language
fmx - $APPL_TOP/<MODULE>/12.0.0/forms/US/ or some other language

Note: Before compiling plls and fmbs for other languages please initalize nls variable with the proper encoding:
export NLS_LANG=Croatian_Croatia.UTF8
Thats it!

EBS version query

If you want to find out the version of your EBS instance, use the following queries...

For APPS:
select RELEASE_NAME from fnd_product_groups;

For DB:
select * from v$version

Output post processor troubleshooting

Here are some Metalink notes on OPP troubleshooting

Output Post Processor (OPP) Log Contains Error "java.lang.OutOfMemoryError" [ID 1266368.1]
Output Post Processor (OPP) Log Contains Error "java.lang.OutOfMemoryError: Java heap space" [ID 1268217.1]
XML Publisher Data Template Request XDODTEXE Fails with Java.Lang.OutOfMemoryError [ID 390968.1]
How to Configure the Account Analysis Report in Release 12 for Large Reports [ID 737311.1]
Out Of Memory Error When Running XML Publisher Template Re-Generator Concurrent Program [ID 788935.1]
Previewing PDF Generates 'java.lang.OutOfMemoryError: java heap space' Error [ID 415995.1]
Large Reports are Not Produced When Using BI Publisher Scheduler [ID 1088838.1]

Output post processor log location


This is the query to get OPP log location:

SELECT fcpp.concurrent_request_id req_id, fcp.node_name, fcp.logfile_name
FROM fnd_conc_pp_actions fcpp, fnd_concurrent_processes fcp
WHERE fcpp.processor_id = fcp.concurrent_process_id
AND fcpp.action_type = 6
AND fcpp.concurrent_request_id = <request_id>;

R12 log locations

- Autoconfig log file:
Apps:
$INST_TOP/apps/$CONTEXT_NAME/admin/log/$MMDDHHMM/adconfig.log
Database:
$ORACLE_HOME/appsutil/log/$CONTEXT_NAME//adconfig.log $ORACLE_HOME/appsutil/log/$CONTEXT_NAME//NetServiceHandler.log
- Startup/Shutdown Log files:
$INST_TOP/logs/appl/admin/log
- Apache, OC4J and OPMN:
$LOG_HOME/ora/10.1.3/Apache $LOG_HOME/ora/10.1.3/j2ee $LOG_HOME/ora/10.1.3/opmn
- Patch log:
$APPL_TOP/admin/$SID/log/
- Concurrent log:
$INST_TOP/apps/$CONTEXT_NAME/logs/appl/conc/log
Apps:
$INST_TOP/apps/$CONTEXT_NAME/admin/log/ (StageAppsTier_MMDDHHMM.log)
Db:
$ORACLE_HOME/appsutil/log/$CONTEXT_NAME/(StageDBTier_MMDDHHMM.log)
Clone log files in target instance
Apps :
$INST_TOP/apps/$CONTEXT_NAME/admin/log/ApplyAppsTier_.log
Db:
$ORACLE_HOME/appsutil/log/$CONTEXT_NAME/ApplyDBTier_.log
- Alert Log File:
$ORACLE_HOME/admin/$CONTEXT_NAME/bdump/alert_$SID.log
Patch log file location:
$APPL_TOP/admin/PROD/log
Worker Log file location:
$APPL_TOP/admin/PROD/log

Concurrent manager log location


With the following query you can get log location of concurrent manager:
SELECT 'ICM_LOG_NAME=' || fcp.logfile_name
FROM fnd_concurrent_processes fcp, fnd_concurrent_queues fcq
WHERE fcp.concurrent_queue_id = fcq.concurrent_queue_id
AND fcp.queue_application_id = fcq.application_id
AND fcq.manager_type = '0'
AND fcp.process_status_code = 'A';
-----------------------------------------------------------------------

'ICM_LOG_NAME='||FCP.LOGFILE_NAME                                            
--------------------------------------------------------------------------------
ICM_LOG_NAME=/d02/oracle/TEST/inst/apps/TEST_prod2/logs/appl/conc/log/TEST_0321.
mgr

default location
$APPLCSF/$APPLLOG
Another possible location
$FND_TOP/log 

Linux untar to remote location or just to local directory

A few examples how to untar data to remote location:
ssh remotehost (cd /tmp ; tar xvf test.tar)
ssh remotehost "cd tmp ; tar xvf test.tar"
Or stream
cat test.tar | ssh remotehost "cd tmp ; tar xvf -"
cd /where/the/original/data/is ; tar -cf - . | ssh remotehost "cd tmp ; tar xvf -"
Untar to directory:
tar -C <directory> -zxvf tarball.tar.gz
Tar and gz specific directory:
 tar -cvzf tarball.tar.gz <FOLDER_TO_COMPRESS>
 Extract a single file from a .tar.gz file:
 gunzip -c /path/to/folder/filename.tar.gz | tar -xvf - path/within/archive/filename.php