LindaC
asked on
Failed to save last-line mode history and Invalid history file format. [Press return to continue]
Hi experts.
After quitting seeing a file in vi with q!, I have the following message in the server:
Sat Oct 15 08:00:22 2011
Thread 1 advanced to log sequence 4709 (LGWR switch)
Current log# 2 seq# 4709 mem# 0: /pststdb01/dmo/ora1/log/re do01b.log
Current log# 2 seq# 4709 mem# 1: /pststdb01/dmo/ora1/log/re do02b.log
Current log# 2 seq# 4709 mem# 2: /pststdb01/dmo/ora1/log/re do03b.log
~
~
~
~
~
~
~
~
~
~
~
~
:q!
Failed to save last-line mode history.------------------ ---------- ---------- ->What is this message?
psdevtstdb:/pststdb01/dmo/ ora1/admin /bdump> touch test
psdevtstdb:/pststdb01/dmo/ ora1/admin /bdump> rm test
psdevtstdb:/pststdb01/dmo/ ora1/admin /bdump>
psdevtstdb:/pststdb01/dev/ ora1/admin /bdump> vi alert*.log
Invalid history file format. [Press return to continue]
After quitting seeing a file in vi with q!, I have the following message in the server:
Sat Oct 15 08:00:22 2011
Thread 1 advanced to log sequence 4709 (LGWR switch)
Current log# 2 seq# 4709 mem# 0: /pststdb01/dmo/ora1/log/re
Current log# 2 seq# 4709 mem# 1: /pststdb01/dmo/ora1/log/re
Current log# 2 seq# 4709 mem# 2: /pststdb01/dmo/ora1/log/re
~
~
~
~
~
~
~
~
~
~
~
~
:q!
Failed to save last-line mode history.------------------
psdevtstdb:/pststdb01/dmo/
psdevtstdb:/pststdb01/dmo/
psdevtstdb:/pststdb01/dmo/
psdevtstdb:/pststdb01/dev/
Invalid history file format. [Press return to continue]
ASKER
Thank you.
I'am using ksh
psdevtstdb:/home/oracle> ls -ltr *hist*
ls: 0653-341 The file *hist* does not exist.
psdevtstdb:/home/oracle>
This are some tries in the $HOME
[YOU HAVE NEW MAIL]
psdevtstdb:/home/oracle> ls -ltr
total 368
drwxr-s--- 3 oracle dba 512 Jan 12 2009 admin
-rw-r--r-- 1 oracle dba 157 Jan 19 2009 smit.script
-rw-r--r-- 1 oracle dba 299 Jan 19 2009 smit.transaction
-rw-r--r-- 1 oracle dba 36 Feb 03 2009 dropSysadm.sql
drwxrwx--- 2 root system 512 Feb 10 2009 lost+found
-rw-r----- 1 oracle dba 15555 Jun 12 2009 findev.htm
-rw-r--r-- 1 oracle dba 41 Jun 14 2009 afiedt.buf
-rw-r--r-- 1 oracle dba 9261 Aug 04 2010 spdtab.lis
-rw-r--r-- 1 oracle dba 1294 Aug 04 2010 spdusr.lis
drwxr-S--- 3 oracle dba 512 Jan 05 2011 oradiag_oracle
drwxr-sr-x 7 oracle dba 512 Aug 02 07:03 dba
drwxrws--- 7 oracle oinstall 512 Aug 15 16:00 oraInventory
-rw-r--r-- 1 oracle dba 29 Sep 16 02:00 export_FINDEV_dpump.201
1-09-16.log
-rw-r--r-- 1 oracle dba 29 Sep 17 02:00 export_FINDEV_dpump.201
1-09-17.log
-rw-r--r-- 1 oracle dba 29 Sep 18 02:00 export_FINDEV_dpump.201
1-09-18.log
-rw-r--r-- 1 oracle dba 29 Sep 19 02:00 export_FINDEV_dpump.201
1-09-19.log
-rw-r--r-- 1 oracle dba 29 Sep 20 02:00 export_FINDEV_dpump.201
1-09-20.log
-rw-r--r-- 1 oracle dba 29 Sep 21 02:00 export_FINDEV_dpump.201
1-09-21.log
-rw-r--r-- 1 oracle dba 29 Sep 22 02:00 export_FINDEV_dpump.201
1-09-22.log
-rw-r--r-- 1 oracle dba 29 Sep 23 02:00 export_FINDEV_dpump.201
1-09-23.log
-rw-r--r-- 1 oracle dba 29 Sep 24 02:00 export_FINDEV_dpump.201
I'am using ksh
psdevtstdb:/home/oracle> ls -ltr *hist*
ls: 0653-341 The file *hist* does not exist.
psdevtstdb:/home/oracle>
This are some tries in the $HOME
[YOU HAVE NEW MAIL]
psdevtstdb:/home/oracle> ls -ltr
total 368
drwxr-s--- 3 oracle dba 512 Jan 12 2009 admin
-rw-r--r-- 1 oracle dba 157 Jan 19 2009 smit.script
-rw-r--r-- 1 oracle dba 299 Jan 19 2009 smit.transaction
-rw-r--r-- 1 oracle dba 36 Feb 03 2009 dropSysadm.sql
drwxrwx--- 2 root system 512 Feb 10 2009 lost+found
-rw-r----- 1 oracle dba 15555 Jun 12 2009 findev.htm
-rw-r--r-- 1 oracle dba 41 Jun 14 2009 afiedt.buf
-rw-r--r-- 1 oracle dba 9261 Aug 04 2010 spdtab.lis
-rw-r--r-- 1 oracle dba 1294 Aug 04 2010 spdusr.lis
drwxr-S--- 3 oracle dba 512 Jan 05 2011 oradiag_oracle
drwxr-sr-x 7 oracle dba 512 Aug 02 07:03 dba
drwxrws--- 7 oracle oinstall 512 Aug 15 16:00 oraInventory
-rw-r--r-- 1 oracle dba 29 Sep 16 02:00 export_FINDEV_dpump.201
1-09-16.log
-rw-r--r-- 1 oracle dba 29 Sep 17 02:00 export_FINDEV_dpump.201
1-09-17.log
-rw-r--r-- 1 oracle dba 29 Sep 18 02:00 export_FINDEV_dpump.201
1-09-18.log
-rw-r--r-- 1 oracle dba 29 Sep 19 02:00 export_FINDEV_dpump.201
1-09-19.log
-rw-r--r-- 1 oracle dba 29 Sep 20 02:00 export_FINDEV_dpump.201
1-09-20.log
-rw-r--r-- 1 oracle dba 29 Sep 21 02:00 export_FINDEV_dpump.201
1-09-21.log
-rw-r--r-- 1 oracle dba 29 Sep 22 02:00 export_FINDEV_dpump.201
1-09-22.log
-rw-r--r-- 1 oracle dba 29 Sep 23 02:00 export_FINDEV_dpump.201
1-09-23.log
-rw-r--r-- 1 oracle dba 29 Sep 24 02:00 export_FINDEV_dpump.201
The korn shell also has command line history
Try:
ls *.hist*
http://docstore.mik.ua/orelly/unix/ksh/ch02_02.htm
Try:
ls *.hist*
http://docstore.mik.ua/orelly/unix/ksh/ch02_02.htm
ASKER
psdevtstdb:/home/oracle> ls *.hist*
ls: 0653-341 The file *.hist* does not exist.
ls: 0653-341 The file *.hist* does not exist.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The command to find the command history file under ksh in AIX is
ls -la .sh_history
View the command history with
history
(or "fc -l", history is an alias).
history -1000 will give the last 1000 entries (if present)
If the history file is indeed corrupt you can safely delete it:
rm .sh_history
Logout and login again to free the corresponding file handle.
You will now have a new, clean history.
ls -la .sh_history
View the command history with
history
(or "fc -l", history is an alias).
history -1000 will give the last 1000 entries (if present)
If the history file is indeed corrupt you can safely delete it:
rm .sh_history
Logout and login again to free the corresponding file handle.
You will now have a new, clean history.
ASKER
Thank you, you are correct. The system Admin made a fsck and the rebooted the server which fix the "no writable" of the /home/oracke $HOME directory.
Now I can see the history and the issue is fixed.
psdevtstdb:/home/oracle> ls -la .sh_history
-rw------- 1 oracle dba 4200 Oct 19 08:08 .sh_history
psdevtstdb:/home/oracle>
Now I can see the history and the issue is fixed.
psdevtstdb:/home/oracle> ls -la .sh_history
-rw------- 1 oracle dba 4200 Oct 19 08:08 .sh_history
psdevtstdb:/home/oracle>
history -c will clear the history list and history -d N will delete a history entry N.
By default, the history list is kept in user's home directory in a file '.bash_history'.