Create User with Profile Only for Query

DBA Geral (instalação, configuração do banco, scripts do Sql*Plus, shell scripts, batch scripts, etc...)
Post Reply
antonio.rodrigues
Rank: Estagiário Júnior
Rank: Estagiário Júnior
Posts: 2
Joined: Tue, 07 Oct 2008 6:07 pm
Location: fortaleza - ce
Antonio Rodrigues
Analista/Programador de Softwares

Hello, someone can help me with a tutorial, explain how
create user with profile only for consultation in Oracle.
I need this much, thank you

Antonio.rodrigues@scientific.med.br
elidias7
Rank: Analista Sênior
Rank: Analista Sênior
Posts: 153
Joined: Thu, 01 Nov 2007 2:53 pm
Location: Osasco
Eli Dias
Oracle Certified Professional

Good Morning.

You can create the user with the following commands

You can create the user with the script below by changing the login, password and tablespace options.

Select all

create user nome_usuario identified by senha_usuario 
account unlock 
default tablespace nome_tablespace (esta tablespace geralmente é utilizada a users, agora se eles especificarem outra não tem problema) 
temporary tablespace temp; 
 
grant create session to nome_usuario;
Now the question of privilege, you need to check with who asked you if the user will have permissions on any table or only in some defined, for example:

# For all tables in the bank:

Select all

Grant select any table to nome_usuario; 
This is not very recommended at security level)

# for client-defined tables:

Select all

Grant select on table_name to nome_usuario; 

Hugs,
antonio.rodrigues
Rank: Estagiário Júnior
Rank: Estagiário Júnior
Posts: 2
Joined: Tue, 07 Oct 2008 6:07 pm
Location: fortaleza - ce
Antonio Rodrigues
Analista/Programador de Softwares

: D, Thanks for the script, I'll apply here.
diegoleite
Rank: Analista Pleno
Rank: Analista Pleno
Posts: 115
Joined: Sat, 10 Nov 2007 2:54 pm
Location: rio de janeiro
Att,


Diego Leite
DBA ORACLE

Friend,

Beware of grant select any tables .. Not recommended! Even if it comes to a test base !!!! Imagine an instance with payroll schema, and this information were available for people who should not have these available information.

Ideal will be a dynamic script.

Select all

select 'grant select on '||table_name||'to NOMEUSUARIO;' 
from all_tables where owner='NOMEDOOWNER';
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests