[20160712]ASM ab_+ASM.dat.txt

  1. 云栖社区>
  2. 博客>
  3. 正文

[20160712]ASM ab_+ASM.dat.txt

lfreeali 2016-07-12 08:31:47 浏览981

[20160712]ASM ab_+ASM.dat.txt

--如果你使用asm,在dbs目录下$ORACLE_HOME/dbs目录下存在ab_+ASM.dat的文件。
--11GR2在grid的用户。

$ strings ab_+ASM.dat
GREP_COLOR=01;32
HOSTNAME=xxxxxdg2
TERM=linux
SHELL=/bin/bash
HISTSIZE=2000
KDE_NO_IPV6=1
TMPDIR=/tmp
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
QTDIR=/usr/lib64/qt-3.3
QTINC=/usr/lib64/qt-3.3/include
USER=oracle
HISTFILESIZE=2000
LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
LD_LIBRARY_PATH=/u01/app/oracle/product/10.2.0/rac_db/lib:/u01/app/oracle/product/10.2.0/rac_db/oracm/lib:/lib:/usr/lib:/usr/local/lib:/lib64:/usr/lib64:/usr/local/lib64
ORACLE_SID=+ASM
ON=/u01/app/oracle/product/10.2.0/rac_db/network/admin
OH=/u01/app/oracle/product/10.2.0/rac_db
ORACLE_HOSTNAME=xxxxxdg2
ORACLE_BASE=/u01/app/oracle
KDEDIR=/usr
OD=/u01/app/oracle/product/10.2.0/rac_db/dbs
PATH=
MAIL=/var/spool/mail/oracle
NXDIR=/usr/NX
OB=/u01/app/oracle
PWD=/home/oracle
INPUTRC=/etc/inputrc
NLS_TIMESTAMP_TZ_FORMAT=YYYY-MM-DD HH24:MI:SS.FF
KDE_IS_PRELINKED=1
LANG=en_US
OBDUMP=/u01/app/oracle/admin/xxxxxdg2/bdump
ORACLE_TERM=linux
OASMDUMP=/u01/app/oracle/admin/+ASM/bdump
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
HOME=/home/oracle
SHLVL=2
GREP_OPTIONS=--color=auto
LOGNAME=oracle
TMP=/tmp
CVS_RSH=ssh
QTLIB=/usr/lib64/qt-3.3/lib
CLASSPATH=/u01/app/oracle/product/10.2.0/rac_db/JRE:/u01/app/oracle/product/10.2.0/rac_db/jlib:/u01/app/oracle/product/10.2.0/rac_db/rdbms/jlib
LESSOPEN=|/usr/bin/lesspipe.sh %s
ORACLE_HOME=/u01/app/oracle/product/10.2.0/rac_db
G_BROKEN_FILENAMES=1
HISTTIMEFORMAT=%F %T =
NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS
_=/u01/app/oracle/product/10.2.0/rac_db/bin/sqlplus
ORA_NET2_DESC=8,11
ORACLE_SPAWNED_PROCESS=1
SC=8,11
ORACLE_SPAWNED_PROCESS=1

--很明显保存一些环境。我改动1个参数
HISTSIZE=2001

-- 再重新登录看看:

$ strings ab_+ASM.dat |grep -i histsize
HISTSIZE=2000

--//并不会因此改变,也许要重启asm实例。现在我无法重启,留待以后观察。

$ stat ab_+ASM.dat
  File: `ab_+ASM.dat'
  Size: 1981            Blocks: 8          IO Block: 4096   regular file
Device: 803h/2051d      Inode: 217219075   Links: 1
Access: (0660/-rw-rw----)  Uid: (  500/  oracle)   Gid: (  501/oinstall)
Access: 2016-07-12 08:18:47.000000000 +0800
Modify: 2014-09-21 04:24:05.000000000 +0800
Change: 2014-09-21 04:24:05.000000000 +0800

SYS@xxxxx> select STARTUP_TIME from v$instance;

STARTUP_TIME
-------------------
2014-09-21 04:24:24

--从时间看,这里可以看出应该是启动的时候会建立或者修改这个文件。
--找到一个链接:
http://mohamedazar.com/2014/06/17/asm-ab_asm-dat-hc_asm-dat/

ab_+ASM.dat : This file generated when asm instance startup. this file is used by the RDBMS instance to determine the
appropriate enviornment information whenever the RDBMS instance connects to the asm instance. If this file is removed,
RDBMS instance can not able to connect to ASM。

--里面测试还说明了如果mv了文件,asm实例无法启动,建立表空间失败。我没有测试环境,放弃测试。

SQL> startup
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DATA/asmoracle/spfileasmoracle.ora'
ORA-17503: ksfdopn:2 Failed to open file +DATA/asmoracle/spfileasmoracle.ora
ORA-27300: OS system dependent operation:open failed with status: 2
ORA-27301: OS failure message: No such file or directory
ORA-27302: failure occurred at: sskgmsmr_7


SQL> create tablespace testtbs datafile '+DATA' size 1m;
create tablespace testtbs datafile '+DATA' size 1m
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 4644
Session ID: 1 Serial number: 17

--我仅仅测试建立表空间的情况:
$ mv ab_+ASM.dat ab_+ASM.dat_new

SYS@xxxxx> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE    10.2.0.4.0      Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production


SYS@xxxxx> create tablespace testtbs datafile '+g0' size 1m;
create tablespace testtbs datafile '+g0' size 1m
*
ERROR at line 1:
ORA-01119: error in creating database file '+g0'
ORA-17502: ksfdcre:4 Failed to create file +g0
ORA-15055: unable to connect to ASM instance
ORA-15055: unable to connect to ASM instance
ORA-15055: unable to connect to ASM instance
ORA-15055: unable to connect to ASM instance
--与他的测试错误信息不同。我的版本是10.2.0.4

$ mv ab_+ASM.dat_new ab_+ASM.dat

SYS@xxxxx> create tablespace testtbs datafile '+g0' size 1m;
Tablespace created.

SYS@xxxxx> drop  tablespace testtbs;
Tablespace dropped.

--没有测试启动asm实例,如果删除该文件如何启动asm实例呢?

--有一些人看一些文件不顺眼,可能会删除,比如OMF建立的数据文件,我就遇到这种情况。在生产系统做这些操作一定要慎之又慎!!