Skip to content
Snippets Groups Projects
Commit 71f02dbb authored by Dennis Waldron's avatar Dennis Waldron
Browse files

Initial Revision

parent 2f3b3b4b
Branches
Tags
No related merge requests found
fillType2Obj.sql
oracleCommon.sql
oraclePerm.sql
oracleStager.sql
oracleJob.sql
oracleQuery.sql
oracleTape.sql
oracleGC.sql
oracleDebug.sql
/******************************************************************************
* stager_oracle_grant.sql
*
* This file is part of the Castor project.
* See http://castor.web.cern.ch/castor
*
* Copyright (C) 2003 CERN
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* @(#)$RCSfile: stager_oracle_grant.sql,v $ $Release: 1.2 $ $Release$ $Date: 2009/02/05 16:12:48 $ $Author: waldron $
*
* This script grant access to all tables through the castor_read account
*
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
DECLARE
unused NUMBER;
BEGIN
-- Check to see if the castor_read user exists
SELECT user_id INTO unused FROM all_users WHERE username = 'CASTOR_READ';
-- Grant select on all tables, excluding temporary ones to the castor_read
-- account. Note: there is no easy GRANT SELECT ON ANY syntax here so we
-- must loop on all tables.
FOR a IN (SELECT table_name FROM user_tables WHERE temporary = 'N')
LOOP
EXECUTE IMMEDIATE 'GRANT SELECT ON '||a.table_name||' TO castor_read';
END LOOP;
-- The castor_read account is not mandatory so if it doesn't exist do nothing
EXCEPTION WHEN NO_DATA_FOUND THEN
NULL;
END;
/
/* End-of-File */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment