Yearly Archives: 2015

在线打补丁 opatch apply online

0

Posted on by

All OPatch versions after 11.1.0.6 are Online Patch aware.

The syntax to install an Online Patch is:

opatch apply online -connectString <SID>:<USERNAME>:<PASSWORD>:<NODE>


example:

$ opatch apply online -connectString db11202:sys:oracle -invPtrLoc /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
Invoking OPatch 11.2.0.1.4

Oracle Interim Patch Installer version 11.2.0.1.4
Copyright (c) 2010, Oracle Corporation. All rights reserved.

Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
OPatch version : 11.2.0.1.4
OUI version : 11.2.0.2.0
OUI location : /u01/app/oracle/product/11.2.0/dbhome_1/oui
Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2011-01-27_16-14-21PM.log

Patch history file: /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt

The patch should be applied/rolled back in '-all_nodes' mode only.
Converting the RAC mode to '-all_nodes' mode.
ApplySession applying interim patch '10188727' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Running prerequisite checks…
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name: 

You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: y

OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.

Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '10188727' for restore. This might take a while…
Backing up files affected by the patch '10188727' for rollback. This might take a while…

Patching component oracle.rdbms, 11.2.0.2.0…
The patch will be installed on active database instances.
Installing and enabling the online patch 'bug10188727.pch', on database 'db11202'.

ApplySession adding interim patch '10188727' to inventory

Verifying the update…
Inventory check OK: Patch ID 10188727 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 10188727 are present in Oracle Home.

OPatch succeeded.

For RAC you can list all of the instances:

opatch apply online -connectString <SID>:<USERNAME>:<PASSWORD>:<NODE1>,<SID2>:<USERNAME>:<PASSWORD>:<NODE2>,…

The USERNAME and PASSWORD are those of a user that has SYSDBA privileges. 
The USERNAME and PASSWORD can be left blank if the OS user applying the patch has the SYSDBA privilege. 
To apply a patch only to local in the RAC environment, it is necessary to use '-local'.

 

 

 

参考:RDBMS Online Patching Aka Hot Patching (文档 ID 761111.1)

kcbgtcr_13 on active dataguard

0

Posted on by

今天在acitve dataguard上报出一个错误,在监控表空间时报出的,

经查为bug Bug 12848798 – OERI:kcbgtcr_13 on active dataguard [ID 12848798.8]

数据库版本为:11.2.0.3.5 

错误内容:

	ORA-00600: internal error code, arguments: [kcbgtcr_13], [], [], [], [], [], [], [], [], [], [], []

在查询V$或者X$会报出的。

下载补丁:12848798可解决

Affects:

Product (Component)

Oracle Server (Rdbms)

Range of versions believed to be affected

Versions >= 10.2 but BELOW 12.1

Versions confirmed as being affected

Platforms affected

Generic (all / most platforms affected)

Fixed:

The fix for 12848798 is first included in

 

Using WGET to download My Oracle Support Patches

0

Posted on by

 oracle的补丁可以在linux上通过wget方式来下载,避免了下载到windows在拉到服务器上的繁琐过程。

可以直接在linux下新建一个可执行文件:

	username=dba@oradbca.com

	password=xxxxxxxxx
wget -c --secure-protocol=TLSv1 --http-user=$username --http-password=$password --no-check-certificate --output-document=p13390677_112040_Linux-x86-64_1of7.zip "https://updates.oracle.com/Orion/Services/download/p13390677_112040_Linux-x86-64_1of7.zip?aru=16716375&patch_file=p13390677_112040_Linux-x86-64_1of7.zip" -o p13390677_112040_Linux-x86-64_1of7.log

 

执行这个文件,然后就可以看p13390677_112040_Linux-x86-64_1of7.log 这个文件的下载进度了。

创建lvm Found duplicate PV的错误

0

Posted on by

在创建lvm的时候,报一下错误:

[root@oradbca ~]#  vgcreate vg_data /dev/sddlmaa
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sdb not /dev/sddlmaa
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sdc not /dev/sdb
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sdd not /dev/sdc
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sde not /dev/sdd
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sddlmaa not /dev/sde
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sdb not /dev/sddlmaa
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sdc not /dev/sdb
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sdd not /dev/sdc
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sde not /dev/sdd
  Volume group "vg_data" successfully created

虽然创建成功了,,但是感觉有点别扭。

同时创建的盘也不是我多路径上的盘

[root@oradbca ~]# pvdisplay 
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sdb not /dev/sddlmaa
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sdc not /dev/sdb
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sdd not /dev/sdc
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sde not /dev/sdd
  --- Physical volume ---
  PV Name               /dev/sde
  VG Name               vg_data
  PV Size               2.44 TiB / not usable 4.00 MiB
  Allocatable           yes 
  PE Size               4.00 MiB
  Total PE              639999
  Free PE               367
  Allocated PE          639632
  PV UUID               YjFs3Q-Zw30-enKp-lsoQ-5YmF-FnDV-08Owyy

原因是:默认的扫描设置是扫描所有的磁盘,由于多路径的问题,多块磁盘前面的元数据信息是一致的,导致PV信息相同

所以直接修改lvm的配置文件,修改扫描的策略就可以了。

我的fdisk -l 内容


Disk /dev/sda: 1199.1 GB, 1199101181952 bytes
255 heads, 63 sectors/track, 145782 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000a399

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          26      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              26        8185    65536000   82  Linux swap / Solaris
/dev/sda3            8185      145783  1105255424   8e  Linux LVM

Disk /dev/sdb: 2684.4 GB, 2684354560000 bytes
255 heads, 63 sectors/track, 326354 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sdc: 2684.4 GB, 2684354560000 bytes
255 heads, 63 sectors/track, 326354 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup-LogVol00: 1131.8 GB, 1131774214144 bytes
255 heads, 63 sectors/track, 137597 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sdd: 2684.4 GB, 2684354560000 bytes
255 heads, 63 sectors/track, 326354 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sde: 2684.4 GB, 2684354560000 bytes
255 heads, 63 sectors/track, 326354 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sddlmaa: 2684.4 GB, 2684354560000 bytes
255 heads, 63 sectors/track, 326354 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_data-lv_data: 2682.8 GB, 2682811056128 bytes
255 heads, 63 sectors/track, 326166 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

 

 

修改文件   /etc/lvm/lvm.conf

由原来的 

	filter = [ "a/.*/" ]

修改成   

	filter = [ "a/sddl.*/","a/sda.*/", "r/sd.*/" ]

a 是允许  b是拒绝

由于我在sda上也有lvm 所以单独允许。

 

修改后 允许 vgscan -v  重建缓存 

运行lvmdiskscan 查看当前的访问路径

 

[root@whljk ~]# lvmdiskscan 
  /dev/ram0            [      16.00 MiB] 
  /dev/sddlmaa         [       2.44 TiB] LVM physical volume
  /dev/root            [       1.03 TiB] 
  /dev/ram1            [      16.00 MiB] 
  /dev/sda1            [     200.00 MiB] 
  /dev/vg_data/lv_data [       2.44 TiB] 
  /dev/ram2            [      16.00 MiB] 
  /dev/sda2            [      62.50 GiB] 
  /dev/ram3            [      16.00 MiB] 
  /dev/sda3            [       1.03 TiB] LVM physical volume
  /dev/ram4            [      16.00 MiB] 
  /dev/ram5            [      16.00 MiB] 
  /dev/ram6            [      16.00 MiB] 
  /dev/ram7            [      16.00 MiB] 
  /dev/ram8            [      16.00 MiB] 
  /dev/ram9            [      16.00 MiB] 
  /dev/ram10           [      16.00 MiB] 
  /dev/ram11           [      16.00 MiB] 
  /dev/ram12           [      16.00 MiB] 
  /dev/ram13           [      16.00 MiB] 
  /dev/ram14           [      16.00 MiB] 
  /dev/ram15           [      16.00 MiB] 
  2 disks
  18 partitions
  1 LVM physical volume whole disk
  1 LVM physical volume

 

正常显示

ORA-08104: this index object ##### is being online built or rebuilt

0

Posted on by

这个错误由于在异常终止online rebuild的时候,还没来得及清理相应的临时段和标志位,系统认为online rebuild操作还在进行造成的。

根据文章 Session Was Killed During The Rebuild Of Index ORA-08104 (文档 ID 375856.1)说明
 
1.等smon清理
 
2.在10g之后用dbms_repair.online_index_clean手工清理这些信息,在Oracle 9i下,需要打Bug 3805539 后才可以使用该工具
DECLARE
RetVal BOOLEAN;
OBJECT_ID BINARY_INTEGER;
WAIT_FOR_LOCK BINARY_INTEGER;
BEGIN
OBJECT_ID := 53367;
WAIT_FOR_LOCK := NULL;
RetVal := SYS.DBMS_REPAIR.ONLINE_INDEX_CLEAN ();
COMMIT;
END;
/
 
 
3.修改字典数据

(1)先查看ind$ flags 标志,如果不正确,就减去512.

       sql>update ind$ set flags=flags-512 where obj#=<object id>;

(2)drop journal table,这个步骤可能会报资源忙,因为有大量的日志正在插入,可以反复重试一下。

       sql>drop table <owner>.sys_journal_<object_id>;

 

注意:

       这个步骤不能反,如果先删除sys_journal_<object_id>临时表,然后再修改index的flags状态,则会报出ora-600 [4610]号错误,即数据字典不一致的错误。