标签归档:工作

从11.1.0.7 32bit ASM OMF rman backup恢复数据到11.1.0.7 64bit filesystem OMF

 

准备工作
安装64bit软件
Install 11.1.0.6 db software
Upgrate to 11.1.0.7

复制rman备份到新机器
复制init.ora到新机器,修改相关路径如下

*.control_files=’/apps/oradata/DESTDB/controlfile/control01.ctl’
*.db_create_file_dest=’/apps/oradata’
*.db_create_online_log_dest_1=’/apps/oradata’

开始恢复
继续阅读

PRVF-5436 : The NTP daemon running on one or more nodes lacks the slewing option “-x” -

During ClusterWare installation , show following errors:

Network Time Protocol (NTP) – This task verifies cluster time synchronization on clusters that use Network Time Protocol (NTP). Error:
-
PRVF-5436 : The NTP daemon running on one or more nodes lacks the slewing option “-x” – Cause: NTP daemon on one or more nodes lacked slewing option. – Action: Shut down and restart the NTP daemon after setting the slewing option as follows: For Linux, edit /etc/sysconfig/ntpd and add -x to the command line option. For SUSE Linux, edit /etc/sysconfig/ntp and add -x to the OPTIONS variable. For AIX, edit /etc/rc.tcpip and add -x to the command line option. For HP-UX, edit /etc/rc.config.d/netdaemons and add -x to the command line option. For Solaris, edit /etc/inet/ntp.conf and add ‘slewalways yes’ and ‘disable pll’ in ntp.conf. 继续阅读

v$sql_plan format

