satellite/install/install.pl | 3 +-
spacewalk/setup/lib/Spacewalk/Setup.pm | 13 +++--------
spacewalk/setup/share/embedded_diskspace_check.py | 8 +++++--
web/modules/dobby/Dobby/CLI/BackupCommands.pm | 1
web/modules/dobby/Dobby/CLI/MaintCommands.pm | 6 +++++
web/modules/dobby/Dobby/CLI/MiscCommands.pm | 6 +++++
web/modules/dobby/scripts/check-oracle-space-usage.sh | 20 ++++++++++++++----
web/modules/dobby/scripts/db-control | 14 ++++++++++--
8 files changed, 53 insertions(+), 18 deletions(-)
New commits:
commit f7451d3ddaf8be83fa551dfe59f8717547a59f57
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Oct 22 16:24:35 2012 +0200
805822 - warn about parsing backup log
diff --git a/web/modules/dobby/Dobby/CLI/BackupCommands.pm b/web/modules/dobby/Dobby/CLI/BackupCommands.pm
index 2e6c145..57e7825 100644
--- a/web/modules/dobby/Dobby/CLI/BackupCommands.pm
+++ b/web/modules/dobby/Dobby/CLI/BackupCommands.pm
@@ -149,6 +149,7 @@ sub command_restore {
$cli->fatal("Error: restoration failed, unable to locate $restore_log") unless -r $restore_log;
my $d = new Dobby::DB;
+ print "Parsing backup log.\n";
my $log = Dobby::BackupLog->parse($restore_log);
if ($log->type ne 'cold') {
commit 2a0c7b309b6960d8598667fb53c6a476e024bb05
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Oct 22 16:23:57 2012 +0200
805822 - mark some commands as Oracle only and sync --help with man page
diff --git a/web/modules/dobby/Dobby/CLI/MaintCommands.pm b/web/modules/dobby/Dobby/CLI/MaintCommands.pm
index c5d7fb5..ad74be5 100644
--- a/web/modules/dobby/Dobby/CLI/MaintCommands.pm
+++ b/web/modules/dobby/Dobby/CLI/MaintCommands.pm
@@ -44,6 +44,9 @@ sub command_extend {
my $ts = shift;
$ts = uc($ts);
+ my $backend = PXT::Config->get('db_backend');
+ $cli->fatal("Error: This command works only with Oracle.") unless ($backend eq 'oracle');
+
$cli->usage("TABLESPACE") unless $ts;
my $d = new Dobby::DB;
@@ -140,6 +143,9 @@ sub gather_stats {
sub shrink_segments {
my $cli = shift;
+ my $backend = PXT::Config->get('db_backend');
+ $cli->fatal("Error: This command works only with Oracle.") unless ($backend eq 'oracle');
+
my $d = new Dobby::DB;
if (not $d->database_started) {
diff --git a/web/modules/dobby/Dobby/CLI/MiscCommands.pm b/web/modules/dobby/Dobby/CLI/MiscCommands.pm
index 29af33e..d1c3673 100644
--- a/web/modules/dobby/Dobby/CLI/MiscCommands.pm
+++ b/web/modules/dobby/Dobby/CLI/MiscCommands.pm
@@ -260,6 +260,9 @@ sub command_resetpassword {
sub command_get_optimizer {
my $cli = shift;
+ my $backend = PXT::Config->get('db_backend');
+ $cli->fatal("Error: This command works only with Oracle.") unless ($backend eq 'oracle');
+
my $d = new Dobby::DB;
if (not $d->database_started) {
@@ -281,6 +284,9 @@ sub command_get_optimizer {
sub command_set_optimizer {
my $cli = shift;
+ my $backend = PXT::Config->get('db_backend');
+ $cli->fatal("Error: This command works only with Oracle.") unless ($backend eq 'oracle');
+
my $d = new Dobby::DB;
if (not $d->database_started) {
diff --git a/web/modules/dobby/scripts/db-control b/web/modules/dobby/scripts/db-control
index 09fb555..689c5e5 100755
--- a/web/modules/dobby/scripts/db-control
+++ b/web/modules/dobby/scripts/db-control
@@ -60,10 +60,12 @@ B<db-control>
[B<examine DIRNAME>]
[B<extend TABLESPACE>]
[B<gather-stats PCT>]
+[B<get-optimizer>]
[B<help>]
[B<report>]
[B<report-stats>]
[B<restore DIRNAME>]
+[B<set-optimizer>]
[B<shrink-segments>]
[B<start>]
[B<status>]
@@ -87,12 +89,16 @@ Examines the contents of a backup directory. Quicker than B<verify>, this comma
=item B<extend TABLESPACE>
-Increases the tablespace size for TABLESPACE by adding an additional datafile.
+Increases the tablespace size for TABLESPACE by adding an additional datafile. (Oracle only)
=item B<gather-stats PCT>
Gather statistics on database objects. On Oracle PCT is the percentage of rows to estimate (the default is 15 per cent). On PostgreSQL PCT does not have sense.
+=item B<get-optimizer>
+
+Show database optimizer mode (Oracle only).
+
=item B<help>
Gives a list of db-control options.
@@ -119,9 +125,13 @@ Restores the database from backup kept in DIRNAME. Database must be stopped for
Before restoring, the files in DIRNAME are verified. Once all files are verified successfully, the restore runs. Once the restore is completed, the database may be started and run normally.
+=item B<set-optimizer>
+
+Set database optimizer mode to ALL_ROWS (Oracle only).
+
=item B<shrink-segments>
-Determines and shrinks database segments with significant amount of free space.
+Determines and shrinks database segments with signifcant amount of free space. (Oracle only)
=item B<start>
commit c943527e40dc0cba0de83690c59fd1fc7df070d6
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Oct 22 16:23:31 2012 +0200
815236 - adopt check-oracle-space-usage.sh for PotgreSQL
diff --git a/web/modules/dobby/scripts/check-oracle-space-usage.sh b/web/modules/dobby/scripts/check-oracle-space-usage.sh
index 6ea4b48..1f4ac58 100755
--- a/web/modules/dobby/scripts/check-oracle-space-usage.sh
+++ b/web/modules/dobby/scripts/check-oracle-space-usage.sh
@@ -15,8 +15,13 @@ PATH=/usr/bin:/bin
export PATH
reportusage() {
- # don't report UNDO usage
- /sbin/runuser oracle -c "db-control report" | grep -E -v 'UNDO|TEMP'
+ # both command produce percent as 5th field and first row is header, which is ignored
+ if [ 0$(spacewalk-cfg-get db_backend) = "0postgresql" ]; then
+ df -h /var/lib/pgsql/data/
+ else
+ # don't report UNDO usage
+ /sbin/runuser oracle -c "db-control report" | grep -E -v 'UNDO|TEMP'
+ fi
}
mailitout() {
@@ -25,13 +30,20 @@ mailitout() {
#get Satellite email address
MAILADDRESS=$(spacewalk-cfg-get traceback_mail)
- SUBJECT="Warning - high tablespace usage on Satellite oracle DB"
+ if [ 0$(spacewalk-cfg-get db_backend) = "0postgresql" ]; then
+ SUBJECT="Warning - PostgreSQL database mount point is running out of space"
+ BODY="This is a notice to let you know that you have gone over 90% usage of
+the mount point where the PostgreSQL database resides. We recommend to be
+proactive and increase the storage before getting to 100% usage."
+ else
+ SUBJECT="Warning - high tablespace usage on Satellite oracle DB"
- BODY="This is a notice to let you know that you have gone over 90% usage in
+ BODY="This is a notice to let you know that you have gone over 90% usage in
one of the Oracle Tablespaces. We recommend to be proactive and increase the
size of the tablespace before getting to 100% usage. Please consult
the Satellite documentation on using db-control to increase the size or
contact Red Hat Support for assistance."
+ fi
echo -e "$BODY\n\n$reportusage" | mail -s "$SUBJECT" $MAILADDRESS
exit 0
commit c7bdf88c1dfcc415656f6c174d727a34a6e5e1ec
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Oct 22 16:22:48 2012 +0200
check free space under /var/lib/pgsql/data
diff --git a/spacewalk/setup/lib/Spacewalk/Setup.pm b/spacewalk/setup/lib/Spacewalk/Setup.pm
index 387a3c0..a024def 100644
--- a/spacewalk/setup/lib/Spacewalk/Setup.pm
+++ b/spacewalk/setup/lib/Spacewalk/Setup.pm
@@ -948,7 +948,7 @@ EOQ
if (not $opts->{"skip-db-diskspace-check"}) {
system_or_exit(['python', SHARED_DIR .
- '/embedded_diskspace_check.py'], 14,
+ '/embedded_diskspace_check.py', '/var/lib/pgsql/data', '12288'], 14,
'There is not enough space available for the embedded database.');
}
else {
commit 15e643fbbe2f2d33e6a2b8d04a3e9b20cc9199fd
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Oct 22 16:22:18 2012 +0200
modified embedded_diskspace_check to support non default directories
diff --git a/spacewalk/setup/share/embedded_diskspace_check.py b/spacewalk/setup/share/embedded_diskspace_check.py
index d10d14b..3fc89c4 100644
--- a/spacewalk/setup/share/embedded_diskspace_check.py
+++ b/spacewalk/setup/share/embedded_diskspace_check.py
@@ -166,7 +166,7 @@ def main(needsDict=None):
needsDict = needsDict or DEFAULT_NEEDS
- unfulfilled = getNeeds()[0]
+ unfulfilled = getNeeds(needsDict)[0]
if unfulfilled:
sys.stderr.write("ERROR: diskspace does not meet minimum system "
"requirements:\n")
@@ -194,5 +194,9 @@ def main(needsDict=None):
if __name__ == "__main__":
- sys.exit(main() or 0)
+ needsDict = {}
+ if sys.argv:
+ for i, dir in enumerate(sys.argv[1::2]):
+ needsDict[dir] = int(sys.argv[i*2+2]) * 2**20 # in MB
+ sys.exit(main(needsDict) or 0)
commit 7447b192a2ad2bc97dbf83175670e0defa55bfe7
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Oct 22 16:22:15 2012 +0200
don't print error messages if postgresql is not set up yet
diff --git a/spacewalk/setup/lib/Spacewalk/Setup.pm b/spacewalk/setup/lib/Spacewalk/Setup.pm
index a6cefce..387a3c0 100644
--- a/spacewalk/setup/lib/Spacewalk/Setup.pm
+++ b/spacewalk/setup/lib/Spacewalk/Setup.pm
@@ -933,7 +933,8 @@ sub postgresql_setup_embedded_db {
return 0;
}
- if (! system(qq{/usr/bin/spacewalk-setup-embedded-postgresql check --db $answers->{'db-name'}})) {
+ if (-d "/var/lib/pgsql/data/base" and
+ ! system(qq{/usr/bin/spacewalk-setup-embedded-postgresql check --db $answers->{'db-name'}})) {
my $shared_dir = SHARED_DIR;
print loc(<<EOQ);
The embedded database appears to be already installed. Either rerun
commit f01d1397d795895e978cc70d94a9aabfb44ef9c5
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Mon Oct 22 16:21:54 2012 +0200
setup embedded db also during upgrade
diff --git a/spacewalk/setup/lib/Spacewalk/Setup.pm b/spacewalk/setup/lib/Spacewalk/Setup.pm
index b614893..a6cefce 100644
--- a/spacewalk/setup/lib/Spacewalk/Setup.pm
+++ b/spacewalk/setup/lib/Spacewalk/Setup.pm
@@ -928,14 +928,8 @@ sub postgresql_setup_embedded_db {
return 0;
}
- if ($opts->{'upgrade'}) {
- # FIXME: upgrade code should go here
- return 0;
- }
-
- if ($opts->{"skip-db-install"} || $opts->{"upgrade"}) {
+ if ($opts->{"skip-db-install"}) {
print loc("** Database: Embedded database installation SKIPPED.\n");
-
return 0;
}
commit 659f11bdac2aea0143f5b9643c47320a01d54a17
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Mon Oct 22 16:21:50 2012 +0200
new packages to be removed before upgrade
diff --git a/satellite/install/install.pl b/satellite/install/install.pl
index fdb01a8..7959851 100755
--- a/satellite/install/install.pl
+++ b/satellite/install/install.pl
@@ -486,7 +486,8 @@ sub remove_obsoleted_packages {
print "* Purging conflicting packages.\n";
my @pkgs = ('rhn-apache', 'rhn-modpython', 'rhn-modssl', 'rhn-modperl',
'perl-libapreq', 'bouncycastle-jdk1.4',
- 'quartz-oracle', 'jaf', 'jta');
+ 'quartz-oracle', 'jaf', 'jta',
+ 'python-sgmlop', 'xml-commons-apis', 'jakarta-commons-io', 'geronimo-specs-compat');
for my $pkg (@pkgs) {
if (system_debug('rpm', '-q', $pkg) == 0) {
system_debug('rpm', '-ev', '--nodeps', $pkg);