Wednesday 30 August 2017

Recover SYS account password!!!!

While installing/creating oracle database , we will provide the schema password for all user is same like "oracle",, due to some reasons we forgot to noted down the password given for schema users while installing oracle DB.

After that iam connecting to sys schema to startup the database its says login denied(password incorrect),due to some reason iam not possible to use the option 

"connect / as sysdba".

ERROR:

 sqlplus / as sysdba
 SQL*Plus: Release 10.2.0.1.0 - Production on Wed Aug 30 15:39:05 2017
 Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 ERROR:
 ORA-01031: insufficient privileges

we have lost/forgot newly created oracle database sys account password,To recover sys account password we have several options to recover sys user password.


We can recover sys account password using following options:


Use a another SYSDBA user account

Use orapwd utlity
Rebuild the schema in a new database

Normally you can reset the schema user password:


To recover a password in Oracle, simply connect under command line mode on the server: 

#sqlplus /nolog      
SQL>conn / as sysdba      
SQL>alter user Username identified by PASSWORD;
But iam not able to use this option,due to some issues.so iam orapwd utility to reset the sys account password.

ORAPWD utility:


Using this orapwd utility we can reset the sys account password.


Password file should be under <orahome>\database\PWD<SID>.ora. 
Delete it and run the Oracle password utility from the command prompt:

ORAPWD file=<oracle_home>\database\PWD<SID>.ora password="password" entries="however many"
The <password> is your new sys password. After you log in as sys you can change it and create new passwords for system. 

Now we can able to connect sys account using newly created password.
Another options to reset the sys account password,


Optionally if you have another sysdba account reset the sys account password using this account.


Rebuild the schema to new database:


Create a new database with known sys password then export/import the schema to new database.


Best Regards.


Wednesday 23 August 2017

Issue on Opening ORACLE EBS FORMS:

While openings oracle forms on internet explorer we will get some issue like java version or compatablity or trusted site issues.

If you got below error while opening oracle ebs forms on internet explorer.

If you got above error on opening oracle forms first please check the correct  java version installed on your pc,for example if you are using EBS 12.1.3 java  jdk6 version is ok , but if you upgraded java version JDK7 please check the corresponding patch applied on EBS.


If you installed correct version or related version of java on your machine, Please add the EBS url to trusted site on internet explorer setting, Then try to check this steps,

After you got this forms error , Go to internet explorer setting,

click Setting - select Compatability view setting


you will get above page with you EBS url domain name (like "xxx.com") then click add the url and click close.
Else if not chosen anything on the website name , please enter the website name ("xxx.com"hostname of the server running application) then click add and close

Then reload the browser or automatically it will reload after added the url in compatablity mode.

Now if you open the EBS form you will get below popup options to choose select "run this time" options,

If its again popup came please choose the option "run this time".Now form will be opened.

 ISSUE RESOLVED

Best Regards

Friday 11 August 2017

SQL Developer backspace/delete not working


We regularly working on sql developer without  any issues, suddenly we got an issue with sql developer backupsace button and delete button is now working,.

We restarted the sql developer and tried its same issue.

Becuase of this issue  no need to unistall / reinstall sqldeveloper,

To resolve the problem you have to go to:

Sql  Developer (old version) 

 Tools -> Preferences -> Accelerators -> Load Preset -> Default -> OK

Sql Developer(New version 3.2):

Open sqldeveloper -> Tools - > Preferences - > Shortcut Keys -> More Actions -> Load keyboard schema -> Default - > OK.

Now its working well.

Best Regards.

Thursday 10 August 2017

Find DB tier details from R 12 application login.

How to find the oracle R12 application database running  hostname, port number,service name from oracle application front end .

If R12 oracle application installed on multi-node we will find the database server details from application front end ..

Iam have crossed this situation, we having only access to oracle application and have access to database apps user only but we dnt know the database tier details someone is supporting for database.

while executing scripts given wrong password for apps user, now apps user account is locked.

We need to unlock the apps user account for that we need to connect to database system user.

To find the database tier details , login to application "http://.......com:8007/" sysadmin/password.

In Home page - click on "About this page" available at left side bottom - Click on "Page Context" tab in about oracle application page.

Here you will get the database tier details,

hostname :
port number:1527.
SID   :DEV

Now we connected to the database using this details and unlocked the apps user account.

FYI. If system/sys account password is Default as "manager" then only you can connect to database.


Best Regards.


Unlock R12 APPS user account...

Unlocking APPS user account:

Check the status of the user account using sql query ,connect system/sys account and check the account status.

SQL> select username,account_status from dba_users where username='APPS';

USERNAME                  ACCOUNT_STATUS
------------------------------ --------------------------------
APPS                           LOCKED

Account status locked,

  • Using below query you can check the "FALIED LOGIN ATTEMPTS" 
  • You have given wrong password more than 10 times so account locked,

SQL> select RESOURCE_NAME,RESOURCE_TYPE,LIMIT from dba_profiles where profile='DEFAULT';  
                                                                             
RESOURCE_NAME                    RESOURCE LIMIT
-------------------------------- -------- ----------------------------------------
COMPOSITE_LIMIT                  KERNEL   UNLIMITED
SESSIONS_PER_USER                KERNEL   UNLIMITED
CPU_PER_SESSION                  KERNEL   UNLIMITED
CPU_PER_CALL                     KERNEL   UNLIMITED
LOGICAL_READS_PER_SESSION        KERNEL   UNLIMITED
LOGICAL_READS_PER_CALL           KERNEL   UNLIMITED
IDLE_TIME                        KERNEL   UNLIMITED
CONNECT_TIME                     KERNEL   UNLIMITED
PRIVATE_SGA                      KERNEL   UNLIMITED
FAILED_LOGIN_ATTEMPTS            PASSWORD 10
PASSWORD_LIFE_TIME               PASSWORD UNLIMITED

RESOURCE_NAME                    RESOURCE LIMIT
-------------------------------- -------- ----------------------------------------
PASSWORD_REUSE_TIME              PASSWORD UNLIMITED
PASSWORD_REUSE_MAX               PASSWORD UNLIMITED
PASSWORD_VERIFY_FUNCTION         PASSWORD NULL
PASSWORD_LOCK_TIME               PASSWORD UNLIMITED
PASSWORD_GRACE_TIME              PASSWORD UNLIMITED

16 rows selected.

To unlock the APPS user account,

