安装环境
Sun Solaris(11.1) SPARC T5-2,内存256G,CPU 256颗逻辑CPU,安装数据库版本为11gR2(11.2.0.4)。SPARC5-2配置了最多2颗CPU,256颗逻辑CPU,高达1TB内存,8个PCIe 3.0插槽,详情请点击http://www.oracle.com/cn/servers/sparc/t5-2/comparisons/index.html
启用root远程登陆
修改 /etc/ssh/sshd_config文件,将'PermitRootLogin no'修改为'PermitRootLogin yes' 重新启动SSH服务 svcadm restart ssh 查看ssh服务状态 root@ohs:~# svcs -l ssh fmri svc:/network/ssh:default name SSH server enabled true state online next_state none state_time Thu Nov 03 16:51:18 2016 logfile /var/svc/log/network-ssh:default.log restarter svc:/system/svc/restarter:default contract_id 271 manifest /etc/svc/profile/generic.xml manifest /lib/svc/manifest/network/ssh.xml dependency require_all/none svc:/system/filesystem/local (online) dependency optional_all/none svc:/system/filesystem/autofs (online) dependency require_all/none svc:/network/loopback (online) dependency require_all/none svc:/network/physical:default (online) dependency require_all/none svc:/system/utmp (online) dependency optional_all/error svc:/network/ipfilter:default (disabled) dependency require_all/restart file://localhost/etc/ssh/sshd_config (online) root@solaris:~#
关闭防火墙
svcadm disable svc:/network/ipfilter:default root@ohs:~# svcs -l ipfilter fmri svc:/network/ipfilter:default name IP Filter enabled false state disabled next_state none state_time Thu Nov 03 16:42:41 2016 logfile /var/svc/log/network-ipfilter:default.log restarter svc:/system/svc/restarter:default contract_id manifest /lib/svc/manifest/network/ipfilter.xml manifest /lib/svc/manifest/network/network-location.xml dependency require_all/none svc:/system/filesystem/minimal (online) dependency require_all/restart svc:/network/physical:default (online) dependency require_all/restart svc:/system/identity:node (online) dependency require_all/restart svc:/system/identity:domain (online) dependency optional_all/none svc:/network/location:default (online) root@ohs:~#
修改机器名,时区,地址
svccfg -s system/identity:node listprop config svccfg -s system/identity:node setprop config/nodename="ohs" svccfg -s system/identity:node setprop config/loopback="ohs" svccfg -s system/identity:node refresh svcadm restart system/identity:node root@ohs:~# ipadm show-addr ADDROBJ TYPE STATE ADDR lo0/v4 static ok 127.0.0.1/8 net0/v4 static ok 10.0.2.15/24 root@ohs:~# ipadm delete-addr net0/v4 root@ohs:~# ipadm create-addr -T static -a local=192.168.1.180/24 net0/v4 root@ohs:~# route add default 192.168.1.254 root@ohs:~# svccfg -s timezone:default setprop timezone/localtime=astring: PRC root@ohs:~# svcadm refresh timezone:default查看操作系统相关信息
root@ohs # uname -a SunOS ohs 5.11 11.1 sun4v sparc sun4v root@ohs # uname -r 5.11 root@ohs # root@ohs # cat /etc/release Oracle Solaris 11.1 SPARC Copyright (c) 1983, 2012, Oracle and/or its affiliates. All rights reserved. Assembled 19 September 2012 root@ohs # root@ohs # /usr/sbin/prtconf | grep "Memory size" Memory size: 261120 Megabytes root@ohs # /usr/sbin/swap -l swapfile dev swaplo blocks free /dev/zvol/dsk/rpool/swap 285,2 16 8388592 8388592 root@ohs # root@ohs # /bin/isainfo -kv 64-bit sparcv9 kernel modules root@ohs # root@ohs # df -k /tmp Filesystem 1024-blocks Used Available Capacity Mounted on swap 227424776 2638384 224786392 2% /tmp root@ohs # df -k Filesystem 1024-blocks Used Available Capacity Mounted on rpool/ROOT/solaris 286949376 28752156 175733880 15% / /devices 0 0 0 0% /devices /dev 0 0 0 0% /dev ctfs 0 0 0 0% /system/contract proc 0 0 0 0% /proc mnttab 0 0 0 0% /etc/mnttab swap 224789000 2608 224786392 1% /system/volatile objfs 0 0 0 0% /system/object sharefs 0 0 0 0% /etc/dfs/sharetab fd 0 0 0 0% /dev/fd rpool/ROOT/solaris/var 286949376 369820 175733880 1% /var swap 227424776 2638384 224786392 2% /tmp rpool/VARSHARE 286949376 752 175733880 1% /var/share rpool/export 286949376 69556 175733880 1% /export rpool/export/home 286949376 220 175733880 1% /export/home rpool/export/home/afcdb 286949376 144 175733880 1% /export/home/afcdb rpool/export/home/informix 286949376 164 175733880 1% /export/home/informix rpool/export/home/mqm 286949376 144 175733880 1% /export/home/mqm rpool 286949376 212 175733880 1% /rpool root@ohs # cat /etc/vfstab #device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # /devices - /devices devfs - no - /proc - /proc proc - no - ctfs - /system/contract ctfs - no - objfs - /system/object objfs - no - sharefs - /etc/dfs/sharetab sharefs - no - fd - /dev/fd fd - no - swap - /tmp tmpfs - yes - /dev/zvol/dsk/rpool/swap - - swap - no - root@ohs #查看所需安装包信息
root@ohs # pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibC SUNWlibms SUNWsprot SUNWtoo SUNWi1of SUNWi1cs SUNWi15cs SUNWxwfnt system SUNWarc Lint Libraries (usr) system SUNWbtool CCS tools bundled with SunOS system SUNWhea SunOS Header Files system SUNWlibC Sun Workshop Compilers Bundled libC system SUNWlibms Math & Microtasking Libraries (Usr) system SUNWsprot Solaris Bundled tools system SUNWtoo Programming Tools ERROR: information for "SUNWi1of" was not found ERROR: information for "SUNWi1cs" was not found ERROR: information for "SUNWi15cs" was not found ERROR: information for "SUNWxwfnt" was not found root@ohs #查看vnc是否安装
root@ohs # pkginfo -i |grep vnc system SUNWvncviewer VNC viewer client system SUNWxvnc X11/VNC server root@ohs #创建用户设置权限
root@ohs # /usr/sbin/groupadd oinstall root@ohs # /usr/sbin/groupadd dba root@ohs # id -a oracle id: invalid user name: "oracle" root@ohs # which bash /usr/bin/bash root@ohs # /usr/sbin/useradd -d /export/home/oracle -m -s /bin/bash -g oinstall -G dba oracle 80 blocks root@ohs # passwd -r files oracle New Password: Re-enter new Password: passwd: password successfully changed for oracle创建目录设置权限
root@ohs # mkdir /oradata root@ohs # mkdir /u01 root@ohs # mkdir -p /u01/oracle/product/112 root@ohs # chown -R oracle:oinstall /u01 /oradata root@ohs #创建project并修改Oracle资源属性
root@ohs # projadd -c "z" 'user.oracle' root@ohs # cat /etc/project system:0:::: user.root:1:::: noproject:2:::: default:3:::: group.staff:10:::: user.oracle:100:Oracle::: root@ohs # root@ohs # projadd -c "Oracle" 'user.oracle' root@ohs # root@ohs # projmod -s -K "project.max-shm-memory=(privileged,128GB,deny)" 'user.oracle' root@ohs # projmod -s -K "project.max-sem-ids=(privileged,100,deny)" 'user.oracle' root@ohs # projmod -s -K "process.max-sem-nsems=(privileged,256,deny)" 'user.oracle' root@ohs # projmod -s -K "project.max-shm-ids=(privileged,256,deny)" 'user.oracle' root@ohs # cat /etc/project system:0:::: user.root:1:::: noproject:2:::: default:3:::: group.staff:10:::: user.oracle:100:Oracle:::process.max-sem-nsems=(privileged,256,deny);project.max-sem-ids=(privileged,100,deny);project.max-shm-ids=(privileged,256,deny);project.max-shm-memory=(privileged,137438953472,deny) root@ohs #修改oracle用户limit数值
root@ohs # su - oracle oracle@ohs # ulimit -a core file size (blocks, -c) unlimited data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited open files (-n) 256 pipe size (512 bytes, -p) 10 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 32773
调整swap大小
oracle@ohs:~$ swap -l swapfile dev swaplo blocks free /dev/zvol/dsk/rpool/swap 304,1 16 8388592 8388592 oracle@ohs:~$ exit logout root@ohs:~# swap -l swapfile dev swaplo blocks free /dev/zvol/dsk/rpool/swap 304,1 16 8388592 8388592 root@ohs:~# ls -l /dev/zvol/dsk/rpool/swap lrwxrwxrwx 1 root root 0 Mar 28 01:30 /dev/zvol/dsk/rpool/swap -> ../../../../devices/pseudo/zfs@0:1 root@ohs:~# swap -d /dev/zvol/dsk/rpool/swap root@ohs:~# zfs volsize=32G rpool/swap root@ohs:~# swap -a /dev/zvol/dsk/rpool/swap root@ohs:~# swap -l swapfile dev swaplo blocks free /dev/zvol/dsk/rpool/swap 304,1 16 67108848 67108848 root@ohs:~#配置ftp,允许root登陆
/etc/ftpusers #root /etc/proftpd.conf RootLogin on root@ohs:~# svcs ftp STATE STIME FMRI disabled 1:30:04 svc:/network/ftp:default root@ohs:~# svcadm enable ftp root@ohs:~# svcs ftp STATE STIME FMRI online 19:33:58 svc:/network/ftp:default root@ohs:~# root@ohs:~# svcadm restart ftp root@ohs:~# svcs ftp STATE STIME FMRI online 19:40:20 svc:/network/ftp:default root@ohs:~#
root@ohs:~# xhost + access control disabled, clients can connect from any host root@ohs:~# su - oracle Oracle Corporation SunOS 5.11 11.1 September 2012 oracle@ohs:~$ cd /tmp/ oracle@ohs:/tmp$ cd database/ oracle@ohs:/tmp/database$ ls install response runInstaller stage readme.html rpm sshsetup welcome.html oracle@ohs:/tmp/database$ export DISPLAY=:1.0 oracle@ohs:/tmp/database$ ./runInstaller Starting Oracle Universal Installer... Checking Temp space: must be greater than 180 MB. Actual 216211 MB Passed Checking swap space: must be greater than 150 MB. Actual 222563 MB Passed Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed Preparing to launch Oracle Universal Installer from /tmp/OraInstall2016-09-20_11-49-19PM. Please wait ...oracle@ohs:/tmp/database$ You can find the log of this install session at: /u01/oracle/oraInventory/logs/installActions2016-09-20_11-49-19PM.log oracle@ohs:/tmp/database$设置环境变量
export ORACLE_SID=prod export ORACLE_BASE=/u01/oracle/product export ORACLE_HOME=$ORACLE_BASE/112 export PATH=$ORACLE_HOME/bin:$PATH查看oratab和oraInst.loc(这个和Linux,AIX路径有区别)
oracle@ohs:~$ cat /var/opt/oracle/oratab # # This file is used by ORACLE utilities. It is created by root.sh # and updated by either Database Configuration Assistant while creating # a database or ASM Configuration Assistant while creating ASM instance. # A colon, ':', is used as the field terminator. A new line terminates # the entry. Lines beginning with a pound sign, '#', are comments. # # Entries are of the form: # $ORACLE_SID:$ORACLE_HOME:<N|Y>: # # The first and second fields are the system identifier and home # directory of the database respectively. The third filed indicates # to the dbstart utility that the database should , "Y", or should not, # "N", be brought up at system boot time. # # Multiple entries with the same $ORACLE_SID are not allowed. # # prod:/u01/oracle/product/112:N oracle@ohs:~$ cat /var/opt/oracle/oraInst.loc inventory_loc=/u01/oracle/oraInventory inst_group=oinstall oracle@ohs:~$
查看dbconsole
oracle@ohs:~$ emctl status dbconsole Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0 Copyright (c) 1996, 2013 Oracle Corporation. All rights reserved. https://ohs:1158/em/console/aboutApplication Oracle Enterprise Manager 11g is running. ------------------------------------------------------------------ Logs are generated in directory /u01/oracle/product/112/ohs_prod/sysman/log oracle@ohs:~$ emctl status agent Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0 Copyright (c) 1996, 2013 Oracle Corporation. All rights reserved. --------------------------------------------------------------- Agent Version : 10.2.0.4.5 OMS Version : 10.2.0.4.5 Protocol Version : 10.2.0.4.5 Agent Home : /u01/oracle/product/112/ohs_prod Agent binaries : /u01/oracle/product/112 Agent Process ID : 4473 Parent Process ID : 4464 Agent URL : https://ohs:3938/emd/main Repository URL : https://ohs:1158/em/upload/ Started at : 2016-09-21 00:12:02 Started by user : oracle Last Reload : 2016-09-21 00:12:02 Last successful upload : 2016-09-21 00:56:40 Total Megabytes of XML files uploaded so far : 9.81 Number of XML files pending upload : 0 Size of XML files pending upload(MB) : 0.00 Available disk space on upload filesystem : 82.06% Data channel upload directory : /u01/oracle/product/112/ohs_prod/sysman/recv Last successful heartbeat to OMS : 2016-09-21 00:56:35 --------------------------------------------------------------- Agent is Running and Ready oracle@ohs:~$ lsnrctl status LSNRCTL for Solaris: Version 11.2.0.4.0 - Production on 21-SEP-2016 00:57:35 Copyright (c) 1991, 2013, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ohs)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Solaris: Version 11.2.0.4.0 - Production Start Date 21-SEP-2016 00:01:06 Uptime 0 days 0 hr. 56 min. 30 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/oracle/product/112/network/admin/listener.ora Listener Log File /u01/oracle/product/diag/tnslsnr/ohs/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ohs)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Services Summary... Service "prod" has 1 instance(s). Instance "prod", status READY, has 1 handler(s) for this service... Service "prodXDB" has 1 instance(s). Instance "prod", status READY, has 1 handler(s) for this service... The command completed successfully oracle@ohs:~$
关闭/重启服务器/进入OK模式
shutdown -i5 -g0 -y (power down)
shutdown -i6 -g0 -y (reboot)
reboot -- -r(reboot)
shutdown -i0 -g0 -y (OK prompt)
Oracle Database Quick Installation Guide for Oracle Solaris on SPARC (64-Bit)
http://www.oracle.com/technetwork/cn/articles/servers-storage-admin/s11-network-config-1632927-zhs.html
Oracle Solaris 管理:IP 服务
Oracle Solaris 管理:命名服务和目录服务
Oracle Solaris 管理:网络接口和网络虚拟化
Oracle Solaris 11 的一些其他资源:
- 下载 Oracle Solaris 11
- 访问 Oracle Solaris 11 产品文档
- 访问所有 Oracle Solaris 11 方法文章
- 通过 Oracle Solaris 11 培训和支持了解更多信息
- 查看官方 Oracle Solaris 博客
- 查看 The Observatory 和 OTN Garage 博客中的 Oracle Solaris 提示和技巧
- 通过 Facebook 和 Twitter 关注 Oracle Solaris
http://www.oracle.com/technetwork/articles/servers-storage-admin/ser-howto-save-pwr-sparc-1982424.html