安裝oracle 11gR2單實例+ASM

安裝oracle11gR2單實例+ASM,讓新手走向數據庫管理員

一、介紹
因業務需要,最近在主系統的基礎上搭建一套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
二、安裝實施準備
1.創建ORACLE用戶和組成員

groupadd oinstall

groupadd dba

groupadd oper

groupadd asmadmin

groupadd asmdba

groupadd asmoper

useradd -g oinstall -G dba,asmdba,oper -d /home/oracle oracle

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,DATA1、DATA2、DATA3存放oracle數據;
//本文分區如下:/u0110G,/u0220G,ASM10G*3DATA1、DATA2、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


三、安裝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

224640939.jpg

5.安裝grid組件
//使用XmanagerEnterprise3的Xbrowser圖形連接服務器

224739409.jpg



















//圖形界面grid用戶登錄,進入/u02/

#unzip p10404530_112030_Linux-x86-64_3of7.zip

#cd grid
#./runinstall

224846967.jpg
224944388.jpg

//安裝參數說明:

225109965.jpg

225125636.jpg

225204699.jpg

225213195.jpg

225230748.jpg

225238135.jpg


225356377.jpg


225408158.jpg

225416512.jpg

225434867.jpg

225448568.jpg

225500383.jpg

225511901.jpg

225549989.jpg

225635776.jpg

[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即可
225728356.jpg

225740580.jpg

225814479.jpg

225845404.jpg

225857252.jpg

//注意:如果上述在執行./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

230000643.jpg

230022161.jpg

230038606.jpg

//如果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軟件安裝介紹

230319674.jpg

230355636.jpg

230416566.jpg

230425158.jpg

230434560.jpg

230443498.jpg

230451465.jpg

230504407.jpg

230514767.jpg

230521410.jpg

230532839.jpg

230541170.jpg


[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建庫介紹
//創建完成後重啓服務器

230648814.jpg

230657554.jpg


230706843.jpg

230740685.jpg

230757733.jpg

230819901.jpg

230828754.jpg

230835265.jpg

230842256.jpg

230850949.jpg

【20130725】注:該項參數務必配置正確,否則影響數據庫使用。

230857627.jpg

230907436.jpg

230915480.jpg

230928609.jpg

230936776.jpg

230944548.jpg

230953142.jpg

231010223.jpg

9.oracle單實例+ASM的監聽
安裝好grid後,無論是管理磁盤、磁盤數據、oralce啓動與停止、監聽等均可由grid來操作;
使用grid用戶netca創建監聽
不在介紹
四、使用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

五、數據庫備份
因爲ASM管理的數據直接存儲在磁盤上,日常備份一般採用RMAN備份,寒楓後續會介紹oracle11gR2數據庫之RMAN備份。


參考文獻:ORACLE官網手冊、交易系統數據庫搭建資料

如查看手冊請點擊:

http://docs.oracle.com/cd/E11882_01/install.112/e16773/oraclerestart.htm


近期忙於項目,博客已經近半年沒有更新了,最近幾個月由項目選型到方案設計,由招標文件起草到服務器選型,由服務器進場到系統部署,一步步妥而穩的進行,一天天忙而不的學習。終於項目定於11月5日上線,我們執着,我們堅信,我們務實,我們謹慎,預祝項目順利上線。
寒楓最近太忙了,OCP在忙碌的過程中已經首戰告捷,接下來就是沉澱數據管理工作實際經驗,當然保證數據的安全是每個數據庫管理員的第一個職責。

業餘時間,寒楓仍然繼續學習oracle這個神聖的機器,讓我們學習的思想像DBMS一樣有條不絮的運轉,未來的道路也漸行漸遠。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章