Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Restore database improve code Post 303046015 by RudiC on Tuesday 21st of April 2020 03:44:29 PM
Old 04-21-2020
Quote:
Originally Posted by mustfirst
let me know if you can suggest any improvement in my code. I think i have too many ECHO.
.
.
.
Yes, definitely. After running this 10 times, you'll be fed up with its verbosity and scrap all the output except for error messages. *nix philosophy: no news is good news.
You may want to better structure your code. You've done some block building, yes, but e.g. indenting might improve readability and understandability for future you, and others.
 

4 More Discussions You Might Find Interesting

1. AIX

mksysb restore - Wrong OS level for restore

Hi all, I am still working on my mksysb restore. My latest issue is during an alt_disk_install from tape I got the following error after all the data had been restored. 0505-143 alt_disk_install: Unable to match mksysb level 5.2.0 with any available boot images. Please correct this... (0 Replies)
Discussion started by: pobman
0 Replies

2. Solaris

Restore a database on solaris..

hi All, Can anyone help me with the set of commands which are used to restore maybe a sybase database on solaris.. (1 Reply)
Discussion started by: sankasu
1 Replies

3. Programming

Improve the performance of my C++ code

Hello, Attached is my very simple C++ code to remove any substrings (DNA sequence) of each other, i.e. any redundant sequence is removed to get unique sequences. Similar to sort | uniq command except there is reverse-complementary for DNA sequence. The program runs well with small dataset, but... (11 Replies)
Discussion started by: yifangt
11 Replies

4. Shell Programming and Scripting

Improve awk code that has three separate parts

I have a very inefficient awk below that I need some help improving. Basically, there are three parts, that ideally, could be combined into one search and one output file. Thank you :). Part 1: Check if the user inputted string contains + or - in it and if it does the input is writting to a... (4 Replies)
Discussion started by: cmccabe
4 Replies
PG_STAGING(5)							  [FIXME: manual]						     PG_STAGING(5)

NAME
pg_staging - Prepare a staging environment from http accessible backups SYNOPSIS
[GLOBAL] [database_name.env] DESCRIPTION
Configuration file is a .ini containing several sections: first a GLOBAL section containing common options to the following sections, then a section per target database. SECTIONS
The [DEFAULT] section allows to provide default values for any setting describe here, that you can override in any of the specific sections. Each specific section represent a target database to restore. The options will allow to say from which backup and on which host. The host knob is used in commands such as pg_restore, scp and ssh, so can be either an ip address or a hostname (resolv.conf applies). OPTIONS
backup_host Which host to connect to to fetch the backup file. HTTP only. backup_base_url Path leading to the backup for the section's database. The database dump file will get expanded to dbname.date -I.dump, this is not (yet?) configurable as of version 0.5. dumpall_url Path to the cluster pg_dumpall -g accompanying file, e.g. 8.2-main.globals.sql. host Target where to restore the dump file and manage pgbouncer setup. dbname Database name, will get appended by the backup date to form a dbname_YYYYMMDD name. dbowner Owner of the database to get restored. dbuser Maintenance database role used in the connections to create or drop databases. maintdb Maintenance database to connect to, usually postgres. db_encoding Database encoding to use in the following statement: CREATE DATABASE ... WITH OWNER "..." ENCODING '...'; postgres_port PostgreSQL port to use in pgbouncer configuration file. postgres_major Major version of postgresql, allows to choose the pg_restore binary with the default settings. pgbouncer_port pgbouncer port to connect to, used for all pg_staging operations. pgbouncer_conf Configuration file name for pgbouncer, e.g. +/etc/pgbouncer/pgbouncer.ini/ remove_dump boolean (True or False) to control if pg_staging removes the dump file after restore. keep_bases How many databases to keep arround, pg_staging drops less recent databases. Not Yet Implemented as of 0.5. auto_switch boolean to control if pg_staging switches pgbouncer configuration at restore time use_sudo boolean, used when invoking staging-client.sh pg_restore /usr/lib/postgresql/%(postgres_major)s/bin/pg_restore pg_restore_st boolean, use --single-statement option (-1) in pg_restore. restore_vacuum boolean, when true the restore command will VACUUM ANALYZE the database. restore_jobs Number of working process to use at the same time while restoring. Will set the -j option to pg_restore and will not check for you that you're using a pg_restore client version 8.4 or newer. replication configuration filename where to setup the replication options. tmpdir Directory where to fetch backup files, defaults to /tmp. Command line argument -t will override .ini setting. sql_path Directory where to dispose SQL files to be sourced with the psql utility, in alphabetical order. This directory may contain a pre and a post subdirectories containing files following the shell *.sql global pattern. No subdirectory of pre and post will get walked into. The name of the section using the files will always get expanded to the given sql_path. schemas List of schema (comma separated) to restore. If present, any schema not listed here nor in schemas_nodata will get filtered out from the pg_restore catalog. search_path List of schemas (comma separated) to add to the database search_path, using the SQL command +ALTER DATABASE self.dbname SET search_path TO +. schemas_nodata List of schema (comma separated) to restore without content. The pg_restore catalog TABLE DATA sections will get filtered out. EXAMPLE
[DEFAULT] backup_host = backup1.backbone dbuser = postgres maintdb = postgres postgres_port = 5432 postgres_major = 8.3 pgbouncer_port = 6432 pgbouncer_conf = /etc/pgbouncer/pgbouncer.ini remove_dump = True keep_bases = 2 auto_switch = True use_sudo = True pg_restore = /usr/lib/postgresql/%(postgres_major)s/bin/pg_restore pg_restore_st = True restore_vacuum = True restore_jobs = 1 replication = replication.ini [allopass_db.dev] backup_base_url = /PostgreSQL/allopass_db/nightly/ dumpall_url = /PostgreSQL/clusters/bdd.allopass/8.2-main.globals.sql host = bdd.allopass.dev postgres_major = 8.2 dbname = allopass_db dbowner = root schemas = public, payment, utils, jdb SEE ALSO
pg_staging(1) AUTHOR
pg_staging is written by Dimitri Fontaine <dim@tapoueh.org[1]>. NOTES
1. dim@tapoueh.org mailto:dim@tapoueh.org [FIXME: source] 11/24/2009 PG_STAGING(5)
All times are GMT -4. The time now is 04:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy