解決UNIX下@符號報SP2-0734錯誤

趙宇發表於2008-06-20

今天重起備份伺服器,發生資料庫down了,檢查發現,原來是一個磁碟沒有自動掛載

# ioscan -funCdisk
Class     I  H/W Path       Driver     S/W State   H/W Type     Description
============================================================================
disk      0  0/0/2/0.0.0.0  sdisk      CLAIMED     DEVICE       TEAC    DV-28E-N
                           /dev/dsk/c0t0d0   /dev/rdsk/c0t0d0
disk      1  0/1/1/0.0.0    sdisk      CLAIMED     DEVICE       HP 36.4GST336607LC
                           /dev/dsk/c2t0d0     /dev/dsk/c2t0d0s2   /dev/rdsk/c2t0d0    /dev/rdsk/c2t0d0s2
                           /dev/dsk/c2t0d0s1   /dev/dsk/c2t0d0s3   /dev/rdsk/c2t0d0s1  /dev/rdsk/c2t0d0s3
disk      2  0/1/1/0.1.0    sdisk      CLAIMED     DEVICE       HP 36.4GST336607LC
                           /dev/dsk/c2t1d0     /dev/dsk/c2t1d0s2   /dev/rdsk/c2t1d0    /dev/rdsk/c2t1d0s2
                           /dev/dsk/c2t1d0s1   /dev/dsk/c2t1d0s3   /dev/rdsk/c2t1d0s1  /dev/rdsk/c2t1d0s3
disk      3  0/1/1/1.2.0    sdisk      CLAIMED     DEVICE       COMPAQ  BD1468A4C5
                           /dev/dsk/c3t2d0   /dev/rdsk/c3t2d0
# pvcreate /dev/rdsk/c3t2d0
pvcreate: The physical volume already belongs to a volume group
# bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    1048576  342128  700936   33% /
/dev/vg00/lvol1    1048576  203496  838520   20% /stand
/dev/vg00/lvol8    6348800 1499704 4812912   24% /var
/dev/vg00/lvol7    6348800 2850696 3470816   45% /usr
/dev/vg00/lvol6    2097152  102672 1979136    5% /tmp
/dev/vgora/lvora   35536896 22132746 12567008   64% /ora
/dev/vg00/lvol5    6348800 2816328 3504912   45% /opt
/dev/vg00/lvol4    1048576   16672 1023856    2% /home


# cd /dev
# ls |grep vg
vg00
vg01
vgora
#


# vgdisplay -v vg01
--- Volume groups ---
VG Name                     /dev/vg01
VG Write Access             read/write    
VG Status                   available                
Max LV                      255   
Cur LV                      1     
Open LV                     1     
Max PV                      16    
Cur PV                      1     
Act PV                      1     
Max PE per PV               65535       
VGDA                        2  
PE Size (Mbytes)            16             
Total PE                    8749   
Alloc PE                    8749   
Free PE                     0      
Total PVG                   0       
Total Spare PVs             0             
Total Spare PVs in use      0                    

   --- Logical volumes ---
   LV Name                     /dev/vg01/lvol1
   LV Status                   available/syncd          
   LV Size (Mbytes)            139984         
   Current LE                  8749     
   Allocated PE                8749       
   Used PV                     1      


   --- Physical volumes ---
   PV Name                     /dev/dsk/c3t2d0
   PV Status                   available               
   Total PE                    8749   
   Free PE                     0      
   Autoswitch                  On       


# mount /dev/vg01/lvol1 /RAC_BACKUP
$ bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    1048576  342128  700936   33% /
/dev/vg00/lvol1    1048576  203496  838520   20% /stand
/dev/vg00/lvol8    6348800 1499720 4812896   24% /var
/dev/vg00/lvol7    6348800 2850696 3470816   45% /usr
/dev/vg00/lvol6    2097152  102672 1979136    5% /tmp
/dev/vgora/lvora   35536896 22132746 12567008   64% /ora
/dev/vg00/lvol5    6348800 2816328 3504912   45% /opt
/dev/vg00/lvol4    1048576   16672 1023856    2% /home
/dev/vg01/lvol1    143343616 120302117 21601484   85% /RAC_BACKUP

在/etc/fstab中新增一行,防止下次不能自動掛載

檢查錯誤日誌,資料庫需要startup upgrade模式下進行升級

Errors in file /ora/app/oracle/admin/baan/udump/baan_ora_4218.trc:
ORA-00704: bootstrap process failure
ORA-39700: database must be opened with UPGRADE option
Fri Jun 20 11:37:35 2008
Error 704 happened during db open, shutting down database
USER: terminating instance due to error 704
Termination issued to instance processes. Waiting for the processes to exit
Fri Jun 20 11:37:45 2008
Instance termination failed to kill one or more processes
Instance terminated by USER, pid = 4218
ORA-1092 signalled during: alter database open...


$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Fri Jun 20 11:41:11 2008

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> startup upgrade
ORACLE instance started.

Total System Global Area 1308622848 bytes
Fixed Size                  2055960 bytes
Variable Size            1006633192 bytes
Database Buffers          285212672 bytes
Redo Buffers               14721024 bytes
Database mounted.
Database opened.

鬱悶的是怎麼執行也不識別這個@符號

SQL> @/ora/app/oracle/oracle/product/10.2.0/db_1/rdbms/admin/catupgrd.sql
SP2-0734: unknown command beginning "/ora/app/o..." - rest of line ignored.

SQL>start /ora/app/oracle/oracle/product/10.2.0/db_1/rdbms/admin/catupgrd.sql

start是可以執行的,檢視metalink,

SP2-0734 and/or SP2-0042 Error Immediately When Attempting To Run catpatch.sql
  文件 ID: 註釋:336920.1 型別: PROBLEM
  上次修訂日期: 12-FEB-2008 狀態: PUBLISHED

The problem is with the display terminal keyboard settings. The sqlplus session had trouble interpreting the "@" sign, because it was assigned in the terminal to the "kill" setting.  The catpatch.sql script. was supposed to be run as "@catpatch.sql" and since the "@" sign had a completely different meaning for this OS session, sqlplus only saw "catpatch.sql".

原來是UNIX把這個符號識別為kill,而SQL*plus根本不識別,把kill改成其他符號,就可以了
$ stty kill ^u

SQL> @/ora/app/oracle/oracle/product/10.2.0/db_1/rdbms/admin/catalog.sql

可以執行了:)

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/175005/viewspace-351961/,如需轉載,請註明出處,否則將追究法律責任。

相關文章