Feeds:
Posts
Comments

Posts Tagged ‘Datafile’

Dear all, yesterday I face small issue which I would like to share with you guy’s.It was temporary tablespace issue.This was development server for storage was recently changed.As mount point was changed but control file was having the previous temp file details so got the error while exporting schema.Just drop the old tempfile and created new one. Issue got resolved after that.

bash-2.05$ ls -lrt

total 562420

-rw-r–r–   1 oracle10g oinstall    1729 Jan 30 14:57 abc.sh

-rw-r—–   1 oracle10g oinstall 77631488 Jan 30 23:50 reporter_sam_exp30JAN2011.dmp

-rw-r—–   1 oracle10g oinstall 77635584 Apr  9 23:19 reporter_sam_exp09042011.dmp

-rw-r—–   1 oracle10g oinstall 132513792 Jun  1 04:01 SAM1_exp31052011.dmp

bash-2.05$ exp

Export: Release 10.2.0.3.0 – Production on Wed Jun 1 04:13:42 2011

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

Username: / as sysdba

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production

With the Partitioning, OLAP and Data Mining options

Enter array fetch buffer size: 4096 >

Export file: expdat.dmp > SAM1_orig_exp31052011.dmp

(1)E(ntire database), (2)U(sers), or (3)T(ables): (2)U > 2

Export grants (yes/no): yes > y

Export table data (yes/no): yes > y

Compress extents (yes/no): yes > y

Export done in US7ASCII character set and AL16UTF16 NCHAR character set

server uses WE8ISO8859P1 character set (possible charset conversion)

About to export specified users …

User to be exported: (RETURN to quit) > SAM1

User to be exported: (RETURN to quit) >

 . exporting pre-schema procedural objects and actions

. exporting foreign function library names for user SAM1

. exporting PUBLIC type synonyms

. exporting private type synonyms

. exporting object type definitions for user SAM1

About to export SAM1’s objects …

. exporting database links

. exporting sequence numbers

. exporting cluster definitions

EXP-00056: ORACLE error 1157 encountered

ORA-01157: cannot identify/lock data file 201 – see DBWR trace file

ORA-01110: data file 201: ‘/oradata/oracle10g/oradata/temp/temp2.dbf’

EXP-00000: Export terminated unsuccessfully

bash-2.05$ sqlplus / as sysdba

 SQL*Plus: Release 10.2.0.3.0 – Production on Wed Jun 1 04:16:46 2011

 Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.

 Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production

With the Partitioning, OLAP and Data Mining options

 SQL> select * from v$tempfile;

      FILE# CREATION_CHANGE# CREATION_        TS#     RFILE# STATUS  ENABLED

———- —————- ——— ———- ———- ——- ———-

     BYTES     BLOCKS CREATE_BYTES BLOCK_SIZE

———- ———- ———— ———-

NAME

——————————————————————————–

         1       8.2892E+12 07-FEB-11         24          2 ONLINE  READ WRITE

         0          0   2147483648       8192

/oradata/oracle10g/oradata/temp/temp2.dbf

          3       8.2892E+12 07-FEB-11         24          1 ONLINE  READ WRITE

         0          0   3221225472       8192

/oradata/oracle10g/oradata/temp/temp1.dbf

      FILE# CREATION_CHANGE# CREATION_        TS#     RFILE# STATUS  ENABLED

———- —————- ——— ———- ———- ——- ———-

     BYTES     BLOCKS CREATE_BYTES BLOCK_SIZE

———- ———- ———— ———-

NAME

——————————————————————————–

 SQL> select tablespace_name, file_name, bytes/1048576 “MB” from dba_temp_files;

select tablespace_name, file_name, bytes/1048576 “MB” from dba_temp_files

                                                          *

ERROR at line 1:

ORA-01157: cannot identify/lock data file 203 – see DBWR trace file

ORA-01110: data file 203: ‘/oradata/oracle10g/oradata/temp/temp1.dbf’

 SQL> select file#,status,name from v$tempfile;

      FILE# STATUS

———- ——-

NAME

——————————————————————————–

         1 ONLINE

/oradata/oracle10g/oradata/temp/temp2.dbf

          3 ONLINE

/oradata/oracle10g/oradata/temp/temp1.dbf

 SQL> !ls -lrt /oradata/oracle10g/oradata/temp/temp1.dbf

/oradata/oracle10g/oradata/temp/temp1.dbf: No such file or directory

 SQL> !ls -lrt /oradata/oracle10g/oradata/temp/temp2.dbf

/oradata/oracle10g/oradata/temp/temp2.dbf: No such file or directory

 SQL> select tablespace_name, file_name, bytes/1048576 “MB” from dba_temp_files;

select tablespace_name, file_name, bytes/1048576 “MB” from dba_temp_files

                                                           *

ERROR at line 1:

ORA-01157: cannot identify/lock data file 203 – see DBWR trace file

ORA-01110: data file 203: ‘/oradata/oracle10g/oradata/temp/temp1.dbf’

 SQL> alter database tempfile ‘/oradata/oracle10g/oradata/temp/temp1.dbf’ drop;

 Database altered.

 SQL> select file#,status,name from v$tempfile;

      FILE# STATUS

———- ——-

NAME

——————————————————————————–

         1 ONLINE

/oradata/oracle10g/oradata/temp/temp2.dbf

 SQL> ALTER TABLESPACE TEMP1 add tempfile ‘/DATA1/temp1.dbf’ size 10G;

 Tablespace altered.

 SQL> select tablespace_name, file_name, bytes/1048576 “MB” from dba_temp_files;

ERROR:

ORA-01157: cannot identify/lock data file 201 – see DBWR trace file

ORA-01110: data file 201: ‘/oradata/oracle10g/oradata/temp/temp2.dbf’

 SQL> alter database tempfile ‘/oradata/oracle10g/oradata/temp/temp2.dbf’ drop;

 Database altered.

 SQL> ALTER TABLESPACE TEMP1 add tempfile ‘/DATA1/temp2.dbf’ size 10G;

 Tablespace altered.

 SQL> select tablespace_name, file_name, bytes/1048576 “MB” from dba_temp_files;

 TABLESPACE_NAME

——————————

FILE_NAME

——————————————————————————–

        MB

———-

TEMP1

/DATA1/temp1.dbf

     10240

 TEMP1

/DATA1/temp2.dbf

     10240

 SQL> select file#,status,name from v$tempfile;

      FILE# STATUS

———- ——-

NAME

——————————————————————————–

         1 ONLINE

/DATA1/temp2.dbf

          2 ONLINE

/DATA1/temp1.dbf

 SQL> exit

Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production

With the Partitioning, OLAP and Data Mining options

bash-2.05$ pwd

/DATA1

bash-2.05$ cd –

/DATA

bash-2.05$ cd sam_cxl

bash-2.05$ ls -lrt

total 562420

-rw-r–r–   1 oracle10g oinstall    1729 Jan 30 14:57 abc.sh

-rw-r—–   1 oracle10g oinstall 77631488 Jan 30 23:50 sam_cxl_exp30JAN2011.dmp

-rw-r—–   1 oracle10g oinstall 77635584 Apr  9 23:19 sam_cxl_exp09042011.dmp

-rw-r—–   1 oracle10g oinstall 132513792 Jun  1 04:01 SAM1_exp31052011.dmp

bash-2.05$ exp

 Export: Release 10.2.0.3.0 – Production on Wed Jun 1 04:35:18 2011

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

 Username: / as sysdba

 Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production

With the Partitioning, OLAP and Data Mining options

Enter array fetch buffer size: 4096 >

 Export file: expdat.dmp > SAm1_orig_exp31052011.dmp

 (1)E(ntire database), (2)U(sers), or (3)T(ables): (2)U > 2

 Export grants (yes/no): yes >

 Export table data (yes/no): yes >

 Compress extents (yes/no): yes >

 Export done in US7ASCII character set and AL16UTF16 NCHAR character set

server uses WE8ISO8859P1 character set (possible charset conversion)

 About to export specified users …

User to be exported: (RETURN to quit) > SAM1

 User to be exported: (RETURN to quit) >

 . exporting pre-schema procedural objects and actions

. exporting foreign function library names for user SAM1

. exporting PUBLIC type synonyms

. exporting private type synonyms

. exporting object type definitions for user SAM1

About to export ISCM’s objects …

. exporting database links

. exporting sequence numbers

. exporting cluster definitions

. about to export SAM1’s tables via Conventional Path …

. . exporting table       SAM_BERTHING_GRADE_ARMS          5 rows exported

.

.

.

. exporting synonyms

. exporting views

. exporting stored procedures

. exporting operators

. exporting referential integrity constraints

. exporting triggers

. exporting indextypes

. exporting bitmap, functional and extensible indexes

. exporting posttables actions

. exporting materialized views

. exporting snapshot logs

. exporting job queues

. exporting refresh groups and children

. exporting dimensions

. exporting post-schema procedural objects and actions

. exporting statistics

Export terminated successfully with warnings.

Hope you guy’s enjoy this post.Very soon I wil come up with Parsing & execution as well.

Experts are always welcome for their valuable comment or suggestion for the above post.

Advertisements

Read Full Post »

set feedback off
set termout on
set pagesize 56
set linesize 800
ttitle off
spool out.log

set heading off
set verify off
column today NEW_VALUE p_currdate noprint
select TO_CHAR(SYSDATE,’fmMonth ddth, yyyy’) today from dual;
clear breaks
clear computes
clear columns
set heading off
column name heading ” justify center format a74
select ‘Database Name (SID): ‘ || name “name” from v$database;
prompt
prompt
prompt Version/SGA Information:
set heading off
select * from v$version;
column sgatot justify left format 9,999,999,999
select ‘Total System Global Area as of &p_currdate.:’ hd1, sum(value) sgatot, ‘bytes’ hd2 from v$sga;

— ************* TABLESPACES/DATAFILES **************

prompt
prompt
prompt Tablespaces and Datafiles:
clear breaks
clear computes
clear columns
set heading on
column tablespace_name heading ‘Tablespace’ justify left format a15
column file_id heading ‘File|ID’ justify center format 9999
column file_name heading ‘Datafile’ justify center format a60 word_wrapped
column size Heading ‘Size|in MB.’ justify center format 9,99990.99
break on tablespace_name skip 1 on report skip 2
compute sum label ‘TS SIZE:’ of size on tablespace_name
compute sum label ‘DB SIZE:’ of size on report
select tablespace_name,file_id,file_name,bytes/1024/1024 “size” from dba_data_files order by tablespace_name, file_id, file_name;

— ************* SPACE USAGE **************

prompt Space usage (as of &p_currdate.):
prompt
clear breaks
clear computes
clear columns
set heading on
column tspace heading ‘Tablespace’ justify left format a20 truncated
column tot_ts_size heading ‘Size|in MB.’ justify left format 9,99999999990
column free_ts_size heading ‘Used|in MB.’ justify right format 9,9999999990
column tbusedpct heading ” justify left format a6
column tbfreepct heading ” justify left format a6
break on report
compute sum label ‘Totals:’ of tot_ts_size free_ts_size on report
col tspace form a25 Heading “Tablespace”
col tot_ts_size form 99999999999999 Heading “Size (Mb)”
col free_ts_size form 99999999999999 Heading “Free (Mb)”
col ts_pct form 999 Heading “% Free”
col ts_pct1 form 999 Heading “% Used”

SELECT df.tablespace_name tspace,df.bytes/(1024*1024) tot_ts_size,
sum(fs.bytes)/(1024*1024) free_ts_size,round(sum(fs.bytes)*100/df.bytes) ts_pct,
round((df.bytes-sum(fs.bytes))*100/df.bytes) ts_pct1
FROM dba_free_space fs,
(select tablespace_name, sum(bytes) bytes from dba_data_files group by tablespace_name ) df
WHERE fs.tablespace_name = df.tablespace_name
GROUP BY df.tablespace_name, df.bytes;

— ************* REDO LOG FILES **************

prompt
prompt
prompt Online Redo Logfiles:
clear breaks
clear computes
clear columns
column member heading ‘Logfile’ justify center format a60 word_wrapped
column group heading ‘Group|Number’ justify center format 9999
column size heading ‘Size|in MB.’ justify center format 999990.99
select f.member “member”,f.group# “group”,l.bytes/1024/1024 “size” from v$logfile f, v$log l where f.group#=l.group# order by f.group#,f.member;

— ************* CONTROL FILES ************** —
prompt
prompt
prompt Control files:
clear breaks
clear computes
clear columns
column name heading ‘File Name’ format a60 word_wrapped
select name from v$controlfile;

— ************* ROLLBACK SEGMENTS ************** —
prompt
prompt
prompt Rollback Segments (sizes as of &p_currdate.):
clear breaks
clear computes
clear columns
set heading on
column tablespace_name heading ‘Tablespace’ justify left format a15 truncated
column segment_name heading ‘Seg|Name’ justify center format a7
column status heading ‘Status’ justify center format a8
column initial_extent heading ‘Initial|(in M)’ justify center format 99990.9
column next_extent heading ‘Next|(in M)’ justify center format 99990.9
column min_extents heading ‘Min|Ext’ justify center format 99990
column max_extents heading ‘Max|Ext’ justify center format 999999999990
column pct_increase heading ‘Pct|Inc’ justify center format 99990
column rbsize heading ‘Curr Size|(in M)’ justify left format 9,99990
break on tablespace_name skip 1 on report skip 2
select r.tablespace_name,r.segment_name,r.status,
r.initial_extent/1024/1024 “initial_extent”,
r.next_extent/1024/1024 “next_extent”,
r.min_extents,r.max_extents,
r.pct_increase,
sum(e.bytes)/1024/1024 “rbsize”
from dba_rollback_segs r, dba_extents e
where e.segment_name = r.segment_name
group by r.tablespace_name, r.segment_name, r.status,
r.initial_extent/1024, r.next_extent/1024,
r.min_extents, r.max_extents, r.pct_increase;


— ************* PARAMETERS **************

prompt
prompt Parameters (non-defaults):
clear breaks
clear computes
clear columns
column name heading ‘Name’ format a35 word_wrapped
column pvalue heading ‘Value’ format a50 word_wrapped
select name, rtrim(value) “pvalue” from v$parameter order by name;


— ************* USER DETAILS **************

prompt
prompt user details :
clear breaks
clear computes
clear columns
select username,profile,default_tablespace,temporary_tablespace from dba_users;
select * from nls_database_parameters;
select TABLESPACE_NAME,BLOCK_SIZE,EXTENT_MANAGEMENT,SEGMENT_SPACE_MANAGEMENT from dba_tablespaces;
select owner,object_type,count(1) from dba_objects group by owner,object_type order by owner;
SELECT file_name,tablespace_name,autoextensible,maxbytes/1048576 FROM dba_data_files;

Read Full Post »