set lines 121
set pages 999
col sql_text format a80
select sql_text from
v$sqltext_with_newlines
where hash_value=4041323804
order by piece;
set heading off
select ‘——————————————————————————–’ from dual
union all
select ‘| Operation                                                    | PHV/Object Name     | Rows  | Bytes| Cost   |’ as "Optimizer Plan:" from dual
union all
select ‘——————————————————————————–’ from dual
union all
select *
from (select
rpad(‘|’||substr(lpad(‘ ‘,1*(depth-1))||operation||
decode(options, null,”,’ ‘||options), 1, 62), 63, ‘ ‘)||’|'||
rpad(decode(id, 0, ‘—– ‘||to_char(hash_value)||’ —–’
, substr(decode(substr(object_name, 1, 7), ‘SYS_LE_’, null, object_name)
||’ ‘,1, 20)), 21, ‘ ‘)||’|'||
lpad(decode(cardinality,null,’ ‘,
decode(sign(cardinality-10000), -1, cardinality||’ ‘,
decode(sign(cardinality-1000000), -1, trunc(cardinality/1000)||’K',
decode(sign(cardinality-1000000000), -1, trunc(cardinality/1000000)||’M',
trunc(cardinality/1000000000)||’G')))), 7, ‘ ‘) || ‘|’ ||
lpad(decode(bytes,null,’ ‘,
decode(sign(bytes-1024), -1, bytes||’ ‘,
decode(sign(bytes-1048576), -1, trunc(bytes/1024)||’K',
decode(sign(bytes-1073741824), -1, trunc(bytes/1048576)||’M',
trunc(bytes/1073741824)||’G')))), 6, ‘ ‘) || ‘|’ ||
lpad(decode(cost,null,’ ‘,
decode(sign(cost-10000000), -1, cost||’ ‘,
decode(sign(cost-1000000000), -1, trunc(cost/1000000)||’M',
trunc(cost/1000000000)||’G'))), 8, ‘ ‘) || ‘|’ as "Explain plan"
from v$sql_plan
where hash_value = 3918835632)
union all
select ‘——————————————————————————–’ from dual;

java.lang.UnsatisfiedLinkError: libawt.so: libXt.so.6 Missing

 

When installing Oracle Application Server 10.1.2.0.2 32bit on a 64bit Exdata Linux Machine , hit following errors:

Exception java.lang.UnsatisfiedLinkError: /tmp/OraInstall2011-05-16_03-04-14AM/jre/1.4.2/lib/i386/libawt.so: libXt.so.6: cannot open shared object file: No such file or directory occurred..
java.lang.UnsatisfiedLinkError: /tmp/OraInstall2011-05-16_03-04-14AM/jre/1.4.2/lib/i386/libawt.so: libXt.so.6: cannot open shared object file: No such file or directory
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477)
        at java.lang.Runtime.loadLibrary0(Runtime.java:788)
        at java.lang.System.loadLibrary(System.java:834)

……

[usr01@machine01 i386]$ ldd libawt.so
ldd: warning: you do not have execution permission for `./libawt.so’
        linux-gate.so.1 =>  (0xffffe000)
        libmlib_image.so => not found
        libjvm.so => not found
        libXp.so.6 => /usr/lib/libXp.so.6 (0xf7cbc000)
        libXt.so.6 => not found
        libXext.so.6 => not found
        libXtst.so.6 => /usr/lib/libXtst.so.6 (0xf7cb5000)
        libX11.so.6 => not found
        libm.so.6 => /lib/libm.so.6 (0xf7c8e000)
        libdl.so.2 => /lib/libdl.so.2 (0xf7c8a000)
        libjava.so => not found
        libc.so.6 => /lib/libc.so.6 (0xf7b43000)
        /lib/ld-linux.so.2 (0x0094f000)
        libX11.so.6 => not found
        libXext.so.6 => not found
        libXau.so.6 => not found
        libX11.so.6 => not found
        libXext.so.6 => not found

check google and metalink , this error is caused by a 32bit library miss . (iAAS10.1.2.0.2 only has a 32bit version , when installing in a 64bit machine , just execute linux32 bash before runInstaller is ok)

solution:
install missing 32bit lib in 64bit machine.

rpm -ivh libXau-1.0.1-3.1.i386.rpm
rpm -ivh libXdmcp-1.0.1-2.1.i386.rpm
rpm -ivh libX11-1.0.3-11.el5.i386.rpm
rpm -ivh libSM-1.0.1-3.1.i386.rpm
rpm -ivh libICE-1.0.1-2.1.i386.rpm
rpm -ivh libSM-1.0.1-3.1.i386.rpm
rpm -ivh libXt-1.0.2-3.2.el5.i386.rpm
rpm -ivh libXext-1.0.1-2.1.i386.rpm

ref:
NOTE:726451.1 – Oracle Client Install issue on Linux Red Hat 5, gives "libXp.so.6 is missing" error message
JAVA.LANG.UNSATISFIEDLINKERROR Error Running Net Configuration Assistant [ID 1066299.1]

clusterware on 2nd node can’t startup after Oracle 11.1.0.6 Upgrade to 11.1.0.7

after upgrade from Oracle 11.1.0.6 to Oracle 11.1.0.7, the clusterware can’t startup after run the $ORA_CRS_HOME/install/root111.sh.

scripts output:

# /crs/11.1.0/bin/crsctl stop crs
Stopping resources.
This could take several minutes.
Successfully stopped Oracle Clusterware resources
Stopping Cluster Synchronization Services.
Shutting down the Cluster Synchronization Services daemon.
Shutdown request successfully issued.
# /crs/11.1.0/install/root111.sh
Creating pre-patch directory for saving pre-patch clusterware files
Completed patching clusterware files to /crs/11.1.0
Relinking some shared libraries.
Relinking of patched files is complete.
Preparing to recopy patched init and RC scripts.
Recopying init and RC scripts.
Startup will be queued to init within 30 seconds.
Starting up the CRS daemons.
Waiting for the patched CRS daemons to start.
This may take a while on some systems.
.
.
.
.
.
.
Timed out waiting for the CRS daemons to start. Look at the system message file and the CRS log files for diagnostics.

check $ORA_CRS_HOME/log/hostname/alerthostname.log, no usefule info.
check ps -ef|grep crs result, find that the evmd command is running.
check $ORA_CRS_HOME/log/hostname/evmd/evmd.log, find follwing error message:

2010-07-15 05:50:22.351: [    EVMD][4143711936] EVMD Starting
2010-07-15 05:50:22.351: [    EVMD][4143711936] Initializing OCR
2010-07-15 05:50:22.368: [    EVMD][4143711936] Get OCR context succeeded
2010-07-15 05:50:22.369: [ COMMCRS][83372976]clsc_connect: (0×9857018) no listener at (ADDRESS=(PROTOCOL=ipc)(KEY=OCSSD_LL_stase09_))

2010-07-15 05:50:22.370: [ CSSCLNT][4143711936]clsssInitNative: failed to connect to (ADDRESS=(PROTOCOL=ipc)(KEY=OCSSD_LL_stase09_)), rc 9

2010-07-15 05:50:22.370: [    EVMD][4143711936] EVMD waiting for CSS to be ready err = 3
2010-07-15 05:50:23.373: [ COMMCRS][83372976]clsc_connect: (0×9857018) no listener at (ADDRESS=(PROTOCOL=ipc)(KEY=OCSSD_LL_stase09_))

2010-07-15 05:50:23.373: [ CSSCLNT][4143711936]clsssInitNative: failed to connect to (ADDRESS=(PROTOCOL=ipc)(KEY=OCSSD_LL_stase09_)), rc 9

2010-07-15 05:50:23.374: [    EVMD][4143711936] EVMD waiting for CSS to be ready err = 3

so the EVMD is waiting for CSSD to startup.

then check the CSSD log files in $ORA_CRS_HOME/hostname/cssd/ocssd.log
find following error message:

[    CSSD]2010-07-15 06:48:22.354 [4033264560] >TRACE:   kgzf_dskm_conn4: unable to connect to master diskmon in 60260 msec

[    CSSD]2010-07-15 06:48:22.354 [4033264560] >TRACE:   kgzf_send_main1: connection to master diskmon timed out

[    CSSD]2010-07-15 06:48:22.354 [4012284848] >TRACE:   KGZF: Fatal diskmon condition, IO fencing is not available. For additional error info look at the master diskmon log file (diskmon.log)

 so , continue , check the dismon.log   $ORA_CRS_HOME/log/hostname/diskmon/diskmon.log

[ DISKMON]

        I/O Fencing and SKGXP HA monitoring daemon — Version 1.0.0.0
        Process 2323 started on 07/15/2010 at 07:00:02.867

[ DISKMON] 07/15/2010 07:00:02.893 [2323:4143413984] dskm main11: skgznp_create(default pipe) failed with error 56810
[ DISKMON] 07/15/2010 07:00:02.894 [2323:4143413984] dskm_main11: error 56810 at location skgznpcre3 – bind() – Address already in use
[ DISKMON]
        Process 2323 exiting on 07/15/2010 at 07:00:02.895

check google and metalink for error code 56810, no result .
from the error message , I think the error is caused by network bind errors,  then try to strace diskmon
strace diskmon output :
bind(5, {sa_family=AF_FILE, path=”/tmp/.oracle_master_diskmon”}, 110) = -1 EADDRINUSE (Address already in use)
close(5)                                = 0
gettimeofday({1279202402, 893531}, NULL) = 0
futex(0x96103fc, 0×4 /* FUTEX_??? */, 1) = 1
gettimeofday({1279202402, 894007}, NULL) = 0
futex(0x96103fc, 0×4 /* FUTEX_??? */, 1) = 1
unlink(“/tmp/.oracle_master_diskmon”)   = -1 EPERM (Operation not permitted)
rt_sigprocmask(SIG_BLOCK, [ALRM], NULL, 8) = 0
rt_sigaction(SIGALRM, {SIG_DFL}, {0x1e5dcf4, ~[ILL ABRT BUS FPE KILL SEGV USR2 STOP XCPU XFSZ SYS RTMIN RT_1], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x9b5880}, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [ALRM], NULL, 8) = 0
gettimeofday({1279202402, 895365}, NULL) = 0
futex(0x96103fc, 0×4 /* FUTEX_??? */, 1) = 1
exit_group(1)                           = ?

check socket file “/tmp/.oracle_master_diskmon” , find the file is created long ago, then delete it. then rerun root111.sh,  the upgrade root script complete successfully.

also can check /var/tmp/.oracle  , there are other socket file used by oracle cluster ware.

Oracle 11.1.0.7 , Single Instance, Clusterware, Giving up: Oracle CSS stack appears NOT to be running.

今天恢复旧的11.1.0.7单机ASM数据库环境,用来恢复原有的11.1.0.7的数据库备份,按照以前的方法操作如下:

1.清空当前clusterware环境:

rm -rf /etc/oracle
rm -rf /var/tmp/.oracle/*
rm -rf /tmp/.oracle
rm -rf /home/user01/oracle/11g/Clusterware
rm -rf /home/user01/oracle/11g/checkpoints

# vi /etc/inittab ,去掉最后的crs启动命令。

# init q;

# mv $ORA_CRS_HOME to a new location

# reboot

2.重新配置11.1.0.7 single instance clusterware [为了使用ASM]

#/home/user01/oracle/11g/crs_11gProd/bin/localconfig reset

这一步运行出错,报错如下:

Successfully accumulated necessary OCR keys.
Creating OCR keys for user ‘root’, privgrp ‘root’..
Operation successful.
Configuration for local CSS has been initialized

Cleaning up Network socket directories
Setting up Network socket directories
Adding to inittab
Startup will be queued to init within 30 seconds.
Checking the status of new Oracle init process…
Expecting the CRS daemons to be up within 600 seconds.
ls /home/user01/oracle/11g/crs_11gProd/cdata/localhost/local.ocrGiving up: Oracle CSS stack appears NOT to be running.
Oracle CSS service would not start as installed
Automatic Storage Management(ASM) cannot be used until Oracle CSS service is started

ps -ef|grep crs, 没有进行在运行。

查看 $ORA_CRS_HOME/log/hostname/alertxxxx.log文件,未发现错误。查看Crsd和cssd目录的log,没有发现错误。

重新清空环境,再次操作,错误依旧。

查看/var/log/message文件,发现如下log:

Apr  7 05:30:08 host01 logger: Waiting for filesystem containing /home/user01/oracle/crs_11gR2/bin/crsctl.
Apr  7 05:31:08 host01 logger: Waiting for filesystem containing /home/user01/oracle/crs_11gR2/bin/crsctl.

怀疑是以前历史记录没有清除干净,造成运行root后,查找的是旧的crsctl。

crs_11gR2目录已经删除,不应该再被引用。

检查配置文件和脚本,查找原因。

到/etc/init.d/目录

grep crs_11gR2 *

发现init.ohasd和ohasd两个文件中包含上述路径,删除这两个文件。

#nit q;

发现后台仍然报

host01 logger: Waiting for filesystem containing /home/user01/oracle/crs_11gR2/bin/crsctl.
错误,

#reboot

reboot后message里面的错误提示消失,重新运行配置命令。

#/home/user01/oracle/11g/crs_11gProd/bin/localconfig reset

Successfully accumulated necessary OCR keys.
Creating OCR keys for user ‘root’, privgrp ‘root’..
Operation successful.
Configuration for local CSS has been initialized

Cleaning up Network socket directories
Setting up Network socket directories
Adding to inittab
Startup will be queued to init within 30 seconds.
Checking the status of new Oracle init process…
Expecting the CRS daemons to be up within 600 seconds.
Cluster Synchronization Services is active on these nodes.
        host01
Cluster Synchronization Services is active on all the nodes.
Oracle CSS service is installed and running under init(1M)

配置成功。

Oracle 11gR2 clusterware [INS-06006] error

今天安装11gR2 clusterware的时候在输入完hostname和vip之后,碰到[INS-06006]Passowrdless SSH connectivity not setup between the following node(s):[host1].

 

查看了文档,发现clusterware安装的时候ssh配置,不仅要两个节点能相互访问,还要能访问自身。在两个节点上分别添加自己的rsa key即可,命令如下:

cat ~/.ssh/id_rsa.pub | ssh user@host1 "cat – >> ~/.ssh/authorized_keys"
cat ~/.ssh/id_rsa.pub | ssh user@host2 "cat – >> ~/.ssh/authorized_keys"

 

————————-

ps,昨天碰到另一个ssh相关问题,顺便记录一下。

host1,host2配置相同,配完ssh后,host1能ssh host2,反之不行。Google了很多,都没发现原因。最后发现时host1的user home目录权限为775. 要使ssh起作用,user home目录,必须只有owner有写权限。Google过程中,还有一些说法是 .ssh 目录权限要求为只有owner自己有写权限。authorized_keys 权限应为600.