Posts

Showing posts from December, 2014

Tablespaces DDL - Oracle

There may be situation where you are trying to create a new database similar to old one and it is a fresh install and you need to get the Tablespaces DDL from the old one. This query will be very help full. SQL>Set pages 999; SQL>set long 90000; SQL>spool ddl_list.sql SQL>select dbms_metadata.get_ddl('TABLESPACE',tb.tablespace_name) from dba_tablespaces tb; SQL>spool off Sample Output : "  CREATE TABLESPACE "USERS" DATAFILE   '/u02/oracle/oradata/ORCL/datafiles/users01.dbf' SIZE 5242880   AUTOEXTEND ON NEXT 52428800 MAXSIZE 20000M   LOGGING ONLINE PERMANENT BLOCKSIZE 8192   EXTENT MANAGEMENT LOCAL AUTOALLOCATE DEFAULT  NOCOMPRESS  SEGMENT SPACE MANAGEMENT AUTO    ALTER DATABASE DATAFILE   '/u02/oracle/oradata/ORCL/datafiles/users01.dbf' RESIZE 2097152000"; "  CREATE TABLESPACE "TOOLS" DATAFILE   '/u02/oracle/oradata/ORCL/datafiles/tools01.dbf' SIZE 67108864   LOGGING ONLINE PERMANENT BLOCKSIZE 8192   E

Audit failed logon attempts - Oracle

How to audit failed logon attempts Oracle Audit -- failed connection Background: In some situation DBA team wants to audit failed logon attempts when "unlock account"  requirement becomes frequently and user cannot figure out who from where is using incorrect password to cause account get locked. Audit concern: Oracle auditing may add extra load and require extra operation support. For this situation DBA only need audit on failed logon attempts and do not need other audit information. Failed logon attempt is only be able to track through Oracle audit trail, logon trigger does not apply to failure logon attempts Hint: The setting here is suggested to use in a none production system. Please evaluate all concern and load before use it in production. Approach: 1. Turn on Oracle audit function by set init parameter:                audit_trail=DB Note: database installed by manual script, the audit function may not turn on: database installed by dbca, the default audit function may