这两天遇到客户因为误操作,将RAC环境下的所有共享存储格式化掉了,客户只有一个最近的RMAN的0级全备(无数据文件,无控制文件,无归档日志,无redo日志),需要帮忙恢复。将大致的恢复过程记录一下。
0.恢复共享存储是第一步,给存储原厂打电话,原厂推是os的问题,让给os打电话,结果只能初始化了,最后只能恢复到被识别的状态,一切从头开始。
1.因为集群软件是装在本地的,所以恢复rac的集群环境,只需要将ocr和vdisk重新配置一下,就可以了。可以执行root.sh脚本来进行重新的配置,如果中间报一个已经被配置过的提示,那就先用dd清除ocr和vdisk的信息,并删除相应的目录文件,如下:
rm -rf /usr/tmp/.oracle /var/tmp/.oracle /tmp/.oracle /etc/oracle/* /var/opt/oracle/*
rm -rf /etc/init.cssd /etc/init.crs* /etc/init.evmd /etc/init.d/init.cssd /etc/init.d/init.crs
rm -rf /etc/init.d/init.crsd /etc/init.d/init.evmd /etc/rc3.d/K96init.crs /etc/rc3.d/S96init.crs
rm -rf /etc/rc.d/rc2.d/K96init.crs /etc/rc.d/rc2.d/S96init.crs
2.恢复完集群环境之后,开始恢复数据库。因为询问到客户有去年年底的一个RMAN的0级全备,以及控制文件的快照没有放到共享存储上,故可以采用重建控制文件+restore备份的方法来恢复。中途遇到很多问题,因为所有的日志备份均放到共享存储下的,故这次恢复在recover的步骤时是没有日志用来补充的。所以restore databse until 时间后,再recover,再alter database open resetlogs后,会报一个需要恢复数据文件的错误提示,操作的时候运气不好,刚好遇到的是需要恢复datafile 1,再折腾了几个小时候,终于发现按照正常的手段是行不通的.
3.因为没有日志,无法使得数据库达到一致性,所以只有采取修改隐藏参数的办法来忽略数据库的不一致,来强行打开数据库.先将数据库打到mount状态,在做完restore,recover之后,将隐藏参数修改 alter system set "_allow_resetlogs_corruption"=true scope=spfile;再shutdown数据库,启动到mount状态之后,alter database open resetlogs; resetlogs打开数据库后,运气仍然不是太好,又遇到了ORA-00600 2662号的错误.
4. 当使用修改_allow_resetlogs_corruption ,再打开数据库时遇到了ORA-00600 2662号的错误, 如果SCN相差不多,可以通过多次重起数据库解决 ,但是这次遇到的SCN相差很大(通过查v$datafile和v$datafile_header的CHECKPOINT_CHANGE#来判断),这个时候只有再修改另外一个隐藏参数 _minimum_giga_scn来解决问题._minimum_giga_scn的作用是推进SCN号,该参数值的单位是billion,也就是说设置了该参数后,SCN号会变成XX* (1024*1024*1024) ,XX可以通过2662的几个参数来确定. 2662后的参数[2662],[a],[b],[c],[d],[e]…[a] Current SCN WRAP,[b] Current SCN BASE,[c] dependent SCN WRAP,[d] dependent SCN BASE,[e] Where present this is the DBA where the dependent SCN came from.
5.当修改了2个隐藏参数之后,数据库终于能启动了,但是alert日志还是会报一些600的错误,暂时忽略.用exp(expdp可能会报错)将数据全部导出,重建新的实例,再用imp导入数据到新的库中.exp的时候需要注意一个参数compress,这个参数可以降低HWM,使的imp的时候,时间相对尽量少一些.
posted @
2012-04-12 00:24 xrzp 阅读(392) |
评论 (0) |
编辑 收藏
早上做个实验,update数据的时候报错ora-30036:无法按8扩展段(在还原表空间‘undotbs_new’中)
1.查询了一下undo表空间的使用,发现已经超过了80%
SELECT a.tablespace_name as tablespace_name,
to_char(b.total/1024/1024,999999.99) as Total,
to_char((b.total-a.free)/1024/1024,999999.99) as Used,
to_char(a.free/1024/1024,999999.99) as Free,
to_char(round((total-free)/total,4)*100,999.99) as Used_Rate
FROM (SELECT tablespace_name, sum(bytes) free FROM DBA_FREE_SPACE GROUP BY tablespace_name) a,
(SELECT tablespace_name, sum(bytes) total FROM DBA_DATA_FILES GROUP BY tablespace_name ) b
WHERE a.tablespace_name=b.tablespace_name
AND a.tablespace_name='UNDOTBS_NEW'
ORDER BY a.tablespace_name;
2.将undo表空间大小重新加大点,解决问题~
alter database datafile 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SUREDD\UNTOTBS_NEW_01.DBF' resize 2048M;
posted @
2011-11-07 10:30 xrzp 阅读(18058) |
评论 (0) |
编辑 收藏
v$sqltext:存储的是完整的SQL,SQL被分割
v$sqlarea:存储的SQL 和一些相关的信息,比如累计的执行次数,逻辑读,物理读等统计信息.v$sqlarea 忽略了执行计划等差异,只是在形式上sql文本看起来一样.相当于做了个聚合,是多个不同执行计划的sql的聚合和累计信息
v$sql:存储的是具体的SQL 和执行计划相关信息,v$sqlarea 可以看做 v$sql 根据 sqltext 等 做了 group by 之后的信息
v$sql_plan:代表了具体的sql的执行计划,通过下面3个字段做连接(与v$sql)
ADDRESS RAW(4),HASH_VALUE NUMBER,CHILD_NUMBER NUMBER
posted @
2011-11-07 00:00 xrzp 阅读(346) |
评论 (0) |
编辑 收藏
这几天安装oracle,检查包的时候,发现一些包没有装上,使用rpm来装的时候,又发现包的依耐性很重,所以就搭建一个本地的源,使用yum install来安装.
1.挂载安装介质
mount /dev/cdrom /mnt/cdrom
如果是实体机:
mount -o loop 镜像所在目录 挂载点
2.vi /etc/yum.repos.d/server.repo
[dange] #随意填
name=red hat #随意填
baseurl=file:///mnt/cdrom/RedHat/Server #光盘挂载,Server目录所在路径
enable=1 #yum开关
gpgcheck=1 #是否检查密钥
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release #密钥所在地
3.如果安装软件包提示没有key的话导入key
cd /mnt/cdrom
rpm --import RPM-GPG-KEY-redhat-release //安装验证文件,导入key
yum list //列出仓库中的所有软件,查看yum是否搭建成功
yum clean all //清空yum仓库
4.OK,可以直接使用yum install了
posted @
2011-10-20 09:22 xrzp 阅读(408) |
评论 (0) |
编辑 收藏
1.现象:装clusterware,执行第二个脚本的时候可能会报错
Running vipca(silent) for configuring nodeapps
/u01/app/oracle/crs/jdk/jre//bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory
2. 解决方案:分别修改 $CRS_HOME/bin 目录下的srvctl和vipca文件,在vipca文件ARGUMENTS=""行之前和srvctl文件的export LD_ASSUME_KERNEL行之后增加 unset LD_ASSUME_KERNEL 语句.
修改之后再用root用户执行vipca就可以了.
posted @
2011-10-16 23:31 xrzp 阅读(312) |
评论 (0) |
编辑 收藏
Mount Options for Oracle files when used with NAS devices [ID 359515.1] |
|
| 修改时间 23-SEP-2011 类型 BULLETIN 状态 PUBLISHED | |
In this Document
Purpose
Scope and Application
Mount Options for Oracle files when used with NAS devices
RAC
Single Instance
References
Applies to:
Oracle Server - Enterprise Edition - Version: 10.1.0.2 to 11.2.0.2 - Release: 10.1 to 11.2
Information in this document applies to any platform.
Oracle Clusterware, Oracle Real Application Clusters, NASPurpose
The purpose of this bulletin is to document the options with which the NAS systems should be mounted. This note does not cover the new dNFS feature that was introduced in 11g.
Scope and Application
This document is relevant to all environments using Oracle Clusterware & RAC.
Mount Options for Oracle files when used with NAS devices
RAC
In the table below
- Binaries is the shared mount points where the Oracle Home and CRS_HOME is installed.
- Datafiles includes Online Logs, Controlfile and Datafiles
- nfsvers and vers are identical on those OS platforms that has nfsvers. The ver option is an alternative to the nfsvers option. It is included for compatibility with other operating systems
- Please note that the mount options on each of the following cells are applicable only to those type of files listed in the column heading.
- For RMAN backup sets, image copies, and Data Pump dump files, the "NOAC" mount option should not be specified - that is because RMAN and Data Pump do not check this option and specifying this can adversely affect performance.
Operating System | Mount options for Binaries ## | Mount options for Oracle Datafiles | Mount options for CRS Voting Disk and OCR |
Sun Solaris * | rw,bg,hard,nointr,rsize=32768, wsize=32768,proto=tcp,noac, vers=3,suid | rw,bg,hard,nointr,rsize=32768, wsize=32768,proto=tcp,noac, forcedirectio, vers=3,suid | rw,bg,hard,nointr,rsize=32768, wsize=32768,proto=tcp,vers=3, noac,forcedirectio |
AIX (5L) ** | rw,bg,hard,nointr,rsize=32768, wsize=32768,proto=tcp, vers=3,timeo=600 | cio,rw,bg,hard,nointr,rsize=32768, wsize=32768,proto=tcp,noac, vers=3,timeo=600 | cio,rw,bg,hard,intr,rsize=32768, wsize=32768,tcp,noac, vers=3,timeo=600 |
HPUX 11.23 *** -- | rw,bg,vers=3,proto=tcp,noac, hard,nointr,timeo=600, rsize=32768,wsize=32768,suid | rw,bg,vers=3,proto=tcp,noac, forcedirectio,hard,nointr,timeo=600, rsize=32768,wsize=32768,suid | rw,bg,vers=3,proto=tcp,noac, forcedirectio,hard,nointr,timeo=600 ,rsize=32768,wsize=32768,suid |
Windows | Not Supported | Not Supported | Not Supported |
Linux x86 # ****
| rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp, vers=3, timeo=600, actimeo=0 | rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,actimeo=0, vers=3,timeo=600 | rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,noac,actimeo=0, vers=3,timeo=600 |
Linux x86-64 # ****
| rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,vers=3, timeo=600, actimeo=0 | rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,actimeo=0, vers=3,timeo=600 | rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,noac,vers=3, timeo=600,actimeo=0 |
Linux - Itanium | rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,vers=3, timeo=600, actimeo=0 | rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,actimeo=0, vers=3,timeo=600 | rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,noac,vers=3, timeo=600,actimeo=0 |
* NFS mount option “forcedirectio” is required on Solaris platforms when mounting the OCR/CRS files when using Oracle 10.1.0.4 or 10.2.0.2 or later (Oracle unpublished bug 4466428)
** AIX is only supported with NAS on AIX 5.3 TL04 and higher with Oracle 10.2.0.1 and later (NetApp)
*** NAS devices are only supported with HPUX 11.23 or higher ONLY
**** As per BUG 11812928, the 'intr' & 'nointr' are deprecated in OEL 5.6 kernels and up including Oracle Linux 6. It is harmless to still include it, but the "NFS: ignoring mount option: nointr" will appears. This message can be ingnored.
# These mount options are for Linux kernels 2.6 and above for older kernels please check Note 279393.1
Due to Unpublished bug 5856342, it is necessary to use the following init.ora parameter when using NAS with all versions of RAC on Linux (x86 & X86-64 platforms) until 10.2.0.4. This bug is fixed and included in 10.2.0.4 patchset.
filesystemio_options = DIRECTIO
Single Instance
Operating System | Mount options for Binaries | Mount options for Oracle Datafiles |
Sun Solaris * (8, 9, 10) | rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,proto=tcp,suid | rw,bg,hard,rsize=32768,wsize=32768,vers=3,[forcedirectio or llock],nointr,proto=tcp,suid |
AIX (5L) ** | rw,bg,hard,rsize=32768,wsize=32768,vers=3,intr,timeo=600,proto=tcp | rw,bg,hard,rsize=32768,wsize=32768,vers=3,cio,intr,timeo=600,proto=tcp |
HPUX 11.23 **** | rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,proto=tcp,suid | rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,proto=tcp, suid, forcedirectio |
Windows | Not Supported | Not Supported |
Linux x86 # | rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp | rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp,actimeo=0* |
Linux x86-64 # | rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp | rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp,actimeo=0* |
Linux - Itanium | rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp | rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp |
* actime=0 or noac can be used
References
http://now.netapp.com/Knowledgebase/solutionarea.asp?id=kb7518
http://linux.oracle.com/pls/apex/f?p=102:2:3947951439689189::NO::P2_VC_ID:424
相关内容
|
posted @
2011-10-16 23:16 xrzp 阅读(1529) |
评论 (0) |
编辑 收藏
1.检查时区:
检查/etc/sysconfig/clock设置:
ZONE="Asia/Shanghai"(Linux会拷贝/usr/share/zoneinfo/Asia/Shanghai 到/etc/locatime作为本地时区,如果我们需要改变时区,那么只需要修改/etc/sysconfig/clock,并且将对应的/usr/share/zoneinfo/Asia的时区文件拷贝成/etc/localtime即可)
UTC=false
ARC=false
2.安装NTP包:
rpm -ivh ntp-xxxxxx.rpm
或者:
yum install ntp
3.编辑/etc/ntp.conf文件:
服务端:
server 127.127.1.0
fudge 127.127.1.0 stratum 11
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
客户端:
server 192.168.0.11 prefer #192.168.0.11为服务端的ip地址
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
4.重启ntp服务:
service ntpd restart
5.等待5分钟,测试客户端更新时间:
ntpdate 192.168.0.11
Oct 16 21:09:28 ntpdate[8316]: step time server 192.168.0.11 offset -1791.709393 sec
6.在客户端将更新时间加入crontab:
(1).cp /usr/sbin/ntpdate /usr/bin/
(2).crontab –e
加入
*/1 * * * * /usr/sbin/ntpdate 192.168.0.11 ; hwclock –w
posted @
2011-10-16 23:14 xrzp 阅读(414) |
评论 (0) |
编辑 收藏
gunzip xxx.cpio.gz
cpio -idcmv < xxx.cpio
posted @
2011-10-16 23:02 xrzp 阅读(452) |
评论 (1) |
编辑 收藏
1.查看版本
crsctl query crs softwareversion
crsctl query crs activeversion
2.管理
srvctl start nodeapps -n <node1 hostname>
srvctl start nodeapps -n <node2 hostname>
srvctl start asm -n <node1 hostname>
srvctl start asm -n <node2 hostname>
srvctl start database -d <database name>
srvctl start service -d <database name> -s <service name>
crs_stat -t
srvctl stop service -d <database name> -s <service name>
srvctl stop database -d <database name>
srvctl stop asm -n <node1 hostname>
srvctl stop asm -n <node2 hostname>
srvctl stop nodeapps -n <node1 hostname>
srvctl stop nodeapps -n <node2 hostname>
crs_stat -t
posted @
2011-10-16 23:01 xrzp 阅读(257) |
评论 (0) |
编辑 收藏
当服务器没有装图形化界面的时候,如不能使用xhost之类的命令,就不能使用vnc了,那这个时候可以使用xmanager来代替
1.网上可以下载一个xmanager企业版,下载完后打开Xbrowser,在help-->about Xbrowser中输入注册码
2.在服务器端
DISPLAY=192.168.X.X:0.0
export DISPLAY
echo $DISPLAY
3.使用xmanager的xshell来打开图形化界面.(有可能会提醒运行一个rootpre之类的脚本)
posted @
2011-10-14 01:35 xrzp 阅读(503) |
评论 (0) |
编辑 收藏
在Redhat5之前通过/etc/sysconfig/rawdevices配置raw的控制文件,通过/etc/init.d/rawdevices来管理raw设备的启动和关闭.
在Redhat5之后,需要编辑/etc/udev/rules.d/60-raw.rules 这个文件.
1.假设已经把一个硬盘新建了几个区
fdisk -l /dev/sdc
/dev/sdc1
/dev/sdc2
/dev/sdc3
2.修改/etc/udev/rules.d/60-raw.rules
添加:
ACTION=="add", KERNEL=="sdc1",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdc2",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdc3",RUN+="/bin/raw /dev/raw/raw3 %N"
假设这个设备是给oracle用的,那再加上权限
KERNEL=="raw[1-3]*", NAME="raw/%k" OWNER="oracle" GROUP="oinstall", MODE="0660"
3.修改完之后重启服务
start_udev
4.查看
raw -qa 或者 ls -lrt /dev/raw/
5.取消映射
raw /dev/raw/rawX 0 0
posted @
2011-10-14 01:28 xrzp 阅读(445) |
评论 (0) |
编辑 收藏
1.停止数据库
2.停止Listener
3.用su或者重新登录到root将oracle安装目录删除
4.将/usr/bin下的文件删除(删除这三个文件后,Oracle就不能使用了)
rm /usr/local/bin/dbhome
rm /usr/local/bin/oraenv
rm /usr/local/bin/coraenv
5.将/etc/oratab删除
6.将/etc/oraInst.loc删除
7.将oracle用户删除(若要重新安装,可以不删除)
8.将用户组删除(若要重新安装,可以不删除)
posted @
2011-10-14 01:22 xrzp 阅读(343) |
评论 (1) |
编辑 收藏