Skip to content

Instantly share code, notes, and snippets.

@alparslanozturk
Last active January 25, 2023 13:53
Show Gist options
  • Save alparslanozturk/3687476cc1d88d5df923f20a39b2ae23 to your computer and use it in GitHub Desktop.
Save alparslanozturk/3687476cc1d88d5df923f20a39b2ae23 to your computer and use it in GitHub Desktop.

Oracle Solaris 11 (30.12.2022)

filedisk

mkdir /btaciksistem
mkfile 15g /btaciksistem/disk0
ldm add-vdsdev /btaciksistem/disk0 disk0@primary-vds0
ldm  remove-vdsdev disk0@primary-vds0


ldm create test-ldom
#ldm set-core 1 test-ldom
#ldm set-domain max-cores=1 test-ldom
ldm set-vcpu 1 test-ldom
ldm set-mem 4G test-ldom
ldm bind test-ldom
#ldm add-vdsdev options=ro /var/share/pkg/solaris11/Solaris-11_4_42_111_0-Text-SPARC.iso solaris114@primary-vds0
ldm add-vdisk cd solaris114@primary-vds0 test-ldom

Network netadm eskidi...11 de yok artık.

https://docs.oracle.com/cd/E26502_01/html/E28987/geyqe.html#NWSTAgldhm

# netadm enable -p ncp DefaultFixed

# dladm show-phys
LINK     MEDIA        STATE     SPEED     DUPLEX     DEVICE
net3     Ethernet     up        100Mb     full       bge3

# dladm show-link
LINK     CLASS     MTU     STATE     BRIDGE   OVER
net3     phys      1500    up        --       --

# ipadm create-ip net3
# ipadm create-addr -a 192.168.84.3/24 net3
ipadm: net3/v4

# ipadm
NAME      CLASS/TYPE     STATE     UNDER     ADDR
lo0       loopback       ok        --        --
   l0/v4       static    ok        --        127.0.0.1/8
net3      ip             ok        --        --
   net3/v4     static    ok        --        192.168.84.3/24

# vi /etc/hosts
# Internet host table
# 127.0.0.1       localhost
10.0.0.14       myhost
192.168.84.3    campus01

add solaris 11 repo upgrade

pkg set-publisher -G '*' -M '*' -g http://1.1.1.1/ solaris
pkg update --license --accept

pkg install oracle-database-preinstall-19c
pkg avoid oracle-database-os-configuration
pkg install xclock

repo avalible from network

svccfg -s application/pkg/server listprop pkg
svccfg -s application/pkg/server setprop pkg/inst_root=

Oracle 19c create project ( :-) )

projadd -U grid -K "project.max-shm-memory=(priv,16G,deny)" user.grid
projadd -U oracle -K "project.max-shm-memory=(priv,40G,deny)" user.oracle

su - oracle
prctl -n project.max-shm-memory -i process $$

sed -i in Solaris

perl -pi -e 's/  wrong / Correct /g' /etc/hosts

set hostname net0 and lo0

svccfg -s system/identity:node listprop config/nodename
svccfg -s system/identity:node listprop config/loopback
svccfg -s system/identity:node setprop config/nodename="gunes"
svccfg -s system/identity:node setprop config/loopback="gunes"
svccfg -s system/identity:node refresh
svcadm restart system/identity:node

paravirtualization ( ldom )

# 01. Find boot disk/CD and add them into ldom
echo |format |grep 0707 
c0t610C3AB10036526948967292340707Fd0 <HUAWEI-XSG1-6001 cyl 41793 alt 2 hd 224 sec 112>  boot_disk01

ldm add-vdsdev /dev/dsk/c0t610C3AB10036526948967292340707Fd0s2 sunucu1_boot@primary-vds0
ldm add-vdsdev options=ro /mnt/Solaris-11_4_42_111_0-Text-SPARC.iso sunucu1_cd@primary-vds0

# 02. Create VM
ldm create sunucu1-ldom
ldm set-core 2 sunucu1-ldom
ldm set-domain max-cores=2 sunucu1-ldom
ldm set-mem 4G sunucu1-ldom

# 03. Add net, disk, cd 
ldm add-vnet pvid=1 vnet0 primary-vsw0 sunucu1-ldom
ldm add-vdisk sunucu1_boot sunucu1_boot@primary-vds0 sunucu1-ldom
ldm add-vdisk sunucu1_cd sunucu1_cd@primary-vds0 sunucu1-ldom

ldm bind sunucu1-ldom
ldm start sunucu1-ldom

ldm ls -o disk
ldm ls -o network
ldm ls 
telnet 0 5000
devalias
boot cd

...

# eject cdrom 
ldm rm-vdisk sunucu1_cd sunucu1-ldom


# last save 
ldm add-config 20221230
ldm list-config

zpool ( data pool for oracle u01 )

zpool create dpool c1d1
mkdir /u01
zfs create dpool/oracle
zfs set mountpoint=/dpool/oracle
zpool list

