HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Can a sql command be assigned a nice value?
Operating System - HP-UX
1835268
Members
2326
Online
110078
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2005 08:24 AM
03-23-2005 08:24 AM
Can a sql command be assigned a nice value?
just wondering...
if a script runs an sql script, does the nice value get passed on to the child process?
if a script runs an sql script, does the nice value get passed on to the child process?
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2005 08:28 AM
03-23-2005 08:28 AM
Re: Can a sql command be assigned a nice value?
This is taken from the nice manpage:
Normally, all processes inherit the system nice value of their parent process when they are spawned. The shell (sh, csh, ksh, etc.) can create a child process with a different priority from the current shell process by spawning the child process via the nice command.
See man nice for more details.
Jim
Normally, all processes inherit the system nice value of their parent process when they are spawned. The shell (sh, csh, ksh, etc.) can create a child process with a different priority from the current shell process by spawning the child process via the nice command.
See man nice for more details.
Jim
Hindsight is 20/20
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2005 08:36 AM
03-23-2005 08:36 AM
Re: Can a sql command be assigned a nice value?
Are you going through tnsnames / the listener or connecting directly and locally? The oracle slaves will inheret the listener attributes.
If I need to renice (or nasty) Oracle slaves, then I tend to need a quick sql script to run over v$sessions and/or v$process
Hien.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2005 09:49 AM
03-23-2005 09:49 AM
Re: Can a sql command be assigned a nice value?
Joe, the oracle shadow process that's going to do all the work for you is the the thing that you'd like to renice (I think). This gets its value from the tns listener.
Kind of fishing through this list:
SELECT vp.spid||' '||vs.sid||' '||vp.pid||' '||vs.username||' '||vs.osuser||' '||vs.machine ||' '|| vs.module||' '||vs.program||' '||vs.process||' '||vs.action
from FROM v$session vs, v$process vp
WHERE vs.paddr = vp.addr(+)
you can come up with a script that will suit your needs.
The following generates a list to a file that can be run from a unix looping script to renice things for a user connecting as oracle user 'JOER' from OS user 'jrobinson' --
if it's JOER and user jrobinson -it's reniced to 5, if it's JOER and anyone else, it's reniced to 7, otherwise in the default case it's niced to 9. These numbers won't make sense for you - you'll have to look at what you want to do to set them properly. In this example I used single digits b/c it allowed me to cram them on a single line on the screen hoping that they would display the same for the forum readers (it probably won't).
There's another example for a ksmith in there, so you can see how to add more decodes as you need.
set heading off;
set feedback off;
set pagesize 500;
set linesize 280;
spool reprioritize
SELECT decode(nvl(p.spid,'x'),'x',' ','renice -n ')||
decode ( nvl(p.spid,'x'),'x',' ',
decode ( s.username,
'JOER',decode(s.osuser,'jrobinson','5','7'),
'KSMT',decode(s.osuser,'ksmith','8','9'),
9))
||' '||p.spid
exit;
This would create the file reprioritize.lst
do a chmod on it, and then you can run it to renice that process. Since it's a renice command, you'd have to run the output file as root (use sudo command).
You can/should of course use others of the columns I indicated in the first generic statment above to make your own rules.
Kind of fishing through this list:
SELECT vp.spid||' '||vs.sid||' '||vp.pid||' '||vs.username||' '||vs.osuser||' '||vs.machine ||' '|| vs.module||' '||vs.program||' '||vs.process||' '||vs.action
from FROM v$session vs, v$process vp
WHERE vs.paddr = vp.addr(+)
you can come up with a script that will suit your needs.
The following generates a list to a file that can be run from a unix looping script to renice things for a user connecting as oracle user 'JOER' from OS user 'jrobinson' --
if it's JOER and user jrobinson -it's reniced to 5, if it's JOER and anyone else, it's reniced to 7, otherwise in the default case it's niced to 9. These numbers won't make sense for you - you'll have to look at what you want to do to set them properly. In this example I used single digits b/c it allowed me to cram them on a single line on the screen hoping that they would display the same for the forum readers (it probably won't).
There's another example for a ksmith in there, so you can see how to add more decodes as you need.
set heading off;
set feedback off;
set pagesize 500;
set linesize 280;
spool reprioritize
SELECT decode(nvl(p.spid,'x'),'x',' ','renice -n ')||
decode ( nvl(p.spid,'x'),'x',' ',
decode ( s.username,
'JOER',decode(s.osuser,'jrobinson','5','7'),
'KSMT',decode(s.osuser,'ksmith','8','9'),
9))
||' '||p.spid
exit;
This would create the file reprioritize.lst
do a chmod on it, and then you can run it to renice that process. Since it's a renice command, you'd have to run the output file as root (use sudo command).
You can/should of course use others of the columns I indicated in the first generic statment above to make your own rules.
We are the people our parents warned us about --Jimmy Buffett
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP