#!/usr/local/bin/perl # # $Header: createPrivileges.pl 04-nov-2004.08:44:19 dkjain Exp $ # # createPrivileges.pl # # Copyright (c) 2004, Oracle. All rights reserved. # # NAME # createPrivileges.pl - # # DESCRIPTION # # # NOTES # # # MODIFIED (MM/DD/YY) # dkjain 10/31/04 - Fixed unable to connect # dkjain 10/13/04 - dkjain_esa_impl2 # dkjain 10/13/04 - Creation # require "emd_common.pl"; require "semd_common.pl"; require "$ENV{EMDROOT}/sysman/admin/scripts/db/esaDbUtils.pl"; require "$ENV{EMDROOT}/sysman/admin/scripts/db/esaUtils.pl"; my %stdinArgs = get_stdinvars(); my $username = $stdinArgs{"EM_TARGET_USERNAME"}; my $password = $stdinArgs{"EM_TARGET_PASSWORD"}; my $address = $ENV{EM_TARGET_ADDRESS}; my $role = $ENV{EM_TARGET_ROLE}; my $mode = 0; if($role =~ /SYSDBA/i) { $mode = 2; } elsif($role =~ /SYSOPER/i) { $mode = 4; } my $dbh = open_db_connection("dbi:Oracle:", "$username@".$address,$password,$mode); getUserWithPrivs($dbh,"CREATE_PRIVILEGE","CREATE"); close_db_connection($dbh) ;