安装oracle11gR2单实例+ASM,让新手走向数据库管理员css
1、介绍
因业务须要,最近在主系统的基础上搭建一套mini系统,本文只讲ORACLE数据库+ASM磁盘管理工具的安装;
1.服务器系统版本:RHEL5.5x64Bit,kernel2.6.18-194.el5
2.磁盘分区格式:LVM+裸设备
3.ORACLE软件版本:p10404530_112030_Linux-x86-64
4.ASM组件版本:oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm
oracleasmlib-2.0.4-1.el5.x86_64.rpm
oracleasm-support-2.1.7-1.el5.x86_64.rpm
2、安装实施准备
1.建立ORACLE用户和组成员
html
groupadd oinstallnode
groupadd dbalinux
groupadd operc++
groupadd asmadmin数据库
groupadd asmdbavim
groupadd asmoper安全
useradd -g oinstall -G dba,asmdba,oper -d /home/oracle oraclebash
useradd -g oinstall -G dba,asmadmin,asmdba,asmoper -d /home/grid grid服务器
2.分别建立oracle、grid用户的密码
passwd oracle
new unix password:oracle
passwd grid
new unix password:grid
3.磁盘分区
//介绍:本文为项目简化,实际项目磁盘分区为:8块300G15KSAS磁盘(HP388/G82U服务器最多支持8块);
//前2块 raid1,安装系统包括:/、sawp、boot分区等,可冗余磁盘为:1块;
//后6块 raid5,/u0140GLVM管理安装oracle软件,/u02450GLVM管理,存放arch和RMAN备份等,可冗余磁盘为:1块;
//ASM磁盘组为300G*3,DATA一、DATA二、DATA3存放oracle数据;
//本文分区以下:/u0110G,/u0220G,ASM10G*3DATA一、DATA二、DATA3等;
[root@ctp-dbserver~]#fdisk -l
Disk/dev/sda:80.0GB,80026361856bytes
255heads,63sectors/track,9729cylinders
Units=cylindersof16065*512=8225280bytes
DeviceBootStartEndBlocksIdSystem
/dev/sda1 1310439183 Linux
/dev/sda2 1413181048241283 Linux
/dev/sda3 131926231048241283 Linux
/dev/sda4 26249729570789455 Extended
/dev/sda5 262439281048238183 Linux
/dev/sda6 392952331048238183 Linux
/dev/sda7 52345755419293382 Linux swap /Solaris
/dev/sda8 57569729319211238eLinuxLVM
说明:/dev/sda235分配为ASM,sda8划分出u01u02
[root@ctp-dbserver~]#pvcreate /dev/sda
sda sda1 sda2 sda3 sda4 sda5 sda6 sda7 sda8
[root@ctp-dbserver~]#pvcreate /dev/sda8
Physical volume "/dev/sda8" successfully created
[root@ctp-dbserver~]#vgcreate vg00 /dev/sda8
Volumegroup "vg00" successfully created
[root@ctp-dbserver~]#
[root@ctp-dbserver~]#vgs
/dev/hdb: openfailed: Nomediumfound
VG# PV# LV# SNAttrVSizeVFree
vg00100wz--n-30.44G30.44G
[root@ctp-dbserver~]#lvcreate -L 10G -n lv_u01 /dev/vg00
Logicalvolume"lv_u01"created
[root@ctp-dbserver~]#lvcreate -l 100% FREE -n lv_u02 /dev/vg00 //使用剩余空间建立lv_u02
Logicalvolume "lv_u02" created
[root@ctp-dbserver~]#
[root@ctp-dbserver~]#lvs
LVVGAttrLSizeOriginSnap %MoveLogCopy% Convert
lv_u01vg00-wi-a-10.00G
lv_u02vg00-wi-a-20.44G
[root@ctp-dbserver~]#
//格式化lv_u01lv_u02并分别指定(LABEL)要创建的卷标名名称u01和u02
[root@ctp-dbserver~]#mkfs.ext3 -L u01 /dev/vg00/lv_u01
mke2fs1.39(29-May-2006)
Filesystemlabel=u01
OStype:Linux
Blocksize=4096(log=2)
Fragmentsize=4096(log=2)
1310720inodes,2621440blocks
131072blocks(5.00%)reservedforthesuperuser
Firstdatablock=0
Maximumfilesystemblocks=2684354560
80blockgroups
32768blockspergroup,32768fragmentspergroup
16384inodespergroup
Superblockbackupsstoredonblocks:
32768,98304,163840,229376,294912,819200,884736,1605632
Writinginodetables:done
Creatingjournal(32768blocks):done
Writingsuperblocksandfilesystemaccountinginformation:done
Thisfilesystemwillbeautomaticallycheckedevery28mountsor
180days,whichevercomesfirst.Usetune2fs-cor-itooverride.
[root@ctp-dbserver~]#
[root@ctp-dbserver~]#mkfs.ext3 -L u02 /dev/vg00/lv_u02
mke2fs1.39(29-May-2006)
Filesystemlabel=u02
OStype:Linux
Blocksize=4096(log=2)
Fragmentsize=4096(log=2)
2681728inodes,5358592blocks
267929blocks(5.00%)reservedforthesuperuser
Firstdatablock=0
Maximumfilesystemblocks=4294967296
164blockgroups
32768blockspergroup,32768fragmentspergroup
16352inodespergroup
Superblockbackupsstoredonblocks:
32768,98304,163840,229376,294912,819200,884736,1605632,2654208,
4096000
Writinginodetables:done
Creatingjournal(32768blocks):done
Writingsuperblocksandfilesystemaccountinginformation:done
Thisfilesystemwillbeautomaticallycheckedevery34mountsor
180days,whichevercomesfirst.Usetune2fs-cor-itooverride.
[root@ctp-dbserver~]#
//vim编辑磁盘分区挂载文件fstab,添加如下2行;
[root@ctp-dbserver~]#vim /etc/fstab
LABEL=u01/u01ext3defaults11
LABEL=u02/u02ext3defaults11
//建立目录和更改目录属性
mkdir/u0{1,2}
执行mount-a挂载lv_u01和lv_u02
[root@ctp-dbserver~]#df -h
FilesystemSizeUsedAvailUse%Mountedon
/dev/sda69.7G3.0G6.3G32%/
/dev/sda199M12M83M13%/boot
tmpfs1.9G01.9G0%/dev/shm
/dev/mapper/vg00-lv_u01
9.9G151M9.2G2%/u01
/dev/mapper/vg00-lv_u02
21G173M19G1%/u02
[root@ctp-dbserver~]#
//建立如下目录
mkdir -p /u01/app/11.2.0/grid
mkdir -p /u01/app/grid
mkdir -p /u01/app/oracle/product/11.2.0/db_1
mkdir -p /u02/arch
chown -R grid:oinstall /u01
chown -R oracle:oinstall /u01/app/oracle
chown -R oracle:oinstall /u02
chmod -R 775 /u01
chmod -R 775 /u02
4.使用oracle用户登录,设置oracle用户的环境变量
//增长如下几行
[oracle@ctp-dbserver~]$vim .bash_profile
export ORACLE_SID=zxxj
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:.
export NLS_LANG=American_america.ZHS16GBK
export PATH=$PATH:$ORACLE_HOME/bin:.
5.使用grid域名登录,设置grid用户的环境变量
//增长如下几行
[grid@ctp-dbserver~]$vim .bash_profile
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2.0/grid
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:.
export NLS_LANG=American_america.ZHS16GBK
export PATH=$PATH:$ORACLE_HOME/bin:.
export ORACLE_SID=+ASM
6.使用root更改如下几项参数
//具体值要根据实际硬件设置,本参数则先按照原服务器CPU:2颗*8核、32G内存、32Gsawp的配置,若有错误后面再更正;
[root@ctp-dbserver~]#vim /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
//该参数的大小和物理内存以及在安装oracle的时候SGA占物理内存的40%时的数据直接涉及到sga_max_size的参数的大小。若是设置不恰当极可能致使oracle启动失败,或者在手动:
alter system set sga_max_size = **G scope=spfile;
执行/sbin/sysctl-p使设置当即生效
#sysctl -p
7.修改文件数和安全设置
#vim /etc/security/limits.conf
//增长如下内容
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
8.增长session链接限制库
#vim /etc/pam.d/login
//增长如下内容
session required /lib/security/pam_limits.so
9.修改hosts文件和主机名
#vim /etc/hosts
192.168.1.10ctp-dbserver
#vim /etc/sysconfig/network
//修改HOSTNAME,使其永久生效
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=ctp-dbserver
GATEWAY=192.168.1.1
10.将必要的安装文件上传至服务器
如:
//oracle用户安装软件,存放/u02下
p10404530_112030_Linux-x86-64_1of7.zip
p10404530_112030_Linux-x86-64_2of7.zip
p10404530_112030_Linux-x86-64_3of7.zip
//ASM使用的3个rpm包存放/root下
oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm
oracleasmlib-2.0.4-1.el5.x86_64.rpm
oracleasm-support-2.1.7-1.el5.x86_64.rpm
//依赖的rpm包存放/root下,按照实际系统配置决定,有的包已经安装;
binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
compat-libstdc++-33-3.2.3(32bit)
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-2.5-24(32bit)
glibc-common-2.5
glibc-devel-2.5
glibc-devel-2.5(32bit)
glibc-headers-2.5
ksh-20060214
libaio-0.3.106
libaio-0.3.106(32bit)
libaio-devel-0.3.106
libaio-devel-0.3.106(32bit)
libgcc-4.1.2
libgcc-4.1.2(32bit)
libstdc++-4.1.2
libstdc++-4.1.2(32bit)
libstdc++-devel4.1.2
make-3.81
numactl-devel-0.9.8.x86_64
sysstat-7.0.2
//可先rpm-qa|grep查找是否有缺失未安装的rpm包
#rpm -ivh *.rpm
3、安装oralce和ASM组件
1.安装ASM
//说明:asm组件的安装须要3个asmrpm包的支持,oracleasmrpm须要和linux系统的内核对应
#uname -ar
2.6.18-194.el5
//oracleasm包要求:
oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm//此包必须和linuxkernel一致
oracleasmlib-2.0.4-1.el5.x86_64.rpm//此包根据要官网说明
oracleasm-support-2.1.7-1.el5.x86_64.rpm//此包根据要官网说明
//参考:下载地址
http://www.oracle.com/technetwork/server-storage/linux/downloads/rhel5-084877.html#oracleasm_rhel5_amd64
[root@ctp-dbserver~]#rpm -ivh *.rpm
warning: oracleasm-2.6.18-308.el5-2.0.5-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [ 33%]
2:oracleasm-2.6.18-308.el########################################### [ 67%]
3:oracleasmlib ########################################### [100%]
[root@ctp-dbserver~]#
2.配置ASM
root用户登陆,(本次安装为单实例),执行:
[root@ctp-dbserver~]#/etc/init.d/oracleasm configure
ConfiguringtheOracleASMlibrarydriver.
Thiswillconfiguretheon-bootpropertiesoftheOracleASMlibrary
driver.Thefollowingquestionswilldeterminewhetherthedriveris
loadedonbootandwhatpermissionsitwillhave.Thecurrentvalues
willbeshowninbrackets('[]').Hitting<ENTER>withouttypingan
answerwillkeepthatcurrentvalue.Ctrl-Cwillabort.
Defaultusertoownthedriverinterface[]:grid
Defaultgrouptoownthedriverinterface[]:asmadmin
StartOracleASMlibrarydriveronboot(y/n)[n]:y
ScanforOracleASMdisksonboot(y/n)[y]:y
WritingOracleASMlibrarydriverconfiguration:done
InitializingtheOracleASMLibdriver:[OK]
ScanningthesystemforOracleASMLibdisks:[OK]
[root@ctp-dbserver~]#
3.建立ASM磁盘
[root@ctp-dbserver~]#oracleasm createdisk DATA1 /dev/sda2
Writingdiskheader:done
Instantiatingdisk:done
[root@ctp-dbserver~]#oracleasm createdisk DATA2 /dev/sda3
Writingdiskheader:done
Instantiatingdisk:done
[root@ctp-dbserver~]#
[root@ctp-dbserver~]#oracleasm createdisk DATA3 /dev/sda5
Writingdiskheader:done
Instantiatingdisk:done
[root@ctp-dbserver~]#
[root@ctp-dbserver~]#oracleasm listdisks
DATA1
DATA2
DATA3
[root@ctp-dbserver~]#
4.配置xmanager远程链接RHEL5.5
//修改配置defaults.conf文件
//若是只有oralce和grid图形登陆只改如下2项便可
#vim /usr/share/gdm/defaults.conf
Enable=true
Port=177
//root登陆,还须要
AllowRoot=true
AllowRemoteRoot=root
//修改inittab必须为5级别
#vim /etc/inittab
id:5:initdefault:
//重启gdm
#gdm-restart
//一切OK
5.安装grid组件
//使用XmanagerEnterprise3的Xbrowser图形链接服务器
//图形界面grid用户登陆,进入/u02/
#unzip p10404530_112030_Linux-x86-64_3of7.zip
#cd grid
#./runinstall
//安装参数说明:
[root@ctp-dbserver~]#cd /u01/app/oraInventory/
[root@ctp-dbserveroraInventory]#ls
ContentsXMLlogsoraInst.locorainstRoot.shoui
[root@ctp-dbserveroraInventory]#./orainstRoot.sh
Changingpermissionsof/u01/app/oraInventory.
Addingread,writepermissionsforgroup.
Removingread,write,executepermissionsforworld.
Changinggroupnameof/u01/app/oraInventorytooinstall.
Theexecutionofthescriptiscomplete.
[root@ctp-dbserveroraInventory]#cd /u01/app/11.2.0/grid/
//注意:在ORACLE单实例中执行./root.sh后,显示说明:
##################################################
ToconfigureGridInfrastructureforaStand-AloneServerrunthefollowingcommandastherootuser:
/u01/app/11.2.0/grid/perl/bin/perl-I/u01/app/11.2.0/grid/perl/lib-I/u01/app/11.2.0/grid/crs/install/u01/app/11.2.0/grid/crs/install/roothas.pl
##################################################
//提示:在执行root.sh后,再执行/u01/app/11.2.0/grid/crs/install/roothas.pl
//不然后面的creadeasm将会出错
[root@ctp-dbservergrid]#./root.sh
PerformingrootuseroperationforOracle11g
Thefollowingenvironmentvariablesaresetas:
ORACLE_OWNER=grid
ORACLE_HOME=/u01/app/11.2.0/grid
Enterthefullpathnameofthelocalbindirectory:[/usr/local/bin]:
Copyingdbhometo/usr/local/bin...
Copyingoraenvto/usr/local/bin...
Copyingcoraenvto/usr/local/bin...
Creating/etc/oratabfile...
Entrieswillbeaddedtothe/etc/oratabfileasneededby
DatabaseConfigurationAssistantwhenadatabaseiscreated
Finishedrunninggenericpartofrootscript.
Nowproduct-specificrootactionswillbeperformed.
ToconfigureGridInfrastructureforaStand-AloneServerrunthefollowingcommandastherootuser:
//大概是说:配置grid为一个独立的节点(单实例),须要root用户:(执行roothas.pl)
/u01/app/11.2.0/grid/perl/bin/perl-I/u01/app/11.2.0/grid/perl/lib-I/u01/app/11.2.0/grid/crs/install/u01/app/11.2.0/grid/crs/install/roothas.pl
ToconfigureGridInfrastructureforaClusterexecutethefollowingcommand:
/u01/app/11.2.0/grid/crs/config/config.sh
ThiscommandlaunchestheGridInfrastructureConfigurationWizard.Thewizardalsosupportssilentoperation,andtheparameterscanbepassedthroughtheresponsefilethatisavailableintheinstallationmedia.
[root@ctp-dbservergrid]#
6.图形界面使用asmca建立ASM磁盘组
$asmca
//asmca建立ASM磁盘介绍
//因在硬件上采用了raid5 的冗余,再此将选External便可
//注意:若是上述在执行./root.sh后没有执行,/u01/app/11.2.0/grid/crs/install/roothas.pl
//那么将会出现:
OracleGridInfrastructureisnotconfiguredproperly.ASMCAneedsOracleGridInfrastructuretoconfigureASM.
//若是你错过了,那么如今执行还来得及;
[root@ctp-dbserverinstall]#./roothas.pl
Usingconfigurationparameterfile:./crsconfig_params
Creatingtracedirectory
UserignoredPrerequisitesduringinstallation
LOCALADDMODE
CreatingOCRkeysforuser'grid',privgrp'oinstall'..
Operationsuccessful.
LOCALONLYMODE
SuccessfullyaccumulatednecessaryOCRkeys.
CreatingOCRkeysforuser'root',privgrp'root'..
Operationsuccessful.
CRS-4664:Nodectp-dbserversuccessfullypinned.
AddingClusterwareentriestoinittab
ctp-dbserver2012/10/2902:03:01/u01/app/11.2.0/grid/cdata/ctp-dbserver/backup_20121029_020301.olr
SuccessfullyconfiguredOracleGridInfrastructureforaStandaloneServer
[root@ctp-dbserverinstall]#
//执行roothas.pl脚本后,再检查has进程是否启动;
#ps -ef|grep has
//肯定进程已经启动后,再图形下执行CreateASM
//若是grid安装顺利,那么能够泡杯红茶休息一下,后面都是很容易的了。
7.使用Oracle用户图形下安装oralce软件
[oracle@ctp-dbserver]$cd /u02/
[oracle@ctp-dbserver]$unzip p10404530_112030_Linux-x86-64_1of7.zip
[oracle@ctp-dbserver]$unzip p10404530_112030_Linux-x86-64_2of7.zip
[oracle@ctp-dbserverdatabase]$./runInstaller
//oracle软件安装介绍
[root@ctp-dbserverdb_1]#./root.sh
PerformingrootuseroperationforOracle11g
Thefollowingenvironmentvariablesaresetas:
ORACLE_OWNER=oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
Enterthefullpathnameofthelocalbindirectory:[/usr/local/bin]:
Thecontentsof"dbhome"havenotchanged.Noneedtooverwrite.
Thecontentsof"oraenv"havenotchanged.Noneedtooverwrite.
Thecontentsof"coraenv"havenotchanged.Noneedtooverwrite.
Entrieswillbeaddedtothe/etc/oratabfileasneededby
DatabaseConfigurationAssistantwhenadatabaseiscreated
Finishedrunninggenericpartofrootscript.
Nowproduct-specificrootactionswillbeperformed.
Finishedproduct-specificrootactions.
[root@ctp-dbserverdb_1]#
8.建立数据库
//图形界面下使用oracle用户执行dbca
$dbca
//dbca建库介绍
//建立完成后重启服务器
【20130725】注:该项参数务必配置正确,不然影响数据库使用。
9.oracle单实例+ASM的监听
安装好grid后,不管是管理磁盘、磁盘数据、oralce启动与中止、监听等都可由grid来操做;
使用grid用户netca建立监听
不在介绍
4、使用grid用户平常管理ORACLE
[grid@ctp-dbserver~]$crs_stat -t
NameTypeTargetStateHost
------------------------------------------------------------
ora.DATA.dgora....up.type OFFLINEOFFLINE
ora....ER.lsnrora....er.type ONLINEONLINEctp-...rver
ora.asmora.asm.type OFFLINEOFFLINE
ora.cssdora.cssd.type ONLINEOFFLINE
ora.diskmonora....on.type OFFLINEOFFLINE
ora.evmdora.evm.type ONLINEONLINEctp-...rver
ora.onsora.ons.type OFFLINEOFFLINE
ora.zxxj.dbora....se.type OFFLINEOFFLINE
[grid@ctp-dbserver~]$
[grid@ctp-dbserver~]$crs_stat //资源项目
NAME=ora.DATA.dg
TYPE=ora.diskgroup.type
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.LISTENER.lsnr
TYPE=ora.listener.type
TARGET=ONLINE
STATE=ONLINEonctp-dbserver
NAME=ora.asm
TYPE=ora.asm.type
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.cssd
TYPE=ora.cssd.type
TARGET=ONLINE
STATE=OFFLINE
NAME=ora.diskmon
TYPE=ora.diskmon.type
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.evmd
TYPE=ora.evm.type
TARGET=ONLINE
STATE=ONLINEonctp-dbserver
NAME=ora.ons
TYPE=ora.ons.type
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.zxxj.db
TYPE=ora.database.type
TARGET=OFFLINE
STATE=OFFLINE
[grid@ctp-dbserver~]$
[grid@ctp-dbserver~]$srvctl //管理命令介绍
Usage:srvctl<command><object>[<options>]
commands:enable|disable|start|stop|status|add|remove|modify|getenv|setenv|unsetenv|config|upgrade
objects:database|service|asm|diskgroup|listener|home|ons
Fordetailedhelponeachcommandandobjectanditsoptionsuse:
srvctl<command>-hor
srvctl<command><object>-h
[grid@ctp-dbserver~]$
2.oracle+asm单实例数据库重启流程
2.1启动
[grid@ctp-dbserver~]$crs_stat -t
NameTypeTargetStateHost
------------------------------------------------------------
ora.DATA.dgora....up.typeOFFLINEOFFLINE
ora....ER.lsnrora....er.typeONLINEONLINEctp-...rver
ora.asmora.asm.typeOFFLINEOFFLINE
ora.cssdora.cssd.typeONLINEOFFLINE
ora.diskmonora....on.typeOFFLINEOFFLINE
ora.evmdora.evm.typeONLINEONLINEctp-...rver
ora.onsora.ons.typeOFFLINEOFFLINE
ora.zxxj.dbora....se.typeOFFLINEOFFLINE
[grid@ctp-dbserver~]$srvctl start asm
[grid@ctp-dbserver~]$crs_stat -t
NameTypeTargetStateHost
------------------------------------------------------------
ora.DATA.dgora....up.typeONLINEONLINEctp-...rver
ora....ER.lsnrora....er.typeONLINEONLINEctp-...rver
ora.asmora.asm.typeONLINEONLINEctp-...rver
ora.cssdora.cssd.typeONLINEONLINEctp-...rver
ora.diskmonora....on.typeOFFLINEOFFLINE
ora.evmdora.evm.typeONLINEONLINEctp-...rver
ora.onsora.ons.typeOFFLINEOFFLINE
ora.zxxj.dbora....se.typeOFFLINEOFFLINE
//若是asm磁盘启动之后,asm磁盘组DATA也成功启动,则不用执行
[grid@ctp-dbserver~]$srvctlstartdiskgroup-gDATA
//这是若是执行了上述命令,则会显示:
PRCC-1014:DATAwasalreadyrunning
PRCR-1004:Resourceora.DATA.dgisalreadyrunning
PRCR-1079:Failedtostartresourceora.DATA.dg
CRS-5702:Resource'ora.DATA.dg'isalreadyrunningon'ctp-dbserver'
//启动数据库
[grid@ctp-dbserver~]$srvctl start database -d zxxj
[grid@ctp-dbserver~]$crs_stat -t
NameTypeTargetStateHost
------------------------------------------------------------
ora.DATA.dgora....up.typeONLINEONLINEctp-...rver
ora....ER.lsnrora....er.typeONLINEONLINEctp-...rver
ora.asmora.asm.typeONLINEONLINEctp-...rver
ora.cssdora.cssd.typeONLINEONLINEctp-...rver
ora.diskmonora....on.typeOFFLINEOFFLINE
ora.evmdora.evm.typeONLINEONLINEctp-...rver
ora.onsora.ons.typeOFFLINEOFFLINE
ora.zxxj.dbora....se.typeONLINEONLINEctp-...rver
[grid@ctp-dbserver~]$
//以上说明启动成功
2.2关闭,操做顺序相反
[grid@ctp-dbserver~]$srvctl stop database -d zxxj
[grid@ctp-dbserver~]$srvctl stop diskgroup -g DATA
[grid@ctp-dbserver~]$srvctl stop asm
[grid@ctp-dbserver~]$crs_stat -t
NameTypeTargetStateHost
------------------------------------------------------------
ora.DATA.dgora....up.typeOFFLINEOFFLINE
ora....ER.lsnrora....er.typeONLINEONLINEctp-...rver
ora.asmora.asm.typeOFFLINEOFFLINE
ora.cssdora.cssd.typeONLINEOFFLINE
ora.diskmonora....on.typeOFFLINEOFFLINE
ora.evmdora.evm.typeONLINEONLINEctp-...rver
ora.onsora.ons.typeOFFLINEOFFLINE
ora.zxxj.dbora....se.typeOFFLINEOFFLINE
5、数据库备份
由于ASM管理的数据直接存储在磁盘上,平常备份通常采用RMAN备份,寒枫后续会介绍oracle11gR2数据库之RMAN备份。
参考文献:ORACLE官网手册、交易系统数据库搭建资料
如查看手册请点击:
http://docs.oracle.com/cd/E11882_01/install.112/e16773/oraclerestart.htm
近期忙于项目,博客已经近半年没有更新了,最近几个月由项目选型到方案设计,由招标文件起草到服务器选型,由服务器进场到系统部署,一步步妥而稳的进行,一每天忙而不乏的学习。终于项目定于11月5日上线,咱们执着,咱们坚信,咱们务实,咱们谨慎,预祝项目顺利上线。
寒枫最近太忙了,OCP在忙碌的过程当中已经首战告捷,接下来就是沉淀数据管理工做实际经验,固然保证数据的安全是每一个数据库管理员的第一个职责。
业余时间,寒枫仍然继续学习oracle这个神圣的机器,让咱们学习的思想像DBMS同样有条不絮的运转,将来的道路也渐行渐远。