informatica:oracle:comandos
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| informatica:oracle:comandos [2013/07/08 10:57] – created jose | informatica:oracle:comandos [2024/06/19 09:46] (current) – jose | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | < | ||
| + | SELECT 'DROP TABLE ' || owner || ' | ||
| + | FROM all_tables | ||
| + | WHERE owner = ' | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | set sqlformat insert; | ||
| + | select * from WZC_AUTHORIZATION_OWN.AUTHORIZATION_CONFIGURATION; | ||
| + | set sqlformat default; | ||
| + | </ | ||
| + | |||
| + | ====== Crear Usuario ====== | ||
| + | |||
| + | CREATE USER usuari IDENTIFIED BY contrasenya | ||
| + | |||
| + | GRANT CREATE SESSION TO usuari | ||
| + | |||
| + | |||
| + | |||
| + | ====== Comprobar usuario bloqueado: ====== | ||
| + | |||
| + | < | ||
| + | select username, | ||
| + | |||
| + | USERNAME | ||
| + | ------------------------------ -------------------------------- ------------------------------ | ||
| + | jose | ||
| + | </ | ||
| + | |||
| Desbloquear usuario: | Desbloquear usuario: | ||
| ALTER USER username ACCOUNT UNLOCK; | ALTER USER username ACCOUNT UNLOCK; | ||
| + | |||
| + | Comprobar parámetros perfil usuario: | ||
| + | < | ||
| + | SELECT resource_name, | ||
| + | |||
| + | RESOURCE_NAME RESOURCE LIMIT | ||
| + | -------------------------------- -------- ---------------------------------------- | ||
| + | COMPOSITE_LIMIT KERNEL | ||
| + | SESSIONS_PER_USER KERNEL | ||
| + | CPU_PER_SESSION KERNEL | ||
| + | CPU_PER_CALL KERNEL | ||
| + | LOGICAL_READS_PER_SESSION KERNEL | ||
| + | LOGICAL_READS_PER_CALL KERNEL | ||
| + | IDLE_TIME KERNEL | ||
| + | CONNECT_TIME KERNEL | ||
| + | PRIVATE_SGA KERNEL | ||
| + | FAILED_LOGIN_ATTEMPTS PASSWORD 10 | ||
| + | PASSWORD_LIFE_TIME PASSWORD UNLIMITED | ||
| + | PASSWORD_REUSE_TIME PASSWORD UNLIMITED | ||
| + | PASSWORD_REUSE_MAX PASSWORD UNLIMITED | ||
| + | PASSWORD_VERIFY_FUNCTION PASSWORD NULL | ||
| + | PASSWORD_LOCK_TIME PASSWORD 1 | ||
| + | PASSWORD_GRACE_TIME PASSWORD 7 | ||
| + | </ | ||
| + | |||
| + | ====== Activar auditoria: ====== | ||
| + | Una vez activada, se busca los errores con la consulta: | ||
| + | select * from dba_audit_session where username=' | ||
| + | | ||
| + | Para vaciar la tabla: | ||
| + | truncate table aud$ | ||
| + | | ||
| + | ====== Cambiar contraseña ====== | ||
| + | alter user user_name identified by new_password; | ||
| + | | ||
| + | ====== Porcentaje tablespaces ====== | ||
| + | < | ||
| + | COLUMN tsname FORMAT a30 | ||
| + | COLUMN allocation_type FORMAT A4 TRU HEADING ALLO | ||
| + | COLUMN contents FORMAT A4 TRU HEADING MGMT | ||
| + | COLUMN Tot_Size FORMAT 999,999 HEADING " | ||
| + | COLUMN Tot_Free FORMAT 999,999 HEADING " | ||
| + | COLUMN Pct_Free FORMAT 999 HEADING "FREE %" | ||
| + | COLUMN Fragments FORMAT 99,999 HEADING " | ||
| + | COLUMN Large_Ext FORMAT 999,999 HEADING " | ||
| + | set lines 120 | ||
| + | set feedback off pages 999 trims on | ||
| + | SELECT a.tablespace_name TSNAME, SUM(a.tots)/ | ||
| + | SUM(a.sumb)/ | ||
| + | SUM(a.sumb)*100/ | ||
| + | SUM(a.largest)/ | ||
| + | b.contents, b.allocation_type | ||
| + | FROM (SELECt tablespace_name, | ||
| + | MAX(bytes) largest, COUNT(*) chunks | ||
| + | FROM dba_free_space a | ||
| + | GROUP BY tablespace_name | ||
| + | UNION | ||
| + | SELECT tablespace_name, | ||
| + | FROM dba_data_files | ||
| + | GROUP BY tablespace_name | ||
| + | UNION | ||
| + | SELECT tablespace_name, | ||
| + | FROM dba_temp_files | ||
| + | GROUP BY tablespace_name) a, dba_tablespaces b | ||
| + | WHERE b.tablespace_name = a.tablespace_name | ||
| + | GROUP BY a.tablespace_name, | ||
| + | ORDER BY 4 | ||
| + | / | ||
| + | </ | ||
informatica/oracle/comandos.1373281033.txt.gz · Last modified: (external edit)
