The "ls" command lists all files and directories in the specified directory. If no location is defined it acts on the current directory. The "-a" flag lists hidden "." files. The "-l" flag lists file details.root> pwd
/u01/app/oracle/product/9.2.0.1.0
More Examples:root> ls
root> ls /u01
root> ls -al
The "touch" command is used to create a new empty file with the default permissions:root> cd /u01/app/oracle
The "rm" command is used to delete files and directories. The "-R" flag tells the command to recurse through subdirectories.root> touch my.log
The "mv" command is used to move or rename files and directories. The "." represents the current directoryroot> rm my.log
root> rm -R /archive
The "cp" command is used to copy files and directories:root> mv [from] [to]
root> mv my.log my1.log
root> mv * /archive
root> mv /archive/* .
The "mkdir" command is used to create new directories:root> cp [from] [to]
root> cp my.log my1.log
root> cp * /archive
root> cp /archive/* .
The "rmdir" command is used to delete directories:root> mkdir archive
The "grep" command performs a search for a specified string or pattern.root> rmdir archive
Display only the lines in /etc/oratab where the lines do not (-v option; negation) start with # character (^ is a special character indicating beginning of line, similarly $ is end of line).root> find / -name dbmspool.sql
root> find / -print | grep dbmspool.sql Search everywhere for the specified file
root> find . -exec grep "DISPLAY" {} \; -print | pg Search all files for the text string "DISPLAY" - takes a while to run !
root> grep -v '^#' /etc/oratabTip for Oracle Users
The "PS1"changes your prompt.oracle> which sqlplus
root> PS1="Diego_Master:> "The "wc" utility displays a count of the number of characters, words and lines in a file. The switches for this utility are:
Diego_Master:>
root> wc -l README.txtThe "more" or "cat" commands lets you display the contents of a file:
85 README.txt
gzip
command results in a compressed copy of the original
file with a ".gz" extension. The gunzip command reverses
this process. The compress command results in a
compressed copy of the original
file with a ".Z" extension. The uncompress command
reverses this process:
gzip myfile
gunzip myfile.gz
compress myfile
uncompress myfile
The umask value is subtracted from the default permissions (666) to give the final permission:root> umask 022
The "chmod" command is used to alter file permissions after the file has been created:666 : Default permission
022 : - umask value
644 : final permission
Character eqivalents can be used in the chmod command:root> chmod 777 *.log
Owner Group World Permission
========= ========= ========= ======================
7 (u+rwx) 7 (g+rwx) 7 (o+rwx) read + write + execute
6 (u+wx) 6 (g+wx) 6 (o+wx) write + execute
5 (u+Rx) 5 (g+Rx) 5 (o+Rx) read + execute
4 (u+r) 4 (g+r) 4 (o+r) read only
2 (u+w) 2 (g+w) 2 (o+w) write only
1 (u+x) 1 (g+x) 1 (o+x) execute only
The "chown" command is used to change the ownership of files after creation. The "-R" flag causes the command ro recurse through any subdirectories.root> chmod o+rwx *.log
root> chmod g+r *.log
root> chmod -Rx *.log
Finally the "chgrp" command is used to change the group to a file:root> chown -R oinstall.dba *
root> chgrp <directory> groupThe following example changes the ownership on every single file in current directory and lower directories to oracle (useful if someone has done an install erroneously as root.)
root> useradd -G oinstall -g dba -d /usr/users/my_user -m -s /bin/ksh my_user
The "userdel" command is used to delete existing users. The "-r" flag removes the default directory.root> usermod -s /bin/csh my_user
The "passwd" command is used to set, or reset, the users login password:root> userdel -r my_user
The "who" command can be used to list all users who have OS connections:root> passwd my_user
root> who
root> who | head -5
root> who | tail -5
root> who | grep -i ora
root> who | wc -l
Specific processes can be killed by specifying the process id in the "kill" command, the -9 forces to kill that process.root> ps
root> ps -ef | grep -i ora
root> kill -9 12345
root> uname -a
Linux HPLINUX 2.4.21-20.ELsmp #1 SMP Wed Aug 18 20:46:40 EDT 2004 i686 i686 i386 GNU/Linux
root> uname -a | awk '{ print $2 }'
HPLINUX
root> hostname
HPLINUX
#!/bin/ksh
su - oracle <<EOF
ORACLE_SID=LIN1; export ORACLE_SID
rman catalog=rman/rman@w2k1 target=/ cmdfile=my_cmdfile log=my_logfile append
EOF
|
OS |
patchlevel |
memory |
I/O Info |
CPU Info |
CPU / Memory |
|
Sun Solaris |
showrev -p |
sysinfo |
sar -d |
/opt/RICHPse/bin/se |
/opt/RICHPse/bin/se |
| Linux |
grep MemTotal
/proc/meminfo free |
vmstat 3 5 |
grep "model name" /proc/cpuinfo cat /proc/cpuinfo sar -u 2 5 sar -b |
top sar -W 5 5 |
|
|
HP-UX |
swlist |
sam |
|
|
vmstat -n 2 200 |
|
AIX/RS-6000 |
instfix -ivqk |
smit or sar |
|
|
|
mount | column -t
List mounted filesystems on the
system (and align output)
free -m (in MB)
Check Swap Activity (Metalink Note 225451.1)
/sbin/swapon -s
free -t
cat /proc/swaps
The recommended SWap size is two to three times the amount of Physical
Memory for Swap space (unless the system exceeds 1 GB of Physical
Memory, where two times the amount of Physical Memory for Swap space is
sufficient)
Swap space in Linux is used when the amount of physical memory (RAM) is
full.If the system needs more memory resources and the physical memory
is full, inactive pages in memory are moved to the swap space. While
swap space can help machines with a small amount of RAM, it should not
be considered a replacement for more RAM. Swap space is located on hard
drives, which have a slower access time than physical memory.
Swapping is one of the Unix mechanisms to accommodate the size
limitation of memory by moving entire processes to disk to reclaim
memory.
Paging is another Unix machanism to manage the limitations of memory.
Unlike swapping, where entire processes are moved in and out of memory,
paging moves only individual pages of processes to disk. Paging is not
as serious a problem as swapping, as the entire program does not have
to reside in memory to run. A small amount of paging may not noticeably
affect the performance of a system. However, the performance of a
system may degraderapidly as paging activity increases.
Swap space can have a dedicated swap partition (recommended), a swap
file, or a combination of swap partitions and swap files.
When analyzing your UNIX machine, make sure that the machine is not
swapping at all and at worst paging lightly. This indicates a system
with a healthy amount of memory available.
How can I enable Swap in
LINUX ?
First check is Swap is enabled:
/sbin/swapon -s
Filename
Type
Size Used Priority
/dev/sda3
partition 2040244 453180 -1
To enable swap, check for swap entries in your /etc/fstab
grep swap /etc/fstab
/dev/sda3
swap
swap
defaults 0 0
And use the '/sbin/swapon -a'
command to enable all Swap partitions
listed in /etc/fstab.
How to add a swapfile?
Determine the size of the new swap file and multiple by 1024 to
determine the block size. For example, the block size of a 64 MB swap
file is 65536.
At a shell prompt as root, type the following command with count being
equal to the desired block size:
dd if=/dev/zero
of=/data2/swapfile1 bs=1024 count=65536
Setup the swap file with the command:
/sbin/mkswap /data2/swapfile1
To enable the swap file immediately but not automatically at boot time:
/sbin/swapon /data2/swapfile
To enable it at boot time, edit /etc/fstab to include:
/data2/swapfile swap swap
defaults 0 0
The next time the system boots, it will enable the new swap file.
Check Services Running and
stop them if not used
Services that should be removed: r* (shell or rsh, login
or rlogin,
exec or rexec, rcp), telnet, ftp, sendmail, exim, postfix, printer,
qmail, http, portmap, SMBD (Samba)
chkconfig --list
--> Show
services running and its level
chkconfig --del servicename
--> Stop
that service
chkconfig --level 345 servicename
off -->
Stop that service for level 3,4,5
Also it could be necessary to check the file /etc/inetd.conf
because it has references to some services, if any service that I want
to stop is there, comment that line and reboot the server or run:
/etc/init.d/inetd restart
Enable FTP
and TELNET Services
cd to /etc/xinetd.d
vi wu-ftpd
Change the disable field from "yes" to "no" and save changes.
vi telnet
Change the disable field from "yes" to "no" and save changes.
Information on Network
Display
network
interface configuration
parameters
Address
resolution
display and control
Check Routes:
Change
network, change it's ip, mask, bcast and gateway.
The easiest way is to execute sys-unconfig.
After the process finishes power down the box and move it to the new
network.
When you boot the box it will ask the appropriate questions about the
network configuration
Important
Network LINUX files:
Making the following gross assumptions:
Your IP
is:
192.168.0.1
Your Gateway
is: 192.168.0.254
Your netmask
is: 255.255.255.0
Your nameservers are:
192.168.0.2, 192.168.0.3, and 192.168.0.4
/etc/sysconfig/network File
NETWORKING=yes
HOSTNAME=your_machine_name.saa.senate.gov
GATEWAY=192.168.0.254
/etc/hosts File
127.0.0.1
localhost.localdomain
localhost
192.168.0.1
your_machine_name.company.com
your_machine_name
192.168.0.254
your_gateway.company.com
your_gateway
(You don't absolutely *need* your gateway in the hosts file, but I feel
it does sometimes speed up some operations)
/etc/sysconfig/network-scripts/ifcfg-eth0
File
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.0.1
NETMASK=255.255.255.0
/etc/resolv.conf File
search gateway compay_gateway
nameserver 192.168.0.2
nameserver 192.168.0.3
nameserver 192.168.0.4
(The 'search' line is optional. You can have up to 3 'nameserver'
lines,and they don't need to be inside your network)
/etc/resolv.conf File
domain
domain_name
nameserver
192.168.0.1
search
domain_name
Get
OS File System Block Size 64 bit or 32 bit
Create
a file with just 1 character on it and then perform:
On linux
$uname -a
Linux debian 2.6.18-4-686 #1 SMP Wed May 9 23:03:12 UTC 2007 i686
GNU/Linux
On Solaris
isainfo -b -v
/usr/bin/isainfo -kv
On AIX
$ getconf -a | grep KERN
$ file /usr/lib/boot/unix*
On HP-UX
/usr/bin/ getconf KERNEL_BITS
/usr/bin/file /stand/vmunix
The free command let you identify the amoung of memory
used by all the apps on the box. If the amount of memory used is
bigger than the available RAM, then the box starts to swap.
If you use this command with the -m
option, it will show the numbers in MB.
# free -m
total
used free
shared buffers cached
Mem:
1772
1654 117
0
18 618
-/+
buffers/cache:
1017 754
Swap:
1983
1065 918
Here we can see that the box has 1772
MB of RAM, currently using 1654
MB, and only 117 MB of
free memory.
The next line shows the changes on the size of the cache and buffers in
the memory.
Finally the third one shows the amount of swap memory that is being
used.
The –t options shows you the totals at the end of the output (adds
physical memory plus swap memory):
# free -m -t
total
used free
shared buffers cached
Mem:
1772
1644
127
0
16 613
-/+
buffers/cache:
1014 757
Swap:
1983
1065 918
Total:
3756
2709 1046
Some tips
Shows the percentage of used memory:
# free -m | grep Mem | awk
'{print ($3 / $2)*100}'
98.7077
Shows the percentage of swap memory:
free -m | grep -i Swap | awk
'{print ($3 / $2)*100}'
The top command is probably the most
useful one for an Oracle DBA managing a database on Linux.
Note that unlike other commands, top does not produce an
output and sits still. It refreshes the screen to display new
information. So, if you just issue top and leave the screen
up, the most current information is always up. To stop and exit to
shell, you can press Control-C.
$ top
18:46:13 up 11 days, 21:50, 5 users, load average: 0.11, 0.19, 0.18
151 processes: 147 sleeping, 4 running, 0 zombie, 0 stopped
CPU states: cpu user nice system irq softirq iowait idle
total 12.5% 0.0% 6.7% 0.0% 0.0% 5.3% 75.2%
Mem: 1026912k av, 999548k used, 27364k free, 0k shrd, 116104k buff
758312k actv, 145904k in_d, 16192k in_c
Swap: 2041192k av, 122224k used, 1918968k free 590140k cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
451 oracle 15 0 6044 4928 4216 S 0.1 0.4 0:20 0 tnslsnr
8991 oracle 15 0 1248 1248 896 R 0.1 0.1 0:00 0 top
1 root 19 0 440 400 372 S 0.0 0.0 0:04 0 init
2 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 keventd
3 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kapmd
4 root 34 19 0 0 0 SWN 0.0 0.0 0:00 0 ksoftirqd/0
7 root 15 0 0 0 0 SW 0.0 0.0 0:01 0 bdflush
5 root 15 0 0 0 0 SW 0.0 0.0 0:33 0 kswapd
6 root 15 0 0 0 0 SW 0.0 0.0 0:14 0 kscand
8 root 15 0 0 0 0 SW 0.0 0.0 0:00 0 kupdated
9 root 25 0 0 0 0 SW 0.0 0.0 0:00 0 mdrecoveryd
... output snipped ...
Let's examine the different types of information produced.
The first line: 18:46:13 up 11 days, 21:50, 5 users, load
average: 0.11, 0.19, 0.18
shows the current time (18:46:13), that system has
been up for 11 days; that the system has been working for 21 hours 50
seconds. The load average of the system is shown (0.11, 0.19, 0.18) for
the last 1, 5 and 15 minutes respectively. (By the way, you can also
get this information by issuing the uptime command.)
If
the load average is not required, press the letter "l" (lowercase L);
it will turn it off. To turn it back on press l again. Ideally
Load average should be less than 1, otherwise the processes are fully
burdened
The second line: 151 processes: 147 sleeping, 4 running, 0
zombie, 0 stopped
shows the number of processes, running, sleeping, etc.
The third and fourth lines:
CPU states: cpu user nice system irq softirq iowait idle
total 12.5% 0.0% 6.7% 0.0% 0.0% 5.3% 75.2%
show the CPU utilization details. The above line shows
that user processes consume 12.5% and system consumes 6.7%. The user
processes include the Oracle processes. Press "t" to turn these three
lines off and on. If there are more than one CPU, you will see one line
per CPU.
The next two lines:
Mem: 1026912k av, 1000688k used, 26224k free, 0k shrd, 113624k buff
758668k actv, 146872k in_d, 14460k in_c
Swap: 2041192k av, 122476k used, 1918716k free 591776k cached
show the memory available and utilized. Total memory is "1026912k av", approximately 1GB, of which only 26224k or 26MB is free. The swap space is 2GB; but it's almost not used. To turn it off and on, press "m".
The rest of the display shows the processes in a tabular format. Here is the explanation of the columns:
| Column | Description |
| PID | The process ID of the process |
| USER | The user running the process |
| PRI | The priority of the process |
| NI | The nice value: The higher the value, the lower the priority of the task |
| SIZE | Memory used by this process (code+data+stack) |
| RSS | The physical memory used by this process |
| SHARE | The shared memory used by this process |
| STAT |
The status of this process, shown in code. Some major status
codes are: W – Swapped out process N – positive nice value |
| %CPU | The percentage of CPU used by this process |
| %MEM | The percentage of memory used by this process |
| TIME | The total CPU time used by this process |
| CPU | If this is a multi-processor system, this column indicates the ID of the CPU this process is running on. |
| COMMAND | The command issued by this process |
While the top is being displayed, you can press a few keys to format the display as you like. Pressing the uppercase M key sorts the output by memory usage. (Note that using lowercase m will turn the memory summary lines on or off at the top of the display.) This is very useful when you want to find out who is consuming the memory. Here is sample output:
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
31903 oracle 15 0 75760 72M 72508 S 0.0 7.2 0:01 0 ora_smon_PRODB2
31909 oracle 15 0 68944 66M 64572 S 0.0 6.6 0:03 0 ora_mmon_PRODB2
31897 oracle 15 0 53788 49M 48652 S 0.0 4.9 0:00 0 ora_dbw0_PRODB2
Now that you learned how to interpret the output, let's see how to use command line parameters.
The most useful is -d, which indicates the delay between the screen refreshes. To refresh every second, use top -d 1.
The other useful option is -p. If you want to monitor only a few processes, not all, you can specify only those after the -p option. To monitor processes 13609, 13608 and 13554, issue:
top -p 13609 -p 13608 -p 13554
This will show results in the same format as the top command, but only those specific processes.
It's probably needless to say that the top utility comes in very handy for analyzing the performance of database servers. Here is a partial top output.
20:51:14 up 11 days, 23:55, 4 users, load average: 0.88, 0.39, 0.27
113 processes: 110 sleeping, 2 running, 1 zombie, 0 stopped
CPU states: cpu user nice system irq softirq iowait idle
total 1.0% 0.0% 5.6% 2.2% 0.0% 91.2% 0.0%
Mem: 1026912k av, 1008832k used, 18080k free, 0k shrd, 30064k buff
771512k actv, 141348k in_d, 13308k in_c
Swap: 2041192k av, 66776k used, 1974416k free 812652k cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
16143 oracle 15 0 39280 32M 26608 D 4.0 3.2 0:02 0 oraclePRODB2...
5 root 15 0 0 0 0 SW 1.6 0.0 0:33 0 kswapd
... output snipped ...
Let's analyze the output carefully. The first thing
you should notice is the "idle" column under CPU states; it's
0.0%—meaning, the CPU is completely occupied doing something.
The
question is, doing what?
Move your attention to the column "system",
just slightly left; it shows 5.6%. So the system itself is not
doing
much.
Go even more left to the column marked "user", which shows 1.0%.
Since user processes include Oracle as well, Oracle is not consuming
the CPU cycles.
So, what's eating up all the CPU?
The
answer lies in the same line, just to the right under the column
"iowait", which indicates 91.2%.
This explains it all: the CPU is
waiting for IO 91.2% of the time.
So why so much IO wait? The answer lies in the display. Note the PID of the highest consuming process: 16143. You can use the following query to determine what the process is doing:
select s.sid, s.username, s.program
from v$session s, v$process p
where spid = &server_process_id
and p.addr = s.paddr
/
SID USERNAME PROGRAM
------------------- -----------------------------
159 SYS rman@prolin2 (TNS V1-V3)
The rman process is taking up the IO waits related CPU cycles. This information helps you determine the next course of action.
From the previous discussion you learned how to identify a CPU consuming resource. What if you find that a process is consuming a lot of CPU and memory, but you don't want to kill it? Consider the top output below:
$ top -c -p 16514
23:00:44 up 12 days, 2:04, 4 users, load average: 0.47, 0.35, 0.31
1 processes: 1 sleeping, 0 running, 0 zombie, 0 stopped
CPU states: cpu user nice system irq softirq iowait idle
total 0.0% 0.6% 8.7% 2.2% 0.0% 88.3% 0.0%
Mem: 1026912k av, 1010476k used, 16436k free, 0k shrd, 52128k buff
766724k actv, 143128k in_d, 14264k in_c
Swap: 2041192k av, 83160k used, 1958032k free 799432k cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
16514 oracle 19 4 28796 26M 20252 D N 7.0 2.5 0:03 0 oraclePRODB2...
Now that you confirmed the process 16514 is consuming a lot of memory, you can "freeze" it—but not kill it—using the skill command.
$ skill -STOP 1
After this, check the top output:
23:01:11 up 12 days, 2:05, 4 users, load average: 1.20, 0.54, 0.38
1 processes: 0 sleeping, 0 running, 0 zombie, 1 stopped
CPU states: cpu user nice system irq softirq iowait idle
total 2.3% 0.0% 0.3% 0.0% 0.0% 2.3% 94.8%
Mem: 1026912k av, 1008756k used, 18156k free, 0k shrd, 3976k buff
770024k actv, 143496k in_d, 12876k in_c
Swap: 2041192k av, 83152k used, 1958040k free 851200k cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
16514 oracle 19 4 28796 26M 20252 T N 0.0 2.5 0:04 0 oraclePRODB2...
The CPU is now 94% idle from 0%. The process is effectively frozen. After some time, you may want to revive the process from coma:
$ skill -CONT 16514
This approach is immensely useful for temporarily freezing processes to make room for more important processes to complete.
The command is very versatile. If you want to stop all processes of the user "oracle", only one command does it all:
$ skill -STOP oracle
You can use a user, a PID, a command or terminal id as argument. The following stops all rman commands.
$ skill -STOP rman
As you can see, skill decides that argument you entered—a process ID, userid, or command—and acts appropriately. This may cause an issue in some cases, where you may have a user and a command in the same name. The best example is the "oracle" process, which is typically run by the user "oracle". So, when you want to stop the process called "oracle" and you issue:
$ skill -STOP oracle
all the processes of user "oracle" stop, including the session you may be on. To be completely unambiguous you can optionally give a new parameter to specify the type of the parameter. To stop a command called oracle, you can give:
$ skill -STOP -c oracle
The command snice is similar. Instead of stopping a process it makes its priority a lower one. First, check the top output:
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
3 root 15 0 0 0 0 RW 0.0 0.0 0:00 0 kapmd
13680 oracle 15 0 11336 10M 8820 T 0.0 1.0 0:00 0 oracle
13683 oracle 15 0 9972 9608 7788 T 0.0 0.9 0:00 0 oracle
13686 oracle 15 0 9860 9496 7676 T 0.0 0.9 0:00 0 oracle
13689 oracle 15 0 10004 9640 7820 T 0.0 0.9 0:00 0 oracle
13695 oracle 15 0 9984 9620 7800 T 0.0 0.9 0:00 0 oracle
13698 oracle 15 0 10064 9700 7884 T 0.0 0.9 0:00 0 oracle
13701 oracle 15 0 22204 21M 16940 T 0.0 2.1 0:00 0 oracle
Now, drop the priority of the processes of "oracle" by four points. Note that the higher the number, the lower the priority.
$ snice +4 -u oracle
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
16894 oracle 20 4 38904 32M 26248 D N 5.5 3.2 0:01 0 oracle
Note how the NI column (for nice values) is now 4 and
the priority is now set to 20, instead of 15. This is quite useful in
reducing priorities.
| procs | memory | page | disk | faults | cpu | ||||||||||||||||
| r | b | w | swap | free | re | mf | pi | po | fr | de | sr | s0 | s1 | s2 | s3 | in | sy | cs | us | sy | id |
| 0 | 0 | 0 | 28872 | 8792 | 8 | 5 | 172 | 142 | 210 | 0 | 24 | 3 | 11 | 17 | 2 | 289 | 1081 | 201 | 14 | 6 | 80 |
| 0 | 0 | 0 | 102920 | 1936 | 1 | 95 | 193 | 6 | 302 | 1264 | 235 | 12 | 1 | 0 | 3 | 240 | 459 | 211 | 0 | 2 | 97 |
| 0 | 0 | 0 | 102800 | 1960 | 0 | 0 | 0 | 0 | 0 | 464 | 0 | 0 | 0 | 0 | 0 | 107 | 146 | 29 | 0 | 0 | 100 |
| Time | %usr | %sys | %wio | %idle |
| 11:57:31 | 72 | 28 | 0 | 0 |
| 11:57:41 | 70 | 30 | 0 | 0 |
| 11:57:51 | 70 | 30 | 0 | 0 |
| 11:58:01 | 68 | 32 | 0 | 0 |
| 11:58:11 | 67 | 33 | 0 | 0 |
| 11:58:21 | 65 | 28 | 0 | 7 |
| 11:58:31 | 73 | 27 | 0 | 0 |
| 11:58:41 | 69 | 31 | 0 | 0 |
| Average | 69 | 30 | 0 | 1 |
| %CPU | PID | USER | COMMAND |
| 78.1 | 4789 | oracle | ora_dbwr_DDDS2 |
| 8.5 | 4793 | oracle | ora_lgwr_DDDS2 |
| 2.4 | 6206 | oracle | oracleDDDS2 (LOCAL=NO) |
| 0.1 | 4797 | oracle | ora_smon_DDDS2 |
| 0.1 | 6207 | oracle | oracleDDDS2 (LOCAL=NO) |
| etc. | etc. | etc. | etc. |
SELECT a.username, a.osuser, a.program, spid, sid, a.serial#
FROM v$session a, v$process b
WHERE a.paddr = b.addr
AND spid = '&pid';
| CPU | minf | mjf | xcal | intr | ithr | csw | icsw | migr | smtx | srw | syscl | usr | sys | wt | idl |
| 0 | 6 | 8 | 0 | 438 | 237 | 246 | 85 | 0 | 0 | 21 | 8542 | 23 | 9 | 9 | 59 |
| 0 | 0 | 29 | 0 | 744 | 544 | 494 | 206 | 0 | 0 | 95 | 110911 | 65 | 29 | 6 | 0 |
/etc/init.d/ directory, in this case
the file is called myservice, containing the commands you
wish to run at startup and/or shutdown.chmod command to set the privileges to 750:Link the file into the appropriate run-level script directories:chmod 750 /etc/init.d/myservice
Associate theln -s /etc/init.d/myservice /etc/rc0.d/K10myservice
ln -s /etc/init.d/myservice /etc/rc3.d/S99myservice
myservice service with the appropriate run
levels:The script should now be automatically run at startup and shutdown (with "start" or "stop" as a commandline parameter) like other service initialization scripts.chkconfig --level 345 dbora on
Examples* - All available values or "first-last".
3-4 - A single range representing each possible from the start to the end of the range inclusive.
1,2,5,6 - A specific list of values.
1-3,5-8 - A specific list of ranges.
0-23/2 - Every other value in the specified range.
This script returns TRUE (0) only on the node which is the CFS serving cluster_root.#!/bin/ksh
set -- $(/usr/sbin/cfsmgr -F raw /)
shift 12
[[ "$1" = "$(/bin/hostname -s)" ]] && exit 0
exit 1
Although the cron jobs fire on all nodes, the "/bin/cronrun &&" part of the entry prevents the script from running on all nodes except the current CFS serving cluster_root.5 * * * /bin/cronrun && /usr/local/bin/myjob
First the mount point must be shared so it can be seen by remote machines:exportfs
Next the share can be mounted on a remote machine by root using:share -F nfs -o ro /cdrom
mkdir /cdrom#1
mount -o ro myhost:/cdrom /cdrom#1
Append the following entry to the "/etc/exports" file:mkdir /u04/backup
Make sure the correct permissions are granted on the directory:/u04/backup
On the client machine:chmod -R 777 /u04/backup
Append an following entry to the "/etc/fstab" file:mkdir /backup
Finally, mount the fileset:nfs-server-name:/u04/backup /backup nfs rw,bg,intr 0 0
At this point you can start to use the mount point from your client machine. Thanks to Bryan Mills for his help with Tru64.mount /backup
- From the command promot on the PC do the following:<client-name>:0
- The X environment should start in a new window.set PATH=PATH;c:cygwinbin;c:cygwinusrX11R6bin
XWin.exe :0 -query <server-name>
DISPLAY=<client-name>:0.0; export DISPLAY
The command line history can be accessed using the [Esc][k] by adding the following entry:stty erase "^H"
Auto completion of paths using a double strike of the [Esc] key can be configured by adding the following entry:set -o vi
set filec
| Path | Contents |
| /etc/passwd | User settings |
| /etc/group | Group settings for users. |
| /etc/hosts | Hostname lookup information. |
| /etc/system | Kernel parameters for Solaris. |
| /etc/sysconfigtab | Kernel parameters for Tru64. |