#!/usr/local/bin/perl # # $Header: exemptAccessPolicy.pl 04-nov-2004.08:50:15 dkjain Exp $ # # exemptAccessPolicy.pl # # Copyright (c) 2004, Oracle. All rights reserved. # # NAME # exemptAccessPolicy.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 # ################################################################################# ################Actually This Script Is Meant For OLS And FGAC Environment Only. ################But how do figure out this ????? ################################################################################# 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); getUserWithPrivileges($dbh, "EXEMPT_ACCESS_POLICY","EXEMPT ACCESS POLICY"); close_db_connection($dbh) ;