Chinaunix首页 | 论坛 | 博客
  • 博客访问: 129671
  • 博文数量: 35
  • 博客积分: 1002
  • 博客等级: 准尉
  • 技术积分: 345
  • 用 户 组: 普通用户
  • 注册时间: 2009-09-03 14:30
文章分类

全部博文(35)

文章存档

2014年(7)

2013年(8)

2011年(4)

2010年(9)

2009年(7)

我的朋友

分类: Oracle

2010-07-21 20:29:02

一、日志报错

WARNING: You are creating/reusing datafile /dev/rora_temp01.

WARNING: Oracle recommends creating new datafiles on devices with zero offset. The command "/usr/sbin/mklv -y LVname -T O -w n -s n -r n VGname NumPPs" can be used. Please contact Oracle customer support for more details.

Mon Jul 19 17:00:20 2010

ORA-1652: unable to extend temp segment by 128 in tablespace                 TEMP

二、由主机人员重建LV

mklv -y LVname -T O -w n -s n -r n VGname NumPPs

查看新建lv是否改正错误

$ dbfsize /dev/rora_temp02 Database file: /dev/rora_temp02Database file type: raw device without 4K starting offsetDatabase file size: 131072 8192 byte blocks$  dbfsize /dev/rora_temp03 Database file: /dev/rora_temp03Database file type: raw device without 4K starting offsetDatabase file size: 396800 8192 byte blocks

新建临时表空间

create temporary tablespace temp02 tempfile

'/dev/rora_temp02' SIZE 1024M;

 

修改默认临时表空间

alter database default temporary tablespace temp02;

 

添加数据文件

alter tablespace TEMP02 add tempfile '/dev/rora_temp03' size 3100m;

 

删除原临时表空及数据文件

alter  database tempfile '/dev/rora_temp01' offline;

drop tablespace temp including contents and datafiles;

查看新建临时表空间大小

SQL> Col name format a10

SQL> col "used (M)" format a20

SQL> SELECT  d.status "status",

  2      d.tablespace_name "name",

  3      d.contents "type", d.extent_management "manage type",

  4          TO_CHAR(NVL(a.bytes / 1024 / 1024, 0),'99,999,990.900') "byte M",

  5          NVL(t.bytes, 0)/1024/1024 ||'/'||NVL(a.bytes/1024/1024, 0) "used (M)",

  6          TO_CHAR(NVL(t.bytes / a.bytes * 100, 0), '990.00') "per used%"

  7          FROM  sys.dba_tablespaces d,

  8                  (select tablespace_name, sum(bytes) bytes from dba_temp_files group by tablespace_name) a,

  9                  (select tablespace_name, sum(bytes_cached) bytes from v$temp_extent_pool group by tablespace_name) t

 10           WHERE  d.tablespace_name = a.tablespace_name(+)

 11             AND  d.tablespace_name = t.tablespace_name(+)

 12             AND  d.extent_management like 'LOCAL'

 13             AND  d.contents like 'TEMPORARY';

status  name    type      manage typ byte M          used (M)  per use

------- ------- --------- ---------- --------------- --------- -------

ONLINE  TEMP02  TEMPORARY LOCAL            4,124.000 2122/4124   51.45

查看原临时表空间LV状态

LV NAME       TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT

ora_temp01       jfs        79      79       1    open/syncd       N/A

由于lv状态仍为open,故需要重启数据库以释放LV连接

总结

AIX的每一个逻辑卷前512字节被称为logical-volume control block (LVCB),包含了LV的一些信息。为了避免和LVCB的冲突,Oracle 软件会跳过前4k字节不用。LVCB的和Oracle跳过4K的特点带来的问题:

如果一个VG中包含多个PVPV做了条带化(stripe),创建的LV跨在不同的PV上,这样会导致下面的问题,例如:如果stripe32Kdb_block8K,如果没有offset,则4db_block就全在一个stripe里了,不会跨PV。而有了4Koffset,则肯定第四个db_block就跨stripe了,也就成了一个Oracle DB block跨在多个LUN/PV上了。

由于在建立了big vg之后,在建裸设备的时候没有加-T O的参数,导致裸设备的前4k用来做为logical volume control block,由于数据库的块大小是8k,而裸设备都没有加-T O参数,所以需要重建LV,不然的话由于一个数据块可能存在在stripe 的不同pv 上,可能导致系统crash 或意外停机后oracle 存在大量坏块而不可使用。

 

阅读(902) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~