Friday, January 23, 2009

ORA-01114 ( ORA-27072 or ORA-27069)

ORA-01114: IO error writing block to file 1501 (block # 579517) :
ORA-27072: skgfdisp: I/O error :Linux Error: 25: Inappropriate ioctl for device :
Additional information: 579516 :
Or
ORA-01114: IO error writing block to file 1501 (block # 579517) :
ORA-27069 : skgfdisp: attempt to do I/O beyond the range of the file
Additional information: 16385
At the first attempt, quickly I had search for the file_id in the dba_data_files and could not find and tried with the block#, no luck.
We may have to try finding file_id parameter from dba_temp_files, you will find the id there. Temp file_id start from next value from db_files parameter.
Now you are clear with the culprit.
There are two causes, either you need to add some space to resolve the issue or you have enough space to expand and still you are getting the same issue, please add a temp tablespace , make that as default tablespace and drop old temp tablespace.

Illustrations :
SQL> show parameter db_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_files integer 1500

Here you will see the temp file_id starg from the 1501 and so on. Temp file_id numbering start from

SQL> select file_name,tablespace_name,file_id from dba_temp_files;

FILE_NAME TABLESPACE_NAME FILE_ID
-------------------------------------------------------------------------------------------------------------- ----------


/u02/oradata/TESTDB/temp01.db TEMP2 1501


SQL> CREATE TEMPORARY TABLESPACE temp2
2 TEMPFILE '/u02/oradata/TESTDB/temp2_01.dbf' SIZE 5M REUSE
3 AUTOEXTEND ON NEXT 1M MAXSIZE unlimited
4 EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M;

Tablespace created.


SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp2;

Database altered.


SQL> DROP TABLESPACE temp INCLUDING CONTENTS AND DATAFILES;

Tablespace dropped.

SQL> CREATE TEMPORARY TABLESPACE temp
2 TEMPFILE '/u02/oradata/TESTDB/temp01.dbf' SIZE 500M REUSE
3 AUTOEXTEND ON NEXT 100M MAXSIZE unlimited
4 EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M;

Tablespace created.


SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp;

Database altered.


SQL> DROP TABLESPACE temp2 INCLUDING CONTENTS AND DATAFILES;

Tablespace dropped.

Wednesday, January 7, 2009

nohup and running a process in background....

There are scenarios that we encounter that we run a job that will take more time to complete than our session time out.

Eg. We run an export for database which run for 6 hrs where are our ssh session will have a time out of 30 or 45, once the job in process and no input from keyboard to our ssh session then the session idle timeout count start. Once the idle time out happen our session and the job running in the session gets terminated.

There are three ways that we can overcome this situation.

1. Hard core just press enter in our ssh ( putty window) though it make no sence just to keep session active.
2. Run job in background using & option.
3. Use “ nohup option”

Option 2:

Eg.
# exp sys@dbname file=exp_dbname_date.exp log=exp_dbname_date.log full=y &

This will send the export process to back ground but, export process get terminated the moment the session terminates.

You can use the below script to keep your session alive with a simple while loop to run infinite loop.

#while true
>do
>echo " Exp going on"
>sleep 200
>done
Here you will not get prompt till you press Ctl + c (^c). This process will keep your session alive till you press enter.


Option 3:

Using nohup option

Eg.
# nohup exp sys@dbname file=exp_dbname_date.exp log=exp_dbname_date.log full=y &

or

# vi exp_script.sh
exp sys@dbname file=exp_dbname_date.exp log=exp_dbname_date.log full=y
:wq

# ls –l
Check the permissions if that has execute permissions
#chomod 755 exp_script.sh

# nohup ./exp_script.sh &

Here even when your session terminates job run in background.