1) Oracle Penetration Tools : http://www.petefinnigan.com/tools.htm
2) Oracle Journal : http://www.databasejournal.com/article.php/2237601
SELECT to_char(entry_date -8/24, 'DD-MON-YYYY HH12:MI:SSam'), OLD_BIN_ID old_bin, NEW_BIN_ID NEW_BIN, ISBN ASIN, QUANTITY
FROM BINEDIT_ENTRIES
WHERE ENTRY_DATE BETWEEN trunc(SYSDATE) -1 +4/24 AND trunc(SYSDATE) -1 +16/24
--where entry_date BETWEEN trunc(sysdate)-1 '00:00:00' AND trunc(sysdate)-1 '00:00:00.000'
AND substr(old_bin_id,1,2) = 'SC'
AND substr(new_bin_id,1,2) = 'vt'
GROUP BY ENTRY_DATE, OLD_BIN_ID, NEW_BIN_ID, ISBN, Quantity
ORDER BY QUANTITY DESC;
Example :
select a.br_code,b.branch_nm,a.err_dt,a.err_code,a.err_msg from error_log a , BRANCH_HOME_BANK b where a.err_dt --like 'sysdate-1'
BETWEEN trunc(SYSDATE) -2 +20/24 AND trunc(SYSDATE) -2 +24/24
--BETWEEN TO_DATE('12/02/2014 20:00:00', 'MM/DD/YYYY HH24:MI:SS') AND TO_DATE('12/02/2014 23:59:00', 'MM/DD/YYYY HH24:MI:SS')
AND ERR_CODE like '%-20000%' and br_code not in ('0100','0116','0117','0500')
order by a.err_dt desc
Here , 20/24 means 8 PM
Sysdate : Todays date
sysdate -1 : 1 Day before
select br_code,err_dt,err_code,err_msg from error_log where err_dt --like 'sysdate-1'
BETWEEN trunc (SYSDATE) +20/24 AND trunc(SYSDATE) +24/24
--BETWEEN TO_DATE('12/02/2014 20:00:00', 'MM/DD/YYYY HH24:MI:SS') AND TO_DATE('12/02/2014 23:59:00', 'MM/DD/YYYY HH24:MI:SS')
AND ERR_CODE like '%-20000%' and br_code not in ('0100','0116','0117','0500')
order by err_dt;
STARTUP NOMOUNT;
ALTER DATABASE MOUNT STANDBY DATABASE;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE;
Disks Mounts: gpttrtnlxmgmt:/rman3 4297753856 123008 4251116224 1% /rman3
RPC: error 5 connecting to server gpttrtnlxtest nfs_statfs: statfs error = 5 ... RPC: error 512 connecting to server gpttrtnlxmgmt
SQL> connect / as sysdba Connected. SQL> alter user USER_A grant connect through USER_B; User altered. SQL>
SQL> connect USER_B[USER_A]/passw0rd Connected. SQL> show user USER is "USER_A" SQL>
alter session set current_schema = USER_A;
SQL> alter user USER_A grant connect through USER_B; User altered. SQL> connect USER_B[USER_A]/passw0rd Connected. SQL> alter session set current_schema = SCOTT; Session altered. SQL> select sys_context('USERENV','SESSION_USER') as session_user, 2 sys_context('USERENV','SESSION_SCHEMA') as session_schema, 3 sys_context('USERENV','CURRENT_SCHEMA') as current_schema, 4 sys_context('USERENV','PROXY_USER') as proxy_id, 5 user 6 from dual; SESSION_USER SESSION_SCHEMA CURRENT_SCHEMA PROXY_ID USER -------------- -------------- -------------- -------------- ------------ USER_A SCOTT SCOTT USER_B USER_A SQL>
SQL> connect / as sysdba Connected. SQL> alter user USER_A account lock; User altered. SQL> connect USER_B[USER_A]/passw0rd ERROR: ORA-28000: the account is locked Warning: You are no longer connected to ORACLE. SQL>
$ impdp dumpfile=temp.dmp nologfile=y include=JOB Import: Release 11.2.0.4.0 - Production on Wed Oct 15 19:10:13 2014 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. Username: USER_B[USER_A]/passw0rd Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Master table "USER_A"."SYS_IMPORT_FULL_01" successfully loaded/unloaded Starting "USER_A"."SYS_IMPORT_FULL_01": USER_B[USER_A]/******** dumpfile=temp.dmp nologfile=y include=JOB Processing object type SCHEMA_EXPORT/JOB Job "USER_A"."SYS_IMPORT_FULL_01" successfully completed at Wed Oct 15 19:10:22 2014 elapsed 0 00:00:01 $
$ mkstore -wrl "/u01/app/oracle/wallet" -createCredential ORCL USER_A passw0rd Oracle Secret Store Tool : Version 11.2.0.4.0 - Production Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. Enter wallet password: Create credential oracle.security.client.connect_string1 $ mkstore -wrl "/u01/app/oracle/wallet" -listCredential Oracle Secret Store Tool : Version 11.2.0.4.0 - Production Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. Enter wallet password: List credential (index: connect_string username) 1: ORCL USER_A $ $ sqlplus /@ORCL SQL*Plus: Release 11.2.0.4.0 Production on Wed Oct 15 13:45:04 2014 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> show user USER is "USER_A" SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options $ sqlplus [app_user]/@ORCL SQL*Plus: Release 11.2.0.4.0 Production on Wed Oct 15 13:45:14 2014 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> show user USER is "APP_USER" SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options $
SQL> select * from PROXY_USERS; PROXY CLIENT AUT FLAGS ------------ ------------ --- ----------------------------------- USER_B USER_A NO PROXY MAY ACTIVATE ALL CLIENT ROLES SQL> alter user USER_A revoke connect through USER_B; User altered. SQL> select * from PROXY_USERS; no rows selected SQL>