Home » RDBMS Server » Server Administration » script creation
script creation [message #183491] Fri, 21 July 2006 02:50 Go to next message
anandhi
Messages: 31
Registered: April 2006
Location: Chennai
Member
Hi

Can anyone let me know how to create script for the below mentioned topics? Its very urgent.

1. Script to list User Session excluding Background Process &
User name is Null.

2. Script to list User Session with User Process.

3. Script to find Tablespace (Data, Temporary, Undo/RBS) Space
availability.

4. Script to find Locks with Locked User Session.

5. Script to find Hit Ratio of DB Buffer, Row Cache, Library
Cache.

6. Script to find Sort using memory and Disk.

thanks
Anandhi
Re: script creation [message #183527 is a reply to message #183491] Fri, 21 July 2006 04:29 Go to previous message
nmacdannald
Messages: 460
Registered: July 2005
Location: Stockton, California - US...
Senior Member
1. Script to list User Session excluding Background Process &
User name is Null.
As O/S user:
ps -ef |grep $ORACLE_SID |grep -v |grep -v ora_ |wc -l

As dba:
select username from all_users
where
(unername not null)
and
(username not like 'ora%')
;
commit;
or
spool ${DIR}/ocr_${ORACLE_SID}.userprivs.txt
set pagesize 2000
set echo off
set feed off
set verify off

-- Users list
ttitle 'All users'
select username "Users"
from dba_users
where username not in ('SYS','SYSTEM','OUTLN',
'DBSNMP','SCOTT','DB_CONTROL',
'OPS$ORACLE','ORADBA')
;
commit;


2. Script to list User Session with User Process.
As O/S user:
ps -ef |grep ora |sort

3. Script to find Tablespace (Data, Temporary, Undo/RBS) Space
availability.
select tablespace_name from dba_tablespaces order by tablespace_name;
commit;

5. Script to find Hit Ratio of DB Buffer, Row Cache, Library
Cache.
Use em for this.

6. Script to find Sort using memory and Disk.
sar -b 5 5
sar -w 5 5
sar -r 5 5
prtconf |grep -i mem

All this assumes you are using Solaris 9, Oracle 9 or better.
Hope this helps.
Neil.
Previous Topic: DBWn
Next Topic: How to create second listener.
Goto Forum:
  


Current Time: Fri Sep 20 09:38:00 CDT 2024