Hi, I needed the new Oracle 12c feature to connect to the database with SYSBACKUP. So I patched the latest DBD::Oracle.
This patch supports ORA_SYSBACKUP, ORA_SYSDG and ORA_SYSKM.
The OCI parameter are OCI_SYSBKP, OCI_SYSDGD and OCI_SYSKMT
but since DBD::Oracle will be used by users who are used to use '/ as
sysbackup'
I decided to use ORA_SYSBACKUP over ORA_SYSBKP.
My test results :
Extract from my $OH/rdbms/lib/config.c
#define SS_DBA_GRP "dba"
#define SS_OPER_GRP "dba"
#define SS_ASM_GRP ""
#define SS_BKP_GRP "bkpdba"
#define SS_DGD_GRP "dgddba"
#define SS_KMT_GRP "kmtdba"
My os users :
grep dba /etc/passwd
bkpdba:x:4102:15001::/home/bkpdba:/bin/bash
dgddba:x:4103:15002::/home/dgddba:/bin/bash
kmtdba:x:4104:15003::/home/kmtdba:/bin/bash
My os grps :
grep dba /etc/group
dba:x:15000:
bkpdba:x:15001:oracle
dgddba:x:15002:oracle
kmtdba:x:15003:oracle
Test script (quick and dirty) :
#!/usr/local/bin/perl
use DBI;
use DBD::Oracle qw(:ora_session_modes);
use Data::Dumper;
my @session_modes = (ORA_SYSDBA, ORA_SYSBACKUP, ORA_SYSKM, ORA_SYSDG);
print "Execution user is :\n";
system("id");
foreach $session_mode ( @session_modes ) {
printf( "Session mode is %x\n", $session_mode);
$dbh = DBI->connect("dbi:Oracle:", "/", "", {PrintError=>0,
ora_session_mode=>$session_mode});
if (defined $dbh) {
$ary_ref = $dbh->selectall_arrayref("SELECT username FROM
user_users");
print $ary_ref->[0]->[0]."\n";
$dbh->disconnect;
} else {
print $DBI::errstr . "\n";
}
print "\n";
}
Execution user is :
uid=80000649(oracle) gid=15000(dba)
groups=15000(dba),15001(bkpdba),15002(dgddba),15003(kmtdba)
context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
Session mode is 2
SYS
Session mode is 20000
SYSBACKUP
Session mode is 80000
SYSKM
Session mode is 40000
SYSDG
Execution user is :
uid=4102(bkpdba) gid=15001(bkpdba) groups=15001(bkpdba)
context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
Session mode is 2
ORA-01017: invalid username/password; logon denied (DBD ERROR:
OCISessionBegin)
Session mode is 20000
SYSBACKUP
Session mode is 80000
ORA-01017: invalid username/password; logon denied (DBD ERROR:
OCISessionBegin)
Session mode is 40000
ORA-01017: invalid username/password; logon denied (DBD ERROR:
OCISessionBegin)
Execution user is :
uid=4103(dgddba) gid=15002(dgddba) groups=15002(dgddba)
context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
Session mode is 2
ORA-01017: invalid username/password; logon denied (DBD ERROR:
OCISessionBegin)
Session mode is 20000
ORA-01017: invalid username/password; logon denied (DBD ERROR:
OCISessionBegin)
Session mode is 80000
ORA-01017: invalid username/password; logon denied (DBD ERROR:
OCISessionBegin)
Session mode is 40000
SYSDG
Execution user is :
uid=4104(kmtdba) gid=15003(kmtdba) groups=15003(kmtdba)
context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
Session mode is 2
ORA-01017: invalid username/password; logon denied (DBD ERROR:
OCISessionBegin)
Session mode is 20000
ORA-01017: invalid username/password; logon denied (DBD ERROR:
OCISessionBegin)
Session mode is 80000
SYSKM
Session mode is 40000
ORA-01017: invalid username/password; logon denied (DBD ERROR:
OCISessionBegin)
Met vriendelijke groeten,
Yours truly,
Kris Lemaire, Oracle DBA
Tel. + 32 15 35 93 38 - fax + 015 35 20 18 - [email protected]
Application Hosting Product Factory 1 - Server Frameworks - Databases
KBC Global Services NV, COX (MECPark4 - COR+2 - CMS Infrastructuur -
Databanken)
E. Walschaertsstraat 3, 2800 Mechelen, België
For additional information on our private cloud services we recommend the
HPC portal (available internal KBC only)
Be green – keep it on the screen. Please think before you print this
e-mail.
KBC Global NV, Havenlaan 2, 1080 Brussels, Belgium, VAT BE 0465.746.488,
RLP Brussels
A division of the KBC-group
This e-mail and any attached files are confidential and may be legally
privileged. If you are not the addressee, any disclosure, reproduction,
copying, distribution, or other dissemination or use of this communication is
strictly prohibited. If you have received this transmission in error please
notify KBC immediately and then delete this e-mail.
KBC does not accept liability for the correct and complete transmission of the
information, nor for any delay or interruption of the transmission, nor for
damages arising from the use of or reliance on the information.
All e-mail messages addressed to, received or sent by KBC or KBC employees are
deemed to be professional in nature. Accordingly, the sender or recipient of
these messages agrees that they may be read by other KBC employees than the
official recipient or sender in order to ensure the continuity of work-related
activities and allow supervision thereof.
<<image/png>>
DBD-Oracle-1.66.withSYSBACKUP.patch
Description: Binary data
