E492: Not an editor command: ASM2_ora_26576.trc

Problem:

I want to open ASM trace file using vim.

[root@rac2 trace]# ll +ASM2_ora_26576.trc
-rw-r----- 1 grid oinstall 1388 Mar  7 18:06 +ASM2_ora_26576.trc

But because of filename contains + sign, my command fails:

[root@rac2 trace]# vim +ASM2_ora_26576.trc

Error detected while processing command line:
E492: Not an editor command: ASM2_ora_26576.trc
Press ENTER or type command to continue

Solution:

Indicate — (two dashes)

[root@rac2 trace]# vim -- +ASM2_ora_26576.trc

From man page of vim — means the following:

 --          Denotes  the  end  of  the options.  Arguments after this will be handled as a file name.  This can be used to edit a filename that starts with a '-'.

Inserting entry in .db file from Linux shell

  • Create a text file containing necessary entries, e.g
[root@rac1 ~]# cat test.txt
ora.test.db
\92\c4\9dhard(global:uniform:ora.DATA.dg) pullup(global:ora.DATA.dg) weak(type:ora.listener.type, global:type:ora.scan_listener.type, uniform:ora.ons, global:ora.gns)\c4\c5hard(fg.DATA.DisksReady, global:uniform:ora.DATA.dg) pullup(fg.DATA.DisksReady, global:ora.DATA.dg) weak(type:ora.listener.type, global:type:ora.scan_listener.type, uniform:ora.ons, global:ora.gns)

Please note, this is a sample entry that was necessary in my case. You better know what should be there for your case.

  • Create output.db file from test.txt
[root@rac1 ~]# db_load -T -t btree -f test.txt output.db
  • Read data from output.db file to make sure that the entry is there using db_dump
[root@rac1 ~]# db_dump -p output.db
VERSION=3
format=print
type=btree
db_pagesize=4096
HEADER=END
 ora.test.db
 \92\c4\9dhard(global:uniform:ora.DATA.dg) pullup(global:ora.DATA.dg) weak(type:ora.listener.type, global:type:ora.scan_listener.type, uniform:ora.ons, global:ora.gns)\c4\c5hard(fg.DATA.DisksReady, global:uniform:ora.DATA.dg) pullup(fg.DATA.DisksReady, global:ora.DATA.dg) weak(type:ora.listener.type, global:type:ora.scan_listener.type, uniform:ora.ons, global:ora.gns)
DATA=END