Tuesday, October 21, 2014

Create Raw Disk

# dd if=/dev/zero of=/dev/rdsk/c0t5000CCA0562BD16Cd0

on Linux
# watch -n5 kill -USR1 $(pgrep ^dd)

On MacBook
# watch -n5 kill -INFO $(pgrep ^dd)

Monday, October 20, 2014

Solaris 11: Hide dot files

cd /export/user1
sudo find . -name '\.*' -exec chmod S+cH {} \;
cd ..
sudo chmod S-cH user1

Friday, October 10, 2014

Oracle VM Manager: Enabling Remote Log Ins

http://docs.oracle.com/cd/E27300_01/E27308/html/vmiug-manager-tcps.html

To enable TCPS connections from a remote Oracle VM Manager:
  1. Enter the following commands on the Oracle VM Manager host to create the keystore:
    # cd /u01/app/oracle/ovm-manager-3/bin
    # ./secureOvmmTcpGenKeyStore.sh
    You are prompted to enter the following information:
    Generate OVMM TCP over SSH key store by following steps:
    Enter keystore password: password
    Re-enter new password: password
    What is your first and last name?
      [Unknown]:  name     
    What is the name of your organizational unit?
      [Unknown]:  unit       
    What is the name of your organization?
      [Unknown]:  organization
    What is the name of your City or Locality?
      [Unknown]:  City
    What is the name of your State or Province?
      [Unknown]:  State
    What is the two-letter country code for this unit?
      [Unknown]:  country_code
    Is CN=name, OU=unit, O=organization, L=City, ST=State, C=country_code correct?
      [no]:  yes
    
    Enter key password for <ovmm> 
            (RETURN if same as keystore password): password
    Re-enter new password: password
  2. Use the keystore to enable the TCPS service using the secureOvmmTcp.sh script, which is in the same directory as the keystore script above. On the Oracle VM Manager host, enter:
    # ./secureOvmmTcp.sh
    You are prompted to enter the following information:
    Enabling OVMM TCP over SSH service
    
    Please enter the OVM manager user name: username            The local Oracle VM Manager
                                                                      username to use
    Please enter the OVM manager user password: password        The local Oracle VM Manager 
                                                                      password to use
    Please enter the password for TCPS key store : password     The keystore password created 
                                                                       in the previous script
    The job of enabling OVMM TCPS service is committed, please restart OVMM to take effect.
    The username and password entered here are the local Oracle VM Manager authentication credentials to use when logging in from the remote Oracle VM Manager instance.
  3. Restart the local Oracle VM Manager instance:
    # /sbin/service ovmm stop
    # /sbin/service ovmm start

Thursday, October 9, 2014

ZFS NFS Share

New Sharing

zfs set sharenfs=rw=host1:host2:host3,ro=host4 pool1
unless you really do need to be exporting the filesystems with root permissions to all those hosts, in which case it's safest to be explicit:
zfs set sharenfs=rw=host1:host2:host3,root=host1:host2:host3,ro=host4 pool1
 

Modify Existing NFS sharing on ZFS

 
# zfs get share goweek/ishare
NAME         PROPERTY  VALUE  SOURCE
goweek/ishare  share     name=ishare,path=/ishare,prot=smb,csc=auto  local
goweek/ishare  share     name=goweek_ishare,path=/ishare,prot=nfs,sec=sys,root=effectivea.goweekend.ca:effectiveb.goweekend.ca:mtata3.goweekend.ca:blue2.goweekend.ca:biserver.goweekend.ca:blue.goweekend.ca:purple.goweekend.ca,prot=smb  local

# zfs set share=name=goweek,path=/ishare,prot=nfs,anon=65534,sec=sys,root=effectivea.goweekend.ca:effectiveb.goweekend.ca:mtata3.goweekend.ca:blue2.goweekend.ca:vmtata01.goweekend.ca:blue.goweekend.ca:purple.goweekend.ca:wsdev.goweekend.ca,prot=smb goweek/ishare
name=goweek_ishare,path=/ishare,prot=nfs,anon=65534,sec=sys,root=effectivea.goweekend.ca:effectiveb.goweekend.ca:mtata3.goweekend.ca:blue2.goweekend.ca:vmtata01.goweekend.ca:blue.goweekend.ca:purple.goweekend.ca:wsdev.goweekend.ca,prot=smb 

Monday, October 6, 2014

Solaris 11: changing the hostname

1.Check the current environment properties:
root@sun1:~# svccfg -s system/identity:node listprop config
config                 application        
config/enable_mapping boolean     true
config/nodename       astring     sun1
config/loopback       astring     sun1
2. Change to new name
root@sun1:~# svccfg -s system/identity:node setprop config/nodename="sun01"
root@sun1:~# svccfg -s system/identity:node setprop config/loopback="sun01"
3. Refresh the properties:
root@sun1:~# svccfg -s system/identity:node refresh
4. Restart the service:
root@sun1:~# svcadm restart system/identity:node
5. Verify changes:
root@sun1:~# svccfg -s system/identity:node listprop config
config                 application        
config/enable_mapping boolean     true
config/nodename       astring     sun01
config/loopback       astring     sun01
6. Reboot to refresh all cached old host name. 

Friday, October 3, 2014

Sparc M4000 - Solaris 11.1 Installation and configuration

http://www.oracle.com/technetwork/systems/patches/firmware/release-history-jsp-138416.html

http://docs.oracle.com/cd/E26502_01/html/E28983/gkkvs.html

AVAILABLE DISK SELECTIONS:
       0. c1t1d31 <SUN-UniversalXport-0735 cyl 8 alt 2 hd 64 sec 64>
          /pci@1,700000/SUNW,qlc@0/fp@0,0/ssd@w203400a0b874746e,1f
       1. c2t0d31 <SUN-UniversalXport-0735 cyl 8 alt 2 hd 64 sec 64>
          /pci@3,700000/SUNW,qlc@0/fp@0,0/ssd@w202400a0b874746e,1f
       2. c3t5000C500179375C3d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>  Solaris
          /scsi_vhci/disk@g5000c500179375c3
       3. c3t5000C5001793792Fd0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
          /scsi_vhci/disk@g5000c5001793792f
Specify disk (enter its number): ^C

bash-3.2# devfsadm
bash-3.2# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c1t1d31 <SUN-UniversalXport-0735 cyl 8 alt 2 hd 64 sec 64>
          /pci@1,700000/SUNW,qlc@0/fp@0,0/ssd@w203400a0b874746e,1f
       1. c2t0d31 <SUN-UniversalXport-0735 cyl 8 alt 2 hd 64 sec 64>
          /pci@3,700000/SUNW,qlc@0/fp@0,0/ssd@w202400a0b874746e,1f
       2. c3t5000C500179375C3d0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>  Solaris
          /scsi_vhci/disk@g5000c500179375c3
       3. c3t5000C5001793792Fd0 <SUN146G cyl 14087 alt 2 hd 24 sec 848>
          /scsi_vhci/disk@g5000c5001793792f
Specify disk (enter its number):

To get {ok} prompt:
XSCF> sendbreak -y -d 0                                             
Send break signal to DomainID 0?[y|n] :y     

XSCF>  showdomainmode -d 0
Host-ID             :856e6b3e
Diagnostic Level    :min
Secure Mode         :on
Autoboot            :on
CPU Mode            :auto


# init 0

ok: boot cdrom

sparcsrv1 console login: sparcsrv1 console login: sparcsrv1 console login: exit from console.
XSCF> version -c xcp
XSCF#0 (Active )
XCP0 (Current): 1091
XCP1 (Reserve): 1091

XSCF> getflashimage ftp://137.15.140.70/FFXCP1117.tar.gz
  0MB received
  1MB received
  2MB received
...
 36MB received
 37MB received
 38MB received
 39MB received
 40MB received
 41MB received
 42MB received
 43MB received
Download successful: 44711 Kbytes in 48 secs (918.104 Kbytes/sec)
Checking file...
MD5: e8bf7c11500d71e5a50491bcb67f3357
XSCF> getflashimage -l
Existing versions:
        Version                Size  Date
        FFXCP1117.tar.gz   45784699  Wed Oct 01 15:34:51 UTC 2014