[oradev@erp2 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.1.0.7.0 - Production on Thu Aug 10 15:35:10 2017

Copyright (c) 1982, 2008, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>alter user apps account unlock;

user altered.

SQL> select username,account_status from dba_users where username='APPS';

USERNAME                       ACCOUNT_STATUS
------------------------------ --------------------------------
APPS                           OPEN


We can follow below solutions also:

You can change the "FALIED LOGIN ATTEMPTS" to unlimited, to create a new profile with unlimited attempt.and assingn the profile to apps users

SQL> CREATE PROFILE APPS_DEFAULT LIMIT
 COMPOSITE_LIMIT UNLIMITED
 SESSIONS_PER_USER UNLIMITED
 CPU_PER_SESSION UNLIMITED
 CPU_PER_CALL UNLIMITED
 LOGICAL_READS_PER_SESSION UNLIMITED
 LOGICAL_READS_PER_CALL UNLIMITED
 IDLE_TIME UNLIMITED
 CONNECT_TIME UNLIMITED
 PRIVATE_SGA UNLIMITED
 FAILED_LOGIN_ATTEMPTS UNLIMITED
 PASSWORD_LIFE_TIME UNLIMITED
 PASSWORD_REUSE_TIME UNLIMITED
 PASSWORD_REUSE_MAX UNLIMITED
 PASSWORD_VERIFY_FUNCTION NULL
 PASSWORD_LOCK_TIME UNLIMITED
 PASSWORD_GRACE_TIME UNLIMITED;

Profile created.

Assign the newly created profile to the user as default profile.

SQL> ALTER USER appusr PROFILE appusr_default;

Unlock the user account:

SQL> alter user apps account unlock;
user altered.


Best Regards.




Wednesday 9 August 2017

CREATING TABLESPACE


Creating and Increase the size of tablespace by adding datafiles.(AUTOEXTEND is disabled):

Normally ,we can the increase the tablespace size by adding the datafile to the tablesapce.

Create test tablespace with auntoextend is off,

SQL> create tablespace test datafile 'E:\APP\USER\ORADATA\DEV\test01.DBF' size 1
0M;

Tablespace created.

Auto extend is off:

SQL> select tablespace_name,autoextensible from dba_data_files;

TABLESPACE_NAME                AUT
------------------------------ ---
SYSTEM                         YES
SYSAUX                         YES
UNDOTBS1                       YES
USERS                          YES
TEST                           NO

Query the created tablespace :

SQL> select * from dba_data_files where tablespace_name ='TEST';

FILE_NAME
--------------------------------------------------------------------------------

   FILE_ID TABLESPACE_NAME                     BYTES     BLOCKS STATUS
---------- ------------------------------ ---------- ---------- ---------
RELATIVE_FNO AUT   MAXBYTES  MAXBLOCKS INCREMENT_BY USER_BYTES USER_BLOCKS
------------ --- ---------- ---------- ------------ ---------- -----------
ONLINE_
-------
E:\APP\USER\ORADATA\DEV\TEST01.DBF
        10 TEST                             10485760       1280 AVAILABLE
          10 NO           0          0            0    9437184        1152
ONLINE

Adding the datafile by increasing the tablespace,

SQL> alter tablespace test add datafile 'E:\APP\USER\ORADATA\DEV\TEST02.DBF' siz
e 20M;

Tablespace altered.


SQL> select * from dba_data_files where tablespace_name ='TEST';

FILE_NAME
--------------------------------------------------------------------------------

   FILE_ID TABLESPACE_NAME                     BYTES     BLOCKS STATUS
---------- ------------------------------ ---------- ---------- ---------
RELATIVE_FNO AUT   MAXBYTES  MAXBLOCKS INCREMENT_BY USER_BYTES USER_BLOCKS
------------ --- ---------- ---------- ------------ ---------- -----------
ONLINE_
-------
E:\APP\USER\ORADATA\DEV\TEST01.DBF
        10 TEST                             10485760       1280 AVAILABLE
          10 NO           0          0            0    9437184        1152
ONLINE


FILE_NAME
--------------------------------------------------------------------------------

   FILE_ID TABLESPACE_NAME                     BYTES     BLOCKS STATUS
---------- ------------------------------ ---------- ---------- ---------
RELATIVE_FNO AUT   MAXBYTES  MAXBLOCKS INCREMENT_BY USER_BYTES USER_BLOCKS
------------ --- ---------- ---------- ------------ ---------- -----------
ONLINE_
-------
E:\APP\USER\ORADATA\DEV\TEST02.DBF
        11 TEST                             20971520       2560 AVAILABLE
          11 NO           0          0            0   19922944        2432
ONLINE

Check the free size of the tablespace

SQL> select b.tablespace_name, tbs_size SizeMb, a.free_space FreeMb
  2  from  (select tablespace_name, round(sum(bytes)/1024/1024 ,2) as free_space
  3         from dba_free_space
  4         group by tablespace_name) a,
  5        (select tablespace_name, sum(bytes)/1024/1024 as tbs_size
  6         from dba_data_files
  7         group by tablespace_name) b
  8  where a.tablespace_name(+)=b.tablespace_name;

TABLESPACE_NAME                    SIZEMB     FREEMB
------------------------------ ---------- ----------
SYSAUX                                870      45.25
UNDOTBS1                              725     697.31
USERS                                   5       3.63
TEST                                   30         28
SYSTEM                                780        9.5

Adding the datafile to the tablespace.

SQL> alter tablespace test add datafile 'E:\APP\USER\ORADATA\DEV\TEST03.DBF' siz
e 40M;

Tablespace altered.

Now check the size after adding the datafile to tablespace:

SQL> select b.tablespace_name, tbs_size SizeMb, a.free_space FreeMb
  2  from  (select tablespace_name, round(sum(bytes)/1024/1024 ,2) as free_space

  3         from dba_free_space
  4         group by tablespace_name) a,
  5        (select tablespace_name, sum(bytes)/1024/1024 as tbs_size
  6         from dba_data_files
  7         group by tablespace_name) b
  8  where a.tablespace_name(+)=b.tablespace_name;

TABLESPACE_NAME                    SIZEMB     FREEMB
------------------------------ ---------- ----------
SYSAUX                                870      45.25
UNDOTBS1                              725     697.31
USERS                                   5       3.63
TEST                                   70         67
SYSTEM                                780        9.5


SQL> select tablespace_name,autoextensible from dba_data_files;

TABLESPACE_NAME                AUT
------------------------------ ---
SYSTEM                         YES
SYSAUX                         YES
UNDOTBS1                       YES
USERS                          YES
TEST                           NO
TEST                           NO
TEST                           NO

7 rows selected.

Best Regards.


Tuesday 8 August 2017

How to enable tablespace autoextend on

Enabling and Disabling Automatic Extension for a Datafile:

You can create datafiles or alter existing datafiles so that they automatically increase in size when more space is needed in the database. The file size increases in specified increments up to a specified maximum.
Setting your datafiles to extend automatically provides these advantages:
  • Reduces the need for immediate intervention when a tablespace runs out of space
  • Ensures applications will not halt or be suspended because of failures to allocate extents
To determine whether a datafile is auto-extensible, query the DBA_DATA_FILES view and examine the AUTOEXTENSIBLE column.
SQL> select tablespace_name ,autoextensible from dba_data_files;

TABLESPACE_NAME                AUT
------------------------------ ---
SYSTEM                         YES
SYSAUX                         YES
UNDOTBS1                       YES
USERS                          YES
You can specify automatic file extension by specifying an AUTOEXTEND ON clause when you create datafiles using the following SQL statements:
  • CREATE DATABASE
  • ALTER DATABASE
  • CREATE TABLESPACE
  • ALTER TABLESPACE
You can enable or disable automatic file extension for existing datafiles, or manually resize a datafile, using the ALTER DATABASE statement. For a bigfile tablespace, you are able to perform these operations using the ALTER TABLESPACE statement.
The following example enables automatic extension for a datafile added to the users tablespace:
ALTER TABLESPACE users
    ADD DATAFILE '/u02/oracle/rbdb1/users03.dbf' SIZE 10M
      AUTOEXTEND ON
      NEXT 512K
      MAXSIZE 250M;
The value of NEXT is the minimum size of the increments added to the file when it extends. The value of MAXSIZE is the maximum size to which the file can automatically extend.
The next example disables the automatic extension for the datafile.
ALTER DATABASE DATAFILE '/u02/oracle/rbdb1/users03.dbf' 
    AUTOEXTEND OFF;

Manually Resizing a Datafile

You can manually increase or decrease the size of a datafile using the ALTER DATABASE statement. This enables you to add more space to your database without adding more datafiles. This is beneficial if you are concerned about reaching the maximum number of datafiles allowed in your database.
For a bigfile tablespace you can use the ALTER TABLESPACE statement to resize a datafile. You are not allowed to add a datafile to a bigfile tablespace.
Manually reducing the sizes of datafiles enables you to reclaim unused space in the database. This is useful for correcting errors in estimates of space requirements.
In the next example, assume that the datafile /u02/oracle/rbdb1/users03.dbf has extended up to 250M. However, because its tablespace now stores smaller objects, the datafile can be reduced in size.
The following statement decreases the size of datafile /u02/oracle/rbdb1/users03.dbf:
ALTER DATABASE DATAFILE '/u02/oracle/rbdb1/users03.dbf'
   RESIZE 250M;
Best Regards.

Tuesday 1 August 2017

CREATE TABLESPACE WITH AUTO Extend ON

CREATE TABLESPACE WITH AUTO Extend ON

Create a permanent tablespace.

Syntax:
   CREATE [UNDO] TABLESPACE tablespace_name
      DATAFILE Datafile_Options Storage_Options;


The Autoextend Maxsize clause will default to UNLIMITED if no value is specified.
Storage_Options:

    DEFAULT [COMPRESS|NOCOMPRESS] STORAGE storage_clause
    MINIMUM EXTENT int {K|M}
    BLOCKSIZE int K
    LOGGING | NOLOGGING
    FORCE LOGGING
    ONLINE | OFFLINE
    PERMANENT | TEMPORARY
    EXTENT MANAGEMENT {DICTIONARY |
       LOCAL {AUTOALLOCATE | UNIFORM [SIZE int K | M]} }
    SEGMENT SPACE MANAGEMENT {MANUAL | AUTO}


Examples

-- With Autoextend:

CREATE TABLESPACE ts_mydemo DATAFILE
'/data/ts_mydemo01.dbf' SIZE 50M,
'/data/ts_mydemo02.dbf' SIZE 64M
logging
autoextend on
next 32m maxsize 2048m
extent management local;

-- With specified datafile sizes:

CREATE TABLESPACE ts_myapp DATAFILE
'/data/ts_myapp01.dbf' SIZE 200M,
'/data/ts_myapp02.dbf' SIZE 500M
logging
autoextend off
extent management local;

-- Undo tablespace

CREATE UNDO TABLESPACE ts_undo01 DATAFILE
'/data/ts_undo01.dbf SIZE 50000M REUSE
autoextend on
RETENTION NOGUARANTEE;

Retention guarantee can also be enabled for UNDO tablespaces with the option RETENTION GUARANTEE, this should be used with caution - it can easily cause updates to fail due to a lack of space in the undo tablespace.

Best Regards.