Navigating and Editting
rdfile [file]
wrfile [file]
# ctrl-c commit changes. -a append file instead of overwrite.
* Move cursor: arrow keys, ctrl-a (start of line)
Edit shortcuts: ctrl-w (delete word), ctrl-u (delete line),
ctrl-h (delete left char), ctrl-k (delete to EOL)
System commands
sysconfig # list system components
environment status # show status of shelf etc..
priv set [admin|advanced] # toggle to admin, more powerful commands
options # stuff we can review/configure
options trusted # Administrative clients (up to 5, SSH access)
security.passwd.rules.history 6 # allow reuse of old passwords
options timed # SNTP options, time sync
options ssh # see also security, rsh, telnet, ftpd, httpd...
rdfile /etc/messages # view system messages
man useradmin # manpage for useradmin commands
license [add <code>] # view licenses, or add a license
sysstat -x 1 # show stats (cpu, nfs, disk, cache..)
useradmin whoami # show user. See also user, group, role sub-cmds
version # product version
Admin Options
acp auditlog autologout autosupport backup cdpd cf cifs cksum_offload console coredump disk
dns ems fcp flexcache flexscale fpolicy ftpd httpd ic ifgrp interface ip iscsi kerberos ldap
licensed_feature locking lun ndmpd nfs nis nlm pcnfsd qos ra raid replication rpc rquotad rsh
security sftp shelf sis snaplock snapmirror snapvalidator snapvault snmp ssh ssh1 ssh2 ssl tape
telnet tftpd timed tls trusted vfiler vol vsm wafl webdav
Networking
ifconfig -a # list known interfaces
rdfile /etc/rc # hostname, routing, options..
rdfile /etc/hosts # lookup hosts
rdfile /etc/nsswitch.conf # lookup protocols
netstat -r # routing table
Disks
sysconfig -d # FC: listing host_adapter.device_id (device_id# calculated as
# shelf_id * 16 + disk bay number)
# SAS: listing host_adapter.shelf_id.bay_id
fcstat # show show drive position on FC loop
sasstat # SAS stats
sysconfig -r # raid, spares, -V aggregates
storage show # show adapters and disks
options acp # alternative control path (SAS over ethernet)
disk show -v # list disks and ownership
disk assign [id|all] # add as spares - via software ownership (hardware
# based ownership is no longer supported)
disk replace start [a b] # initiate replacement of dead disk a using spare b
disk replace status # show replacement progress
disk fail [diskid] # fail for removal
disk remove [diskid] # remove so it can be hot-swapped
Aggregates
aggr options aggr0 [option] [value]
aggr status
aggr create [name] [options] # create aggregate (note: 32bit is fast, 64 scales).
sysconfig -r
aggr show_space aggr1 # show allocation, reserves etc..
aggr rename aggr newaggr
aggr offline [aggr] # offline (after volumes are destroyed)
aggr destroy [aggr] # destroy after offline
Volumes
vol options vol0 [option] [value]
vol status vol1
df -h vol1
vol create vol4 aggr1 100m # 100m = 95M avail, 5M snapshot reserve default
vol offline vol4
vol destroy vol4
vol size vol4 +50m # add 50M
* Create volume, then lun, qtree and quota.
Quotas
* apply volume, qtree.
rdfile /etc/quotas # and /etc/usermap.cfg and "quota report"
QTrees
* logical file system under root of volume (subdirectory used for quotas etc..)
qtree create /vol/vol4/vol4_qtree2
qtree status
NFS Exporting
* Use sharing wizard, much easier
rdfile /etc/exports
exportfs # list exports, options for reload, unload, add..
showmount -e <netapp-ip> # from client, list exported directories
mount <netapp:export> <dir>
CIFS Shares
cifs shares # list them
cifs access # allow/prevent access to share
cifs sessions # show connected sessions
cifs terminate # terminate all
cifs restart # restart CIFS services
cifs shares -add freeware /vol/vol3/vol3_qtree1
* map network drive from Windows client.
* use CIFS Setup to configure AD/WORKGROUP etc..
iSCSI LUNs
iscsi status
Passwordless Authentication
SSH services are already running on the v3240, ie. options ssh
Unlock support account, get system shell, create directories,
priv set advanced
useradmin diaguser unlock
useradmin diaguser password
< here I set a new password >
systemshell
login: diag
Password:
mkdir -p /mroot/etc/sshd/root/.ssh
Created authorized_keys file, set permissions, exit system shell,
vi /mroot/etc/sshd/root/.ssh/authorized_keys
< here I pasted public key, and exitted vi >
sudo chown -R root:wheel /mroot/etc/sshd/root
sudo chmod -R 0600 /mroot/etc/sshd/root
exit
Lock diag user, return to normal privileges,
useradmin diaguser lock
priv set
Volume Snapshot Example
# Where ">" denotes filer CLI, and "$" denotes Unix CLI
# Create, list, destroy, and schedule snapshots. Reduce the reserve.
> vol create testvol aggr 10g
> snap create testvol testsnap
> snap list testvol
> snap rename testvol testsnap snaptest
> snap delete testvol snaptest
> snap sched testvol 2 2 8@8,12,16,20
> snap reserve testvol 5
> snap reserve testvol
# Provision storage. Snapshot volume. Write FS. Restore to snapshot.
> exportfs -p rw=myhost,root=myhost /vol/testvol
$ mkdir /test
$ mount myfiler:/vol/testvol /test
$ df -h /test
$ touch /test/snap.before
> snap create testvol testsnap
$ touch /test/snap.after
$ ls -l /test/snap*
> snap restore -t vol -s testsnap testvol
$ ls -l /test/snap*
# A file was lost, restore it from the snapshot copy
$ rm /test/snap.before
> snap restore -t file -s testsnap -r /vol/testvol/snap.before /vol/testvol/snap.before
Oracle on Netapp Best Practices
- One large aggregate, with many disks. Use 64bit FlexVol allowing larger LUNs.
- Agregate has raid-group size = 16 disks
- One volume for one database is OK. Allocate additional volumes to accomodate
backup and restore operations.
- One ORACLE_HOME can be NFS shared to multiple hosts (but patching will impact all)
- Put each Control file on separate filesystems
- Use two volumes for redo logs, alternate allocation (1,3,5 on vol1, 2,4,6 on vol2).
- Disable auto snapshot generation for database volumes
- make sure snapshot reserve < volume free space (or you must delete snapshots. monitor.)
- Leave the volume minra option "off", dont minimise read-ahead scan
- Database volumes dont need access time info, "vol options <volname> no_atime_update on"
- Use NFSv3 TCP only
- The "ENOSPC no space on device" error (poor planning), results in graceful DB shutdown,
or tablespace offline. The app tried to seek past device EOM. Delete a snapshot.
To avoid it,
* use autogrow volume (or manual grow before DB startup and recovery)
* do capacity planning and review monthly
* use 100% volume space reserve
* ensure enough space for dev/uat clones (FlexClone)
* allocate adequate snapshot reserve
* monitor for ORA-27072, ORA-03113, ORA-01243
* if tablespace offlined, increase volume, recover datafile, online datafile
- In 11g, use Direct NFS with rsize and wsize 32768
- oracle params:
* disk_asynch_io=true if OS supports
* if multi-cpu server, dbwr_io_slaves=0; db_writer_processes=2*CPU-cores
* if single-cpu server, use dbwr_io_slaves=4; disk_asynch_io=false
- Use Snapshot Manager for Oracle (SMO), for cloning and snapshot backups
No comments:
Post a Comment