XSCF> version -c xcp -v
XSCF#0 (Active )
XCP0 (Current): 1091
OpenBoot PROM : 02.13.0000
XSCF          : 01.09.0001
XCP1 (Reserve): 1091
OpenBoot PROM : 02.13.0000
XSCF          : 01.09.0001
OpenBoot PROM BACKUP
#0: 02.13.0000
#1: --.--.----
XSCF> flashupdate -c check -m xcp -s 1117
XCP update is possible with domains up
XSCF> flashupdate -c update -m xcp -s 1117
The XSCF will be reset. Continue? [y|n] :y
Checking the XCP image file, please wait a minute
XCP update is started (XCP version=1117:last version=1091)
OpenBoot PROM update is started (OpenBoot PROM version=02320000)
OpenBoot PROM update has been completed (OpenBoot PROM version=02320000)
XSCF update is started (XSCFU=0,bank=1,XCP version=1117:last version=1091)
XSCF download is started (XSCFU=0,bank=1,XCP version=1117:last version=1091, Firmware Element ID=00:version=01110007:last version=01090001)
XSCF download has been completed (XSCFU=0,bank=1,XCP version=1117:last version=1091, Firmware Element ID=00:version=01110007:last version=01090001)
XSCF download is started (XSCFU=0,bank=1,XCP version=1117:last version=1091, Firmware Element ID=01:version=01110007:last version=01090001)
XSCF download has been completed (XSCFU=0,bank=1,XCP version=1117:last version=1091, Firmware Element ID=01:version=01110007:last version=01090001)
XSCF download is started (XSCFU=0,bank=1,XCP version=1117:last version=1091, Firmware Element ID=02:version=01100001:last version=01080001)
XSCF download has been completed (XSCFU=0,bank=1,XCP version=1117:last version=1091, Firmware Element ID=02:version=01100001:last version=01080001)
XSCF download is started (XSCFU=0,bank=1,XCP version=1117:last version=1091, Firmware Element ID=03:version=01110007:last version=01090001)
XSCF download has been completed (XSCFU=0,bank=1,XCP version=1117:last version=1091, Firmware Element ID=03:version=01110007:last version=01090001)
XSCF download is started (XSCFU=0,bank=1,XCP version=1117:last version=1091, Firmware Element ID=04:version=01110007:last version=01090001)
XSCF download has been completed (XSCFU=0,bank=1,XCP version=1117:last version=1091, Firmware Element ID=04:version=01110007:last version=01090001)
XSCF download is started (XSCFU=0,bank=1,XCP version=1117:last version=1091, Firmware Element ID=05:version=01110004:last version=01090001)
XSCF download has been completed (XSCFU=0,bank=1,XCP version=1117:last version=1091, Firmware Element ID=05:version=01110004:last version=01090001)
XSCF download is started (XSCFU=0,bank=1,XCP version=1117:last version=1091, Firmware Element ID=07:version=01090001:last version=01090001)
XSCF download has been completed (XSCFU=0,bank=1,XCP version=1117:last version=1091, Firmware Element ID=07:version=01090001:last version=01090001)
XSCF update has been completed (XSCFU=0,bank=1,XCP version=1117:last version=1091)
XSCF is rebooting to update the reserve bank
XSCF> Connection to csis2rsc closed by remote host.
XSCF> version -c xcp -v
XSCF#0 (Active )
XCP0 (Reserve): 1091
OpenBoot PROM : 02.13.0000
XSCF          : 01.09.0001
XCP1 (Current): 1117
OpenBoot PROM : 02.32.0000
XSCF          : 01.11.0007
OpenBoot PROM BACKUP
#0: 02.13.0000
#1: 02.32.0000

XSCF> version -c cmu -v                                         
DomainID  0: 02.32.0000                                         
DomainID  1: 02.32.0000                                         
XSB#00-0:  02.13.0000(Current)     00.00.0000(Reserve)          
XSB#00-1:  02.13.0000(Current)     00.00.0000(Reserve)          
XSB#00-2:  02.13.0000(Current)     00.00.0000(Reserve)          
XSB#00-3:  02.13.0000(Current)     00.00.0000(Reserve)          

restart Domain
# shutdown -y -g0 -i6

XSCF> console -d 0

XSCF> version -c cmu -v
DomainID  0: 02.32.0000
DomainID  1: 02.32.0000
XSB#00-0:  02.13.0000(Reserve)     02.32.0000(Current)
XSB#00-1:  02.13.0000(Current)     00.00.0000(Reserve)
XSB#00-2:  02.13.0000(Current)     00.00.0000(Reserve)
XSB#00-3:  02.13.0000(Current)     00.00.0000(Reserve)


# pkg update --accept


# stmsboot -e

# rolemod -K type=normal root

# newfs /dev/rdsk/c0t600A0B800074746E00000602542BAB88d0s6

Login as oracle10
$ ./runInstaller -silent -noconfig -responseFile /apps/db_install.rsp

Patch OPatch
p6880880_112000_SOLARIS64.zip



Apply p16056266_112030_SOLARIS64.zip
Unzip it to /var/tmp/patch
$ cd /var/tmp/patch
$ opatch apply

N-Apply: process() done.
Composite patch 16056266 successfully applied.
Locker::release()
OPatch Session completed with warnings.
Log file location: /usr2/app/oracle/product/11.2.0.3/cfgtoollogs/opatch/opatch2014-10-01_16-12-43PM_1.log
Cleaning up the directory : "/usr2/app/oracle/product/11.2.0.3/.patch_storage/patch_unzip"...

OPatch completed with warnings.

# zfs set volsize=20G rpool/swap

Enable rlogin
# inetadm -e rlogin

Grant su to user

# rolemod

# usermod -K type=role root
# usermod -R +root -A +solaris.system.maintenance darrenm
# rolemod -K roleauth=user  root
# passwd -N root

If you have made root as role and you want to go back to a traditional direct login capability for root you can do so by simply running:

# rolemod -K type=normal root