Thursday, December 27, 2012

R3trans -d failed when oracle archiver get stuck

archiver location is full.
# bdf
Filesystem             kbytes    used            avail %used Mounted on
/dev/vg00/lvol12   20971520 20947873   22276  100% /oracle/PIP/oraarch

test R3trans -d which failed with return code 0012.

tstmig:pipadm 42> R3trans -d
This is R3trans version 6.14 (release 700 - 19.01.11 - 11:44:00).
unicode enabled version
2EETW169 no connect possible: "DBMS = ORACLE                           --- dbs_o                                                                                        ra_tnsname = 'PIP'"
R3trans finished (0012).
 

archiver location free
tstmig:pipadm 43> bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol12   20971520 1151649 18581263    6% /oracle/PIP/oraarch





test R3trans -d which success with return code 0000.
tstmig:pipadm 44> R3trans -d
This is R3trans version 6.14 (release 700 - 19.01.11 - 11:44:00).
unicode enabled version
R3trans finished (0000).
tstmig:pipadm 45>

Wednesday, October 17, 2012

How to make table editable in sap &SAP_EDIT

How to make table editable in sap

Earlier you can use &SAP_EDIT functionality in se16n so users can update table.

SAP has removed this function through note 1420281 which was delivered in Release 600 with Support Package 17 and Support Package 18.

Now other alternet as below.

1. call transaction se16n
2. Type '/h' to enter into the debug mode.
3. type two below variable name
    gd-sapedit
    gd-edit
4. change there value to X
5. execute

congratulation table open in editing mode.

Tuesday, October 09, 2012

Beginning Performance Tuning By Arup Nanda - Artical from ORACLE MAGAZINE

Extract of Beginning Performance Tuning By Arup Nanda - Artical from ORACLE MAGAZINE
http://www.oracle.com/technetwork/issue-archive/2012/12-jul/o42dba-1566567.html

Query for displaying sessions, session state, and events

select sid, state, event from v$session where username = 'ARUP';

SID   STATE              EVENT
————— —————————————————  ————————————————————————————
2832  WAITED KNOWN TIME  SQL*Net message from client
3346  WAITING            enq: TX - row lock contention


Query for displaying sessions, session state, and wait details


col "Description" format a50
select sid,decode(state, 'WAITING','Waiting','Working') state,
        decode(state,'WAITING','So far '||seconds_in_wait,'Last waited '||wait_time/100)||' secs for '||event "Description"
from v$session where username = 'ARUP';

Output:

SID   STATE       Description
————— ——————————  ———————————————————————————————————————————————————————
2832  Working     Last waited 2029 secs for SQL*Net message from client
3346  Waiting     So far 743 secs for enq: TX - row lock contention
4208  Waiting     So far 5498 secs for SQL*Net message from client



You can find out the blocking session and instance by issuing the following SQL statement:

select blocking_session B_SID,blocking_instance B_Inst from v$session
where sid = 3346;

B_SID   B_INST
——————  ———————
 2832      1


Getting row lock information

select row_wait_obj#,row_wait_file#,row_wait_block#,row_wait_row#
from v$session where sid = 3346;

ROW_WAIT_OBJ#  ROW_WAIT_FILE#  ROW_WAIT_BLOCK#  ROW_WAIT_ROW#
—————————————  ——————————————  ———————————————— ——————————————
241876         1024            2307623          0



To get the object information:

select owner, object_type, object_name, data_object_id from dba_objects
where object_id = 241876;

OWNER  OBJECT_TYPE  OBJECT_NAME   DATA_OBJECT_ID
—————  ———————————— ————————————  ——————————————
ARUP   TABLE        T1                    241877



Finding the row information

REM Filename: rowinfo.sql
REM This shows the row from the table when the
REM components of ROWID are passed. Pass the
REM following in this exact order
REM  1. owner
REM  2. table name
REM  3. data_object_id
REM  4. relative file ID
REM  5. block ID
REM  6. row Number
REM
select *
from &1..&2
where rowid =
        dbms_rowid.rowid_create (
                rowid_type      =>  1,
                object_number   => &3,
                relative_fno    => &4,
                block_number    => &5,
                row_number      => &6
        )
/

SQL> @rowinfo ARUP T1 241877 1024 2307623 0

COL1  C
————— —
  1   x


Sessions from a specific user

select SID, osuser, machine, terminal, service_name,
       logon_time, last_call_et
from v$session
where username = 'ARUP';

SID   OSUSER  MACHINE   TERMINAL  SERVICE_NAME  LOGON_TIME LAST_CALL_ET
————— ——————  ———————   ————————  ————————————  —————————— ————————————
3346  oradb   prodb1    pts/5     SYS$USERS     05-FEB-12          6848
2832  oradb   prodb1    pts/6     SERV1         05-FEB-12          7616
4408  ANANDA  ANLAP     ANLAP     ADHOC         05-FEB-12             0



Session waits for a specific machine

col username format a5
col program format a10
col state format a10
col last_call_et head 'Called|secs ago' format 999999
col seconds_in_wait head 'Waiting|for secs' format 999999
col event format a50
select sid, username, program,
        decode(state, 'WAITING', 'Waiting',
                'Working') state,
last_call_et, seconds_in_wait, event
from v$session
where machine = 'appsvr1'
/



Getting the SQL
Another key piece of performance tuning information is the SQL statement a session is executing, which will provide more insights into the workings of the session. The same V$SESSION view also shows the SQL statement information. The SQL_ID column in the V$SESSION view shows the ID of the last SQL statement executed. You can get the text of that SQL statement from the V$SQL view, using the SQL_ID value. Here is an example of how I have identified the SQL statement executed by the session that appears slow to the user.



select sql_id from v$session
where sid = 3089;

SQL_ID
—————————————————
g0uubmuvk4uax

set long 99999
select sql_fulltext
from v$sql
where sql_id = 'g0uubmuvk4uax';
SQL_FULLTEXT
————————————————————————————————————————
update t1 set col2 = 'y' where col1 = 1



Data Access Issues
I have used row-level locking as the cause of a slowdown in this article. Although locking-related contention is a very common cause, it is not the only cause of performance problems. Another major cause of contention is disk I/O. When a session retrieves data from the database data files on disk to the buffer cache, it has to wait until the disk sends the data. This wait shows up for that session as “db file sequential read” (for index scans) or “db file scattered read” (for full-table scans) in the EVENT column, as shown below:



select event from v$session where sid = 3011;

EVENT
—————————————————————————
db file sequential read

Tuesday, September 25, 2012

Unix Script for renaming archivelog file with have different SID

Below useful unix script while performing Test Server Refresh.

cd /oracle/<TSID>/saparch
for i in 'ls|grep <SSID>';
do
file_name='echo $i |cut -dD -f2';
mv $i <TSID>${file_name};
done

Friday, September 21, 2012

Monitoring how much time physical standby database behind primary.

SQL> select * from V$DATAGUARD_STATS;

NAME                      VALUE              UNIT                           TIME_COMPUTED                  DATUM_TIME
------------------------- ------------------ ------------------------------ ------------------------------ ------------------------------
transport lag             +00 00:00:00       day(2) to second(0) interval   09/03/2012 18:32:37            09/03/2012 18:32:35
apply lag                 +00 12:05:02       day(2) to second(0) interval   09/03/2012 18:32:37            09/03/2012 18:32:35
apply finish time         +00 00:00:04.972   day(2) to second(3) interval   09/03/2012 18:32:37
estimated startup time    23                 second                         09/03/2012 18:32:37

SQL>

if you see above apply lag showing 12 hrs 05 min and 2 sec behind primary.

but when check archived log list @ primary.
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     1145
Next log sequence to archive   1148
Current log sequence           1148
SQL>

as per above current redo log sequence 1148

Now when i checked @ standby server last applied log sequence number.

SQL> select sequence# last_sequence#,archived,applied,status from v$archived_log
where sequence# = (select max(sequence#) from v$archived_log);

LAST_SEQUENCE# ARC APPLIED   S
-------------- --- --------- -
          1147 YES YES       A

SQL>

its showing 1147

last archived log already applied @ standby, So how apply tag showing value of 12 hrs and 05 min and 2 sec behind primary ?

Check last archived log time at primary.
[root@testsap1 ~]# ls -la /oracle/EHP/oraarch/ | grep 1147
-rw-r-----  1 oraehp dba 43153408 Sep  3 06:22 EHParch1_1147_790785542.dbf
[root@testsap1 ~]#

Its difference of last archived time and current time. ( current time 18:27:03 last archive log (1147) @ 06:22 ).

Tuesday, September 11, 2012

Installed RPM Package 32bit / 64bit

Normally we execute below command to know package installed or not and you get result similar to below.
[root@testsap1 ~]# rpm -qa |grep libaio-0.3.106
libaio-0.3.106-5
libaio-0.3.106-5

Need to execute as below to know installed package are 32bit or 64bit ?
[root@testsap1 ~]# rpm -q --qf '%{NAME}-%{VERSION}(%{ARCH})\n' libaio-0.3.106
libaio-0.3.106(x86_64)
libaio-0.3.106(i386)
[root@testsap1 ~]#


Thursday, August 16, 2012

Remote file / directory copy in linux


Copy temp.data1 files from remote computer testsap2 into /oracle/EHP/sapdata1 directory of local computer.
scp oraehp@testsap2:/oracle/EHP/sapdata1/temp.data1 /oracle/EHP/sapdata1/

copy directory sapdata1 from remote computer testsap2 to local computer under /oracle/EHP
cd /oracle/EHP
scp -r oraehp@testsap2:/oracle/EHP/sapdata1/ .

Saturday, February 18, 2012

Mount/access Windows shares from Linux

[root@testsap2 mnt]# mount -t cifs //10.16.2.20/dbbackuplnx /mnt/share -o username=Administrator
Password:
[root@testsap2 mnt]# cd /mnt/share

Monday, February 13, 2012

Access Red Hat Enterprise Linux 5 with XManager Remote Control

1. Open the /etc/gdm/custom.conf file.
search for "[xdmcp]", add the Enable entry:
add new line with Enable=true
Save the file

2.Reboot the server (I don't know if this is necessary, I have grown used to the Windows way of doing things)