sqlplus
SELECT * FROM V$VERSION;
BANNER ---------------------------------------------------------------- Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product PL/SQL Release 10.2.0.1.0 - Production CORE 10.2.0.1.0 Production TNS for Linux: Version 10.2.0.1.0 - Production NLSRTL Version 10.2.0.1.0 - Production
exp username/password@database tables=table1,table2 file=table_data.dmp imp username/password@database file=table_data.dmp
SET autocommit imm
root
-ként az Oracle szerverresu - oracle
SYSDBA
-ként az SQL-be: sqlplus / as sysdba
SHOW PARAMETER AUDIT
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ audit_file_dest string /home/oracle/app/oracle/admin/ testdb/adump audit_sys_operations boolean TRUE audit_syslog_level string audit_trail string DB unified_audit_sga_queue_size integer 1048576
audit_trail != DB
, vagy az audit_sys_operations != true
, akkor át kell állítanunk:ALTER SYSTEM SET audit_trail=db SCOPE=SPFILE; ALTER SYSTEM SET audit_sys_operations=TRUE SCOPE=spfile;
SHUTDOWN IMMEDIATE STARTUP
test_user
összes mozzanatára: CONNECT sys/password AS SYSDBA AUDIT ALL BY audit_test BY ACCESS; AUDIT SELECT TABLE, UPDATE TABLE, INSERT TABLE, DELETE TABLE BY audit_test BY ACCESS; AUDIT EXECUTE PROCEDURE BY audit_test BY ACCESS;
CREATE USER audit_test IDENTIFIED BY temp_password DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp QUOTA UNLIMITED ON users; GRANT CONNECT TO audit_test; GRANT ALL ON dba_audit_trail TO audit_test;
SELECT * FROM ( SELECT "uid", "datetime", "message" FROM ( SELECT to_char(EXTENDED_TIMESTAMP,'YYYYMMDDHH24MiSSFF') AS "uid", extended_timestamp AS "datetime", 'OS_USERNAME=''' || os_username || ''';USERNAME=''' || username || ''';USERHOST=''' || userhost || ''';TERMINAL=''' || terminal || ''';TIMESTAMP=''' || to_char(TIMESTAMP, 'YYYY-MM-DD HH24:Mi:SS') || ''';OWNER=''' || owner || ''';OBJ_NAME=''' || obj_name || ''';ACTION=''' || action || ''';ACTION_NAME=''' || action_name || ''';NEW_OWNER=''' || new_owner || ''';NEW_NAME=''' || new_name || ''';OBJ_PRIVILEGE=''' || obj_privilege || ''';SYS_PRIVILEGE=''' || sys_privilege || ''';ADMIN_OPTION=''' || admin_option || ''';GRANTEE=''' || grantee || ''';AUDIT_OPTION=''' || audit_option || ''';SES_ACTIONS=''' || ses_actions || ''';LOGOFF_TIME=''' || logoff_time || ''';LOGOFF_LREAD=''' || logoff_lread || ''';LOGOFF_PREAD=''' || logoff_pread || ''';LOGOFF_LWRITE=''' || logoff_lwrite || ''';LOGOFF_DLOCK=''' || logoff_dlock || ''';COMMENT_TEXT=''' || comment_text || ''';SESSIONID=''' || sessionid || ''';ENTRYID=''' || entryid || ''';STATEMENTID=''' || statementid || ''';RETURNCODE=''' || returncode || ''';PRIV_USED=''' || priv_used || ''';CLIENT_ID=''' || client_id || ''';ECONTEXT_ID=''' || econtext_id || ''';SESSION_CPU=''' || session_cpu || ''';EXTENDED_TIMESTAMP=''' || to_char(extended_timestamp,'YYYY-MM-DD HH24:Mi:SS.FF') ||''';PROXY_SESSIONID=''' || proxy_sessionid || ''';GLOBAL_UID=''' || global_uid || ''';INSTANCE_NUMBER=''' || instance_number || ''';OS_PROCESS=''' || os_process || ''';TRANSACTIONID=''' || transactionid || ''';SCN=''' || scn || ''';SQL_BIND=''' || sql_bind || ''';SQL_TEXT=''' || sql_text || ''';OBJ_EDITION_NAME=''' || obj_edition_name || ''';DBID=''' || dbid || '''' AS "message" FROM DBA_AUDIT_TRAIL ) WHERE "uid" > '0' ORDER BY "uid" ) WHERE rownum <= 3000;
ORA-011033: ORACLE initialization or shutdown in progress
sqlplus / as sysdba
FOO_USER
profiljának lekérdezése: SELECT profile FROM DBA_USERS WHERE username = 'FOO_USER';
sqlplus / as sysdba
DEFAULT
profilban: ALTER profile DEFAULT LIMIT password_life_time UNLIMITED;
sqlplus / as sysdba
FOO_USER
jelszavának reset-elése: ALTER USER FOO_USER IDENTIFIED BY FOO_PASSWORD ACCOUNT UNLOCK;