Posts

Showing posts from 2014

Find the IP address of the user who locked a Oracle account

It's been awhile since the last post planning to start again with a small and simple post. OK.. the background, there is a application user account in db, which has " FAILED_LOGIN_ATTEMPTS" set to 3 in the users profile. Now the user is locked because of invalid logins and we need to identify the culprit. Requirments - We need the auditing enabled in the database. Then we can use below queries to get the required details. 1. select account_status, username, LOCK_DATE from  dba_users where username like '%USERNAME%'; 2. select AU.userid ,substr(AU.comment$text, 68,21) as "Host / IP_ADDRESS" from sys.aud$ AU where to_char(AU.ntimestamp#, 'DD-MM-YY') IN ('28-04-14') and AU.returncode=1017  

Moving Oracle Database between AWS instance.

When moving an Oracle database between two Amazon ec2 instances, we can easily accomplish it without backup/restore or Rman duplication as below. Setup - Oracle 11.2.0.1 Running on Amazone ec2 Linux 6.4 Requirment - Moving above oracle database from one Amazone ec2 instance (A) to another (B). Restrications - Need to Shutdown the database on source instance. (A) Step 1. In source ec2 instance, Take control file create statement to trace using below command, alter database backup controlfile to trace; Create pfile from spfile. create pfile from spfile Step 2. In source ec2 instance, Shutdown the oralce database. (In order put all data files on consistent state) Identify the volumes (EBS) which are storing the data files and take snapshot of each of the volume. (If you are dealing with large volumes, take a full AMI (Machine Image) prior to taking volume snapshots. Then after db shutdown take the volume snapshot. This will reduce the snapshot time) Ste...