The index search is similar:
Narrative: sed no auto print mode find the key line and cut out the digits inside the square braces and print them to the for loop, which for each index found, removes all the lines indexed by that number in the file. Normally I use a while read, but since we are changing the file we are getting indexes from, I get all indexes before doing index deletes.
Hi
I am accessing a file on nfs mounted device, after completing using of the file, i am tring to restore the access time and modification times of the file.
So i got the previous modified time of the file using stat() function and trying to set the date and time for the file, To set these... (6 Replies)
Can anyone please suggest an alternate command for "stat" . I am trying this on Solaris 5.9 , but the command doesn't exist.
Basically i need to see one particalar file modification history. Any help is appreciated. (4 Replies)
Dear all,
I 'd like to create a new txt file using the old file. For example, in old file, if count=2 then in new file, repeat that row twice, with the only difference is: on the first row, 'start' column contains the 1st apart of the 'start' in the old file; while in the 2nd row, the 'start'... (7 Replies)
Hi,
I have a file test.txt . The contain of the file is as below :
365798~SAPUS~PR5~0000799005~ADM CHARG MEDCAL INS~~~~~~~~~~~~~~~~~~~~~~~~SLAC480
I want to modify this file. And file contain loking like
"365798"~"SAPUS"~"PR5"~"0000799005"~"ADM CHARG MEDCAL... (6 Replies)
Hi,
I have a file abcd.txt.
cat abcd.txt
output is as follows :
"aa"~"bb"~"001"~""~""~"cc"
"dd"~"005"~""
~""~"kk"~"aa"~"00
8"~""~""~
I want the output looking like:
cat abcd.txt
"aa"~"bb"~"001"~""~""~
"cc""dd"~"005"~""~""~
"kk"~"aa"~"008"~""~""~
I have a script. (4 Replies)
Hi All,
I have a file disk_space.log.
cat disk_space.log
94% /
32% /boot
38% /mnt/data
100% /media/CDROM
I want the output, like
cat disk_space.log
94% /
100% /media/CDROM
That means print the line those are grater-than 90%. And rest of the line is remove from file.
I have a... (2 Replies)
Hi All, I have a file. This file contain huge amount of data. I want to modify this file. I want enter new line when count of "~ character is 79. Please find below the code : cat file_name | tr -d '\n' | sed... (6 Replies)
Hi, I have a file input.txt. cat input.txt output is as follows : Code: "0001"~"name"~"bb"~"20.25"~""~""~"0002"~"name" "dd"~"35.50"~"" ~""~"0003"~"name"~"aa"~"21.3 5"~""~""~ I want the output looking like: cat output.txt Code: "0001"~"name"~"bb"~"20.25"~""~""~... (6 Replies)
Hi,
I have a file. File contains are as follows :
Feb 19, 2012 5:05:00 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Feb 19, 2012 5:05:00 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 771 ms
Feb 20, 2012... (3 Replies)
Discussion started by: mnmonu
3 Replies
LEARN ABOUT REDHAT
reindex
REINDEX(7) SQL Commands REINDEX(7)NAME
REINDEX - rebuild corrupted indexes
SYNOPSIS
REINDEX { TABLE | DATABASE | INDEX } name [ FORCE ]
INPUTS
TABLE Recreate all indexes of a specified table.
DATABASE
Recreate all system indexes of a specified database. (User-table indexes are not included.)
INDEX Recreate a specified index.
name The name of the specific table/database/index to be reindexed. Table and index names may be schema-qualified.
FORCE Force rebuild of system indexes. Without this keyword REINDEX skips system indexes that are not marked invalid. FORCE is irrelevant
for REINDEX INDEX, or when reindexing user indexes.
OUTPUTS
REINDEX
Message returned if the table is successfully reindexed.
DESCRIPTION
REINDEX is used to rebuild corrupted indexes. Although in theory this should never be necessary, in practice indexes may become corrupted
due to software bugs or hardware failures. REINDEX provides a recovery method.
REINDEX also removes certain dead index pages that can't be reclaimed any other way. See the "Routine Reindexing" section in the manual for
more information.
If you suspect corruption of an index on a user table, you can simply rebuild that index, or all indexes on the table, using REINDEX INDEX
or REINDEX TABLE.
Note: Another approach to dealing with a corrupted user-table index is just to drop and recreate it. This may in fact be preferable
if you would like to maintain some semblance of normal operation on the table meanwhile. REINDEX acquires exclusive lock on the ta-
ble, while CREATE INDEX only locks out writes not reads of the table.
Things are more difficult if you need to recover from corruption of an index on a system table. In this case it's important for the backend
doing the recovery to not have used any of the suspect indexes itself. (Indeed, in this sort of scenario you may find that backends are
crashing immediately at start-up, due to reliance on the corrupted indexes.) To recover safely, the postmaster must be shut down and a
stand-alone PostgreSQL backend must be started instead, giving it the command-line options -O and -P (these options allow system table mod-
ifications and prevent use of system indexes, respectively). Then issue REINDEX INDEX, REINDEX TABLE, or REINDEX DATABASE depending on how
much you want to reconstruct. If in doubt, use REINDEX DATABASE FORCE to force reconstruction of all system indexes in the database. Then
quit the standalone backend and restart the postmaster.
Since this is likely the only situation when most people will ever use a standalone backend, some usage notes might be in order:
o Start the backend with a command like
postgres -D $PGDATA -O -P my_database
Provide the correct path to the database area with -D, or make sure that the environment variable PGDATA is set. Also specify the name
of the particular database you want to work in.
o You can issue any SQL command, not only REINDEX.
o Be aware that the standalone backend treats newline as the command entry terminator; there is no intelligence about semicolons, as there
is in psql. To continue a command across multiple lines, you must type backslash just before each newline except the last one. Also, you
won't have any of the conveniences of command-line editing (no command history, for example).
o To quit the backend, type EOF (Control+D, usually).
See the postgres(1) reference page for more information.
USAGE
Recreate the indexes on the table mytable:
REINDEX TABLE mytable;
Rebuild a single index:
REINDEX INDEX my_index;
Rebuild all system indexes (this will only work in a standalone backend):
REINDEX DATABASE my_database FORCE;
COMPATIBILITY
SQL92
There is no REINDEX in SQL92.
SQL - Language Statements 2002-11-22 REINDEX(7)