疑难问题嘛! 我已经熟得不能再熟了。基本上没有疑难问题了。
不过可以总结下,遇到的疑难问题。
1 首先是环境的问题,涉及到监听,实列名字,环境变量里面的。
2 SYS密码不一致的问题,虽然可以在备库上重建一样的密码,只是格式不一致。最好从主库上复制过去。
3 目录不一致,有的时候必须改变目录,那么相应的日志转换,数据转换目录写法
4 使用duplicate 复制备库时候经常因为某个参数不合适而重新来过,一不小心就不知道在主库还是备库了。千万不能在RMAN上使用SQL命令。
5 搭建备库的时候,要注意清理主库上的数据。
6 采用RMAN备份方式最后要打包当前的归档日志
7 采用RMAN备份的时候,在备库恢复,备份文件必须跟主库备份目录一致,否则控制文件是找不到的。
其实ADG已经非常成熟的技术了!
ORACLE 11G RAC的集群 确实很多坑!
这些坑还是先买本书来看才好,比较书上说的比较全面。而不是直接从网上搞来一篇安装文档。
1 首先第一个坑是SSH 认证问题。可能这个涉及到系统版本不同吧。有的时候你在系统上人工搞的SSH,而在图形界面中死活通过不了。一般使用干净的系统,ORACLE LINUX 6.5 然后在图形界面上自动安装进去。
2 最后一步执行ROOT.SH 脚本,该脚本要执行很长时间,中间发生错误后,需要删除集群软件,重新安装过,为此特别好时间。这主要是前面某些配置没过! 另外这个脚本执行很耗时间,在虚拟机上需要2个小时。
3 集群的启动和关闭,每个节点要一个个来启动和关闭。
4 SPRFILE参数文件存放在ASM盘上。ASM实列起不来就无法访问SPFILE文件,所以比较麻烦。
收起当使用官方的DG切换命令,切换失败的时候,如何准确的知道,切换到了哪个状态,为什么失败。
在12c 多租户的模式下,rac和adg有什么要注意的,或者要避免的坑?
虽然已经很完善了,但也遇到过很多问题,这里分享几个脚本和诊断方法吧。
1、 自动hang信息收集脚本,一般提交SR就要求提交systemstate dump的
hangcol.pl:
use strict;
use POSIX ':signal_h';
use Getopt::Long;
Getopt::Long::Configure qw(no_ignore_case);
use POSIX qw(strftime);
use POSIX ':signal_h';
my %opt;
my $interval = 30;
my $workdir="/home/oracle/hangcol";
&get_options();
&wait_until_unhealth();
sub wait_until_unhealth() {
eval {
while (1) {
if(&hang_check()==1){
`sh $workdir/db_check.sh DUMP`;
sleep(30);
`sh $workdir/db_check.sh DUMP`;
sleep(1000);
}
sleep($interval);
}
}
}
sub hang_check {
my $strdate=strftime "%m-%d %H:%M:%S", localtime;
my $sesscount=0;
my $mask = POSIX::SigSet->new( SIGALRM ); # signals to mask in the handler
my $action = POSIX::SigAction->new(
sub { die "connect timeout\\n" }, # the handler code ref
$mask,
# not using (perl 5.8.2 and later) 'safe' switch or sa_flags
);
my $oldaction = POSIX::SigAction->new();
sigaction( SIGALRM, $action, $oldaction );
eval {
eval {
alarm(6); # seconds before time out
$sesscount=`sh $workdir/db_check.sh COUNT`;
if($sesscount>=200 ){
die "dg_health_check error.";
}
};
alarm(0); # cancel alarm (if connect worked fast)
die "$@\\n" if $@; # connect died
};
sigaction( SIGALRM, $oldaction); # restore original signal handler
if ( $@ ) {
print "$strdate " ."hang detected\\n";
return 1;
}else{
return 0;
}
}
sub print_usage {
#print BLUE(),BOLD(),<<EOF,RESET();
print <<EOF;
==========================================================================================
Info :
Created By noodba (www.noodba.com) .
Usage :
Command line options :
-h,--help Print Help Info.
-i,--interval Time(second) Interval(default 30).
-d,--workdir workdir(default "/home/oracle/hangcol").
Sample :
EOF
exit;
}
sub get_options {
# Get options info
GetOptions(
\\%opt,
'h|help', # OUT : print help info
'i|interval=i', # IN : time(second) interval
'd|workdir=s', # IN : workdir
) or &print_usage();
if ( !scalar(%opt) ) {
&print_usage();
}
# Handle for options
$opt{'h'} and &print_usage();
$opt{'i'} and $interval = $opt{'i'};
$opt{'d'} and $workdir = $opt{'d'};
}
2 OSW http://www.talkwithtrend.com/Article/215881
3 dataguard的statspack,您可以参考文档 Installing and Using Standby Statspack in 11g [ID 454848.1]
4 noodba:一个即时的oracle诊断工具,见http://www.noodba.com/?p=400 ,收集到的oracle系统级别的一些信息