[Spacewalk-list] db-control and Oracle XE?

David Nutter davidn at bioss.sari.ac.uk
Wed Sep 17 09:17:47 UTC 2008


Hello,

I've been trying to follow the instructions here 

http://www.redhat.com/docs/manuals/satellite/Red_Hat_Network_Satellite-5.1.0/html/Installation_Guide/s1-maintenance-backup.html

to use db-control to backup my Spacwalk instance which is using Oracle
XE. Out of the box, backup, status and report attempts fail with:

-bash-3.2$ db-control status

Unknown error code 12545 ORA-12545: Connect failed because target host or object does not exist (DBD ERROR: OCIServerAttach) at
/usr/lib/perl5/site_perl/5.8.8/Dobby/CLI/MiscCommands.pm line 86

In /usr/lib/oracle/xe/sqlnet.log I get what's in sqlnet-12545.log
(attached). Connection attempts seem to be via the BEQ protocol rather
than TCP. 

After googling I tried "export TWO_TASK=XE" as the oracle user with
the following results:

-bash-3.2$ db-control status

Unknown error code 1031 ORA-01031: insufficient privileges (DBD ERROR: OCISessionBegin) at
/usr/lib/perl5/site_perl/5.8.8/Dobby/CLI/MiscCommands.pm line 86

OK, so we seem to have a connection. After a bit more digging around I
found and edited /etc/rhn/default/rhn_dobby.conf as follows:

-------------------------
sid = XE

sysdba_username = sys
sysdba_password = sys_password_entered_during_spacewalk-setup

normal_username = spacewalk-user
normal_password = spacewalk-password

remote_dsn =

oracle_home = /opt/apps/oracle/web/product/10.2.0/db_1
data_dir_format = /rhnsat/data/%s
hot_backup_dir_format = /rhnsat/hot-backups/%s/b%02d
archive_dir_format = /rhnsat/admin/%s/archive

oracle_user = oracle
-------------------------

Then I get the following: 

bash-3.2$ export TWO_TASK=XE
bash-3.2$ db-control status
The database is running and accepting connections.

Hurrah! At this point "status" and "report" work. However, backup fails with:

[root at spacewalk default]# /sbin/service rhn-satellite stop
Shutting down rhn-satellite...
Stopping satellite-httpd:                                  [  OK  ]
Stopping tomcat5:                                          [  OK  ]
Stopping RHN Taskomatic...
Stopped RHN Taskomatic.
Shutting down rhn-database:                                [  OK  ]
Done.

[root at spacewalk default]# su - oracle

bash-3.2$ export TWO_TASK=XE
bash-3.2$ db-control backup /tmp/backup-`date +%F`
Database is running; please stop before running a cold backup.


Weird. I decided to try stopping the Oracle XE instance, but then I
just get

host $ db-control backup /tmp/backup-`date +%F`

Unknown error code 12541 ORA-12541: TNS:no listener (DBD ERROR: OCIServerAttach) at
/usr/lib/perl5/site_perl/5.8.8/Dobby/CLI/BackupCommands.pm line 72


Source diving reveals the line:

$cli->fatal("Database is running; please stop before running a cold backup.") if $d->instance_state ne 'OFFLINE';

at /usr/lib/perl5/site_perl/5.8.8/Dobby/CLI/BackupCommands.pm:72

Presumably the instance is not reporting itself as offline after a
/sbin/service rhn-satellite stop and indeed "db-control status"
reports that the database is accepting connections after stopping
rhn-satellite but with Oracle XE itself still running. Commenting out
the above line results in:

-bash-3.2$ db-control backup /tmp/backup-2008-09-16
Initiating cold backup of database XE...
opendir /rhnsat/data/XE: No such file or directory

Tweaking the data_dir_format, hot_backup_dir_format and
archive_dir_format in rhn_dobby.conf would be the next logical step
but I don't know where hot backups and archives are kepts under Oracle
XE.

Anyone got pointers to resolve these problems? I couldn't find
anything in the Spacealk documentation about it, so maybe this tool is
entirely specific to the Satellite product and can't be used with
Spacewalk at the moment.

Logs for the ORA-12545 and ORA-12541 errors in sqlnet.log are
attached. 

Thanks & regards,

-- 
David Nutter  				Tel: +44 (0)131 650 4888
BioSS, JCMB, King's Buildings, Mayfield Rd, EH9 3JZ. Scotland, UK 

Biomathematics and Statistics Scotland (BioSS) is formally part of The
Scottish Crop Research Institute (SCRI), a registered Scottish charity
No. SC006662
-------------- next part --------------
***********************************************************************
Fatal NI connect error 12545, connecting to:
 (DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=/opt/apps/oracle/web/product/10.2.0/db_1/bin/oracle)(ARGV0=oracleXE)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')(DETACH=NO))(CONNECT_DATA=(CID=(PROGRAM=perl)(HOST=spacewalk.bioss.sari.ac.uk)(USER=oracle))))

  VERSION INFORMATION:
        TNS for Linux: Version 10.2.0.4.0 - Production
        Oracle Bequeath NT Protocol Adapter for Linux: Version 10.2.0.4.0 - Production
        TCP/IP NT Protocol Adapter for Linux: Version 10.2.0.4.0 - Production
  Time: 16-SEP-2008 17:55:30
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12545
    TNS-12545: Message 12545 not found; No message file for product=network, facility=TNS
    ns secondary err code: 12560
    nt main err code: 515
    TNS-00515: Message 515 not found; No message file for product=network, facility=TNS
    nt secondary err code: 2
    nt OS err code: 0

-------------- next part --------------
***********************************************************************
Fatal NI connect error 12541, connecting to:
 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=xe)(CID=(PROGRAM=perl)(HOST=spacewalk.bioss.sari.ac.uk)(USER=oracle))))

  VERSION INFORMATION:
        TNS for Linux: Version 10.2.0.4.0 - Production
        TCP/IP NT Protocol Adapter for Linux: Version 10.2.0.4.0 - Production
  Time: 16-SEP-2008 17:50:19
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12541
    TNS-12541: Message 12541 not found; No message file for product=network, facility=TNS
    ns secondary err code: 12560
    nt main err code: 511
    TNS-00511: Message 511 not found; No message file for product=network, facility=TNS
    nt secondary err code: 111
    nt OS err code: 0



More information about the Spacewalk-list mailing list