setup vnc
svccfg -s application/x11/x11-server add display1
svccfg -s application/x11/x11-server:display1 addpg options application
svccfg -s application/x11/x11-server:display1 addpropvalue options/server astring: "/usr/X11/bin/Xvnc"
svccfg -s application/x11/x11-server:display1 addpropvalue options/server_args astring: '"SecurityTypes=None"'
vncserver
mount iso for Solaris
root@TT4-BCCLML1-S # lofiadm -a /u01/sol-10-u10-ga2-sparc-dvd.iso
/dev/lofi/1
mkdir /dvd_iso
root@TT4-BCCLML1-S # mount -F hsfs -o ro /dev/lofi/1 /dvd_iso
root@TT4-BCCLML1-S # cd /dvd_iso/
Use umount command to unmount image:
# umount /mnt
Now remove/free block device:
# lofiadm -d /dev/lofi/1
/usr/sbin/prtconf | grep "Memory size"
/usr/sbin/swap -l
#check 64bit
/bin/isainfo -kv
uname -r
cat /etc/release
df -k /tmp
pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibC SUNWlibms SUNWsprot \
SUNWtoo SUNWi1of SUNWi1cs SUNWi15cs SUNWxwfnt
#cai goi
pkgadd -d /dvd_iso/Solaris_10/Product SUNWi1cs SUNWi15cs
nếu cài oracle trước đó
more /var/opt/oracle/oraInst.loc
root@kinhnghiem # more /var/opt/oracle/oraInst.loc
inventory_loc=/u02/app/oraInventory
inst_group=oinstall
prtconf | grep Mem
Memory size: 32760 Megabytes
groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -G dba -d /export/home/oracle oracle
mkdir /export/home/oracle
chown oracle:oinstall /export/home/oracle
passwd -r files oracle
$ id -p
uid=59008(oracle) gid=10001(dba) projid=3(default)
By default, Oracle 10 will allocate 40% of the total system physical memory to create SGA and PGA. So for 32G system memory, the shmmax for Oracle 10 will be 0.4*32G = 12.8G.
40% 13105
50% 16442
75% 24536
100% 32764
# cat /etc/project
projmod -sK "project.max-shm-memory=(privileged,10G,deny)" oracle
projmod -p 100 -c 'lptrung add' -U oracle -G dba -K 'project.max-shm-memory=(privileged,21G,deny)' oracle
projadd -p 100 -c 'lptrung add' -U oracle -G dba -K 'project.max-shm-memory=(privileged,21G,deny)' projoracle
usermod -K project=projoracle oracle
projects -l
mkdir -p /u01/app/oracle/product/11.2.0.2/db_1
chown -R oracle:oinstall /u01
vi .profile
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
# Select the appropriate ORACLE_BASE
ORACLE_HOSTNAME=KINHNGHIEM-S; export ORACLE_HOSTNAME
ORACLE_UNQNAME=bcclml; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0.2/db_1; export ORACLE_HOME
ORACLE_SID=bcclml; export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH; export PATH
solaris
the following command displays a summary of I/O activity ten times, at ten-second intervals:
sar -b 10 10
update 11.2.0.2
Fix error tcp_largest_anon_port ....
bash-3.00# ndd -set /dev/tcp tcp_largest_anon_port 65535
bash-3.00# ndd -set /dev/udp udp_smallest_anon_port 9000
bash-3.00# ndd -set /dev/udp udp_largest_anon_port 65500
bash-3.00# ndd -set /dev/tcp tcp_smallest_anon_port 9000
bash-3.00# ndd -set /dev/tcp tcp_largest_anon_port 65500
Wednesday, December 21, 2011
Tuesday, December 20, 2011
Map san xuống server solaris sử dụng UFS
-- Kiểm tra ổ dĩa hiện tại
root@c4is-standby-s # echo |format
AVAILABLE DISK SELECTIONS:
0. c1t0d0
/pci@1f,700000/scsi@2/sd@0,0
1. c1t1d0
/pci@1f,700000/scsi@2/sd@1,0
2. c1t2d0
/pci@1f,700000/scsi@2/sd@2,0
3. c1t3d0
/pci@1f,700000/scsi@2/sd@3,0
4. c5t600A0B8000330D0A0000054748BF696Bd0
/scsi_vhci/ssd@g600a0b8000330d0a0000054748bf696b
5. c5t600A0B80004700CE0000057348BF6846d0
/scsi_vhci/ssd@g600a0b80004700ce0000057348bf6846
6. c5t600A0B80004700CE0000057748BF6AD0d0
/scsi_vhci/ssd@g600a0b80004700ce0000057748bf6ad0
Specify disk (enter its number): Specify disk (enter its number):
-- Vào SAN tạo volumn sau đó map xuống host
--Sau khi map xuống xong kiểm tra ổ đĩa mới
root@c4is-standby-s # echo |format
AVAILABLE DISK SELECTIONS:
0. c1t0d0
/pci@1f,700000/scsi@2/sd@0,0
1. c1t1d0
/pci@1f,700000/scsi@2/sd@1,0
2. c1t2d0
/pci@1f,700000/scsi@2/sd@2,0
3. c1t3d0
/pci@1f,700000/scsi@2/sd@3,0
4. c5t600A0B8000330D0A0000054748BF696Bd0
/scsi_vhci/ssd@g600a0b8000330d0a0000054748bf696b
5. c5t600A0B80004700CE00001D8C4EF0CD9Cd0
/scsi_vhci/ssd@g600a0b80004700ce00001d8c4ef0cd9c
6. c5t600A0B80004700CE0000057348BF6846d0
/scsi_vhci/ssd@g600a0b80004700ce0000057348bf6846
7. c5t600A0B80004700CE0000057748BF6AD0d0
/scsi_vhci/ssd@g600a0b80004700ce0000057748bf6ad0
Specify disk (enter its number): Specify disk (enter its number):
-- Ổ đĩa hiện tại đc map xuống là
5. c5t600A0B80004700CE00001D8C4EF0CD9Cd0
-- Xác định lại silde của partition cần format để chọn newfs
root@c4is-standby-s # format
Searching for disks...done
c5t600A0B80004700CE00001D8C4EF0CD9Cd0: configured with capacity of 1024.00GB
AVAILABLE DISK SELECTIONS:
0. c1t0d0
/pci@1f,700000/scsi@2/sd@0,0
1. c1t1d0
/pci@1f,700000/scsi@2/sd@1,0
2. c1t2d0
/pci@1f,700000/scsi@2/sd@2,0
3. c1t3d0
/pci@1f,700000/scsi@2/sd@3,0
4. c5t600A0B8000330D0A0000054748BF696Bd0
/scsi_vhci/ssd@g600a0b8000330d0a0000054748bf696b
5. c5t600A0B80004700CE00001D8C4EF0CD9Cd0
/scsi_vhci/ssd@g600a0b80004700ce00001d8c4ef0cd9c
6. c5t600A0B80004700CE0000057348BF6846d0
/scsi_vhci/ssd@g600a0b80004700ce0000057348bf6846
7. c5t600A0B80004700CE0000057748BF6AD0d0
/scsi_vhci/ssd@g600a0b80004700ce0000057748bf6ad0
--- chọn ổ đĩa mới thứ 5 mới gắn vào
Specify disk (enter its number): 5
selecting c5t600A0B80004700CE00001D8C4EF0CD9Cd0
[disk formatted]
Disk not labeled. Label it now? yes
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
inquiry - show vendor, product and revision
volname - set 8-character volume name
! - execute , then return
quit
format> p
PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
! - execute , then return
quit
partition> p
Current partition table (original):
Total disk sectors available: 2147467230 + 16384 (reserved sectors)
Part Tag Flag First Sector Size Last Sector
0 root wm 34 128.00MB 262177
1 swap wu 262178 128.00MB 524321
2 unassigned wu 0 0 0
3 unassigned wm 0 0 0
4 unassigned wm 0 0 0
5 unassigned wm 0 0 0
6 usr wm 524322 1023.74GB 2147467229
8 reserved wm 2147467230 8.00MB 2147483613
partition> q
==> chú ý thấy vị trí thứ 6 dung lượng là 1G => chính là s6
Tạo newfs
newfs /dev/rdsk/ c5t600A0B80004700CE00001D8C4EF0CD9Cd0s6
-- Tạo một thư mục tên u04, sao đó mount vào
mount -F ufs /dev/dsk/c5t600A0B80004700CE00001D8C4EF0CD9Cd0s6 /u04
Chú ý: thay thế rdsk bằng dsk
=====================
Lệnh để clean cache device
devfsadm -Cv
root@c4is-standby-s # echo |format
AVAILABLE DISK SELECTIONS:
0. c1t0d0
/pci@1f,700000/scsi@2/sd@0,0
1. c1t1d0
/pci@1f,700000/scsi@2/sd@1,0
2. c1t2d0
/pci@1f,700000/scsi@2/sd@2,0
3. c1t3d0
/pci@1f,700000/scsi@2/sd@3,0
4. c5t600A0B8000330D0A0000054748BF696Bd0
/scsi_vhci/ssd@g600a0b8000330d0a0000054748bf696b
5. c5t600A0B80004700CE0000057348BF6846d0
/scsi_vhci/ssd@g600a0b80004700ce0000057348bf6846
6. c5t600A0B80004700CE0000057748BF6AD0d0
/scsi_vhci/ssd@g600a0b80004700ce0000057748bf6ad0
Specify disk (enter its number): Specify disk (enter its number):
-- Vào SAN tạo volumn sau đó map xuống host
--Sau khi map xuống xong kiểm tra ổ đĩa mới
root@c4is-standby-s # echo |format
AVAILABLE DISK SELECTIONS:
0. c1t0d0
/pci@1f,700000/scsi@2/sd@0,0
1. c1t1d0
/pci@1f,700000/scsi@2/sd@1,0
2. c1t2d0
/pci@1f,700000/scsi@2/sd@2,0
3. c1t3d0
/pci@1f,700000/scsi@2/sd@3,0
4. c5t600A0B8000330D0A0000054748BF696Bd0
/scsi_vhci/ssd@g600a0b8000330d0a0000054748bf696b
5. c5t600A0B80004700CE00001D8C4EF0CD9Cd0
/scsi_vhci/ssd@g600a0b80004700ce00001d8c4ef0cd9c
6. c5t600A0B80004700CE0000057348BF6846d0
/scsi_vhci/ssd@g600a0b80004700ce0000057348bf6846
7. c5t600A0B80004700CE0000057748BF6AD0d0
/scsi_vhci/ssd@g600a0b80004700ce0000057748bf6ad0
Specify disk (enter its number): Specify disk (enter its number):
-- Ổ đĩa hiện tại đc map xuống là
5. c5t600A0B80004700CE00001D8C4EF0CD9Cd0
-- Xác định lại silde của partition cần format để chọn newfs
root@c4is-standby-s # format
Searching for disks...done
c5t600A0B80004700CE00001D8C4EF0CD9Cd0: configured with capacity of 1024.00GB
AVAILABLE DISK SELECTIONS:
0. c1t0d0
/pci@1f,700000/scsi@2/sd@0,0
1. c1t1d0
/pci@1f,700000/scsi@2/sd@1,0
2. c1t2d0
/pci@1f,700000/scsi@2/sd@2,0
3. c1t3d0
/pci@1f,700000/scsi@2/sd@3,0
4. c5t600A0B8000330D0A0000054748BF696Bd0
/scsi_vhci/ssd@g600a0b8000330d0a0000054748bf696b
5. c5t600A0B80004700CE00001D8C4EF0CD9Cd0
/scsi_vhci/ssd@g600a0b80004700ce00001d8c4ef0cd9c
6. c5t600A0B80004700CE0000057348BF6846d0
/scsi_vhci/ssd@g600a0b80004700ce0000057348bf6846
7. c5t600A0B80004700CE0000057748BF6AD0d0
/scsi_vhci/ssd@g600a0b80004700ce0000057748bf6ad0
--- chọn ổ đĩa mới thứ 5 mới gắn vào
Specify disk (enter its number): 5
selecting c5t600A0B80004700CE00001D8C4EF0CD9Cd0
[disk formatted]
Disk not labeled. Label it now? yes
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
inquiry - show vendor, product and revision
volname - set 8-character volume name
!
quit
format> p
PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
!
quit
partition> p
Current partition table (original):
Total disk sectors available: 2147467230 + 16384 (reserved sectors)
Part Tag Flag First Sector Size Last Sector
0 root wm 34 128.00MB 262177
1 swap wu 262178 128.00MB 524321
2 unassigned wu 0 0 0
3 unassigned wm 0 0 0
4 unassigned wm 0 0 0
5 unassigned wm 0 0 0
6 usr wm 524322 1023.74GB 2147467229
8 reserved wm 2147467230 8.00MB 2147483613
partition> q
==> chú ý thấy vị trí thứ 6 dung lượng là 1G => chính là s6
-- Tạo một thư mục tên u04, sao đó mount vào
mount -F ufs /dev/dsk/c5t600A0B80004700CE00001D8C4EF0CD9Cd0s6 /u04
Chú ý: thay thế rdsk bằng dsk
Saturday, December 17, 2011
kloxo 500 - Internal Server Error
There are still have a problem when update
Kloxo to version 6.1.10 (especially from 6.1.7) with using 'auto update'
or 'update home' on kloxo.
Solution, run this commands:
Solution, run this commands:
# for sure to using latest version for certain packages yum update # shell command version for update sh /script/upcp # cleanup process for certain settings sh /script/cleanup # restart some services service xinetd restart # fix web config to make sure using latest sh /script/fixweb --server=all # Better reboot after that reboot
Friday, December 16, 2011
Reset password root MYSQL với quyền root
[root@servert1 ~]# /etc/init.d/mysqld stop
Stopping MySQL: [ OK ]
[root@servert1 ~]# mysqld_safe --skip-grant-tables &
[1] 13694
[root@servert1 ~]# Starting mysqld daemon with databases from /var/lib/mysql
[root@servert1 ~]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.77 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use mysql;
mysql> update user set password=PASSWORD("testpass") where User='root';
Query OK, 3 rows affected (0.05 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.04 sec)
mysql> quit
Stopping MySQL: [ OK ]
[root@servert1 ~]# mysqld_safe --skip-grant-tables &
[1] 13694
[root@servert1 ~]# Starting mysqld daemon with databases from /var/lib/mysql
[root@servert1 ~]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.77 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use mysql;
mysql> update user set password=PASSWORD("testpass") where User='root';
Query OK, 3 rows affected (0.05 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.04 sec)
mysql> quit
Thursday, December 15, 2011
ORA-27102: out of memory - Set the kernel parameters
When trying to increase the SGA to approach half available RAM with an Oracle 64-bit version on a Linux 64-bit operating system, even though shmmax is set to match half the amount of RAM, you get the following error when trying to start the instance:
SQL> startup nomount
ORA-27102: out of memory
Linux-x86_64 Error: 28: No space left on device Changes
shmall is too small, most likely is set to the default setting of 2097152
$ cat /proc/sys/kernel/shmall2097152
Cause
shmall is the total amount of shared memory, in pages, that the system can use at one time.Solution
Set shmall equal to the sum of all the SGAs on the system, divided by the page size.The page size can be determined using the following command:
$ getconf PAGE_SIZE
4096As the root user set the shmall to 4194304 in the /etc/sysctl.conf file:
kernel.shmall = 4194304then run the following command:
$ sysctl -p
$ cat /proc/sys/kernel/shmall
4194304The above command loads the new value and a reboot is not necessary.
Switch back to being the oracle user and retry the startup command.
Modifying /etc/sysctl.conf is a permanent workaround (applies at boot time). If for some reason you DO NOT want to change the system wide configuration, you can do it on the fly by directly changing the kernel pseudo FS AKA procfs.
e.g. echo "4194304" > /proc/sys/kernel/shmallUsing HUGEPAGES does not alter the calculation for configuring shmall.
Set the kernel parameters
Add the following the lines in the file /etc/sysctl.conf
kernel.shmall = physical RAM size / pagesize For most systems, this will be the value 2097152. See Note 301830.1 for more information.
kernel.shmmax = 1/2 of physical RAM. This would be the value 2147483648 for a system with 4Gb of physical RAM.
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 512 x processes (for example 65536 for 128 processes)
Development recommends a minimum of 327679 for active systems.
net.ipv4.ip_local_port_range = 9000 65500
(The runInstaller (OUI) checks may expect this to be the old guidance of 1024 65000.
The new guidance from Oracle development is 9000 65500.
Please allow the runInstaller (OUI) to proceed with the new guidance from Oracle development.)
net.core.rmem_default = 262144
net.core.rmem_max = 2097152
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
# sysctl -p Wednesday, December 14, 2011
Linux Add a Swap File – Howto
Procedure To Add a Swap File
You need to use the dd command to create swap file. The mkswap command is used to set up a Linux swap area on a device or in a file.a) Login as the root user.
b) Type following command to create 512MB swap file (1024 * 512MB = 524288 block size):
# dd if=/dev/zero of=/swapfile1 bs=1024 count=524288c) Set up a Linux swap area:
# mkswap /swapfile1d) Activate /swapfile1 swap space immediately:
# swapon /swapfile1e) To activate /swapfile1 after Linux system reboot, add entry to /etc/fstab file. Open this file using a text editor such as vi:
# vi /etc/fstabAppend the following line:
/swapfile1 swap swap defaults 0 0So next time Linux comes up after reboot, it enables the new swap file for you automatically.
g) How do I verify swap is activated or not?
Simply use the free command:
$ free -mSee also:
free command
Display free memory size in MB:$ free -m Output:total used free shared buffers cached Mem: 750 625 125 0 35 335 -/+ buffers/cache: 254 496 Swap: 956 0 956Displays a line containing the totals memory in MB:
$ free -t -mOutput:
total used free shared buffers cached Mem: 750 625 125 0 35 335 -/+ buffers/cache: 253 496 Swap: 956 0 956 Total: 1707 625 1082
vmstat command
Type vmstat command at shell prompt:$ vmstatOutput:
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu---- r b swpd free buff cache si so bi bo in cs us sy id wa 1 0 0 131620 35432 341496 0 0 42 82 737 1364 15 3 81 1
top command
Type top command at the shell prompt:$ topSample outputs:
Tuesday, December 6, 2011
ORA-27102: out of memory on Solaris 10
Monday, September 14, 2009 5:12:10 PM
This problem is due to insufficient shared memory
from system while Oracle tries to create shared memory segment(depends
on the size and SGA and PGA). Unlike earlier releases of Solaris
(Solaris 8 and 9), most of the system parameters needed to run Oracle
are already set properly, so the only one parameter to be set is the
maximum shared memory. In earlier versions this was called
shmsys:shminfo_shmmax and was set by editing the /etc/system file and
rebooting. With Solaris 10 the parameter is set by modifying a "Resource
Control Value". You can do this temporarily by using prctl, but that is
lost at reboot so you will need to add the command to the oracle user.
The other option is to create a default project for the oracle user:
How large shared memory should be set for Oracle depends on the physical memory size. For Solaris , 8M is the default value on Solaris 9 and prior versions where as 1/4th of the physical memory is the default on Solaris 10 and later. Verifying the default setting of os is shown as the following
By default, Oracle 10 will allocate 40% of the total system physical memory to create SGA and PGA. So for 32G system memory, the shmmax for Oracle 10 will be 0.4*32G = 12.8G.
$ projadd -U oracle -K "project.max-shm-memory=(priv,13G,deny)" user.oracle
How large shared memory should be set for Oracle depends on the physical memory size. For Solaris , 8M is the default value on Solaris 9 and prior versions where as 1/4th of the physical memory is the default on Solaris 10 and later. Verifying the default setting of os is shown as the following
$ prtconf | grep Mem
Memory size: 32760 Megabytes
$ id -p
uid=59008(oracle) gid=10001(dba) projid=3(default)
$ prctl -n project.max-shm-memory -i project 3
project: 3: default
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
project.max-shm-memory
privileged 7.84GB - deny -
system 16.0EB max deny -
By default, Oracle 10 will allocate 40% of the total system physical memory to create SGA and PGA. So for 32G system memory, the shmmax for Oracle 10 will be 0.4*32G = 12.8G.
(Temporary method)
$ prctl -n project.max-shm-memory -r -v 10G -i project 3
(No need to reboot)
$ projadd -p 100 -c 'test shmmax' -U oracle -G dba -K 'project.max-shm-memory=(privileged,13G,deny)' user.oracle
$ projects -l
...
user.oracle
projid : 100
comment: "test shmmax"
users : oracle
groups : dba
attribs: project.max-shm-memory=(privileged,13958643712,deny)
$ cat /etc/project
user.oracle:100:test shmmax:oracle:dba:project.max-shm-memory=(privileged,13958643712,deny)
Sunday, December 4, 2011
Command Solaris
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-i
|
Set keyboard defaults from the keyboard default file. This option is mutually exclusive with all other options except for the -d keyboard device option. This option instructs the keyboard command to read and process keyclick and keyboard abort default values from the /etc/default/kbd file. This option can only be used by the superuser. | |
-r
|
Reset the keyboard as if power-up. | |
| -t | Return the type of the keyboard being used. | |
| -c | On/Off state Turn the clicking of the keyboard on or off. | |
| -a | Enable/Disable state; Enable or disable the keyboard abort sequence effect. |
Monitoring Performance
This chapter describes procedures for monitoring system performance by using the vmstat, iostat, df, and sar commands. This is a list of the step-by-step instructions in this chapter.How to Display Virtual Memory Statistics (vmstat)The following example shows the vmstat display of statistics gathered at five-second intervals.$ vmstat 5procs memory page disk faults cpu
r b w swap free re mf pi po fr de sr f0 s3 -- -- in sy cs us sy id
0 0 8 28312 668 0 9 2 0 1 0 0 0 1 0 0 10 61 82 1 2 97
0 0 3 31940 248 0 10 20 0 26 0 27 0 4 0 0 53 189 191 6 6 88
0 0 3 32080 288 3 19 49 6 26 0 15 0 9 0 0 75 415 277 6 15 79
0 0 3 32080 256 0 26 20 6 21 0 12 1 6 0 0 163 110 138 1 3 96
0 1 3 32060 256 3 45 52 28 61 0 27 5 12 0 0 195 191 223 7 11 82
0 0 3 32056 260 0 1 0 0 0 0 0 0 0 0 0 4 52 84 0 1 99
Category Field Name Description procs Reports the following states: r The number of kernel threads in the dispatch queue b Blocked kernel threads waiting for resources w Swapped out LWPs waiting for processing resources to finish memory Reports on usage of real and virtual memory: swap Available swap space free Size of the free list page Reports on page faults and paging activity, in units per second: re Pages reclaimed mf Minor and major faults pi Kbytes paged in po Kbytes paged out fr Kbytes freed de Anticipated memory needed by recently swapped-in processes sr Pages scanned by page daemon (not currently in use). If sr does not equal zero, the page daemon has been running. disk Reports the number of disk operations per second, showing data on up to four disks faults Reports the trap/interrupt rates (per second): in Interrupts per second sy System calls per second cs CPU context switch rate cpu Reports on the use of CPU time: us User time sy System time id Idle time
How to Display System Event InformationRun vmstat -s to show the total of various system events that have taken place since the system was last booted.0 swap ins
0 swap outs
0 pages swapped in
0 pages swapped out
409376480 total address trans. faults taken
3075036 page ins
2601555 page outs
3812452 pages paged in
6525552 pages paged out
11007609 total reclaims
10927650 reclaims from free list
0 micro (hat) faults
409376480 minor (as) faults
2957386 major faults
102738273 copy-on-write faults
61711047 zero fill page faults
1002562077 pages examined by the clock daemon
7881 revolutions of the clock hand
16716370 pages freed by the clock daemon
4999048 forks
1138206 vforks
5747009 execs
741660225 cpu context switches
736047593 device interrupts
528054538 traps
2496638575 system calls
430283487 total name lookups (cache hits 95%)
81727 toolong
10484677 user cpu
9528364 system cpu
443762786 idle cpu
16281790 wait cpuHow to Display Swapping StatisticsRun vmstat -S to show swapping statistics.procs memory page disk faults cpu
r b w swap free si so pi po fr de sr m1 m3 m4 m5 in sy cs us sy id
0 0 0 8512 888 0 0 12 21 55 0 417 1 0 0 0 206 1040 308 2 2 96si = Average number of LWPs swapped in per second
so = Number of whole processes swapped outHow to Display Disk Utilization Information (iostat)You can display disk activity information by using the iostat command with a time interval. The following example shows disk statistics gathered every five seconds.iostat 5tty md1 md3 md4 md5 cpu
tin tout kps tps serv kps tps serv kps tps serv kps tps serv us sy wt id
0 2 10 1 28 2 0 22 0 0 0 1 0 10 2 2 3 92
0 47 58 7 39 16 2 34 0 0 0 0 0 0 0 2 19 78
0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 98
0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 99
0 16 2 0 22 0 0 0 0 0 0 0 0 0 2 3 1 95
0 24 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 98
For Each ... Field Name Description Terminal tin Number of characters in the terminal input queue tout Number of characters in the terminal output queue Disk bps Blocks per second tps Transactions per second serv Average service time, in milliseconds CPU us In user mode sy In system mode wt Waiting for I/O id IdleHow to Display Extended Disk StatisticsRun iostat -xtc to get extended disk statistics. This command displays a line of output for each disk.extended device statistics tty cpu
device r/s w/s kr/s kw/s wait actv svc_t %w %b tin tout us sy wt id
md1 0.4 0.9 3.6 6.9 0.0 0.0 27.7 1 1 0 2 2 2 3 92
md3 0.1 0.2 1.0 1.3 0.0 0.0 21.7 0 0
md4 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
md5 0.0 0.0 0.7 0.0 0.0 0.0 9.9 0 0
md8 0.8 0.3 6.7 14.2 0.0 0.0 13.1 0 1
md10 0.2 0.9 1.8 6.8 0.0 0.0 15.5 0 1
md11 0.2 0.9 1.8 6.8 0.0 0.0 14.8 0 1
md30 0.0 0.2 0.5 1.3 0.0 0.0 11.4 0 0
md31 0.0 0.2 0.5 1.3 0.0 0.0 10.2 0 0
md40 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
md41 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
md50 0.0 0.0 0.4 0.0 0.0 0.0 9.4 0 0
md51 0.0 0.0 0.4 0.0 0.0 0.0 7.3 0 0
md80 0.4 0.3 3.3 14.2 0.0 0.0 10.3 0 0
md81 0.4 0.3 3.3 14.2 0.0 0.0 11.7 0 1
sd0 0.6 2.1 6.0 22.8 0.0 0.0 16.3 0 3
sd1 0.6 2.1 6.0 22.8 0.0 0.0 15.2 0 2
Field Name Description r/s Reads per second w/s Writes per second Kr/s Kbytes read per second Kw/s Kbytes written per second wait Average number of transactions waiting for service (queue length) actv Average number of transactions actively being serviced svc_t Average service time, in milliseconds %w Percentage of time the queue is not empty %b Percentage of time the disk is busyHow to Check CPU Utilization (sar)Display CPU utilization with the sar -u command. (The sar command without any options is equivalent to sar -u.) At any given moment, the processor is either busy or idle. When busy, the processor is in either user or system mode. When idle, the processor is either waiting for I/O completion or "sitting still" with no work to do.Measure CPU utilization during 5 secs one time.sar -u 5 1Measure CPU utilization during 60 secs 1440 times and write result in file sar.log.sar -u -o sar.log 60 1440To later review disk and tape activity from that period:sar -d -f sar.log
Field Name Description %sys Lists the percentage of time that the processor is in system mode %user Lists the percentage of time that the processor is in user mode %wio Lists the percentage of time the processor is idle and waiting for I/O completion %idle Lists the percentage of time the processor is idle and is not waiting for I/OA high %wio generally means a disk slowdown has occurred.
Enable file system
journaling on Solaris 7 and 8
Solaris 7 and 8 include a native implementation of file system journaling. This feature, known as "intent logging" or just "logging" enables FASTER file system operation and FASTER system boot.It's trivial to implement and safe to use. The new logging feature is an option to the Unix File System (UFS), which is the standard file system for all disk partitions on SUN servers, except for partitions holding swap space. By default, the journaling option is disabled. Logging is enabled on a per file system basis, and it can even be enabled on / (root file system) and other operating system partitions.BackgroundSolaris UFS logging works by allocating space from the file system's free blocks. Within that space, all metadata changes to the file system are written. Metadata includes directory and I-node information but not file data blocks, essentially everything but the actual data within the file. So, for example, a "file create" modifies the directory structure and allocates a new I-node, and those activities are written to the logging space. Once the metadata changes are made to the logging area, the system is free to perform other operations to the file system. In the background, the information in the log is flushed to the file system and updates the appropriate directory and I-node structures, completing the file system operations.The logging data is written sequentially within the log space. It's therefore much faster for the operating system to complete metadata changes via logging and background flushing than by directly modifying the metadata (via random I/O) spread across the disk. The size of the logging space is based on the size of the file system, and equals 1 MB per 1 GB of file system space, up to 64 MB. The space is used as a circular log: if the log space is about to fill up, new metadata change requests are paused while the log is emptied. As changes are moved from the log to the file system, that log space is made available, and new metadata changes can be written to the logging space.Usually with UFS, if the system crashes during any file system operation, the entire system must have its consistency checked via the fsck command. That command can take several minutes per file system because it checks all metadata and file data to ensure the structures are correct, free, and used, and that the I-node block counts are correct. It also confirms that the free space available is current, repairs inconsistencies, and occasionally requires manual intervention to fix large problems. Files and even directories can be lost, depending on the operations occurring at the time of the crash.Because metadata changes are made first to the log space rather than to the file system, the consistency check for a logged file system after a crash is a simple and fast operation. The system evaluates the logging data and determines which changes had completed against the underlying file system, which had yet to start, and which were in progress. Those completed or not yet started are removed from the log, and those partly completed are either undone or completed. If there's sufficient data in the log to complete the operation, it's completed. Otherwise, the changes made are removed from the underlying file system.People familiar with database operation will recognize the similarity between database transaction processing and the activities here. The end result is that the underlying file system is consistent, and no thorough consistency checking is needed. That operation completes in a few seconds per file system.Using loggingStarting with Solaris 7, there's a new logging option to the mount command and in the /etc/vfstab system configuration file. Logging only appears in a couple other places within Solaris. The mount command shows which partitions are mounted and lists logging in the options fields for each partition on which logging is enabled. Finally, at system boot time, the fsck phase reports per partition whether each is stable, logging, or being checked. There are no other status commands available to determine the state of logging.A = Device to mount
B = Device to fsck
C = Mount point
D = Filesystem Type
E = Fsck pass (unimportatnt with logging)
F = Mount at boot
G = Mount options# ------------------------------------------------------------------
# A B C D E F G
# ------------------------------------------------------------------
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/dsk/c0t0d0s3 - - swap - no -
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no logging
/dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6 /usr ufs 2 no logging
/dev/dsk/c0t0d0s1 /dev/rdsk/c0t0d0s1 /var ufs 3 no logging
/dev/dsk/c0t0d0s7 /dev/rdsk/c0t0d0s7 /home ufs 4 yes logging
/dev/dsk/c0t0d0s5 /dev/rdsk/c0t0d0s5 /opt ufs 5 yes logging
/dev/dsk/c0t8d0s0 /dev/rdsk/c0t8d0s0 /u01 ufs 6 yes logging
/dev/dsk/c0t9d0s0 /dev/rdsk/c0t9d0s0 /u02 ufs 7 yes logging
/dev/dsk/c0t10d0s0 /dev/rdsk/c0t10d0s0 /u03 ufs 8 yes logging
/dev/dsk/c0t11d0s0 /dev/rdsk/c0t11d0s0 /u04 ufs 9 yes logging
/dev/dsk/c0t12d0s0 /dev/rdsk/c0t12d0s0 /u05 ufs 10 yes logging
/dev/dsk/c1t13d0s0 /dev/rdsk/c1t13d0s0 /app ufs 11 yes logging
/dev/dsk/c1t14d0s0 /dev/rdsk/c1t14d0s0 /users ufs 12 yes logging
swap - /tmp tmpfs - yes -Logging increases performance, decreases fsck time, removes the risk of a file system corruption, can be used on all UFS partitions (including root), and is free.
Solaris Syslog Daemon Debugging
The log system messages daemon syslogd reads and forwards system messages to the appropriate log files and/or users, depending upon the priority of a message and the system facility from which it originates. The configuration file /etc/syslog.conf controls where messages are forwarded. The syslogd daemon ignores any faulty entry in /etc/syslog.conf, specially spaces instead of tabs are not recognized by syslogd. Therefore always check the entries in /etc/syslog.conf in the debugging mode of syslogd.How to check /etc/syslog.conf# /etc/init.d/syslog stop # /usr/sbin/syslogd -dgetnets() found 1 addresses, they are: 0.0.0.0.2.2
amiloghost() testing 193.247.121.196.2.2
cfline(*.err;kern.notice;auth.notice /dev/sysmsg)
cfline(*.err;kern.debug;daemon.notice /var/adm/messages)
cfline(mail.info;mail.debug /var/log/maillog)syslogd: line 14: unknown priority name "debug /var/log/maillog"cfline(*.alert;kern.err;daemon.err operator)
cfline(*.alert root)
cfline(*.emerg *)
cfline(user.err /dev/sysmsg)
cfline(user.err /var/adm/messages)
cfline(user.alert root, operator)
cfline(user.emerg *)syslogd: version 1.70
Started: Sat Jan 6 10:11:47 2001
Input message count: system 0, network 0
# Outputs: 105 3 3 3 5 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 X CONSOLE: /dev/sysmsg
7 3 3 5 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 X FILE: /var/adm/messages
X X 6 X X X X X X X X X X X X X X X X X X X X X X UNUSED:
3 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 X USERS: operator
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 X USERS: root
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 X WALL:
X 3 X X X X X X X X X X X X X X X X X X X X X X X CONSOLE: /dev/sysmsg
X 3 X X X X X X X X X X X X X X X X X X X X X X X FILE: /var/adm/messages
X 1 X X X X X X X X X X X X X X X X X X X X X X X USERS: root, operator
X 0 X X X X X X X X X X X X X X X X X X X X X X X WALL:Per File Statistics
File Tot Dups Nofwd Errs
---- --- ---- ----- ----
/dev/sysmsg 0 0 0 0
/var/adm/messages 0 0 0 0
0 0 0 0
operator 0 0 0 0
root 0 0 0 0
WALL 0 0 0 0
/dev/sysmsg 0 0 0 0
/var/adm/messages 0 0 0 0
root,operator 0 0 0 0
WALL 0 0 0 0syslogd: restarted
off & running....
sys_poll blocking, init_cnt=0# ^D
# /etc/init.d/syslog startLine 14 in /etc/syslog.conf are filled up with spaces instead of tabs. Replace the spaces with tabs and syslogd will accept the new entry in Line 14.
Does each Oracle Process use more than
100M memory ?
If you check the oracle process with the OS comand "pmap" or "top", you can see that each oracle process use more than 100M memory. Is this a problem on the Oracle installation or something else? It seems that pmap counts the SGA size as the private memory segment of each oracle process, but we believe the SGA size should be shared.Output from "top" on our Solaris System with Orcale 8.1.7.0PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
-----------------------------------------------------------------
361 oracle 258 59 0 124M 88M sleep 0:01 0.00% oracle
373 oracle 11 59 0 122M 88M sleep 41:50 0.00% oracle
363 oracle 11 59 0 119M 88M sleep 0:01 0.00% oracle
365 oracle 11 58 0 119M 88M sleep 0:17 0.02% oracle
359 oracle 1 59 0 119M 89M sleep 0:00 0.00% oracle
377 oracle 1 59 0 119M 88M sleep 0:00 0.00% oracle
375 oracle 1 58 0 119M 88M sleep 0:00 0.00% oracle
367 oracle 1 58 0 118M 89M sleep 0:00 0.00% oracle
371 oracle 1 58 0 118M 89M sleep 0:00 0.00% oracle
369 oracle 1 58 0 118M 88M sleep 0:00 0.00% oracleMemory Allocation for Oracle ProcessesOn many UNIX platforms and specially on Sun platforms, the text of the Oracle binary and shared libraries are actually shared between background processes if these instances share the same ORACLE_HOME. So you need to subtract the shared text of the oracle binary and the shared libraries in the result of the OS commands.
Even pmap and pmen utilities make mistakes between these memory divisions, and sometimes SGA and text executable are often added incorrectly.Determine the memory used by each Oracle background process on a SolarisThis can be used by anyone who has privleges for the pmap, which can be found in /usr/proc/bin/. First, we need to find the process id (PID) of the Oracle background process you wish to determine the memory size for. This is done by issueing the following command:# ps -u oracle -fUID PID PPID C STIME TTY TIME CMD
oracle 359 1 0 12:26:17 ? 0:00 ora_pmon_DIA3
oracle 361 1 0 12:26:17 ? 0:01 ora_dbw0_DIA3
oracle 363 1 0 12:26:17 ? 0:01 ora_lgwr_DIA3
oracle 365 1 0 12:26:17 ? 0:18 ora_ckpt_DIA3
oracle 367 1 0 12:26:17 ? 0:01 ora_smon_DIA3
oracle 369 1 0 12:26:17 ? 0:00 ora_reco_DIA3
oracle 371 1 0 12:26:17 ? 0:00 ora_snp0_DIA3
oracle 373 1 0 12:26:17 ? 41:50 ora_s000_DIA3
oracle 375 1 0 12:26:17 ? 0:00 ora_d000_DIA3
oracle 377 1 0 12:26:18 ? 0:00 ora_d001_DIA3Second, you then enter the following commands for the DB Writer process (ora_dbw0_DIA3) with process id = 361 as an example.# /usr/proc/bin/pmap 361 | grep "shmid" 80000000 82992K read/write/exec/shared [ shmid=0x2 ]# /usr/proc/bin/pmap 361 | grep "total"
total 124232KThen you take the total size: 124232K and subtract the SGA size which the line marked with "shmid=" above, in this case it is 82992K. So, 124232K minus 82992K is 41240K. So, the DBWR background process is approximately 41.2 MB. Repeat this steps for all the background processes.
Sizing up Solaris Memory with the RMCmem
Package
How much memory is needed on SUN Solaris? Explaining memory in Solaris by reviewing the different types of memory and introducing a set of tools, the RMCmem package.Install RMCmem PackageDownload the RMCmem tools available from ftp://playground.sun.com/pub/memtool. The package includes a kernel module that provides extra instrumentation.# cd /tmp
# zcat RMCmem3.8.2.tar.gz | tar xvf -
# pkgadd -d .The package is installed in /opt/RMCmem (see README in this directory)Virtual / Physical Memory UsageSolaris is a virtual memory system. The total amount of memory that you can use is increased by adding swap space to the system. If you ever see "out of memory" messages, adding swap space is the usual fix. Performance of the system is very dependent on how much physical memory (RAM) you have. If you don't have enough RAM to run your workload, performance degrades rapidly.Physical memory usage can be classified into four groups:
Kernel memory mapped into kernel address space Process memory is mapped into a process address space Filesystem cache memory that is not mapped into any address space Free memory that is not mapped into any address spaceRMCmem includes a simple command to summarize this:# /opt/RMCmem/bin/prtmemTotal memory: 989 Megabytes
Kernel Memory: 60 Megabytes
Application: 110 Megabytes
Executable & libs: 42 Megabytes
File Cache: 757 Megabytes
Free, file cache: 11 Megabytes
Free, free: 6 MegabytesTotal physical memoryThe total physical memory can be seen using prtconf. Memory is allocated in units called pages, and you can use the 'pagesize' command to see the size in bytes per page:# /usr/sbin/prtconf | grep Memory
Memory size: 1024 Megabytes# /usr/bin/pagesize
8192Kernel memoryKernel memory is allocated to hold the initial kernel code at boot time, then grows dynamically as new device drivers and kernel modules are used. Kernel tables also grow dynamically, unlike some older versions of Unix. As you add hardware and processes to a system, the kernel will grow. In particular, to keep track of all the memory in a system, the kernel allocates a page table structure.If you have several gigabytes of RAM this table gets quite large. The dynamic kernel memory allocator grabs memory in large "slabs," then allocates smaller blocks more efficiently. This means that the kernel tends to grab a bit more memory than it's really using. If there is a severe memory shortage, the kernel unloads unused kernel modules and devices and frees unused slabs. The simplest summary of kernel memory usage comes from sar. To show the kernel memory allocation (KMA) activities use (see man sar for more details).# sar -k 1SunOS diamond 5.7 Generic_106541-12 sun4u 04/28/01sml_mem alloc fail lg_mem alloc fail ovsz_alloc fail
6873088 6044236 0 44818432 43761720 0 11231232 0Application process memoryApplication processes consist of an address space divided into segments, where each segment maps either to a file, anonymous memory (the swap space), System V shared memory, or a memory mapped device. The mapped files include the code and initialized data for the command and all its shared libraries.What we really want to know, is the amount of RAM used by each segment. This is shown by the pmem command in the RMCmem package.# /opt/RMCmem/bin/pmem 361361: ora_dbw0_DIA3
Kbytes Resident Shared Private Permissions Mapped File
82992 82992 82992 - read/write/exec [shmid=0x2]
16 16 8 8 read/exec libc_psr.so.1
16 16 8 8 read/exec libmp.so.2
8 8 8 - read/write/exec libmp.so.2
........ .. .. . ............... ...........
112 80 72 8 read/exec libelf.so.1
8 8 8 - read/write/exec libelf.so.1
16 16 8 8 read/exec libkvm.so.1
8 8 8 - read/write/exec libkvm.so.1
-------- ------ ------ ------ ------
124232 93040 92728 312Now we can see that the process address space size is 124232 kilobytes; 93040 kilobytes of that are currently resident in main memory, wherein 92728 kilobytes are shared with other processes while 312 kilobytes are private. When this command started only the 312 kilobytes of private memory were taken from the free list.If we now go through all the processes on the system, add up how much private memory they use, and also add in the shared memory for each mapped file, we'll know how much application memory is in use. This summary is shown by prtmem as we saw in the beginning, and the detail is listed by the memps command in RMCmem.# /opt/RMCmem/bin/mempsPID Size Resident Shared Private Process
... ....... ...... ...... .... .............
359 118904k 93608k 92800k 808k ora_pmon_DIA3
367 118184k 93152k 92704k 448k ora_smon_DIA3
369 117928k 93120k 92704k 416k ora_reco_DIA3
371 118040k 93136k 92720k 416k ora_snp0_DIA3
365 119040k 93120k 92712k 408k ora_ckpt_DIA3
377 118344k 93080k 92720k 360k ora_d001_DIA3
363 119088k 93056k 92720k 336k ora_lgwr_DIA3
375 118344k 93048k 92720k 328k ora_d000_DIA3
361 124232k 93040k 92728k 312k ora_dbw0_DIA3
373 121608k 93032k 92728k 304k ora_s000_DIA3Filesystem cache memoryThis is the part of memory that is most confusing, as it is invisible. You can only tell it's there if you access the same file twice and it is quicker the second time.The RMCmem package adds kernel instrumentation that counts up all the pages for each cached file. The memps -m command lists the files that are cached in order of the amount of memory they're consuming.One problem is that within the kernel, the file is only known by its inode number and filesystem mount point. The directory pathname for the file may not be known.The RMCmem package tries to solve this problem by catching file names as files are opened (by interposing on the vnode open code) and making an inode-to-name lookup cache in the kernel. This cache size is limited (to 8192 entries by default), and the file may have been opened before the kernel module was loaded, so it can't always find the name.# memps -mSize InUse E/F Filename21064k 21064k F /usr (inode 540488)
8184k 824k F /usr (inode 260922)
7752k 7752k F /usr (inode 540429)
7480k 7480k F /usr (inode 540428)
7480k 7480k F /usr (inode 540427)
6896k 6896k F /usr (inode 540450)
.... .... . .... ...... ......... and so on down to lots of files ...# cd /usr
# find . -inum 540488
./local/jdbc/ora817/old/libserver8.aMore infos about the RMCmem package can be found here as PDF
Using Sun Solaris Manuals directly from
CD-ROM
Solaris 8:cd /cdrom/sol_8_doc
./ab2cd (Start)
http://quorum:8888 (Using the Doc online)
./ab2cd stop (Stop)Solaris 7:cd /cdrom/sol_7_1199_doc
./ab2cd (Start)
http://diamond:8888 (Using the Doc online)
./ab2cd stop (Stop)
DLT-TAPE UNIT INSTALLATION on Solaris
7/8/9
Installation Instructions will cover the installation of the DLT tape peripheral hardware and configuration of the system to communicate with the DLT tape peripheral. In this example we use a «QUANTUM DLT7000».The Solaris system must have the appropriate SCSI interface for DLT drive to attached to, a SCSI single-ended DLT drive can be attached only to a SCSI single-ended interface. The same is true for SCSI differential attachment. Solaris includes a driver to efficiently communicate with SCSI tape drives, such as the DLT tape peripheral.
Perform the installation as follows:
Shut down your Sun workstation/server and power off the machine and all scsi-devices. Connect the DLT to the scsi-bus using good cables and make sure the bus is terminated correctly. Set the scsi-id; id 4 or 5 are the most common to use.
If possible use a separate or underutilized SCSI bus for the DLT. Running the tape drive on the same bus as the disk drives will never let you achieve any good throughput. You bought the DLT because of performance didn't you ?
1. STOP-A (L1-A) Power on the devices/machine again and halt the boot process with.
(or press the BREAK key if you have an ASCII console).2. probe-scsi-all Verify that the drive is connected properly.
Note: output from probe-scsi will not always be correct if you enter the PROM monitor by breaking the boot process!3. boot -rvBoot the system and log in as root. When booting you should see a message similar to these: "st1: ". 4. cd /kernel/drvChange directory to /kernel/drv. Edit the st.conf file by adding the following: tape-config-list="QUANTUM DLT7000","Quantum DLT7000","DLT7-data";
DLT7-data = 1,0x38,0,0x8639,4,0x82,0x83,0x84,0x85,3;tape-config-list="tape unit>"," reference name>"," "
tape-config-list is a variable defined by a series of tape configuration parameters listed below:
is the vendor and product ID string for the DLT device.
Depending on the DLT tape peripheral you are installing, you must insert the appropriate vendor and product ID for
as described in the following table:
DLT Tape ProductDLT7000 QUANTUM DLT7000 (Total string character count, including spaces, must equal 15).
is a name you select that the system will use to identify the DLT device. This reference does not change the DLT product ID. When the system boots, the reference name will be displayed in the list of peripheral devices recognized by the system.
-data> is a variable containing a series of additional DLT device configuration information. You select a name in place of thestring. You will continue editing the st.conf file by defining the name you selected for . The definition depends on the DLT tape peripheral you are installing. For a DLT7000 series unit add the following line:
1,0x38,0,0x8639,4,0x82,0x83,0x84,0x85,3;
contains 10 parameters and are described following:
1The first parameter, is the version number and should not change. 0x38The second parameter, designates the DLT tape type as defined in /usr/include/sys/mtio.h.
#define MT_ISOTHER 0x36 /* generic other type of tape drive */
#define MT_ISDLT 0x38 /* sun: SCSI DLT tape drive */ 0The third parameter is the block size. Since the DLT tape drive uses variable block size, this value should be zero. 0x8639The fourth parameter, 0x8639, is a summation of values that represent selected device options. The table below lists the options and the corresponding value: Option Value
ST_VARIABLE 0x0001
ST_BSF 0x0008
ST_BSR 0x0010 ST_LONG_ERASE 0x0020 ST_NOWS_EOD 0x0200 ST_NLOADABLE 0x0400 ST_NO_RECSIZE_LIMIT 0x8000
The man st page has more information about these and other possible device options. For certain applications, it may be necessary to consider adding or removing one or more of the device options. 4The fifth parameter, 4, defines the number of densities. The maximum definable number of densities is 4. 0x82
0x83
0x84
0x85The sixth, seventh, eighth and ninth parameter are used for system selection of tape densities. Use these values for a DLT 7000 Tape Drive. 3The tenth parameter defines which density the system will use as the default density. The sixth, seventh, eighth and ninth parameters in the string are referenced by the system as 0, 1, 2 and 3, respectively. The 3 value for the tenth parameter selects the 0x85 density code as the system default density.
After editing the st.conf file, reboot the system:
5. shutdown-i0-g0 boot -rvReboot the System
The -r switch in the boot command enables a kernel compile and includes the creation of device special files used for communication with the DLT device. The -v switch enables verbose mode display of system bootup. With verbose mode, the system should indicate that the DLT tape peripheral is attached by displaying thestring you selected. 6. mt -t /dev/rmt/0 statusEnter the following command to verify the installation: Vendor 'TANDBERG' Product 'DLT7000 ' tape drive:
sense key(0x0)= No Additional Sense residual= 0
retries= 0 file no= 0 block no= 0
The target drive designations assigned by Solaris may take on values higher than already established in the /dev/rmt/ path. This is not a problem but during a boot -rv, Solaris does not remove tape device files for drives that are no longer attached to the system. This can increase the effort in locating the device file for the configured drive, however, this can be minimized by first deleting the tape device files:rm /dev/rmt/*then either boot the system with a:boot -rvor issue the following at the command line prompt:drvconfig -i st; tapesIf the DLTtape is the only drive on the system, it's target assignment should be zero. The Solaris man pages have more information on drvconfig and tapes.
Reconfigure Devices on Solaris
If you remove or add a device on Solaris then the devices files must be recreated, either with boot -rv or devfsadm. For example to renumber the logical tape drive devices do the following: Tape drives were numbered beginning with /dev/rmt/3 instead of /dev/rmt/0. The physical devices pointed to by the logical /dev/rmt/[012] devices no longer existed, and we wanted to renumber the valid devices beginning at /dev/rmt/0.
- Cleanup non-existent tape drive devices with devfsadm.
# devfsadm -C -c tape -v
- Remove all /dev/rmt logical links.
# rm -f /dev/rmt/*
- Recreate all /dev/rmt logical links with devfsadm
# devfsadm -c tape -v
devfsadm
devfsadm(1M) maintains the /dev and /devices namespaces. It replaces the previous suite of devfs administration tools including drvconfig(1M), disks(1M), tapes(1M), ports(1M), audlinks(1M), and devlinks(1M).
OPTIONS
The following options are supported:
-CCleanup mode. Prompt devfsadm to cleanup dangling /dev links that are not normally removed. If the -c option is also used, devfsadm only cleans up for the listed devices' classes. -c device_classRestrict operations to devices of class device_class. Solaris defines the following values for device_class: disk, tape, port, audio, and pseudo. This option may be specified more than once to specify multiple device classes.
OpenBoot Diagnostics
The Solaris operating system gets the jumpstart for its booting from a hardware-level interface called the OpenBoot PROM or OBP for short. OpenBoot at its heart has an interactive command interpreter with a varied set of functions. OBP is a firmware which is stored in the socketed startup PROM of the computer and consists of two parts, the PROM and the NVRAM.Start an OpenBoot Diagnostics
As stated earlier while the PROM acts as the interface for access to diagnostics and drivers, the NVRAM consists of some editable user defined parameters. Non Volatile information like the system identification information, device aliases etc are stored in the NVRAM.The OpenBoot PROM is programmable and can be programmed based on Forth, which is an interactive
programming language much like shell scripting.
The main tasks performed by the OpenBoot firmware are:
- Initializing and Testing system hardware ( POST , power on self test)
- Interactive Debugging
- Management of NVRAM Parameters
- Start the Operating System boot
Useful commands at OK prompt. Dignostics : boot General
- banner
- this command shows the following systems hardware informatiion : Model, architecture, processor,keyboard, openboot version, Serial no. ethernet address & host id.
test floppy - test floppy disk drive
test net - test network loopbacks
test scsi - test scsi interface
test-all test for all devices with selftest method
watch-clock- Show ticks of real-time clock
watch-net- Monitor network broadcast packets
watch-net-all- Monitor broadcast packets on all net interfaces
probe-scsi- Show attached SCSI devices
- probe-scsi-all
- Show attached SCSI devices for all host adapters- internal & external.
boot - boot kernel from default device.
Factory default is to boot
from DISK if present, otherwise from NET.
boot net - boot kernel from network
boot cdrom - boot kernel from CD-ROM
boot disk1:h - boot from disk1 partition h
boot tape - boot default file from tape
boot disk myunix -as - boot myunix from disk with flags "-as" DEVALIAS
- ok>show-devs
- ok cd /pci@1f,4000/scsi@3
- ok .properties
- ok ls
- f00809d8 tape
- f007ecdc disk
- ok .speed
- CPU Speed : 200.00MHz
- UPA Speed : 100.00MHz
- PCI Bus A : 66Mhz
- PCI Bus B : 33Mhz
- printenv Display all variables and current values.
- setenv
Set variable to the given value.
- set-default
- Reset the value of variable to the factory default.
- set-defaults
- Reset variable values to the factory defaults.
- Key Sequences
- These commands are disabled if the PROM security is on. Also, if your system has full security enabled, you cannot apply any of the suggested commands unless you have the password to get to the ok prompt.
- Stop - Bypass POST. This command does not depend on security-mode. (Note: some systems bypass POST as a default; in such cases, use Stop-D to start POST.)
- Stop-A Abort.
- Stop-D - Enter diagnostic mode (set diag-switch? to true).
- Stop-F - Enter Forth on TTYA instead of probing. Use exit to continue with the initialization sequence. Useful if hardware is broken.
- Stop-N Reset NVRAM contents to default values.
Configure Graphics Console (e.g. Sun XVR-100 Graphics Accelerator) instead of serial TTYAOK setenv diag-switch? true OK setenv auto-boot? false OK reset-all
OK test-all or obdiag
OK show-displays
Select the graphics accelerator, e.g. bOK nvalias mydevOK setenv output-device mydev OK setenv use-nvramrc? true OK reset-all
Why doesn't my .forward file
work?
Overview
If you are having problems where you have created a $HOME/.forward file in your home directory to forward e-mails from one account to another and it just won't forward them?
Set correct Permissions
First make sure the file isn't group or world writable.
-rwxrwxr-x 1 zahn dba 0 Jan 9 12:17 .forward # wrongLastly, make sure your home directory isn't group or world writable.
-rwxr-xr-x 1 zahn dba 0 Jan 9 12:17 .forward # OK
drwxrwxr-x 14 zahn dba 4096 Jan 9 12:20 zahn # wrong drwxr-xr-x 14 zahn dba 4096 Jan 9 12:20 zahn # OK
Simple Shell Script
to backup your Files
OverviewA backup strategy is more complex than creating a redundant copy of disk storage and considering the strategy a success. A successful backup strategy must detail how the backup media are rotated, how the media are archived, how the system will be recovered, and what the backup software will do to create the backup. Although all parts of the backup strategy are equally important, this tip will focus on the backup script and will detail a flexible backup script that uses built-in Solaris software tools which create a reliable local backup of a Solaris machine.IntroductionThe backup script will accomplish the following goals:
- Create a backup archive that is as easy to restore a single file as it is to restore an entire file system.
- The backup script will run autonomously. The only human intervention will be to swap media and review output.
- The filesystems or directories to backup can be specified in the script. Using automounter you can even specify remote filesystems.
- The script will create a detailed log of the backup.
- The script will send an abbreviated email summary of the backup to the administrator.
- After a successful backup, the script will verify to some extent the contents of the backup media.
- The backup script will be able to run on any Solaris 2.6 or greater machine without modification.
Tools usedMagnetic Tape ControlWe use the well known utilities TAR, GZIP and DD, because they are available on any Unix system. They are very well tested and simple to use. In case of an emergency it is important to have a simple way to restore, independent of complex tools and incompatible software releases.
The utility MT sends commands to a tape drive. Many of these commands are familiar, but some are not. The script will use these mt commands.
- rewind – rewind the tape
- rewoffl – rewind the tape and eject it (go offline)
- eom – space to end of recorded media on tape
- weof – write count EOF marks at current position on tape
- status – display current status of tape
ScriptClick here for the Shell Script
Subscribe to:
Posts (Atom)