create-ip, create-addr and route

dladm show-linkprop -p mac-address
dladm show-link
ipadm create-ip net0
ipadm delete-ip net0

ipadm
ipadm create-addr -T static -a 192.168.1.225/24 net0/v4
ipadm delete-addr net0/v4
ipadm

route -p add default 192.168.1.1

root@gunes:~# route -p show
add persistent net -name route-1 default: gateway 192.168.1.1



ipadm show-ifprop net0


root@solaris:~# svccfg -s dns/client 'setprop config/nameserver = net_address: 192.168.1.1'
root@solaris:~# svccfg -s dns/client 'setprop config/domain = astring: "example.com" '
root@solaris:~# svccfg -s name-service/switch 'setprop config/host = astring: "files dns" '
root@solaris:~# svcadm refresh name-service/switch
root@solaris:~# svcadm refresh dns/client

Alternatively, you can edit the usual files /etc/resolv.conf and /etc/nsswitch.conf, 
but you have to import them into the naming service configuration:

root@solaris:~# nscfg import -f svc:/system/name-service/switch:default
root@solaris:~# nscfg import -f svc:/network/dns/client:default
root@solaris:~# svcadm refresh dns/client


ntp

cp /etc/inet/ntp.client /etc/inet/ntp.conf
echo "server kuveytturk.local iburst" >> /etc/inet/ntp.conf
svcadm enable ntp
svcadm restart ntp
ntpq -pn

hostname

svccfg -s system/identity:node listprop config/nodename
svccfg -s system/identity:node listprop config/loopback
svccfg -s system/identity:node setprop config/nodename="gunes"
svccfg -s system/identity:node setprop config/loopback="gunes"
svccfg -s system/identity:node refresh
svcadm restart system/identity:node

DNS nameserver, search, domain etc.

root@gunes:~# svccfg -s dns/client setprop config/nameserver = net_address: 1.1.1.1
or
root@gunes:~# svccfg -s dns/client setprop config/nameserver = net_address: \( 192.168.1.1 8.8.8.8 \)
root@gunes:~# svccfg -s dns/client setprop config/search = ornek.com
root@gunes:~# svccfg -s dns/client listprop config
config                     application
config/nameserver          net_address 192.168.1.1 8.8.8.8
config/search              astring     ornek.com
config/value_authorization astring     solaris.smf.value.name-service.dns.client
root@gunes:~# cat /etc/resolv.conf

#
# _AUTOGENERATED_FROM_SMF_V1_
#
# WARNING: THIS FILE GENERATED FROM SMF DATA.
#   DO NOT EDIT THIS FILE.  EDITS WILL BE LOST.
# See resolv.conf(5) for details.

search  ornek.com
nameserver      192.168.1.1
nameserver      8.8.8.8

domain

svccfg -s network/dns/client setprop config/domain = astring: ornek.com

nssswitch

svccfg -s system/name-service/switch
setprop config/host = astring: "files dns"
svcadm enable system/name-service/switch
svcadm restart system/name-service/switch
svcadm refresh system/name-service/switch


root@gunes:~# svccfg -s system/name-service/switch listprop config
config                     application
config/default             astring     files
config/host                astring     "files dns"
config/value_authorization astring     solaris.smf.value.name-service.switch
root@gunes:~# cat /etc/nsswitch.conf

#
# _AUTOGENERATED_FROM_SMF_V1_
#
# WARNING: THIS FILE GENERATED FROM SMF DATA.
#   DO NOT EDIT THIS FILE.  EDITS WILL BE LOST.
# See nsswitch.conf(5) for details.

passwd: files
group:  files
hosts:  files dns
ipnodes:        files dns
networks:       files
protocols:      files
rpc:    files
ethers: files
netmasks:       files
bootparams:     files
publickey:      files
netgroup:       files
automount:      files
aliases:        files
services:       files
project:        files
auth_attr:      files
prof_attr:      files
tnrhtp: files
tnrhdb: files
sudoers:        files

User Create

useradd -d "/export/home/kullan" -m -s /usr/bin/bash -c "Alparslan Ozturk" -u 1111 -g 10 kullan
passwd kullan
echo "lnxadm12003 ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
su - kullan
sudo -l

create user with passwd on oracle solaris 11


cat > solaris_useradd.sh << "EOF"
#!/usr/bin/expect

set u "kullan"
set u "parola123"

spawn useradd -m $u
expect eof

spawn passwd $u
expect "assword:"
send "$p\r"
expect "assword:"
send "$p\r"
expect eof

EOF

chmod +x solaris_useradd.sh

#sample work here

root@gunes:~# userdel -r kullan
root@gunes:~#
root@gunes:~# ./solaris_useradd.sh
spawn useradd -m kullan
80 blocks
spawn passwd kullan
New Password:
Re-enter new Password:
passwd: password successfully changed for kullan

gdm instlal and disable

pkg update --accept
pkg instlal solaris-desktop
svcadm disable application/graphical-login/gdm:default 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment