Professional Documents
Culture Documents
Requetes 1
Requetes 1
create a tablespace
● create tablespace tab_name datafile ‘path_file’ size 100m ;
create user
● create user user_name identified by user_password
default tablespace tab_name ;
desc user_users ;
● username , user_id , created , default_tablespace ,
temporary_tablespace …
desc user_tables;
● table_name ,tablespace_name , status
select table_name from user_tables;
les tables de l' utilisateur courant
desc user_objects;
● object_name, object_type , object_id …
les objets de l' utilisateur courant
desc user_indexes ; un
desc all_indexes ; tous
● index_name , index_type , table_owner , table_name …
desc user_constraints ; un
desc all_constraints ; tous
● constraint_name ,constraint_type , owner , table_name …
desc user_tablespaces ; un
● tablespace_name , next_extent , block_size …
desc user_segments ; un
desc user_extents ;
● tablespace_name , extent_id , segment_name
desc v$database
● dbid , name , created , open_mode …
desc v$instance
● instance_name ,instance_number , host_name ..
desc v$parameter
● num,name,type,value…
desc v$sga
● name,value ,con_id
desc v$process
● pid , addr , program
chapitre 3 : les contraintes
……………………………………………………………………………………
……………………………………………………………………………………
cle etrangere
not null
check
default
general syntax :
GRANT privilege [ON table/view] TO user [WITH GRANT OPTION]
example :
GRANT select, delete, update ON employee TO administrateur;
roles :
CREATE ROLE rolename;
GRANT privileges to rolename;
GRANT rolename to username;
profile
CREATE PROFILE profile_name LIMIT { resource_parameters |
password_parameters};
ressources
• SESSIONS_PER_USER – specify the number of concurrent sessions that a
user can have when connecting to the Oracle database.
• CPU_PER_SESSION – specify the CPU time limit for a user session,
represented in hundredth of seconds.
• CPU_PER_CALL – specify the CPU time limit for a call such as a parse,
execute, or fetch, expressed in hundredths of seconds.
• CONNECT_TIME – specify the total elapsed time limit for a user session,
expressed in minutes.
• IDLE_TIME – specify the number of minutes allowed for periods of
continuous inactive time during a user session. Note that the
long-running queries and other operations will not be subject to this
limit.
• LOGICAL_READS_PER_SESSION – specify the allowed number of data blocks
read in a user session, including blocks read from both memory and disk.
• LOGICAL_READS_PER_CALL – specify the allowed number of data blocks read
for a call to process a SQL statement.
• PRIVATE_SGA – specify the amount of private memory space that a session
can allocate in the shared pool of the system’s global area (SGA).
• COMPOSITE_LIMIT – specify the total resource cost for a session,
expressed in service units. The total service units are calculated as a
weighted sum of CPU_PER_SESSION, CONNECT_TIME,
LOGICAL_READS_PER_SESSION, and PRIVATE_SGA.
password