create directory
# mkdir -p /isomount7.0
copy file from
#cp /run/media/root/RHEL-7.0\ Server.x86_64/Packages/* /isomount7.0
#createrepo /isomount7.0
#vi /etc/yum.repos.d/custom.repo
custom.repo
#cat custom.repo
[custom]
name=custom
baseurl=file:///isomount7.0
enabled=1
gpgcheck=0
#yum repolist
#yum install httpd -y
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-17.el7 will be installed
--> Processing Dependency: httpd-tools = 2.4.6-17.el7 for package: httpd-2.4.6-17.el7.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-17.el7.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-17.el7.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-17.el7.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.4.8-3.el7 will be installed
---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed
---> Package httpd-tools.x86_64 0:2.4.6-17.el7 will be installed
---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================
Installing:
httpd x86_64 2.4.6-17.el7 custom 1.2 M
Installing for dependencies:
apr x86_64 1.4.8-3.el7 custom 103 k
apr-util x86_64 1.5.2-6.el7 custom 92 k
httpd-tools x86_64 2.4.6-17.el7 custom 77 k
mailcap noarch 2.1.41-2.el7 custom 31 k
Transaction Summary
=============================================================================================================================================================
Install 1 Package (+4 Dependent packages)
Total download size: 1.5 M
Installed size: 4.3 M
Downloading packages:
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 171 MB/s | 1.5 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : apr-1.4.8-3.el7.x86_64 1/5
Installing : apr-util-1.5.2-6.el7.x86_64 2/5
Installing : httpd-tools-2.4.6-17.el7.x86_64 3/5
Installing : mailcap-2.1.41-2.el7.noarch 4/5
Installing : httpd-2.4.6-17.el7.x86_64 5/5
Verifying : mailcap-2.1.41-2.el7.noarch 1/5
Verifying : httpd-tools-2.4.6-17.el7.x86_64 2/5
Verifying : apr-util-1.5.2-6.el7.x86_64 3/5
Verifying : apr-1.4.8-3.el7.x86_64 4/5
Verifying : httpd-2.4.6-17.el7.x86_64 5/5
Installed:
httpd.x86_64 0:2.4.6-17.el7
Dependency Installed:
apr.x86_64 0:1.4.8-3.el7 apr-util.x86_64 0:1.5.2-6.el7 httpd-tools.x86_64 0:2.4.6-17.el7 mailcap.noarch 0:2.1.41-2.el7
Complete!
===============
yum install mod_ssl -y
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package mod_ssl.x86_64 1:2.4.6-17.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================
Installing:
mod_ssl x86_64 1:2.4.6-17.el7 custom 97 k
Transaction Summary
=============================================================================================================================================================
Install 1 Package
Total download size: 97 k
Installed size: 219 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:mod_ssl-2.4.6-17.el7.x86_64 1/1
Verifying : 1:mod_ssl-2.4.6-17.el7.x86_64 1/1
Installed:
mod_ssl.x86_64 1:2.4.6-17.el7
Complete!
[root@veefinapp2 isomount7.0]# yum install telnet -y
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package telnet.x86_64 1:0.17-59.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================
Installing:
telnet x86_64 1:0.17-59.el7 custom 63 k
Transaction Summary
=============================================================================================================================================================
Install 1 Package
Total download size: 63 k
Installed size: 113 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:telnet-0.17-59.el7.x86_64 1/1
Verifying : 1:telnet-0.17-59.el7.x86_64 1/1
Installed:
telnet.x86_64 1:0.17-59.el7
Complete!
Sunday 30 September 2018
Thursday 20 September 2018
ASM DISK view
SELECT name, header_status, path FROM V$ASM_DISK;
NAME HEADER_STATUS PATH
--------- ------------- ---------------------
CANDIDATE /dev/rdsk/disk07
DISK06 MEMBER /dev/rdsk/disk06
DISK05 MEMBER /dev/rdsk/disk05
Wednesday 19 September 2018
oem13c client agent install
edit sudoers file
# vi /etc/sudoers
Allow root to run any commands anywhere
oracle ALL=(ALL) ALL
root@em12c Middleware]# netstat -anp | grep 3872
tcp 0 0 :::3872 :::* LISTEN 2391/java
[root@em12c Middleware]# kill -9 2391
# vi /etc/sudoers
Allow root to run any commands anywhere
oracle ALL=(ALL) ALL
3872 Actual Result: Port 3872 passed is busy Check complete
This error appear while trying to deploy agent for Enterprise manager 12c (em12c) and the
cause for this error that port 3872 is already
solution
root@em12c Middleware]# netstat -anp | grep 3872
tcp 0 0 :::3872 :::* LISTEN 2391/java
[root@em12c Middleware]# kill -9 2391
Tuesday 18 September 2018
solution for used_memory desc
SELECT s.username,
SUBSTR(s.sid,1,5)sid,
p.spid,
s.SERIAL#,
logon_time,
DECODE(TRUNC(SYSDATE - LOGON_TIME), 0, NULL, TRUNC(SYSDATE - LOGON_TIME)
|| ' Days' || ' + ') ||
TO_CHAR(TO_DATE(TRUNC(MOD(SYSDATE-LOGON_TIME,1) * 86400), 'SSSSS'),
'HH24:MI:SS') LOGON,
SUBSTR(s.program,1,22) program ,
MODULE ,
s.process pid_remote,
s.status,
ROUND(pga_used_mem/1024/1024) used_memory,
ROUND(pga_alloc_mem/1024/1024) alocation_memory,
ROUND(pga_freeable_mem/1024/1024) free_memory,
ROUND(pga_max_mem/1024/1024) maximum_memory
FROM v$session s,v$process p
WHERE p.addr=s.paddr
ORDER BY used_memory desc;
SUBSTR(s.sid,1,5)sid,
p.spid,
s.SERIAL#,
logon_time,
DECODE(TRUNC(SYSDATE - LOGON_TIME), 0, NULL, TRUNC(SYSDATE - LOGON_TIME)
|| ' Days' || ' + ') ||
TO_CHAR(TO_DATE(TRUNC(MOD(SYSDATE-LOGON_TIME,1) * 86400), 'SSSSS'),
'HH24:MI:SS') LOGON,
SUBSTR(s.program,1,22) program ,
MODULE ,
s.process pid_remote,
s.status,
ROUND(pga_used_mem/1024/1024) used_memory,
ROUND(pga_alloc_mem/1024/1024) alocation_memory,
ROUND(pga_freeable_mem/1024/1024) free_memory,
ROUND(pga_max_mem/1024/1024) maximum_memory
FROM v$session s,v$process p
WHERE p.addr=s.paddr
ORDER BY used_memory desc;
database distribution lock:
database distribution lock:
sqlplus /nolog
conn / as sysdba;
select * from dba_2pc_pending;
commit force '126.5.288819';
commit
sqlplus /nolog
conn / as sysdba;
select * from dba_2pc_pending;
commit force '126.5.288819';
commit
solaris 11 command
Configure nodename
# hostname myhost
Configure nameserver via SMF
# svccfg -s dns/client \
setprop config/nameserver = net_address: 192.168.1.1
# svccfg -s dns/client \
setprop config/domain = astring: \"myhost.org\"
# svccfg -s name-service/switch \
setprop config/host = astring: \"files dns\"
# svcadm restart name-service/switch
# svcadm restart dns/client
Configure nameserver via SMF when you can’t remember the correct properties to edit.
# svccfg -s dns/client editprop
# svccfg -s name-service/switch editprop
Configure nameserver (alternate approach by editing /etc/resolv.conf and
/etc/nsswitch.conf and then importing these modifications into SMF.)
# nscfg import -f svc:/system/name-service/switch:default
# nscfg import -f svc:/network/dns/client:default
nscfg is a transition tool and not meant for daily use, not matter how useful it is. Please learn the
regular way with the methods described above.
Unconfigure a system and start an interactive configuration tool on reboot
# sysconfig configure -s
Create a system configuration profile
# sysconfig create-profile -o sc-profile.xml
Configure a system according to a system configuration profile
# sysconfig configure -c sc-profile.xml
Users and Roles
The traditional root account has been changed to a ’root’ role on all Oracle Solaris 11
installations as part of the Role Based Access Control (RBAC) feature set. This change gives
improved auditability across the operating system, and the ability for administrators to delegate
various system tasks to others in a safe way.
Revert root to a normal user account
# rolemod -K type=normal root
Configure root as a role (default)
# usermod -K type=role root
Configure root role to use the user password instead of root password
# rolemod -K roleauth=user root
Add a new user and delegate the System Adminstrator profile to the user
# useradd -m -P "System Administrator" joerg
Add a new user with a ZFS file system as the user’s home directory and add an entry in
auto_home
# useradd -m -d localhost:/export/home/joerg2 joerg2
# grep "joerg2" /etc/passwd
joerg2:x:101:10::/home/joerg2:/usr/bin/bash
# cat /etc/auto_home
[...]
joerg2 localhost:/export/home/joerg2
+auto_home
# zfs list | grep joerg2
rpool/export/home/joerg 35K 201G 35K /export/home/joerg2
Add a new user on a second server using another NFS server for the user’s home
directory
# useradd -d nfsserver:/export/home/joerg2 joerg2
# grep "joerg2" /etc/passwd
joerg2:x:103:10::/home/joerg2:/usr/bin/bash
# tail -2 /etc/auto_home
Packaging
Install a package called diagnostic/wireshark:
# pkg install diagnostic/wireshark
Install a group package to provide a desktop environment
# pkg install solaris-desktop
Install package as if you were installing it on a freshly installed system
Warning! All packages that are not a dependency of this package will be removed while installing it.
This is what the command is meant for.
# pkg exact-install web/server/apache-22/module/apache-wsgi-26
Update all possible packages to the newest version, including any zones
# pkg update
List available packages
# pkg list -a
Do a dry run of a system update to identify what packages might change
# pkg update -nv
Uninstall a package called diagnostic/wireshark
# pkg uninstall wireshark
List all packages installed on a system:
# pkg list
Get more information about an installed package called diagnostic/wireshark
# pkg info wireshark
List the contents of an installed package called diagnostic/wireshark
# pkg contents wireshark
Search all packages in the configured repositories for a file called math.h
# pkg search math.h
Search for all packages installed on a system that have a dependency on
library/libxml2:
# pkg search -l -o pkg.name 'depend::library/libxml2'
List currently associated package publishers
# pkg publisher
Connect to the Oracle support repository and update the system
# pkg set-publisher -g https://pkg.oracle.com/solaris/support \
-G http://pkg.oracle.com/solaris/release -k /path/to/ssl_key \
-c /path/to/ssl_cert solaris
# pkg update
Local Package Repository
Download all the repository files from
http://www.oracle.com/technetwork/server-storage/solaris11/downloads/local-repository-2245081.html
into /export/home/<username>.
# zfs create rpool/export/repo
# zfs create rpool/export/repo/solaris
# cd /export/home/<username>
# ./install-repo.ksh -d /export/repo/solaris/
# zfs snapshot rpool/export/repo/solaris@initial
Setting up a depot server to enable other systems to update themself via HTTP
# svccfg -s application/pkg/server setprop
pkg/inst_root=/export/repo/solaris/
# svccfg -s application/pkg/server setprop pkg/readonly=true
# svccfg -s application/pkg/server setprop pkg/port=8081
# svcadm refresh application/pkg/server
# svcadm enable application/pkg/server
# cd /export/home/<username>/sru9
# unzip p20845983_1100_SOLARIS64.zip
# ./install-repo.ksh -d /export/repo/solaris
# svcadm restart application/pkg/server:default
# zfs snapshot rpool/export/repo/solaris@sru9
File Systems - Basic ZFS Administration
Create a ZFS pool with a single disk
# zpool create testpool c3t2d0
Create a ZFS pool with 3 disks in RAID0 configuration
# zpool create testpool c3t2d0 c3t3d0 c3t4d0
Create a ZFS pool with 3 disks in RAID1 configuration
# zpool create testpool mirror c3t2d0 c3t3d0 c3t4d0
Create a ZFS pool with 3 disks in a RAIDZ configuration (single parity)
# zpool create testpool raidz c2t2d0 c3t3d0 c3t4d0
Create a ZFS pool with 1 disk and 1 disk as seperate ZIL (ZFS Intent Log)
# zpool create testpool c3t2d0 log c3t3d0
Create a ZFS pool with 1 disk and 1 disk as L2ARC (Level 2 Storage Cache)
# zpool create testpool c3t2d0 cache c3t3d0
Create a ZFS file system and share it via NFS:
# zfs create rpool/export/nfstest
# zfs set share.nfs=on rpool/export/nfstest
Share a files system via CIFS
# svcadm enable -r smb/server
# echo "other password required pam_smb_passwd.so.1 nowarn" \
>> /etc/pam.d/other
# passwd <username>
# zfs create -o nbmand=on rpool/export/smbservertest
# zfs share -o share.smb=on rpool/export/smbservertest%smb_st
# mkdir /export/smbservertest/archiv
# chown junior2 /export/smbservertest/archiv
Now you can access the share via smb://junior2:password@192.168.1.200/smb_st . You
have to set a new password for each user that wants to access a SMB share after adding the PAM
module
Use shadow migration
# pkg install shadow-migration
# svcadm enable shadowd
# zfs set readonly=on rpool/export/shadowmigtest
# zfs create \
-o shadow=file:///export/shadowmigtest rpool/export/shadowmigtestnew
Create an encrypted zfs dataset
# zfs create -o encryption=on rpool/export/secretproject
Change the wrapping key
# zfs key -c rpool/export/secretproject
Change the encryption key of a dataset
Please keep in mind that you can't set the encryption key to a user-defined value, you just can
initiate the generation of a new encryption key. The wrapping key encrypting the encrytion key can
be set to a user definable value.
# zfs key -K rpool/export/secretproject
How to limit the ZFS ARC cache (up to Oracle Solaris 11.1)
# echo "set zfs:zfs_arc_max=0x40000000" >> /etc/system
# reboot
How to limit the ZFS ARC cache (since Oracle Solaris 11.2)
# echo "set user_reserve_hint_pct=80" > /etc/system.d/arclimit
# reboot
The user_reserve_hint_pct parameter works differently than the old zfs_arc_max
parameter. This parameter doesn’t set a hard limit for the arc cache.This parameter defines
how much memory is reserved for application use. It therefore limits how much memory can
be used by the ZFS ARC cache.
This value is dynamic. So you can change this parameter while the system is running.
However it’s a best practice to change it to it in small steps to it’s intended final value. There is
a script doing it this way available with the MOS note 1663862.1.
You can get the current value of the parameter by using:
Disk Devices
Show all disks on a system
# cfgadm -s "select=type(disk)"
Replace a faulty disk c1t1d0 from ZFS pool testpool
# zpool offline testpool c1t3d0
# cfgadm | grep c1t3d0
sata0/3::dsk/c1t3d0 disk connected configured ok
# cfgadm -c unconfigure sata0/3
# echo "Now replace the failed disk"
# cfgadm -c configure sata0/3
# zpool replace tank c1t3d0
# zpool online tank c1t3d0
Replace a faulty disk of a ZFS rool pool (SPARC or x86/VTOC)
You have to ensure that your new disk contain a fdisk partition (on x86), a SMI label and a slice 0.
# zpool offline rpool c1t0d0s0
# cfgadm -c unconfigure c1::dsk/c1t0d0
# echo "now replace the disk"
# cfgadm -c configure c1::dsk/c1t0d0
# zpool replace rpool c1t0d0s0
# zpool online rpool c1t0d0s0
# zpool status rpool
# bootadm install-bootloader
Replace a faulty disk of a ZFS root pool (SPARC or x86/EFI (GPT))
# zpool offline rpool c1t0d0
# cfgadm -c unconfigure c1::dsk/c1t0d0
# echo "now replace the disk"
# cfgadm -c configure c1::dsk/c1t0d0
# zpool online rpool c1t0d0
# zpool replace rpool c1t0d0
# zpool status rpool
# bootadm install-bootloader
Checking the logical blocksize of a disk device
# devprop -vn /dev/dsk/c3t0d0 device-blksize
Checking the physical blocksize of a disk device
# devprop -vn /dev/dsk/c3t0d0 device-pblksize
zpool expand:
# zpool set autoexpand=on BARMAN
# hostname myhost
Configure nameserver via SMF
# svccfg -s dns/client \
setprop config/nameserver = net_address: 192.168.1.1
# svccfg -s dns/client \
setprop config/domain = astring: \"myhost.org\"
# svccfg -s name-service/switch \
setprop config/host = astring: \"files dns\"
# svcadm restart name-service/switch
# svcadm restart dns/client
Configure nameserver via SMF when you can’t remember the correct properties to edit.
# svccfg -s dns/client editprop
# svccfg -s name-service/switch editprop
Configure nameserver (alternate approach by editing /etc/resolv.conf and
/etc/nsswitch.conf and then importing these modifications into SMF.)
# nscfg import -f svc:/system/name-service/switch:default
# nscfg import -f svc:/network/dns/client:default
nscfg is a transition tool and not meant for daily use, not matter how useful it is. Please learn the
regular way with the methods described above.
Unconfigure a system and start an interactive configuration tool on reboot
# sysconfig configure -s
Create a system configuration profile
# sysconfig create-profile -o sc-profile.xml
Configure a system according to a system configuration profile
# sysconfig configure -c sc-profile.xml
Users and Roles
The traditional root account has been changed to a ’root’ role on all Oracle Solaris 11
installations as part of the Role Based Access Control (RBAC) feature set. This change gives
improved auditability across the operating system, and the ability for administrators to delegate
various system tasks to others in a safe way.
Revert root to a normal user account
# rolemod -K type=normal root
Configure root as a role (default)
# usermod -K type=role root
Configure root role to use the user password instead of root password
# rolemod -K roleauth=user root
Add a new user and delegate the System Adminstrator profile to the user
# useradd -m -P "System Administrator" joerg
Add a new user with a ZFS file system as the user’s home directory and add an entry in
auto_home
# useradd -m -d localhost:/export/home/joerg2 joerg2
# grep "joerg2" /etc/passwd
joerg2:x:101:10::/home/joerg2:/usr/bin/bash
# cat /etc/auto_home
[...]
joerg2 localhost:/export/home/joerg2
+auto_home
# zfs list | grep joerg2
rpool/export/home/joerg 35K 201G 35K /export/home/joerg2
Add a new user on a second server using another NFS server for the user’s home
directory
# useradd -d nfsserver:/export/home/joerg2 joerg2
# grep "joerg2" /etc/passwd
joerg2:x:103:10::/home/joerg2:/usr/bin/bash
# tail -2 /etc/auto_home
Packaging
Install a package called diagnostic/wireshark:
# pkg install diagnostic/wireshark
Install a group package to provide a desktop environment
# pkg install solaris-desktop
Install package as if you were installing it on a freshly installed system
Warning! All packages that are not a dependency of this package will be removed while installing it.
This is what the command is meant for.
# pkg exact-install web/server/apache-22/module/apache-wsgi-26
Update all possible packages to the newest version, including any zones
# pkg update
List available packages
# pkg list -a
Do a dry run of a system update to identify what packages might change
# pkg update -nv
Uninstall a package called diagnostic/wireshark
# pkg uninstall wireshark
List all packages installed on a system:
# pkg list
Get more information about an installed package called diagnostic/wireshark
# pkg info wireshark
List the contents of an installed package called diagnostic/wireshark
# pkg contents wireshark
Search all packages in the configured repositories for a file called math.h
# pkg search math.h
Search for all packages installed on a system that have a dependency on
library/libxml2:
# pkg search -l -o pkg.name 'depend::library/libxml2'
List currently associated package publishers
# pkg publisher
Connect to the Oracle support repository and update the system
# pkg set-publisher -g https://pkg.oracle.com/solaris/support \
-G http://pkg.oracle.com/solaris/release -k /path/to/ssl_key \
-c /path/to/ssl_cert solaris
# pkg update
Local Package Repository
Download all the repository files from
http://www.oracle.com/technetwork/server-storage/solaris11/downloads/local-repository-2245081.html
into /export/home/<username>.
# zfs create rpool/export/repo
# zfs create rpool/export/repo/solaris
# cd /export/home/<username>
# ./install-repo.ksh -d /export/repo/solaris/
# zfs snapshot rpool/export/repo/solaris@initial
Setting up a depot server to enable other systems to update themself via HTTP
# svccfg -s application/pkg/server setprop
pkg/inst_root=/export/repo/solaris/
# svccfg -s application/pkg/server setprop pkg/readonly=true
# svccfg -s application/pkg/server setprop pkg/port=8081
# svcadm refresh application/pkg/server
# svcadm enable application/pkg/server
# cd /export/home/<username>/sru9
# unzip p20845983_1100_SOLARIS64.zip
# ./install-repo.ksh -d /export/repo/solaris
# svcadm restart application/pkg/server:default
# zfs snapshot rpool/export/repo/solaris@sru9
File Systems - Basic ZFS Administration
Create a ZFS pool with a single disk
# zpool create testpool c3t2d0
Create a ZFS pool with 3 disks in RAID0 configuration
# zpool create testpool c3t2d0 c3t3d0 c3t4d0
Create a ZFS pool with 3 disks in RAID1 configuration
# zpool create testpool mirror c3t2d0 c3t3d0 c3t4d0
Create a ZFS pool with 3 disks in a RAIDZ configuration (single parity)
# zpool create testpool raidz c2t2d0 c3t3d0 c3t4d0
Create a ZFS pool with 1 disk and 1 disk as seperate ZIL (ZFS Intent Log)
# zpool create testpool c3t2d0 log c3t3d0
Create a ZFS pool with 1 disk and 1 disk as L2ARC (Level 2 Storage Cache)
# zpool create testpool c3t2d0 cache c3t3d0
Create a ZFS file system and share it via NFS:
# zfs create rpool/export/nfstest
# zfs set share.nfs=on rpool/export/nfstest
Share a files system via CIFS
# svcadm enable -r smb/server
# echo "other password required pam_smb_passwd.so.1 nowarn" \
>> /etc/pam.d/other
# passwd <username>
# zfs create -o nbmand=on rpool/export/smbservertest
# zfs share -o share.smb=on rpool/export/smbservertest%smb_st
# mkdir /export/smbservertest/archiv
# chown junior2 /export/smbservertest/archiv
Now you can access the share via smb://junior2:password@192.168.1.200/smb_st . You
have to set a new password for each user that wants to access a SMB share after adding the PAM
module
Use shadow migration
# pkg install shadow-migration
# svcadm enable shadowd
# zfs set readonly=on rpool/export/shadowmigtest
# zfs create \
-o shadow=file:///export/shadowmigtest rpool/export/shadowmigtestnew
Create an encrypted zfs dataset
# zfs create -o encryption=on rpool/export/secretproject
Change the wrapping key
# zfs key -c rpool/export/secretproject
Change the encryption key of a dataset
Please keep in mind that you can't set the encryption key to a user-defined value, you just can
initiate the generation of a new encryption key. The wrapping key encrypting the encrytion key can
be set to a user definable value.
# zfs key -K rpool/export/secretproject
How to limit the ZFS ARC cache (up to Oracle Solaris 11.1)
# echo "set zfs:zfs_arc_max=0x40000000" >> /etc/system
# reboot
How to limit the ZFS ARC cache (since Oracle Solaris 11.2)
# echo "set user_reserve_hint_pct=80" > /etc/system.d/arclimit
# reboot
The user_reserve_hint_pct parameter works differently than the old zfs_arc_max
parameter. This parameter doesn’t set a hard limit for the arc cache.This parameter defines
how much memory is reserved for application use. It therefore limits how much memory can
be used by the ZFS ARC cache.
This value is dynamic. So you can change this parameter while the system is running.
However it’s a best practice to change it to it in small steps to it’s intended final value. There is
a script doing it this way available with the MOS note 1663862.1.
You can get the current value of the parameter by using:
Disk Devices
Show all disks on a system
# cfgadm -s "select=type(disk)"
Replace a faulty disk c1t1d0 from ZFS pool testpool
# zpool offline testpool c1t3d0
# cfgadm | grep c1t3d0
sata0/3::dsk/c1t3d0 disk connected configured ok
# cfgadm -c unconfigure sata0/3
# echo "Now replace the failed disk"
# cfgadm -c configure sata0/3
# zpool replace tank c1t3d0
# zpool online tank c1t3d0
Replace a faulty disk of a ZFS rool pool (SPARC or x86/VTOC)
You have to ensure that your new disk contain a fdisk partition (on x86), a SMI label and a slice 0.
# zpool offline rpool c1t0d0s0
# cfgadm -c unconfigure c1::dsk/c1t0d0
# echo "now replace the disk"
# cfgadm -c configure c1::dsk/c1t0d0
# zpool replace rpool c1t0d0s0
# zpool online rpool c1t0d0s0
# zpool status rpool
# bootadm install-bootloader
Replace a faulty disk of a ZFS root pool (SPARC or x86/EFI (GPT))
# zpool offline rpool c1t0d0
# cfgadm -c unconfigure c1::dsk/c1t0d0
# echo "now replace the disk"
# cfgadm -c configure c1::dsk/c1t0d0
# zpool online rpool c1t0d0
# zpool replace rpool c1t0d0
# zpool status rpool
# bootadm install-bootloader
Checking the logical blocksize of a disk device
# devprop -vn /dev/dsk/c3t0d0 device-blksize
Checking the physical blocksize of a disk device
# devprop -vn /dev/dsk/c3t0d0 device-pblksize
zpool expand:
# zpool set autoexpand=on BARMAN
Clear Cache Memory in Linux
How to Clear Cache Memory in Linux
Find Memory Status
[root@localhost Desktop]# free -m
total used free shared buffers cached
Mem: 987 915 71 7 0 395
-/+ buffers/cache: 519 467
Swap: 1023 0 1023
In this example the total amount of available memory is 987 M. 519 M are used by processes and 467 M are free for other applications. Do not get confused by the first line which shows that 71 M are free! If you look at the usage figures you can see that most of the memory use is for buffers and cache. Linux always tries to use RAM to speed up disk operations by using available memory for buffers (file system metadata) and cache (pages with actual contents of files or block devices). This helps the system to run faster because disk information is already in memory which saves I/O operations. If space is needed by programs or applications like Oracle, then Linux will free up the buffers and cache to yield memory for the applications. If your system runs for a while you will usually see a small number under the field "free" on the first line.
Find Cache Memory uses in Linux
Use free command to find out cache memory uses by Linux system. Output of free command is like below
Last column is showing cached memory ( 395 MB) by system. -m option is used for showing memory details in MB’s.
[root@localhost Desktop]# free -m
total used free shared buffers cached
Mem: 987 915 71 7 0 395
-/+ buffers/cache: 519 467
Swap: 1023 0 1023
Following command to see much detailed information about current memory usage in 3 second interval:
[root@localhost Desktop]# watch -n 3 cat /proc/meminfo
Every 3.0s: cat /proc/meminfo Wed Dec 23 23:28:53 2015
MemTotal: 1010884 kB
MemFree: 353384 kB
MemAvailable: 367148 kB
Buffers: 40 kB
Cached: 123052 kB
SwapCached: 0 kB
Active: 427352 kB
Inactive: 83868 kB
Active(anon): 385120 kB
Inactive(anon): 11240 kB
Active(file): 42232 kB
Inactive(file): 72628 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 1048572 kB
SwapFree: 1048572 kB
Dirty: 40 kB
Writeback: 0 kB
AnonPages: 388152 kB
Mapped: 95736 kB
Shmem: 8216 kB
Slab: 67208 kB
[root@localhost Desktop]# sync; echo 1 > /proc/sys/vm/drop_caches
[root@localhost Desktop]# free -m
total used free shared buffers cached
Mem: 987 611 375 7 0 92
-/+ buffers/cache: 518 468
Swap: 1023 0 1023
2. Freeing dentries and inodes use following command
[root@localhost Desktop]# sync; echo 2 > /proc/sys/vm/drop_caches
[root@localhost Desktop]# free -m
total used free shared buffers cached
Mem: 987 594 392 7 0 93
-/+ buffers/cache: 501 485
Swap: 1023 0 1023
3. Freeing pagecache, dentries and inodes in cache memory
[root@localhost Desktop]# sync; echo 3 > /proc/sys/vm/drop_caches
[root@localhost Desktop]# free -m
total used free shared buffers cached
Mem: 987 596 391 7 0 91
-/+ buffers/cache: 504 482
Swap: 1023 0 1023
[root@localhost Desktop]#
4. Schedule Cron to Flush Cache Regularly
If we want to schedule following in crontab to automatically flush cache on regular interval.
# crontab -l
0 * * * * sync; echo 3 > /proc/sys/vm/drop_caches
The above cron will execute on every hour and flushes the cached memory on system.
[root@localhost Desktop]# free -m
total used free shared buffers cached
Mem: 987 915 71 7 0 395
-/+ buffers/cache: 519 467
Swap: 1023 0 1023
In this example the total amount of available memory is 987 M. 519 M are used by processes and 467 M are free for other applications. Do not get confused by the first line which shows that 71 M are free! If you look at the usage figures you can see that most of the memory use is for buffers and cache. Linux always tries to use RAM to speed up disk operations by using available memory for buffers (file system metadata) and cache (pages with actual contents of files or block devices). This helps the system to run faster because disk information is already in memory which saves I/O operations. If space is needed by programs or applications like Oracle, then Linux will free up the buffers and cache to yield memory for the applications. If your system runs for a while you will usually see a small number under the field "free" on the first line.
Find Cache Memory uses in Linux
Use free command to find out cache memory uses by Linux system. Output of free command is like below
Last column is showing cached memory ( 395 MB) by system. -m option is used for showing memory details in MB’s.
[root@localhost Desktop]# free -m
total used free shared buffers cached
Mem: 987 915 71 7 0 395
-/+ buffers/cache: 519 467
Swap: 1023 0 1023
Following command to see much detailed information about current memory usage in 3 second interval:
[root@localhost Desktop]# watch -n 3 cat /proc/meminfo
Every 3.0s: cat /proc/meminfo Wed Dec 23 23:28:53 2015
MemTotal: 1010884 kB
MemFree: 353384 kB
MemAvailable: 367148 kB
Buffers: 40 kB
Cached: 123052 kB
SwapCached: 0 kB
Active: 427352 kB
Inactive: 83868 kB
Active(anon): 385120 kB
Inactive(anon): 11240 kB
Active(file): 42232 kB
Inactive(file): 72628 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 1048572 kB
SwapFree: 1048572 kB
Dirty: 40 kB
Writeback: 0 kB
AnonPages: 388152 kB
Mapped: 95736 kB
Shmem: 8216 kB
Slab: 67208 kB
1. Freeing pagecache only use following command
[root@localhost Desktop]# sync; echo 1 > /proc/sys/vm/drop_caches
[root@localhost Desktop]# free -m
total used free shared buffers cached
Mem: 987 611 375 7 0 92
-/+ buffers/cache: 518 468
Swap: 1023 0 1023
2. Freeing dentries and inodes use following command
[root@localhost Desktop]# sync; echo 2 > /proc/sys/vm/drop_caches
[root@localhost Desktop]# free -m
total used free shared buffers cached
Mem: 987 594 392 7 0 93
-/+ buffers/cache: 501 485
Swap: 1023 0 1023
3. Freeing pagecache, dentries and inodes in cache memory
[root@localhost Desktop]# sync; echo 3 > /proc/sys/vm/drop_caches
[root@localhost Desktop]# free -m
total used free shared buffers cached
Mem: 987 596 391 7 0 91
-/+ buffers/cache: 504 482
Swap: 1023 0 1023
[root@localhost Desktop]#
4. Schedule Cron to Flush Cache Regularly
If we want to schedule following in crontab to automatically flush cache on regular interval.
# crontab -l
0 * * * * sync; echo 3 > /proc/sys/vm/drop_caches
The above cron will execute on every hour and flushes the cached memory on system.
Monday 17 September 2018
multipath enable in solaris11
Enable Multipath:
# pkg info system/storage/multipath-utilities
Name: system/storage/multipath-utilities
Summary: Solaris Multipathing CLI
Description: Path Administration Utility for a Solaris Multipathing device
Category: Applications/System Utilities
State: Installed
Publisher: solaris
Version: 0.5.11
Build Release: 5.11
Branch: 0.175.0.0.0.0.0
Packaging Date: Tue Sep 27 01:40:01 2011
Size: 77.29 kB
FMRI: pkg://solaris/system/storage/multipath-utilities@
0.5.11,5.11-0.175.0.0.0.0.0:20110927T014001Z
If not, install it.
# pkg install system/storage/multipath-utilities
Enable device multipathing.
# stmsboot -e
WARNING: stmsboot operates on each supported multipath-capable controller
detected in a host. In your system, these controllers are
/devices/pci@780/pci@0/pci@8/SUNW,qlc@0/fp@0,0
/devices/pci@780/pci@0/pci@8/SUNW,qlc@0,1/fp@0,0
/devices/pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@1
/devices/pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@1
If you do NOT wish to operate on these controllers, please quit stmsboot
and re-invoke with -D { fp | mpt } to specify which controllers you wish
to modify your multipathing configuration for.
Do you wish to continue? [y/n] (default: y) y
Checking mpxio status for driver fp
Checking mpxio status for driver mpt
WARNING: This operation will require a reboot.
Do you want to continue ? [y/n] (default: y) y
The changes will come into effect after rebooting the system.
Reboot the system now ? [y/n] (default: y) y
Disable device multipathing.
# stmsboot -d
WARNING: stmsboot operates on each supported multipath-capable controller
detected in a host. In your system, these controllers are
/devices/pci@780/pci@0/pci@8/SUNW,qlc@0/fp@0,0
/devices/pci@780/pci@0/pci@8/SUNW,qlc@0,1/fp@0,0
/devices/pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@1
/devices/pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@1
/devices/pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2
/devices/pci@7c0/pci@0/pci@9/LSILogic,sas@0
/devices/pci@7c0/pci@0/pci@9/LSILogic,sas@0
If you do NOT wish to operate on these controllers, please quit stmsboot
and re-invoke with -D { fp | mpt } to specify which controllers you wish
to modify your multipathing configuration for.
Do you wish to continue? [y/n] (default: y) y
Checking mpxio status for driver fp
Checking mpxio status for driver mpt
WARNING: This operation will require a reboot.
Do you want to continue ? [y/n] (default: y) y
The changes will come into effect after rebooting the system.
Reboot the system now ? [y/n] (default: y) y
perform an ls -l command on /dev/cfg directory
1 . # cd /dev/cfg
2. # ls -l
output command:
lrwxrwxrwx 1 root root 62 Apr 9 2016 c10 -> ../../devices/pci@5 00/pci@2/pci@0/pci@0/LSI,sas@0/iport@1:scsi
lrwxrwxrwx 1 root root 63 Apr 9 2016 c11 -> ../../devices/pci@5 00/pci@2/pci@0/pci@0/LSI,sas@0/iport@v0:scsi
lrwxrwxrwx 1 root root 62 Apr 9 2016 c3 -> ../../devices/pci@40 0/pci@1/pci@0/pci@0/LSI,sas@0/iport@1:scsi
lrwxrwxrwx 1 root root 62 Apr 9 2016 c4 -> ../../devices/pci@40 0/pci@1/pci@0/pci@0/LSI,sas@0/iport@2:scsi
lrwxrwxrwx 1 root root 63 Apr 9 2016 c5 -> ../../devices/pci@40 0/pci@1/pci@0/pci@0/LSI,sas@0/iport@v0:scsi
lrwxrwxrwx 1 root root 72 Apr 9 2016 c6 -> ../../devices/pci@40 0/pci@2/pci@0/pci@1/pci@0/pci@2/SUNW,qlc@0/fp@0,0:fc
lrwxrwxrwx 1 root root 74 Apr 9 2016 c7 -> ../../devices/pci@40 0/pci@2/pci@0/pci@1/pci@0/pci@2/SUNW,qlc@0,1/fp@0,0:fc
lrwxrwxrwx 1 root root 72 Apr 9 2016 c8 -> ../../devices/pci@50 0/pci@1/pci@0/pci@1/pci@0/pci@2/SUNW,qlc@0/fp@0,0:fc
lrwxrwxrwx 1 root root 74 Apr 9 2016 c9 -> ../../devices/pci@50 0/pci@1/pci@0/pci@1/pci@0/pci@2/SUNW,qlc@0,1/fp@0,0:fc
lrwxrwxrwx 1 root root 47 Apr 9 2016 PCI-EM0 -> ../../devices/p ci@400/pci@2/pci@0/pci@1:PCI-EM0
lrwxrwxrwx 1 root root 47 Apr 9 2016 PCI-EM1 -> ../../devices/p ci@400/pci@2/pci@0/pci@2:PCI-EM1
lrwxrwxrwx
3. Copy the /kernel/drv/fp.conf file to the /etc/driver/drv/fp.conf file.
Select one of the following to enable or disable specific FC HBA ports:
4. Add the following line for each FC HBA port that is to be enabled in the
/etc/driver/drv/fp.conf:
name="fp" parent="parent name" port=port-number mpxio-disable="no";
5. Copy the /kernel/drv/scsi_vhci.conf file to the /etc/driver/drv/scsi_vhci.conf file.
Edit the /etc/driver/drv/scsi_vhci.conf file to add the vendor ID and product IDentries.
The vendor ID and product ID are the vendor and product identification strings that the device
returns in SCSI INQUIRY data. The vendor ID must be eight characters long. You must specify
all eight characters even if the trailing characters are spaces.
The product ID can be up to 16 characters long.
scsi-vhci-failover-override =
"VendorID1ProductID1", "f_sym",
"VendorID2ProductID2", "f_sym",
...
"VendorIDnProductIDn", "f_sym";
Note that the entries are separated by the ’,’ character and the last vendor/product entry is
terminated by the ’;’ character.
For example, to add a device from a “ACME” vendor with a product ID of “MSU”, and to add a
device from vendor “XYZ” vendor with a product ID of “ABC”, you would add the following
lines to the /etc/driver/drv/scsi_vhci.conf file:
To add a device from a “XYZ” vendor with a product ID of “ABC”, you would add:
scsi-vhci-failover-override =
"ACME MSU", "f_sym",
"XYZ ABC", "f_sym";
Save and exit the /etc/driver/drv/scsi_vhci.conf file
For example,
scsi-vhci-failover-override =
"COMPELNTCompellent Vol", "f_sym";
# stmsboot -u
Display the mapping of devices on all controllers. For example:
# stmsboot -L
non-STMS device name STMS device name
----------------------------------------------------------------
/dev/rdsk/c2t8d0 /dev/rdsk/c10t500000E01046DEE0d0
/dev/rdsk/c2t0d0 /dev/rdsk/c10t500000E01046B070d0
/dev/rdsk/c2t3d0 /dev/rdsk/c10t20000020372A40AFd0
/dev/rdsk/c2t12d0 /dev/rdsk/c10t500000E01046DEF0d0
/dev/rdsk/c2t11d0 /dev/rdsk/c10t500000E01046E390d0
/dev/rdsk/c3t8d0 /dev/rdsk/c10t500000E01046DEE0d0
/dev/rdsk/c3t0d0 /dev/rdsk/c10t500000E01046B070d0
/dev/rdsk/c3t3d0 /dev/rdsk/c10t20000020372A40AFd0
/dev/rdsk/c3t12d0 /dev/rdsk/c10t500000E01046DEF0d0
/dev/rdsk/c3t11d0 /dev/rdsk/c10t500000E01046E390d0
The -l option displays the mapping of devices on only the specified controller. The following
example displays the mapping of controller 3.
# stmsboot -l3
non-STMS device name STMS device name
----------------------------------------------------------------
/dev/rdsk/c3t8d0 /dev/rdsk/c10t500000E01046DEE0d0
/dev/rdsk/c3t0d0 /dev/rdsk/c10t500000E01046B070d0
/dev/rdsk/c3t3d0 /dev/rdsk/c10t20000020372A40AFd0
/dev/rdsk/c3t12d0 /dev/rdsk/c10t500000E01046DEF0d0
/dev/rdsk/c3t11d0 /dev/rdsk/c10t500000E01046E390d0
5
6
Configuring Third-Party Storage Devices
30
Howto Configure Automatic Failback
Become an administrator.
Copy the /kernel/drv/scsi_vhci.conf file to the /etc/driver/drv/scsi_vhci.conf file.
Edit the /etc/driver/drv/scsi_vhci.conf file.
Disable automatic failback capability by changing the auto-failback entry to:
auto-failback="disable";
Enable automatic failback capability (if you disabled it before), by changing the auto-failback
entry to:
auto-failback="enable";
Save and exit the file.
Reboot the system.
# shutdown -g0 -y -i6
Administering Multipathing Devices
Perform the following tasks to administer any multipathing devices.
▼ HowtoDisplay Multipathing Support Information
Multipathing support and property information is identified with theMultipathManagement
API plug-in library name.
Become an administrator.
Identify the multipathing support on your system.
# mpathadm list mpath-support
mpath-support: libmpscsi_vhci.so
Display the multipathing support properties for a specified mpath support name.
# mpathadm show mpath-support libmpscsi_vhci.so
mpath-support: libmpscsi_vhci.so
Vendor: Sun Microsystems
Driver Name: scsi_vhci
Default Load Balance: round-robin
Supported Load Balance Types:
round-robin
logical-block
Allows To Activate Target Port Group Access: yes
Allows Path Override: no
4C H A P T E R 4
1
2
3
33
Supported Auto Failback Config: yes
Auto Failback: on
Failback Polling Rate (current/max): 0/0
Supported Auto Probing Config: 0
Auto Probing: NA
Probing Polling Rate (current/max): NA/NA
Supported Devices:
Vendor: SUN
Product: T300
Revision:
Supported Load Balance Types:
round-robin
Vendor: SUN
Product: T4
Revision:
Supported Load Balance Types:
round-robin
.
.
.
The command output also shows a list of device products that is supported by the multipathing
support software. The multipathing support libmpscsi_vhci.so supports T10 target port
group compliant devices by default.
▼ HowtoDisplay Properties of a Specific Initiator Port
The following steps describe how to display the properties of an initiator port.
Identify the initiator port.
# mpathadm list initiator-port
Initiator Port: iqn.1986-03.com.sun:01:ffffffffffff.4e94f9bd,4000002a00ff
Initiator Port: 210100e08ba41feb
Initiator Port: 210000e08b841feb
Display the specific initiator port's properties.
# mpathadm show initiator-port 2000000173018713
Initiator Port: 210100e08ba41feb
Transport Type: Fibre Channel
OS Device File: /devices/pci@1,0/pci1022,7450@1/pci1077,141@2,1/fp@0,0
▼ HowtoDisplay Specific LUNInformation
Display the list of LUNs, along with the properties for each LUNby using the mpathadm
command. The displayed list of LUNs contain names that in turn can be used to display the
properties of a particular LUN.
1
2
Administering Multipathing Devices
34 Oracle Solaris Administration: SAN Configuration andMultipathing • February 2012 E23097–12
Display a list of multipathed LUNs.
# mpathadm list lu
/dev/rdsk/c0t600144F08069703400004E828EE10004d0s2
Total Path Count: 8
Operational Path Count: 8
/dev/rdsk/c0t600144F08069703400004E8183DF0002d0s2
Total Path Count: 8
Operational Path Count: 8
/dev/rdsk/c0t600A0B800026D63A0000A4994E2342D4d0s2
Total Path Count: 4
Operational Path Count: 4
/dev/rdsk/c0t600A0B800029065C00007CF54E234013d0s2
Total Path Count: 4
Operational Path Count: 4
/dev/rdsk/c0t600A0B800026D63A0000A4984E234298d0s2
Total Path Count: 4
Operational Path Count: 4
/dev/rdsk/c0t600A0B800029065C00007CF44E233FCFd0s2
Total Path Count: 4
Operational Path Count: 4
/dev/rdsk/c0t600A0B800026D63A0000A4974E23424Ed0s2
Total Path Count: 4
Operational Path Count: 4
.
.
.
Display configuration information about a specific LUN.
# mpathadm show lu /dev/rdsk/c4t60003BA27D2120004204AC2B000DAB00d0s2
mpath-support: libmpscsi_vhci.so
Vendor: SUN
Product: Sun Storage NAS
Revision: 1.0
Name Type: unknown type
Name: 600144f08069703400004e828ee10004
Asymmetric: yes
Current Load Balance: round-robin
Logical Unit Group ID: NA
Auto Failback: on
Auto Probing: NA
Paths:
Initiator Port Name: 210100e08ba41feb
Target Port Name: 2100001b329b6c3f
Override Path: NA
Path State: OK
Disabled: no
Initiator Port Name: 210100e08ba41feb
Target Port Name: 2101001b32bb6c3f
Override Path: NA
Path State: OK
Disabled: no
Initiator Port Name: 210100e08ba41feb
Target Port Name: 2100001b329b793c
Override Path: NA
1
2
Administering Multipathing Devices
Chapter 4 • Administering Multipathing Devices (mpathadm) 35
Path State: OK
Disabled: no
.
.
.
Target Port Groups:
ID: 0
Explicit Failover: no
Access State: active optimized
Target Ports:
Name: 2100001b329b6c3f
Relative ID: 1
Name: 2101001b32bb6c3f
Relative ID: 2
ID: 1
Explicit Failover: no
Access State: standby
Target Ports:
Name: 2100001b329b793c
Relative ID: 257
Name: 2101001b32bb793c
Relative ID: 256
# pkg info system/storage/multipath-utilities
Name: system/storage/multipath-utilities
Summary: Solaris Multipathing CLI
Description: Path Administration Utility for a Solaris Multipathing device
Category: Applications/System Utilities
State: Installed
Publisher: solaris
Version: 0.5.11
Build Release: 5.11
Branch: 0.175.0.0.0.0.0
Packaging Date: Tue Sep 27 01:40:01 2011
Size: 77.29 kB
FMRI: pkg://solaris/system/storage/multipath-utilities@
0.5.11,5.11-0.175.0.0.0.0.0:20110927T014001Z
If not, install it.
# pkg install system/storage/multipath-utilities
Enable device multipathing.
# stmsboot -e
WARNING: stmsboot operates on each supported multipath-capable controller
detected in a host. In your system, these controllers are
/devices/pci@780/pci@0/pci@8/SUNW,qlc@0/fp@0,0
/devices/pci@780/pci@0/pci@8/SUNW,qlc@0,1/fp@0,0
/devices/pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@1
/devices/pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@1
If you do NOT wish to operate on these controllers, please quit stmsboot
and re-invoke with -D { fp | mpt } to specify which controllers you wish
to modify your multipathing configuration for.
Do you wish to continue? [y/n] (default: y) y
Checking mpxio status for driver fp
Checking mpxio status for driver mpt
WARNING: This operation will require a reboot.
Do you want to continue ? [y/n] (default: y) y
The changes will come into effect after rebooting the system.
Reboot the system now ? [y/n] (default: y) y
Disable device multipathing.
# stmsboot -d
WARNING: stmsboot operates on each supported multipath-capable controller
detected in a host. In your system, these controllers are
/devices/pci@780/pci@0/pci@8/SUNW,qlc@0/fp@0,0
/devices/pci@780/pci@0/pci@8/SUNW,qlc@0,1/fp@0,0
/devices/pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@1
/devices/pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@1
/devices/pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2
/devices/pci@7c0/pci@0/pci@9/LSILogic,sas@0
/devices/pci@7c0/pci@0/pci@9/LSILogic,sas@0
If you do NOT wish to operate on these controllers, please quit stmsboot
and re-invoke with -D { fp | mpt } to specify which controllers you wish
to modify your multipathing configuration for.
Do you wish to continue? [y/n] (default: y) y
Checking mpxio status for driver fp
Checking mpxio status for driver mpt
WARNING: This operation will require a reboot.
Do you want to continue ? [y/n] (default: y) y
The changes will come into effect after rebooting the system.
Reboot the system now ? [y/n] (default: y) y
perform an ls -l command on /dev/cfg directory
1 . # cd /dev/cfg
2. # ls -l
output command:
lrwxrwxrwx 1 root root 62 Apr 9 2016 c10 -> ../../devices/pci@5 00/pci@2/pci@0/pci@0/LSI,sas@0/iport@1:scsi
lrwxrwxrwx 1 root root 63 Apr 9 2016 c11 -> ../../devices/pci@5 00/pci@2/pci@0/pci@0/LSI,sas@0/iport@v0:scsi
lrwxrwxrwx 1 root root 62 Apr 9 2016 c3 -> ../../devices/pci@40 0/pci@1/pci@0/pci@0/LSI,sas@0/iport@1:scsi
lrwxrwxrwx 1 root root 62 Apr 9 2016 c4 -> ../../devices/pci@40 0/pci@1/pci@0/pci@0/LSI,sas@0/iport@2:scsi
lrwxrwxrwx 1 root root 63 Apr 9 2016 c5 -> ../../devices/pci@40 0/pci@1/pci@0/pci@0/LSI,sas@0/iport@v0:scsi
lrwxrwxrwx 1 root root 72 Apr 9 2016 c6 -> ../../devices/pci@40 0/pci@2/pci@0/pci@1/pci@0/pci@2/SUNW,qlc@0/fp@0,0:fc
lrwxrwxrwx 1 root root 74 Apr 9 2016 c7 -> ../../devices/pci@40 0/pci@2/pci@0/pci@1/pci@0/pci@2/SUNW,qlc@0,1/fp@0,0:fc
lrwxrwxrwx 1 root root 72 Apr 9 2016 c8 -> ../../devices/pci@50 0/pci@1/pci@0/pci@1/pci@0/pci@2/SUNW,qlc@0/fp@0,0:fc
lrwxrwxrwx 1 root root 74 Apr 9 2016 c9 -> ../../devices/pci@50 0/pci@1/pci@0/pci@1/pci@0/pci@2/SUNW,qlc@0,1/fp@0,0:fc
lrwxrwxrwx 1 root root 47 Apr 9 2016 PCI-EM0 -> ../../devices/p ci@400/pci@2/pci@0/pci@1:PCI-EM0
lrwxrwxrwx 1 root root 47 Apr 9 2016 PCI-EM1 -> ../../devices/p ci@400/pci@2/pci@0/pci@2:PCI-EM1
lrwxrwxrwx
3. Copy the /kernel/drv/fp.conf file to the /etc/driver/drv/fp.conf file.
Select one of the following to enable or disable specific FC HBA ports:
4. Add the following line for each FC HBA port that is to be enabled in the
/etc/driver/drv/fp.conf:
name="fp" parent="parent name" port=port-number mpxio-disable="no";
5. Copy the /kernel/drv/scsi_vhci.conf file to the /etc/driver/drv/scsi_vhci.conf file.
Edit the /etc/driver/drv/scsi_vhci.conf file to add the vendor ID and product IDentries.
The vendor ID and product ID are the vendor and product identification strings that the device
returns in SCSI INQUIRY data. The vendor ID must be eight characters long. You must specify
all eight characters even if the trailing characters are spaces.
The product ID can be up to 16 characters long.
scsi-vhci-failover-override =
"VendorID1ProductID1", "f_sym",
"VendorID2ProductID2", "f_sym",
...
"VendorIDnProductIDn", "f_sym";
Note that the entries are separated by the ’,’ character and the last vendor/product entry is
terminated by the ’;’ character.
For example, to add a device from a “ACME” vendor with a product ID of “MSU”, and to add a
device from vendor “XYZ” vendor with a product ID of “ABC”, you would add the following
lines to the /etc/driver/drv/scsi_vhci.conf file:
To add a device from a “XYZ” vendor with a product ID of “ABC”, you would add:
scsi-vhci-failover-override =
"ACME MSU", "f_sym",
"XYZ ABC", "f_sym";
Save and exit the /etc/driver/drv/scsi_vhci.conf file
For example,
scsi-vhci-failover-override =
"COMPELNTCompellent Vol", "f_sym";
# stmsboot -u
Display the mapping of devices on all controllers. For example:
# stmsboot -L
non-STMS device name STMS device name
----------------------------------------------------------------
/dev/rdsk/c2t8d0 /dev/rdsk/c10t500000E01046DEE0d0
/dev/rdsk/c2t0d0 /dev/rdsk/c10t500000E01046B070d0
/dev/rdsk/c2t3d0 /dev/rdsk/c10t20000020372A40AFd0
/dev/rdsk/c2t12d0 /dev/rdsk/c10t500000E01046DEF0d0
/dev/rdsk/c2t11d0 /dev/rdsk/c10t500000E01046E390d0
/dev/rdsk/c3t8d0 /dev/rdsk/c10t500000E01046DEE0d0
/dev/rdsk/c3t0d0 /dev/rdsk/c10t500000E01046B070d0
/dev/rdsk/c3t3d0 /dev/rdsk/c10t20000020372A40AFd0
/dev/rdsk/c3t12d0 /dev/rdsk/c10t500000E01046DEF0d0
/dev/rdsk/c3t11d0 /dev/rdsk/c10t500000E01046E390d0
The -l option displays the mapping of devices on only the specified controller. The following
example displays the mapping of controller 3.
# stmsboot -l3
non-STMS device name STMS device name
----------------------------------------------------------------
/dev/rdsk/c3t8d0 /dev/rdsk/c10t500000E01046DEE0d0
/dev/rdsk/c3t0d0 /dev/rdsk/c10t500000E01046B070d0
/dev/rdsk/c3t3d0 /dev/rdsk/c10t20000020372A40AFd0
/dev/rdsk/c3t12d0 /dev/rdsk/c10t500000E01046DEF0d0
/dev/rdsk/c3t11d0 /dev/rdsk/c10t500000E01046E390d0
5
6
Configuring Third-Party Storage Devices
30
Howto Configure Automatic Failback
Become an administrator.
Copy the /kernel/drv/scsi_vhci.conf file to the /etc/driver/drv/scsi_vhci.conf file.
Edit the /etc/driver/drv/scsi_vhci.conf file.
Disable automatic failback capability by changing the auto-failback entry to:
auto-failback="disable";
Enable automatic failback capability (if you disabled it before), by changing the auto-failback
entry to:
auto-failback="enable";
Save and exit the file.
Reboot the system.
# shutdown -g0 -y -i6
Administering Multipathing Devices
Perform the following tasks to administer any multipathing devices.
▼ HowtoDisplay Multipathing Support Information
Multipathing support and property information is identified with theMultipathManagement
API plug-in library name.
Become an administrator.
Identify the multipathing support on your system.
# mpathadm list mpath-support
mpath-support: libmpscsi_vhci.so
Display the multipathing support properties for a specified mpath support name.
# mpathadm show mpath-support libmpscsi_vhci.so
mpath-support: libmpscsi_vhci.so
Vendor: Sun Microsystems
Driver Name: scsi_vhci
Default Load Balance: round-robin
Supported Load Balance Types:
round-robin
logical-block
Allows To Activate Target Port Group Access: yes
Allows Path Override: no
4C H A P T E R 4
1
2
3
33
Supported Auto Failback Config: yes
Auto Failback: on
Failback Polling Rate (current/max): 0/0
Supported Auto Probing Config: 0
Auto Probing: NA
Probing Polling Rate (current/max): NA/NA
Supported Devices:
Vendor: SUN
Product: T300
Revision:
Supported Load Balance Types:
round-robin
Vendor: SUN
Product: T4
Revision:
Supported Load Balance Types:
round-robin
.
.
.
The command output also shows a list of device products that is supported by the multipathing
support software. The multipathing support libmpscsi_vhci.so supports T10 target port
group compliant devices by default.
▼ HowtoDisplay Properties of a Specific Initiator Port
The following steps describe how to display the properties of an initiator port.
Identify the initiator port.
# mpathadm list initiator-port
Initiator Port: iqn.1986-03.com.sun:01:ffffffffffff.4e94f9bd,4000002a00ff
Initiator Port: 210100e08ba41feb
Initiator Port: 210000e08b841feb
Display the specific initiator port's properties.
# mpathadm show initiator-port 2000000173018713
Initiator Port: 210100e08ba41feb
Transport Type: Fibre Channel
OS Device File: /devices/pci@1,0/pci1022,7450@1/pci1077,141@2,1/fp@0,0
▼ HowtoDisplay Specific LUNInformation
Display the list of LUNs, along with the properties for each LUNby using the mpathadm
command. The displayed list of LUNs contain names that in turn can be used to display the
properties of a particular LUN.
1
2
Administering Multipathing Devices
34 Oracle Solaris Administration: SAN Configuration andMultipathing • February 2012 E23097–12
Display a list of multipathed LUNs.
# mpathadm list lu
/dev/rdsk/c0t600144F08069703400004E828EE10004d0s2
Total Path Count: 8
Operational Path Count: 8
/dev/rdsk/c0t600144F08069703400004E8183DF0002d0s2
Total Path Count: 8
Operational Path Count: 8
/dev/rdsk/c0t600A0B800026D63A0000A4994E2342D4d0s2
Total Path Count: 4
Operational Path Count: 4
/dev/rdsk/c0t600A0B800029065C00007CF54E234013d0s2
Total Path Count: 4
Operational Path Count: 4
/dev/rdsk/c0t600A0B800026D63A0000A4984E234298d0s2
Total Path Count: 4
Operational Path Count: 4
/dev/rdsk/c0t600A0B800029065C00007CF44E233FCFd0s2
Total Path Count: 4
Operational Path Count: 4
/dev/rdsk/c0t600A0B800026D63A0000A4974E23424Ed0s2
Total Path Count: 4
Operational Path Count: 4
.
.
.
Display configuration information about a specific LUN.
# mpathadm show lu /dev/rdsk/c4t60003BA27D2120004204AC2B000DAB00d0s2
mpath-support: libmpscsi_vhci.so
Vendor: SUN
Product: Sun Storage NAS
Revision: 1.0
Name Type: unknown type
Name: 600144f08069703400004e828ee10004
Asymmetric: yes
Current Load Balance: round-robin
Logical Unit Group ID: NA
Auto Failback: on
Auto Probing: NA
Paths:
Initiator Port Name: 210100e08ba41feb
Target Port Name: 2100001b329b6c3f
Override Path: NA
Path State: OK
Disabled: no
Initiator Port Name: 210100e08ba41feb
Target Port Name: 2101001b32bb6c3f
Override Path: NA
Path State: OK
Disabled: no
Initiator Port Name: 210100e08ba41feb
Target Port Name: 2100001b329b793c
Override Path: NA
1
2
Administering Multipathing Devices
Chapter 4 • Administering Multipathing Devices (mpathadm) 35
Path State: OK
Disabled: no
.
.
.
Target Port Groups:
ID: 0
Explicit Failover: no
Access State: active optimized
Target Ports:
Name: 2100001b329b6c3f
Relative ID: 1
Name: 2101001b32bb6c3f
Relative ID: 2
ID: 1
Explicit Failover: no
Access State: standby
Target Ports:
Name: 2100001b329b793c
Relative ID: 257
Name: 2101001b32bb793c
Relative ID: 256
Thursday 13 September 2018
archive log gape with Standby
Primary:
SQL> select thread#, max(sequence#) "Last Primary Seq Generated"
from v$archived_log val, v$database vdb
where val.resetlogs_change# = vdb.resetlogs_change#
group by thread# order by 1;
PhyStdby:
SQL> select thread#, max(sequence#) "Last Standby Seq Received"
from v$archived_log val, v$database vdb
where val.resetlogs_change# = vdb.resetlogs_change#
group by thread# order by 1;
PhyStdby:
SQL>select thread#, max(sequence#) "Last Standby Seq Applied"
from v$archived_log val, v$database vdb
where val.resetlogs_change# = vdb.resetlogs_change#
and val.applied in ('YES','IN-MEMORY')
group by thread# order by 1;
PhyStdby:
SQL> select al.thrd "Thread", almax "Last Seq Received", lhmax "Last Seq Applied" , almax-lhmax "Sequence Difference"
from (select thread# thrd, max(sequence#) almax
from v$archived_log
where resetlogs_change#=(select resetlogs_change# from v$database)
group by thread#) al,
(select thread# thrd, max(sequence#) lhmax
from v$log_history
where resetlogs_change#=(select resetlogs_change# from v$database)
group by thread#) lh
where al.thrd = lh.thrd;
SQL> select thread#, max(sequence#) "Last Primary Seq Generated"
from v$archived_log val, v$database vdb
where val.resetlogs_change# = vdb.resetlogs_change#
group by thread# order by 1;
PhyStdby:
SQL> select thread#, max(sequence#) "Last Standby Seq Received"
from v$archived_log val, v$database vdb
where val.resetlogs_change# = vdb.resetlogs_change#
group by thread# order by 1;
PhyStdby:
SQL>select thread#, max(sequence#) "Last Standby Seq Applied"
from v$archived_log val, v$database vdb
where val.resetlogs_change# = vdb.resetlogs_change#
and val.applied in ('YES','IN-MEMORY')
group by thread# order by 1;
PhyStdby:
SQL> select al.thrd "Thread", almax "Last Seq Received", lhmax "Last Seq Applied" , almax-lhmax "Sequence Difference"
from (select thread# thrd, max(sequence#) almax
from v$archived_log
where resetlogs_change#=(select resetlogs_change# from v$database)
group by thread#) al,
(select thread# thrd, max(sequence#) lhmax
from v$log_history
where resetlogs_change#=(select resetlogs_change# from v$database)
group by thread#) lh
where al.thrd = lh.thrd;
Disable ftp port in solaris 11
Disable ftp in solaris 11
/usr/sbin/svcadm disable ftp
or
inetadm -d ftp
To re-enable use:
/usr/sbin/svcadm enable ftp
or
inetadm -e ftp
Wednesday 12 September 2018
Archive log delete from destination location
Archive log delete from destination location:
select name, round(space_limit/1048576),round(space_used/1048576), round((round(space_used/1048576)*100)/(round(space_limit/1048576))) pct_used from v$RECOVERY_FILE_DEST;
SELECT * FROM V$RECOVERY_AREA_USAGE;
rman target /
select * from v$recovery_area_usage;
DELETE FORCE NOPROMPT ARCHIVELOG ALL COMPLETED BEFORE 'sysdate-20';
ORA-00257:
Archiver error. Connect AS SYSDBA only until resolved.
select name, round(space_limit/1048576),round(space_used/1048576), round((round(space_used/1048576)*100)/(round(space_limit/1048576))) pct_used from v$RECOVERY_FILE_DEST;SELECT * FROM V$RECOVERY_AREA_USAGE;
rman target /
select * from v$recovery_area_usage;
DELETE FORCE NOPROMPT ARCHIVELOG ALL COMPLETED BEFORE 'sysdate-20';
Subscribe to:
Posts (Atom)