Sponsored Content
Operating Systems Linux Red Hat What would be the best approach? Post 302904448 by rbatte1 on Wednesday 4th of June 2014 06:48:34 AM
Old 06-04-2014
You may be into an export/truncate/import to remove the data because otherwise you will generate vast amounts of redo. Either the transaction will fail and rollback (so you don't delete anything) or you may hang your database. I suppose you could do it as an un-logged transaction, but then a failure is unrecoverable.

The problem with export/truncate/import might be with the fill ratio. When adding data organically, it will probably fill pages/chunks/blocks (depending on your DB terminology) before allocating the next. With an import, it will likely leave a portion for inserting to later, just in case you add something that would better sit on the same page.

It's all a bit obscure, but the thing you have to bear in mind is that if you export your data with a query that only gives you 50% of it, you might only retrieve 25% of the space allocated.

At towards 300G, any mass manipulation is going to be difficult.


The space you have in your redo log filesystem is going to be critical.




Robin
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Approach to writting a script

Hello all, I've just joined. I did a google search and your site came up, I had a look and thought I'd like to become a member. I'm from Ireland. I've written a few scripts before, but this new task has me foxed. I would like to figure out the best approach to achieving the following ... (15 Replies)
Discussion started by: Bloke
15 Replies

2. Programming

How to evaluate which coding approach is best?

Let's say for example that we have two different ways was can code the exact same program to achieve the same result. What is the best way to determine which of the two methods is the best solution? Is it as simple as basing it on how long the program takes to run or is there a more... (4 Replies)
Discussion started by: jmvbxx
4 Replies

3. Homework & Coursework Questions

How to approach Julian date?

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: This function is given the day, month and year and returns the Julian date. The Julian date is the... (1 Reply)
Discussion started by: mgyeah
1 Replies

4. Shell Programming and Scripting

Need advice on approach for script

Greetings all. I have a repository server which receives, without exhaggeration, several million files a week. The majority of these files are in .csv format, which means they're highly compressable. They are spread throughout numerous directories where there are configured monitoring utilities... (4 Replies)
Discussion started by: msarro
4 Replies

5. Shell Programming and Scripting

Approach on Header record

All, I currently have a requirement to fetch a Date value from a table. And then insert a Header record into a file along with that date value. ex: echo "HDR"" "`date +%Y%j` `date +%Y%m%d` In the above example I used julian date and standard date using Current Date. But the requirement... (0 Replies)
Discussion started by: cmaroju
0 Replies

6. Programming

Oracle Procedure approach

HI All , I am new to oracle procedures. Please help me for the approach to satify the requirement. I need to create procedures. with parameters passed ( say report,type,identities,country ) It should also call sql query within the procedures and passed parameters should be used in where clause... (2 Replies)
Discussion started by: Perlbaby
2 Replies

7. Shell Programming and Scripting

Best Approach To Encrypt The Passwords

Hello All, I am using the red hat Linux OS and bash shell scripting. Below is my requirement. I need to store encrypted the passwords of database accounts, ftp acccounts into a file1. Encrypt that file1 or make it secure with password to open & read it. Later in shell scripts I need to... (12 Replies)
Discussion started by: Ariean
12 Replies

8. Shell Programming and Scripting

Help with approach and developing script

Hi- I need to develop a script for following scenario in AIX and K shell environment.I am from windows server background for most my career ,so please bear with me and advise suitable approach and technical assistance.Having said that I am aware of unix shell commands but never pput together at... (1 Reply)
Discussion started by: nirasm
1 Replies

9. UNIX for Beginners Questions & Answers

What is the right approach to take?

Hello every one, I will love to know what is the best approach to take in obtaining books online. I find it disturbing just googling a book online and downloading it without actually paying for it. I strongly believe that this is wrong and that i may not be able to unlock the key contents and... (2 Replies)
Discussion started by: despiragado
2 Replies
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)
All times are GMT -4. The time now is 04:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy