Tuesday, June 16, 2015

How to Create TEMPORARY tablespace and drop existing temprary tablespace in oracle 11g


Step by Step guide to create new TEMP tablespace and drop existing temporary tablespace.

While doing this activity, existing temporary tablespace may have existing live sessions, due to same oracle won’t let us to drop existing temporary tablespace. Resulting, we need to kill existing session before dropping temporary tablespace.
Following query will give you tablespace name and datafile name along with path of that data file.
SQL> select FILE_NAME,TABLESPACE_NAME from dba_temp_files;
Following query will create temp tablespace named: ‘TEMP_NEW’ with 500 MB size along with auto-extend and maxsize unlimited.
SQL> CREATE TEMPORARY TABLESPACE TEMP_NEW TEMPFILE '/DATA/database/ifsprod/temp_01.dbf' SIZE 500m autoextend on next 10m maxsize unlimited;
Following query will help you to alter database for default temporary tablespace. ( i.e. Newly created temp tablespce: ‘TEMP_NEW’ )
SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP_NEW;
Retrieve ‘SID_NUMBER’ & ‘SERIAL#NUMBER’ of existing live session’s who are using old temporary tablespace ( i.e. TEMP ) and kill them.
SQL> SELECT b.tablespace,b.segfile#,b.segblk#,b.blocks,a.sid,a.serial#,
a.username,a.osuser, a.status
FROM v$session a,v$sort_usage b
WHERE a.saddr = b.session_addr;
Provide above inputs to following query, and kill session’s.
SQL> alter system kill session 'SID_NUMBER, SERIAL#NUMBER';
For example:
SQL> alter system kill session '59,57391';
Now, we can drop old temporary tablespace without any trouble with following:
SQL> DROP TABLESPACE old_temp_tablespace including contents and datafiles;

Tuesday, June 9, 2015

Password Profiles in Oracle E-Business Suite R12

Password Policies in Oracle E-Business Suite

One of my customers is required to define the Password policies in Oracle E-Business Suite

Profile: Signon Password Failure Limit
The Signon Password Failure Limit profile option defines the maximum number of login attempts before the user’s account is disabled.

Profile: Signon Password Hard to Guess

Set this Profile Option to Yes to ensure that they will be "hard to guess."
A password is considered hard-to-guess if it meets this requirements:
• The password contains at least one letter and at least one number.
• The password does not contain the username.
• The password does not contain repeating characters.

Profile: Signon Password Length

Signon Password Length defines the minimum length of the password. Te default is 5 characters



Profile: Signon Password No Reuse
This profile option specifies the number of days before any previously given password can be reused.



Profile: Signon Password Case
Set this profile option to 'Sensitive' to make the password case sensitive (it defaults to 'Insensitive in 11i, apparently, it defaults to 'Sensitive' in R12.1.1).











Thanks
RK

Thursday, May 28, 2015

Java VM: Java HotSpot(TM) while running autoconfig on the database tier 10g

Issue: While running the autoconfig on the database tier below issue occurred.

Context Value Management will now update the Context file
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGSEGV (0xb) at pc=0xf7a8172a, pid=8033, tid=4160080576
#
# Java VM: Java HotSpot(TM) Server VM (1.5.0_06-b05 mixed mode)
# Problematic frame:
# V  [libjvm.so+0x4eb72a]
#
# An error report file with more information is saved as hs_err_pid8033.log

#

Log details.

Stack: [0xffb43000,0xffd43000),  sp=0xffd3eda4,  free space=2031k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x5056fa]
V  [libjvm.so+0x4320f8]
V  [libjvm.so+0x26a6a6]
V  [libjvm.so+0x28b95f]
C  [libnjni10.so+0x5e4c]  Java_oracle_net_common_NetGetEnv_getLocalHostName+0xd6
j  oracle.net.common.NetGetEnv.getLocalHostName()Ljava/lang/String;+0
j  oracle.net.config.Config.systemName()Ljava/lang/String;+36
j  oracle.net.config.DirectoryService.getSystemObjectPath(Loracle/net/config/Config;)Ljava/lang/String;+6
j  oracle.net.config.DirectoryService.qualifyObjectName(Loracle/net/config/Config;Ljava/lang/String;Z)Ljava/lang/String;+36
j  oracle.net.config.Listener.<init>(Loracle/net/config/Config;Ljava/lang/String;)V+37
v  ~StubRoutines::call_stub
V  [libjvm.so+0x26a17c]
V  [libjvm.so+0x43b3f8]
V  [libjvm.so+0x269faf]
V  [libjvm.so+0x4877cc]
"hs_err_pid11679.log" 375L, 23491C 

Cause: In this case in our server the hostname command was returning null, unfortunately the hostname was disappeared in the linux prompt.

Solution:
=======
[oradr@- ~]$ printenv |less
NLS_SORT=binary
ADJREOPTS=-Xms128M -Xmx512M
HOSTNAME=-
SHELL=/bin/bash
TERM=xterm
HISTSIZE=1000

Added the hostname to the environment as below.

[root@- ~]# /bin/hostname localhost.domain
[root@- ~]# hostname
localhost.domain
[root@- ~]#
[oradr@drdb PRODSTBY_drdb]$ printenv |less
NLS_SORT=binary
ADJREOPTS=-Xms128M -Xmx512M
HOSTNAME=localhost.domain
SHELL=/bin/bash
TERM=xterm
HISTSIZE=1000

Run the autoconfig it should complete.


Tuesday, May 26, 2015

Grant privileges on Directory to Users in Oracle 11g


SQL> grant all on directory <directory name> to user;

Grant succeeded.

SQL>

Backup archivelogs to the new location in Oracle 11g

run{
allocate channel d1 type disk;
allocate channel d2 type disk;
allocate channel d3 type disk;
backup tag 'DISK_ARCH' as compressed backupset archivelog all format '/data02/oracle/24052015/rman_arch_%s_%d_%D_%U.arc';
release channel d1;
release channel d2;
release channel d3;
}

Thursday, May 21, 2015

ORA-01157: ORA-01111: ORA-01110:

There are many reasons for a file being created as UNNAMED or MISSING in the standby database, including insufficient disk space on standby site (or) Improper parameter settings related to file management.
STANDBY_FILE_MANAGEMENT enables or disables automatic standby file management. When automatic standby file management is enabled, operating system file additions and deletions on the primary database are replicated on the standby database.
For example if we add a data file on the Primary when parameter STANDBY_FILE_MANAGEMENT on standby set to MANUAL , While recovery process(MRP) is trying to apply archives, Due to that parameter setting it will create an Unnamed file in $ORACLE_HOME/dbs and it will cause to kill MRP process and Errors will be as below.

1. Check for the files needs to be recovered.

select * from v$recover_file where error like '%FILE%';

Identify on primary of data file 124(Primary Database)

select file#,name from v$datafile where file#='124'

Identify on primary of data file 124(Standby Database)

select file#,name from v$datafile where file#='124'

Crosscheck that no MRP is running and STANDBY_FILE_MANAGEMENT can be enabled once after creating file on standby

ENABLE STANDBY_FILE_MANAGEMENT to MANUAL on the STANDBY server

alter system set standby_file_management=MANUAL scope=both;

show parameter standby_file_management

Create missing datafile on the Standby Server

alter database create datafile '/drhome/oradr/STANDBY/db/tech_st/10.2.0/dbs/UNNAMED00124' as '/drdata/oradr/db/apps_st/data/switchover01.dbf';

ENABLE STANDBY_FILE_MANAGEMENT to MANUAL on the STANDBY server

alter system set standby_file_management=AUTO scope=both;

show parameter standby_file_management

alter database recover managed standby database disconnect from session;

After creating the file, MRP will start applying archives on standby database.

Note: Setting STANDBY_FILE_MANAGEMENT to AUTO causes Oracle to automatically create files on the standby database and, in some cases, overwrite existing files. Care must be taken when setting STANDBY_FILE_MANAGEMENT and DB_FILE_NAME_CONVERT so that existing standby files will not be accidentally overwritten.






Monday, May 18, 2015

PING[ARCk]: Heartbeat failed to connect to standby

Issue: Unable to ship the logs.

Troubleshooting Steps:

1. Verify the listener and tnsnames configuration on PRIMARY and STANDBY.

2. Check the tnsping from the both nodes vice-versa.

3. Connect from primary as below

#sqlplus sys@standby

password: 

the above command should connect to the standby database.

verify using the below command.

select name, open_mode from v$database;

4. Repeat the step 3 from standby node using the connect identifier as primary.

5. If step 1 to 4 are successfully executed.

6. Bounce the services as below.

Bounce Standby Database.

1. stop MRP (Managed Recovery Process) if it is running.

2. Stop listener.

3. Stop database.

4. start listener.

5. Start database.

6. Alter system register

Bounce Primary Database.

1. Disable log shipping

2. Stop listener.

3. Stop database.

4. start listener.

5. Start database 

6. Alter system register.

7. Enable log shipping.

8. Start MRP on the standby node.