Script to create user OUTLN in 9i

Hi,
Note 240478.1 "Script to create user OUTLN in 9i"
This script create OUTLN user.
And then should we :
" issue grants, create tables and indexes."
The qustion is :
should we issue grants, create tables and indexes after executing the script ? Then
create which tables , which indexes ? Does the script it-self do not this
Many thanks before.

I suggest you to read
Oracle9i Database Performance Tuning Guide and Reference
Release 2 (9.2)
Part Number A96533-02
Chapter 7. Using Plan Stability
~ Madrid

Similar Messages

  • Modify Script to Create User Role on Single Database.

    Hi All,
    Below is the script to create user role on database. Here problem is when I execute this script, it creates user role for all database within an instance and I want it to create user role only on 2 database say TEST1 and TEST2
    Can anyone help me to modify the script? 
    --===================================================================================
    -- Description
    -- Database Type: MSSQL
    -- This script creates a role called 'gdmmonitor' for ALL databases.
    -- It grants some system catalogs to this role to allow Classification and Assessment on the database.
    -- It then adds a user called "sqlguard" to all databases and grants this user gdmmonitor role.
    -- before runnign this script
    --  you MUST CREATE A SQL LOGIN CALLED 'sqlguard'
    --  This sqlguard login doesn't need to be added to any database or given
    --  any privilege.  The script will take care of that.
    --  Note:
    --   If you wish to use a different login name (instead of 'sqlguard') you need to change
    --   the value of the variable '@Guardium_user' in the script below; 
    --   (Look for the string: "set @Guardium_user = 'sqlguard'" and replace the 'sqlguard')
    -- after runnign this script
    -- Nothing to do, the script already creates the db user
    -- User/Password to use
    -- User: sqlguard (or any other name, if changed)
    -- Pass: user defined
    -- Role: gdmmonitor
    --===================================================================================
    PRINT '>>>==================================================================>>>'
    PRINT '>>> Creating role: "gdmmonitor" at the server level.'
    PRINT '>>>==================================================================>>>'
    -- Change to the master database
    USE master
    -- *** If a different login name is desired, define it here. ***
    DECLARE @Guardium_user AS varchar(50)
    set @Guardium_user = 'sqlguard'
    DECLARE @dbName AS varchar(256)
    DECLARE @memberName AS varchar(256)
    DECLARE @dbVer AS nvarchar(128)
    SET     @dbVer = CAST(serverproperty('ProductVersion') AS nvarchar)
    SET     @dbVer = SUBSTRING(@dbVer, 1, CHARINDEX('.', @dbVer) - 1)
    IF (@dbVer = '8') SET @dbVer = '2000'
    ELSE IF (@dbVer = '9')  SET @dbVer = '2005'
    ELSE IF (@dbVer = '10')  SET @dbVer = '2008'
    ELSE IF (@dbVer = '11')  SET @dbVer = '2012'
    ELSE SET @dbVer = '''Unsupported Version'''
    IF (@dbVer != '2000')
    BEGIN
      -- This privilege is required to peform a specific MSSQL test.
      -- Test name: SQL OLEDB disabled (DisallowAdhocAccess registry key) 
      -- Procedure execute: EXEC master.dbo.sp_MSset_oledb_prop 
      -- Purpose: To display provider property, not changing anything.
      PRINT '==> Granting MSSSQL 2005 and above setupadmin server role'
      EXEC master..sp_addsrvrolemember @loginame = @Guardium_user, @rolename = N'setupadmin'
    END
    SELECT  @dbName = DB_NAME()
    PRINT '==> Starting MSSql ' + @dbVer + ' role creation on database: ' + @dbName
    -- find any members of the role if they exist
    CREATE TABLE #rolemember (membername VARCHAR(256) NOT NULL)
    INSERT INTO #rolemember
    SELECT DISTINCT usr.name FROM dbo.sysusers usr, .dbo.sysmembers mbr
    WHERE usr.uid = mbr.memberuid
    AND mbr.groupuid = (SELECT uid FROM .dbo.sysusers WHERE name = 'gdmmonitor')
    --  Drop the Role Members If they exist
    IF EXISTS (SELECT count(*) FROM #rolemember)
    BEGIN
      PRINT '==> Dropping the gdmmonitor role members on: ' + @dbName
      DECLARE DropCursor CURSOR FOR SELECT membername from #rolemember
      OPEN DropCursor
      FETCH DropCursor INTO @memberName
      WHILE @@Fetch_Status = 0
       BEGIN
        PRINT '==> Dropping member: ''' + @memberName + ''''
        exec('EXEC sp_droprolemember ''gdmmonitor'', ''' + @memberName + ''' ;')
        FETCH DropCursor INTO @memberName
       END
      CLOSE DropCursor
      DEALLOCATE DropCursor
    END
    -- drop the role if it exists
    IF EXISTS (SELECT 1 FROM .dbo.sysusers WHERE name = 'gdmmonitor')
    BEGIN
      PRINT '==> Dropping the role gdmmonitor on: ' + @dbName
      exec sp_droprole 'gdmmonitor'
    END
    -- Create the role
    PRINT '==> Creating the role gdmmonitor on: ' + @dbName
    exec sp_addrole 'gdmmonitor'
    -- Grant select privileges to the role for MSSql Common
    PRINT '==> Granting common SELECT privileges on: ' + @dbName
    GRANT SELECT ON dbo.spt_values     TO gdmmonitor
    GRANT SELECT ON dbo.sysmembers     TO gdmmonitor
    GRANT SELECT ON dbo.sysobjects     TO gdmmonitor
    GRANT SELECT ON dbo.sysprotects    TO gdmmonitor
    GRANT SELECT ON dbo.sysusers       TO gdmmonitor
    GRANT SELECT ON dbo.sysconfigures  TO gdmmonitor
    GRANT SELECT ON dbo.sysdatabases   TO gdmmonitor
    GRANT SELECT ON dbo.sysfiles       TO gdmmonitor
    GRANT SELECT ON dbo.syslogins      TO gdmmonitor
    GRANT SELECT ON dbo.syspermissions TO gdmmonitor
    -- Grant execute privileges to the role for MSSql Common
    PRINT '==> Granting common EXECUTE privileges on: ' + @dbName
    GRANT EXECUTE ON sp_helpdbfixedrole    TO gdmmonitor
    GRANT EXECUTE ON sp_helprotect         TO gdmmonitor
    GRANT EXECUTE ON sp_helprolemember     TO gdmmonitor
    GRANT EXECUTE ON sp_helpsrvrolemember  TO gdmmonitor
    GRANT EXECUTE ON sp_tables             TO gdmmonitor
    GRANT EXECUTE ON sp_validatelogins     TO gdmmonitor
    GRANT EXECUTE ON sp_server_info       TO gdmmonitor
    -- Check if the version is 2005 or greater
    IF (@dbVer != '2000')
    BEGIN
      -- Grant select privileges to the role for MSSql 2005 and above
      PRINT '==> Granting MSSql 2005 and above SELECT privileges on: ' + @dbName
      GRANT SELECT ON sys.all_objects           TO gdmmonitor
      GRANT SELECT ON sys.database_permissions  TO gdmmonitor
      GRANT SELECT ON sys.database_principals   TO gdmmonitor
      GRANT SELECT ON sys.sql_logins            TO gdmmonitor
      GRANT SELECT ON sys.sysfiles              TO gdmmonitor
      GRANT SELECT ON sys.database_role_members TO gdmmonitor 
      GRANT SELECT ON sys.server_role_members   TO gdmmonitor 
      GRANT SELECT ON sys.configurations        TO gdmmonitor
      GRANT SELECT ON sys.master_key_passwords  TO gdmmonitor
      GRANT SELECT ON sys.server_principals     TO gdmmonitor
      GRANT SELECT ON sys.server_permissions    TO gdmmonitor
      GRANT SELECT ON sys.credentials    
       TO gdmmonitor
      --This is called by master.dbo.sp_MSset_oledb_prop.  
      --By defautl it should have already been granted to public. 
      GRANT EXECUTE ON sys.xp_instance_regread TO GDMMONITOR
      GRANT EXECUTE ON sys.sp_MSset_oledb_prop TO GDMMONITOR 
    END
    -- Re-add the dropped members
    IF EXISTS (SELECT 1 FROM #rolemember)
    BEGIN
      PRINT '==> Re-adding the role members on: ' + @dbName
      DECLARE DropCursor CURSOR FOR SELECT membername from #rolemember
      OPEN DropCursor
      FETCH DropCursor INTO @memberName
      WHILE @@Fetch_Status = 0
        BEGIN
         PRINT '==> Re-adding member: ''' + @memberName + ''''
         exec('EXEC sp_addrolemember ''gdmmonitor'', ''' + @memberName + ''' ;')
         FETCH DropCursor INTO @memberName
        END
      CLOSE DropCursor
      DEALLOCATE DropCursor
    END
    -- END of role creation on database
    PRINT '==> END of role creation on: ' + @dbName
    PRINT ''
    -- Change to the msdb database
    USE msdb
    set @memberName = ''
    SELECT  @dbName = DB_NAME()
    PRINT '==> Starting MSSql ' + @dbVer + ' role creation on database: ' + @dbName
    -- find any members of the role if it exists
    TRUNCATE TABLE #rolemember
    INSERT INTO #rolemember
    SELECT DISTINCT usr.name FROM .dbo.sysusers usr, .dbo.sysmembers mbr
    WHERE usr.uid = mbr.memberuid
    AND groupuid = (SELECT uid FROM .dbo.sysusers WHERE name = 'gdmmonitor')
    --  Drop the Role Members If they exist
    IF EXISTS (SELECT count(*) FROM #rolemember)
    BEGIN
      PRINT '==> Dropping the gdmmonitor role members on: ' + @dbName
      DECLARE DropCursor CURSOR FOR SELECT membername from #rolemember
      OPEN DropCursor
      FETCH DropCursor INTO @memberName
      WHILE @@Fetch_Status = 0
       BEGIN
        PRINT '==> Dropping member: ''' + @memberName + ''''
        exec('EXEC sp_droprolemember ''gdmmonitor'', ''' + @memberName + ''' ;')
        FETCH DropCursor INTO @memberName
       END
      CLOSE DropCursor
      DEALLOCATE DropCursor
    END
    -- drop the role if it exists
    IF EXISTS (SELECT 1 FROM .dbo.sysusers WHERE name = 'gdmmonitor')
    BEGIN
      PRINT '==> Dropping the gdmmonitor role on: ' + @dbName
      exec sp_droprole 'gdmmonitor'
    END
    -- Create the role
    PRINT '==> Creating the gdmmonitor role on: ' + @dbName
    exec sp_addrole 'gdmmonitor'
    -- Grant select privileges to the role for MSSql Common
    PRINT '==> Granting common SELECT privileges on: ' + @dbName
    GRANT SELECT ON dbo.sysobjects     TO gdmmonitor
    GRANT SELECT ON dbo.sysusers       TO gdmmonitor
    GRANT SELECT ON dbo.sysprotects    TO gdmmonitor
    GRANT SELECT ON dbo.sysmembers     TO gdmmonitor
    GRANT SELECT ON dbo.sysfiles       TO gdmmonitor
    GRANT SELECT ON dbo.syspermissions TO gdmmonitor
    GRANT SELECT ON dbo.backupset   TO gdmmonitor
    -- Check if the version is 2005 or greater
    IF (@dbVer != '2000')
    BEGIN
      -- Grant select privileges to the role for MSSql 2005 and above
      PRINT '==> Granting MSSql 2005 and above SELECT privileges on: ' + @dbName
      GRANT SELECT ON sys.all_objects TO gdmmonitor
      GRANT SELECT ON sys.database_permissions TO gdmmonitor
      GRANT SELECT ON sys.database_principals TO gdmmonitor
      GRANT SELECT ON sys.sysfiles TO gdmmonitor
      -- Grant execute privileges to the role for MSSql 2005 or above
      PRINT '==> Granting MSSql 2005 and above EXECUTE privileges on: ' + @dbName
      GRANT EXECUTE ON msdb.dbo.sp_enum_login_for_proxy TO gdmmonitor
      GRANT SELECT ON sys.database_role_members  TO gdmmonitor
    END
    IF (@dbVer > '2000' and @dbVer < '2012') 
    --This sp is not available in SQL 2012
    BEGIN
      GRANT EXECUTE ON sp_get_dtspackage TO gdmmonitor
    END
    -- Re-add the dropped members
    IF EXISTS (SELECT count(*) FROM #rolemember)
    BEGIN
      PRINT '==> Re-adding the gdmmonitor role members on: ' + @dbName
      DECLARE DropCursor CURSOR FOR SELECT membername from #rolemember
      OPEN DropCursor
      FETCH DropCursor INTO @memberName
      WHILE @@Fetch_Status = 0
        BEGIN
         PRINT '==> Re-adding member: ''' + @memberName + ''''
         exec('EXEC sp_addrolemember ''gdmmonitor'', ''' + @memberName + ''' ;')
         FETCH DropCursor INTO @memberName
        END
      CLOSE DropCursor
      DEALLOCATE DropCursor
    END
    -- drop the temporary table
    DROP TABLE #rolemember
    -- END of role creation on database
    PRINT '==> END of gdmmonitor role creation on: ' + @dbName
    -- Role creation complete
    PRINT '<<<==================================================================<<<'
    PRINT '<<< END of creating role: "gdmmonitor" at the server level.'
    PRINT '<<<==================================================================<<<'
    PRINT ''
    PRINT '>>>==================================================================>>>'
    PRINT '>>> Starting application database role creation'
    PRINT '>>>==================================================================>>>'
    use master
    DECLARE @databaseName AS varchar(80)
    DECLARE @executeString AS varchar(7950)
    DECLARE @dbcounter as int   
    set @dbcounter = 0
    DECLARE DatabaseCursor CURSOR FOR SELECT name from sysdatabases where name not in ('master', 'msdb')
    and not (status & 1024 > 1)
    --read only
    and not (status & 4096 > 1)
    --single user
    and not (status & 512 > 1)
    --offline
    and not (status & 32 > 1)
    --loading
    and not (status & 64 > 1)
    --pre recovery
    and not (status & 128 > 1)
    --recovering
    and not (status & 256 > 1)
    --not recovered
    and not (status & 32768 > 1)
    --emergency mode
    OPEN DatabaseCursor
    FETCH DatabaseCursor INTO @databaseName
    WHILE @@Fetch_Status = 0
    BEGIN
    set @dbcounter = @dbcounter + 1     
    set @databaseName = '"' + @databaseName + '"'  
    set @executeString = ''
    set @executeString = 'use ' + @databaseName + ' ' +
             'PRINT ''>>>==================================================================>>>'' ' +
             'PRINT ''>>> Starting MSSql ' + @dbVer + ' role creation on database: ' + @databaseName + ''' ' +
             'PRINT ''>>>==================================================================>>>'' ' +
           '/* Variable @memberNameDBname must be declare within the string or else it will fail */ ' +
           'DECLARE @memberName' + cast(@dbcounter as varchar(5)) + ' as varchar(50) ' +
           '/*find any members of the role if it exists*/ ' +
             'CREATE TABLE #rolemember (membername VARCHAR(256) NOT NULL) ' +
             'INSERT INTO #rolemember ' +
             'SELECT DISTINCT usr.name FROM dbo.sysusers usr, dbo.sysmembers mbr ' +
             'WHERE usr.uid = mbr.memberuid ' +
             'AND groupuid = (SELECT uid FROM dbo.sysusers WHERE name = ''gdmmonitor'') ' +
             '/*Drop the Role Members If they exist*/ ' +
             'IF EXISTS (SELECT * FROM #rolemember) ' +
             'BEGIN ' +
               'PRINT ''==> Dropping the role members on: ' + @databaseName + ''' ' +
               'DECLARE DropCursor CURSOR FOR SELECT membername from #rolemember ' +
               'OPEN DropCursor ' +
               'FETCH DropCursor INTO @memberName' + cast(@dbcounter as varchar(5)) + ' ' +
               'WHILE @@Fetch_Status = 0 ' +
                 'BEGIN ' +
                 'PRINT ''==> Dropping member: '' + @memberName' + cast(@dbcounter as varchar(5)) + ' ' +
                 'exec(''EXEC sp_droprolemember ''''gdmmonitor'''', '''''' + @memberName' + cast(@dbcounter as varchar(5))  + ' + '''''';'') ' +
                 'FETCH DropCursor INTO @memberName' + cast(@dbcounter as varchar(5)) + ' ' +
                 'END ' +
               'CLOSE DropCursor ' +
               'DEALLOCATE DropCursor ' +
             'END ' +
             '/*drop the role if it exists*/ ' +
             'IF EXISTS (SELECT 1 FROM .dbo.sysusers WHERE name = ''gdmmonitor'') ' +
             'BEGIN ' +
               'PRINT ''==> Dropping the gdmmonitor role on: ' + @databaseName + ''' ' +
               'exec sp_droprole ''gdmmonitor'' ' +
             'END ' +
             '/* Create the role */ ' +
             'PRINT ''==> Creating the gdmmonitor role on: ' + @databaseName + ''' ' +
             'exec sp_addrole ''gdmmonitor'' ' +
             '/* Grant select privileges to the role for MSSql Common */ ' +
             'PRINT ''==> Granting common SELECT privileges on: ' + @databaseName + ''' ' +
             'GRANT SELECT ON dbo.sysmembers     TO gdmmonitor ' +
             'GRANT SELECT ON dbo.sysobjects     TO gdmmonitor ' +
             'GRANT SELECT ON dbo.sysprotects    TO gdmmonitor ' +
             'GRANT SELECT ON dbo.sysusers       TO gdmmonitor ' +
             'GRANT SELECT ON dbo.sysfiles       TO gdmmonitor ' +
                   'GRANT SELECT ON dbo.syspermissions TO gdmmonitor ' +
             '/* Check if the version is 2005 or greater */ ' +
             'IF (' + @dbVer + ' != ''2000'') ' +
             'BEGIN ' +
               '/* Grant select privileges to the role for MSSql 2005 and above */ ' +
               'PRINT ''==> Granting MSSql 2005 and above SELECT privileges on: ' + @databaseName + ''' ' +
               'GRANT SELECT ON sys.database_permissions TO gdmmonitor ' +
               'GRANT SELECT ON sys.all_objects          TO gdmmonitor ' +
               'GRANT SELECT ON sys.database_principals  TO gdmmonitor ' +
               'GRANT SELECT ON sys.sysfiles      TO gdmmonitor ' +          
               'GRANT SELECT ON sys.database_role_members  TO gdmmonitor ' +           
             'END ' +
             '/* Re-add the dropped members */ ' +
             'IF EXISTS (SELECT 1 FROM #rolemember) ' +
             'BEGIN ' +
               'PRINT ''==> Re-adding the gdmmonitor role members on: ' + @databaseName + ''' ' +
               'DECLARE DropCursor CURSOR FOR SELECT membername from #rolemember ' +
               'OPEN DropCursor ' +
               'FETCH DropCursor INTO @memberName' + cast(@dbcounter as varchar(5)) + ' ' +
               'WHILE @@Fetch_Status = 0 ' +
                 'BEGIN ' +
                   'PRINT ''==> Re-adding member: '' + @memberName' + cast(@dbcounter as varchar(5)) + ' ' +
                   'exec(''EXEC sp_addrolemember ''''gdmmonitor'''', '''''' + @memberName' + cast(@dbcounter as varchar(5))  + ' + '''''';'') ' +
                   'FETCH DropCursor INTO @memberName' + cast(@dbcounter as varchar(5)) + ' ' +
                 'END ' +
               'CLOSE DropCursor ' +
               'DEALLOCATE DropCursor ' +
             'END ' +
             '/* drop the temporary table */ ' +
             'DROP TABLE #rolemember ' +
             'PRINT ''<<<==================================================================<<<'' ' +
             'PRINT ''<<< END of role creation on: ' + @databaseName + ''' ' +
             'PRINT ''<<<==================================================================<<<'' ' +
             'PRINT '' ''' +
             'PRINT '' '''
    execute (@executeString)
    FETCH DatabaseCursor INTO @databaseName
    END
    CLOSE DatabaseCursor
    DEALLOCATE DatabaseCursor
    --  Adding user to all the databases
    --  and grant gdmmonitor role, only if login exists.
    PRINT '>>>==================================================================>>>'
    PRINT '>>> Add and Grant gdmmonitor role to: ''' + @Guardium_user + ''''
    PRINT '>>> on all databases.'
    PRINT '>>>==================================================================>>>'
    USE master
    /* Check if @Guardium_user is a login exist, if not do nothing.*/
    IF NOT EXISTS (select * from syslogins where name = @Guardium_user)
    BEGIN
      PRINT ''
      PRINT '************************************************************************'
      PRINT '*** ERROR: Could not find the login: ''' + @Guardium_user + ''''
      PRINT '***        Please add the login and re-run this script.'
      PRINT '************************************************************************'
      PRINT ''
    END
    ELSE
    BEGIN
      DECLARE @counter AS smallint
      set @counter = 0
      --  This loop runs 4 time just to make sure that the @Guardium_user gets added to all db.
      --  99% of the time, this is totally unnecessary.  But in some rare case on SQL 2005
      --  the loop skips some databases when it tried to add the @Guardium_user.
      --  After two to three executions, the user is added in all the dbs.
      --  Might be a SQL Server bug.
      WHILE @counter <= 3
      BEGIN
      set @counter = @counter + 1
        set @databaseName = ''
        set @executeString = ''
        DECLARE DatabaseCursor CURSOR FOR SELECT name from sysdatabases
        where not (status & 1024 > 1)
    --read only
        and not (status & 4096 > 1)
    --single user
        and not (status & 512 > 1)
    --offline
        and not (status & 32 > 1)
    --loading
        and not (status & 64 > 1)
    --pre recovery
        and not (status & 128 > 1)
    --recovering
        and not (status & 256 > 1)
    --not recovered
    and not (status & 32768 > 1)
    --emergency mode    
        OPEN DatabaseCursor
        FETCH DatabaseCursor INTO @databaseName
        WHILE @@Fetch_Status = 0
        BEGIN
        set @databaseName = '"' + @databaseName + '"' 
        set @executeString = ''
        set @executeString = 'use ' + @databaseName + ' ' +
                 '/*Check if the login already has access to this database */ ' +
                 'IF EXISTS (select * from sysusers where name = ''' + @Guardium_user + ''' and islogin = 1) ' +
                 'BEGIN ' +
                  '/*Check if login already have gdmmonitor role*/ ' +
                  'IF NOT EXISTS (SELECT usr.name FROM dbo.sysusers usr, dbo.sysmembers mbr WHERE usr.uid = mbr.memberuid ' +
                'AND mbr.groupuid = (SELECT uid FROM dbo.sysusers WHERE name = ''gdmmonitor'') ' +
                'AND usr.name = ''' + @Guardium_user + ''') ' +
                  'BEGIN ' +
                  'PRINT ''==> Granting gdmmonitor role to ' + @Guardium_user + ' on database ' + @databaseName + ''' ' +
                  'execute sp_addrolemember ''gdmmonitor''' + ', [' + @Guardium_user + '] ' +
                  'PRINT '' ''' +
                  'END ' +
                 'END ' +
                 'IF NOT EXISTS (select * from sysusers where name = ''' + @Guardium_user + ''' and islogin = 1) ' +
                 'BEGIN ' +
                 'PRINT ''==> Adding user [' + @Guardium_user + '] to database: ' + @databaseName + ''' ' +
                 'execute sp_adduser [' + @Guardium_user + '] ' +
                 'PRINT ''==> Granting gdmmonitor role to ' + @Guardium_user + ' on database '  + @databaseName + ''' ' +
                 'execute sp_addrolemember ''gdmmonitor''' + ', [' + @Guardium_user + '] ' +
                 'PRINT '' ''' +
                 'END '
        execute (@executeString)
        FETCH DatabaseCursor INTO @databaseName
        END
        CLOSE DatabaseCursor
        DEALLOCATE DatabaseCursor
      END   -- end while
      -- Required for Version 2005 or greater.
      IF (@dbVer != '2000')
      BEGIN
        -- Grant system privileges to the @guardium_user.  This is a requirement for >= SQL 2005
        -- or else some system catalogs will filter our result from assessment test.
        -- This will show up in sys.server_permissions view.
        PRINT '==> Granting catalog privileges to: ''' + @Guardium_user + ''''
        execute ('grant VIEW ANY DATABASE to [' + @Guardium_user + ']' )
        execute ('grant VIEW ANY DEFINITION to [' + @Guardium_user + ']' )
      END
      PRINT '<<<==================================================================<<<'
      PRINT '<<< Finished Adding and Granting gdmmonitor role to: ''' + @Guardium_user + ''''
      PRINT '<<< on all databases.'
      PRINT '<<<==================================================================<<<'
      PRINT ''
    END
    GO

    Thanks a lot Sir... it worked.
    Can you also help me in troubleshooting below issue?
    This script is working fine on all databases except one MS SQL 2005 database. build of this database is 9.00.3042.00
    SA account with highest privileges is been used for script execution. errors received are as follow:
    >>>==================================================================>>>
    >>> Creating role: "gdmmonitor" at the server level.
    >>>==================================================================>>>
    ==> Granting MSSSQL 2005 and above setupadmin server role
    ==> Starting MSSql 2005 role creation on database: master
    (0 row(s) affected)
    ==> Dropping the gdmmonitor role members on: master
    ==> Creating the role gdmmonitor on: master
    Msg 15002, Level 16, State 1, Procedure sp_addrole, Line 16
    The procedure 'sys.sp_addrole' cannot be executed within a transaction.
    ==> Granting common SELECT privileges on: master
    Msg 15151, Level 16, State 1, Line 117
    Cannot find the user 'gdmmonitor', because it does not exist or you do not have permission.
    Msg 15151, Level 16, State 1, Line 118
    Cannot find the user 'gdmmonitor', because it does not exist or you do not have permission.
    Msg 15151, Level 16, State 1, Line 119
    Cannot find the user 'gdmmonitor', because it does not exist or you do not have permission.
    Msg 15151, Level 16, State 1, Line 120
    Cannot find the user 'gdmmonitor', because it does not exist or you do not have permission.
    Msg 15151, Level 16, State 1, Line 121
    Cannot find the user 'gdmmonitor', because it does not exist or you do not have permission.
    Msg 15151, Level 16, State 1, Line 122
    Cannot find the user 'gdmmonitor', because it does not exist or you do not have permission.
    Msg 15151, Level 16, State 1, Line 123
    Cannot find the user 'gdmmonitor', because it does not exist or you do not have permission.
    Msg 15151, Level 16, State 1, Line 124
    Cannot find the user 'gdmmonitor', because it does not exist or you do not have permission.
    Msg 15151, Level 16, State 1, Line 125
    Cannot find the user 'gdmmonitor', because it does not exist or you do not have permission.
    Msg 15151, Level 16, State 1, Line 126
    Cannot find the user 'gdmmonitor', because it does not exist or you do not have permission.
    ==> Granting common EXECUTE privileges on: master
    Msg 15151, Level 16, State 1, Line 130
    Cannot find the user 'gdmmonitor', because it does not exist or you do not have permission.
    Msg 15151, Level 16, State 1, Line 131
    Cannot find the user 'gdmmonitor', because it does not exist or you do not have permission.
    Msg 15151, Level 16, State 1, Line 132
    Cannot find the user 'gdmmonitor', because it does not exist or you do not have permission.
    Msg 15151, Level 16, State 1, Line 133
    Cannot find the user 'gdmmonitor', because it does not exist or you do not have permission.
    Msg 15151, Level 16, State 1, Line 134
    Cannot find the user 'gdmmonitor', because it does not exist or you do not have permission.
    Msg 15151, Level 16, State 1, Line 135
    Cannot find the user 'gdmmonitor', because it does not exist or you do not have permission.
    Msg 15151, Level 16, State 1, Line 136
    Cannot find the user 'gdmmonitor', because it does not exist or you do not have permission.

  • Script to create user in OBIEE 10g

    In OBIEE 10g, is it possible to use a script to create users automatically.
    I need this option to import user from the LDAP because if the LDAP are not created in OBI adminsitration tool, they can´t enter in analyticas (BI Server error)

    I suggest you to read
    Oracle9i Database Performance Tuning Guide and Reference
    Release 2 (9.2)
    Part Number A96533-02
    Chapter 7. Using Plan Stability
    ~ Madrid

  • Script for create user

    Hi,
    I have the following script :
    CREATE USER USER
    IDENTIFIED BY pwd
    DEFAULT TABLESPACE TABLES
    TEMPORARY TABLESPACE TEMP
    PROFILE DEFAULT
    ACCOUNT UNLOCK;
    How can I modify it in order to execute with a parameter (username) , like this :
    SQL>@myscript username
    Many thanks.

    Please read the sqlplus user's guide. It is a must I think.
    http://download.oracle.com/docs/cd/B10501_01/server.920/a90842/ch6.htm#1006806

  • Script to Create User and Add profiles

    Instead of using the ODI 10g GUI Console to create users and add them to a profile, Can this task be achieved by scripting ? Either by wlst or JMX or Java Packages ? Please advise and guide me.
    -Thanks,

    Is there any other way for adding Bulk users and assigning them to a profile? Any thoughts Please
    Versions: 10.1.3.5 and 10.1.3.6

  • Need a script to Create Users and assign Responsibilty

    Hi,
    EBS R12
    DB 10.0.2.4
    I need to create 100 application users and assign a responsibilty with them.I do not want to create a single user everytime using sysadmin responsibilty.Give some idea about it.
    Thanks

    Use FND_USER_PKG API.
    Please see old threads for similar discussion -- http://forums.oracle.com/forums/search.jspa?threadID=&q=FND_USER_PKG&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Create user using CATT script

    hi,
    I have done catt script to create user in BW 3.5 ... now I am trying to crete the same script in BW 7.0......
    I have created catt script using SECATT transaction....
    I download the varient to .txt file
    [VARIANT] [DESCRIPTION] ZTEST898
    BDC field value
    *ECATTDEFAULT ztest898
    If I pass parameter directly , the script executing fine ...
    If I try to pass parameters through .....txt file ... it is giving error
    Variants that Match Selection Cannot Be Found
    help me please.
    Regards
    Ben

    1. Create a text file with the UDML to create a new user(s):
    DECLARE USER "NewUser" AS "NewUser" UPGRADE ID 1 FULL NAME {New User} PASSWORD '' PERIODICITY 90
         HAS ROLES (
              "Administrators",
              "XMLP_ADMIN" )
         DESCRIPTION {password = Empty}
         PRIVILEGES ( READ);
    Merge it with your your current repository using nQUDMLExec.exe
    E:\OracleBI\server\Bin>nQUDMLExec.exe -U Administrator -P Administrator -I E:\temp\NewUser.txt -B E:\temp\paint.rpd -O e:\temp\newrep.rpd
    Regards John
    http://obiee101.blogspot.com/

  • Access Denied creating user accounts through vba

    Hello,
    I have a MS-Access application that runs on a Windows 2012 server. My customer logs into the server using RDP. The MS-Access application is started up automatically by means of the environment variable in the user settings. The customer needs to be able
    to create new windows users for this application, simply by clicking a button.  
    The VBA script to create users works, because when I start up the MS-Access application with my own logged on Administrators account, the new users get created. If my customer tries it, he gets 'Access Denied' error. I have added his user account to
    the Power Users group, but that did not solve the problem. I also tried to make him member of the DCOM Users Group, the 'Access Denied' error remains...
    I do not want to give him administrator priviliges, because he is 'just a customer'...
    What do I need to do for this setup to work? I tried altering some DCom settings, but frankly I do not have enough knowledge to feel comfortable with this. Hope anybody can help me out here...
    best regards, Rob

    Is this a standalone server? Only administrators can create user accounts, so there is no work around for that. You could look at something that has the administrator account/password stored and launch PSEXEC or something else in an elevated session behind
    the scenes but that is a security volunerability because the credentials are stored.
    If the account is being created in an Active Directory environment you could delegate permissions to the appropriate OU for your customer.
    Mark B. Cooper, President and Founder of PKI Solutions Inc., former Microsoft Senior Engineer and subject matter expert for Microsoft Active Directory Certificate Services (ADCS). Known as “The PKI Guy” at Microsoft for 10 years.

  • How to create users dynamically?

    Hi All,
    I have to create more then 100 users in shared services. Is there any way that i can create the users dynamically rather then manually.
    Regards,
    Krishna.

    Sure, you can!
    In your case you can use MaxL scripts to create users in Essbase, and as the product, for exemple Essbase, is registered in Shared Services, you will see there your modifications.
    But by my expirience not all operations you can do such way. For example, you can't delete users with MaxL script if Essbase in Shared Services mode.

  • How to create Users/Roles for ldap in weblogic without using admin console

    Is it possible to create Users/Roles for ldap in weblogic without using admin console? if possible what are the files i need to modify in DefaultDomain?
    or is there any ant script for creating USers/Roles?
    Regards,
    Raghu.
    Edited by: user9942600 on Jul 2, 2009 1:00 AM
    Edited by: user9942600 on Jul 2, 2009 1:58 AM

    Hi..
    You can use wlst or jmx to perform all security config etc.. same as if it were perfomred from the admin console..
    .e.g. wlst create user
    ..after connecting to admin server
    serverConfig()
    cd("/SecurityConfiguration/your_domain_name/Realms/myrealm/AuthenticationProviders/DefaultAuthenticator")
    cmo.createUser("userName","Password","UserDesc")
    ..for adding/configuring a role
    cd("/SecurityConfiguration/your_domain_name/Realms/myrealm/RoleMappers/XACMLRoleMapper")
    cmo.createRole('','roleName', 'userName')
    ...see the mbean docs for all the different attributes, operations etc..
    ..Mark.

  • Create user from oracle form builder 10g

    dear all,
    anyone to help me? I want to try, to create a new user from form builder oracle 10g in windows, I use a default script like 'create user user_name identified 123' in toad 9.0 for oracle and the result is success but when I try to combine with form builder oracle 10g this script doesn't work...I hope somebody can help me to solve my problem..
    thank you,,,
    Dedy Prasetyo T.

    Dear Francois,,
    I've tried the way you suggested and success. but how if I take the value of user_name and password from the data block to insert table dba_users ? would you like to help me?
    regard,
    Dedy P.T

  • Create user/schema is script, then tables for that user/schema

    Hi;
    First off, if I phrase this a little wrong - I'm from the Sql Server world and still trying to totally understand Oracle.
    I have a schema (.sql file) that creates my database fine. But what I would liek to add to the .sql schema is for it to create a user and then place all the tables, indexes, sequences, and triggers in as belonging to that created user.
    This way we can tell people to log in as sysop and run the script to create the schema rather than create the user, log in as the user, then run the script.
    What do I need to add?
    thanks - dave

    Hi;
    I have tried:
    CREATE USER DAVE IDENTIFIED BY password;
    CONNECT DAVE/password AS SYSDBA
    I have also tried:
    CONNECT DAVE/password AS SYSTEM
    CONNECT DAVE AS SYSDBA
    CONNECT DAVE
    In all cases ApplicationExpress says it does not recognize the CONNECT command. Should I do something different? What I want to accomplish is that all subsequent commands in the script creating tables, indexes, etc are assigned to the user/schema DAVE.
    thanks - dave

  • A script to accept dafault tablespace and tempspace at runtime create users

    I need to write a script to accept default tablespace and temporary tablespace , then create the users in that tablespace. Please see the example but some how it is not working....
    prompt Specify user's default tablespace
    prompt Using &&default_tablespace for the default tablespace
    prompt Specify user's temporary tablespace
    prompt Using &&temporary_tablespace for the temporary tablespace
    create user test identified by test default tablespace &&default_tablespace temporary tablespace &&temporary_tablespace ;
    grant connect , resource to test;
    Please help me in identifying the errors
    Thanks in advance...
    Message was edited by:
    mvarier

    some how it is not workingHow ? Doesn't the user get created ? Do you get errors ? which errors ?
    (It worked to me)

  • Create user using Script

    Hi
    Does any body know how to create user in BI answers using any Script?
    Thanks.

    1. Create a text file with the UDML to create a new user(s):
    DECLARE USER "NewUser" AS "NewUser" UPGRADE ID 1 FULL NAME {New User} PASSWORD '' PERIODICITY 90
         HAS ROLES (
              "Administrators",
              "XMLP_ADMIN" )
         DESCRIPTION {password = Empty}
         PRIVILEGES ( READ);
    Merge it with your your current repository using nQUDMLExec.exe
    E:\OracleBI\server\Bin>nQUDMLExec.exe -U Administrator -P Administrator -I E:\temp\NewUser.txt -B E:\temp\paint.rpd -O e:\temp\newrep.rpd
    Regards John
    http://obiee101.blogspot.com/

  • Why is user OUTLN created by default?

    Hi,
    After installing ORACLE816EE, I found that user OUTLN is created
    and has 2 tables in its schema.
    Could anyone tell me why this user exists by default in the
    database?
    Thanks,
    Vani
    =============================================================
    SQL> conn outln/outln@development
    Connected.
    SQL> select * from tab ;
    TNAME TABTYPE CLUSTERID
    OL$ TABLE
    OL$HINTS TABLE

    Hi,
    Store outlines ensure the execution plans stay consistent.
    exectuion plan means every query, the optimizer prepares a tree
    of operation called execution plan.
    basic purpose of this that check the users queries, what kind
    of queires users executing.
    Mateen

Maybe you are looking for

  • Problem in installing a HP network printer

    I have a P2055dn laserjet.  It is connected directly to the router on my network.  I have a computer that uses it regularly and I can install it on another one.  It goes thru the installation, finds the printer itself and when it's close to completio

  • Need to replace cover for RAM, HDD, Wi-Fi. Where can I get it?

    Hey all. I have a G505s, model 20255. When taking the bottom cover off (the cover that protects the RAM, hard drive, wifi, etc) I broke some clips because - being stupid - I didn't read the instructions first! IDIOT! Anyway, where can I buy a replace

  • Using at  last statement

    hi, I am using at last statement in my code in the following code:-    LOOP AT ITAB1.       AT LAST.         SUM .           WRITE: / ITAB1-SPART,ITAB1-TOT1.       ENDAT.     ENDLOOP. The code above perform  the calculation of the field ITAB1-TOT1. B

  • Camera Raw Auto Blows Out Images

    Hello, I simply want to apply the auto function for exposure, brightness, contrast, etc, but when I hit auto, it blows the images out. over exposing them. Any help thanks

  • Assertion Failed: Lr3.4.1

    Windows 7 Lightroom 3.4.1 EHD: Iomega 1Tb Had decided to import images in a different way. Attached my Iomega external hard drive, all running smoothly. Inserted memory card into memory card reader. Physically opened Lr (It is not set to auto import)