Tuesday, January 22, 2019

dba_data_files data file not appears but dbf file in exists on FileSystem

Do NOT  Confuse

If you have executed command "DROP TABLESPACE *** INCLUDING CONTENTS AND DATAFILES;" on oracle database it would be noticeable that table-space and data-files has been deleted from server metadata i.e. no entry can be seen in dba_tablespaces and dba_data_files object.

But if you move to data-file physical path on your machine (in which oracle is installed) you may able to see old data-files (do not worry)!!.

Now you are thinking that i have deleted table-space why these files are here or you would try to delete this manually.

Is it safe to do? , can you delete this manually?

Yes you can delete this manually
1. Stop the server
2. Restart the Server
3. Delete unwanted datafiles from physical location

Error ORA-01144: File size (5242880 blocks) exceeds maximum of 4194303 blocks

While creating table-space you might get this error. This error generally comes up when you are giving large size to a data-file of table-space than allowed.
For creating large data-file table-space we need to create bigfile table-spaces.

But i would like to suggest not to create bigfile table-space for regular database restore create instead we can create simple table-space with multiple data-files.

Lets reproduce the issue, suppose i am trying to create table-space with data-file of size 40GB

CREATE TABLESPACE tablsapce1 DATAFILE 'D:\APP\ADMINISTRATOR\ORADATA\ORCL\tablespace01_01.DBF' SIZE 40G AUTOEXTEND ON NEXT 40M;

Error will appear on the screen

Error ORA-01144: File size (5242880 blocks) exceeds maximum of 4194303 blocks

So it is better to create one table-space and add two data-files of 20Gb each, see below how to do it:

CREATE TABLESPACE tablsapce1 DATAFILE 'D:\APP\ADMINISTRATOR\ORADATA\ORCL\tablespace01_01.DBF' SIZE 20G AUTOEXTEND ON NEXT 40M;

alter tablespace tablsapce1 add datafile 'D:\APP\ADMINISTRATOR\ORADATA\ORCL\tablespace01_02.DBF' SIZE 20G AUTOEXTEND ON NEXT 10M;

In this way you can avoid this particular error

On Other hand the concept behind this is "db block size", it depends upon the your Oracle db block size that how bigger you can create your table-space/data-file.

For 2kb Block size data-file size should be below and equal to 8GB and for 4kb (16GB), 8kb (32GB ), 16kb (64GB), 32kb (128GB)
web stats