Error: add datafile to an tablespace
I have a 10g database in Sun machine.
I issued the following command and got this error. What the problem:
SQL> l
1 alter TABLESPACE "TEST" add DATAFILE
2 '/local/ORACLE/product/10.2.0/oradata/orcl/test_02.dbf' SIZE 10m
3* EXTENT MANAGEMENT LOCAL UNIFORM SIZE 40960 SEGMENT SPACE MANAGEMENT AUTO
SQL> /
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 40960 SEGMENT SPACE MANAGEMENT AUTO
ERROR at line 3:
ORA-00933: SQL command not properly ended
However, if I issue the following commanc, it went through
1 alter TABLESPACE "TEST" add DATAFILE
2* '/local/ORACLE/product/10.2.0/oradata/orcl/test_02.dbf' SIZE 10m
SQL> /
SQL>
Any help will be appraciated!
I believe that is the syntax for add datafile nothing else can be done other than this.
ADD TEMPFILE 'filespec' SIZE int K
[ AUTOEXTEND ON [NEXT int K | M]
[MAXSIZE {UNLIMITED|int K|int M}] ]
SS
Similar Messages
-
Command to add multiple datafiles in multiple tablespace in one time.
Send me command to
command to add multiple datafiles in multiple tablespace in one time.Just list the files separated by a comma.
SQL> alter tablespace example
2 add datafile 'e:\oradata\scratch\example02.dbf' size 100m,
3 'e:\oradata\scratch\example02.dbf' size 100m;
Tablespace altered.
SQL>
You will have to use more then one command to add datafiles to multiple tablespaces. -
Alter tablespace add datafile taking too much time
Hi All,
DB Version :10.2.0.1
OS Version: Windows Server 2003 32 Bit
When i am trying to add datafile into tablespace it takes lot of time approx 8 hours.but earlier it take approx 40 to 60 mins
When i check Alert log file i got the message:
ORA-604 signalled during: alter tablespace crbt add datafile
I check there is sufficent space in Disk as i need to add Datafile of 30G.
Syntax i am using is
ALTER TABLESPACE TEST
ADD DATAFILE 'C:\TEST02.DBF' SIZE 30G
Can anyone tell me exactly the reason for the same
Thanks in advanceHi Aman,
The space is added sometime but most of the time i am getting this error
SQL> ALTER TABLESPACE IN_OCT2011
2 ADD DATAFILE 'E:\CAT\IN_OCT04.DBF' SIZE 30G REUSE;
ALTER TABLESPACE IN_OCT2011
ERROR at line 1:
ORA-19502: write error on file "E:\CAT\IN_OCT04.DBF", blockno 11008
(blocksize=8192)
ORA-27072: File I/O error
OSD-04008: WriteFile() failure, unable to write to file
O/S-Error: (OS 33) The process cannot access the file because another process
has locked a portion of the file.
Kindly help over the same
Edited by: Vikas Kohli on Nov 5, 2011 8:38 PM -
Hi folks,
I have one query why asm startwith with + sign? what happen add datafile file in table space,or add disk in disk group without using + sign ,please explain with error no.hello,
+ sign is to indicate the diskgroup you intended to place datafile. this apply to all database files.
without + sign,will be place in ORACLE_HOME/dbs directory. there will be NO error.
see example here: without using +
SQL> create tablespace test45 datafile 'temdg' size 10m;
Tablespace created.
SQL> select name from v$datafile;
NAME
/u01/app/oracle/product/11.2.0/dbhome_1/dbs/temdg
7 rows selected.
second example: with using + sign to specify diskgroup
SQL> create tablespace test55 datafile '+temdg' size 10m;
Tablespace created.
SQL> select name from v$datafile;
NAME
/u01/app/oracle/product/11.2.0/dbhome_1/dbs/temdg
+TEMDG/orcl/datafile/test55.261.844200359
8 rows selected.
HTH
Tobi
Tobi's Oracle DBA & UNIX Blog -
How to add more than one datafile while creating tablespace
how to add more than one datafile while creating tablespace. I know by using alter command i can add datafile but i want while creating tablespace
Hi Dadivela,
how to add more than one datafile while creating tablespace.Here is the syntax:
!http://www.dba-oracle.com/images/create_tablespace.jpg!
I do it like this:
create tablespace myts
datafile
*'/u01/app/oracle/db1.dbf' size 100m,*
*'/u02/app/oracle/db2.dbf' size 200m;*
Here are my complete notes:
http://www.dba-oracle.com/t_tablespace_create_alter.htm
Hope this answers your question . . .
Donald K. Burleosn
Oracle Press author -
Dynamic alter tablespace statement to add datafiles
Hi Gurus,
I need a PL/SQL stored procedure which will accept a datafile name as parameter and dynamically create and execute "alter tablespace" command to add this passed datafile dynamically.
Thanks
Amitava.See this demo : 11.2.0.1 Windows
Before running this demo, I logged into SYS account and said :
grant create tablespace to scott;
grant select on dba_tablespaces to scott;
grant select on dba_data_files to scott;
grant alter tablespace to scott;
even scott user is having DBA role. Then I login as scott user and :
set serveroutput on;
create or replace procedure create_tbs(tbs_name in varchar2, filename in varchar2) as
rt dba_tablespaces%rowtype;
str_tbs varchar2(500);
v_tbs varchar2(100);
begin
str_tbs := 'create tablespace ' || tbs_name || ' datafile '''||filename|| ''' size 1m' ;
dbms_output.put_line(str_tbs);
select * into rt from dba_tablespaces where tablespace_name=upper(tbs_name);
dbms_output.put_line('tablespace exists');
exception
when no_data_found then
execute immediate str_tbs;
dbms_output.put_line('tablespace was created');
end;
select tablespace_name from dba_tablespaces;
TABLESPACE_NAME
SYSTEM
SYSAUX
UNDOTBS1
TEMP
USERS
EXAMPLE
PERFSTAT
7 rows selected.
SQL> exec create_tbs('TESTTBS','c:\data\test.dbf');
create tablespace TESTTBS datafile 'c:\data\test.dbf' size 1m
tablespace was created
PL/SQL procedure successfully completed.
SQL> exec create_tbs('SYSAUX','c:\data\test.dbf');
create tablespace SYSAUX datafile 'c:\data\test.dbf' size 1m
tablespace exists
PL/SQL procedure successfully completed.
SQL> drop tablespace testtbs including contents and datafiles;
Tablespace dropped.
SQL>Now I am going to create add datafile procedure, which is your question :
column file_name for a50;
column tablespace_name for a20;
select file_name,tablespace_name from dba_data_files;
FILE_NAME TABLESPACE_NAME
E:\APP\SERVERROOM\ORADATA\ORCL\USERS01.DBF USERS
E:\APP\SERVERROOM\ORADATA\ORCL\UNDOTBS01.DBF UNDOTBS1
E:\APP\SERVERROOM\ORADATA\ORCL\SYSAUX01.DBF SYSAUX
E:\APP\SERVERROOM\ORADATA\ORCL\SYSTEM01.DBF SYSTEM
E:\APP\SERVERROOM\ORADATA\ORCL\EXAMPLE01.DBF EXAMPLE
E:\APP\SERVERROOM\ORADATA\ORCL\PERFSTAT PERFSTAT
6 rows selected.
create or replace procedure alter_tbs(tbs_name in varchar2, filename in varchar2) as
rt dba_data_files%rowtype;
str_tbs varchar2(500);
v_tbs varchar2(100);
begin
str_tbs := 'alter tablespace ' || tbs_name || ' add datafile '''||filename|| ''' size 10m' ;
dbms_output.put_line(str_tbs);
select * into rt from dba_data_files where tablespace_name=upper(tbs_name) and file_name=upper(filename);
dbms_output.put_line('Datafile already exists.');
exception
when no_data_found then
execute immediate str_tbs;
dbms_output.put_line('Datafile added.');
end;
SQL> exec alter_tbs('users','E:\APP\SERVERROOM\ORADATA\ORCL\USERS01A.DBF');
alter tablespace users add datafile 'E:\APP\SERVERROOM\ORADATA\ORCL\USERS01A.DBF' size 10m
Datafile added.
PL/SQL procedure successfully completed.
SQL> column file_name for a50;
SQL> column tablespace_name for a20;
SQL> select file_name,tablespace_name from dba_data_files;
FILE_NAME TABLESPACE_NAME
E:\APP\SERVERROOM\ORADATA\ORCL\USERS01.DBF USERS
E:\APP\SERVERROOM\ORADATA\ORCL\UNDOTBS01.DBF UNDOTBS1
E:\APP\SERVERROOM\ORADATA\ORCL\SYSAUX01.DBF SYSAUX
E:\APP\SERVERROOM\ORADATA\ORCL\SYSTEM01.DBF SYSTEM
E:\APP\SERVERROOM\ORADATA\ORCL\EXAMPLE01.DBF EXAMPLE
E:\APP\SERVERROOM\ORADATA\ORCL\PERFSTAT PERFSTAT
E:\APP\SERVERROOM\ORADATA\ORCL\USERS01A.DBF USERS
7 rows selected.
SQL> alter tablespace users drop datafile 'E:\APP\SERVERROOM\ORADATA\ORCL\USERS01A.DBF';
Tablespace altered.
SQL> select file_name,tablespace_name from dba_data_files;
FILE_NAME TABLESPACE_NAME
E:\APP\SERVERROOM\ORADATA\ORCL\USERS01.DBF USERS
E:\APP\SERVERROOM\ORADATA\ORCL\UNDOTBS01.DBF UNDOTBS1
E:\APP\SERVERROOM\ORADATA\ORCL\SYSAUX01.DBF SYSAUX
E:\APP\SERVERROOM\ORADATA\ORCL\SYSTEM01.DBF SYSTEM
E:\APP\SERVERROOM\ORADATA\ORCL\EXAMPLE01.DBF EXAMPLE
E:\APP\SERVERROOM\ORADATA\ORCL\PERFSTAT PERFSTAT
6 rows selected.
SQL>Similar thread : Create a procedure to dynamically add a tablespace
Regards
Girish Sharma -
Autoextend user tablespace or add datafile
Hello,
My USERS tablespace had problem today when loading a file using sqlldr. It stopped loading halfway through the file.
The allocated is set to 1900 mb and the used was at 1850. I only have 1 datafile for users tablespace. I have autoextensible to YES.
Why did it not extend the tablespace when I should still have 2gb free??
I dropped a couple unused user tables and it reduced the used amount, then I was able reran the sqlldr load and it completed.
Should I create a new datafile
ALTER TABLESPACE USERS ADD DATAFILE ‘/usr/lib/oracle/xe/oradata/XE/users01.dbf’ SIZE 2000M AUTOEXTEND OFF;
or increase the allocation
ALTER DATABASE DATAFILE ‘/usr/lib/oracle/xe/oradata/XE/users.dbf’ RESIZE 3000M;
Thanks for the help...Why did it not extend the tablespace when I should still have 2gb free??
Might be maxsize was defined at the time of tablespace creation
For example
SQL> select DBMS_METADATA.GET_DDL('TABLESPACE', 'USERS') from dual;
DBMS_METADATA.GET_DDL('TABLESPACE','USERS')
CREATE TABLESPACE "USERS" DATAFILE
'C:\ORACLE\ORACLEXE\ORADATA\XE\USERS.DBF' SIZE 104857600
AUTOEXTEND ON NEXT 10485760[b] MAXSIZE 5120M
LOGGING ONLINE PERMANENT BLOCKSIZE 8192
EXTENT MANAGEMENT LOCAL AUTOALLOCATE SEGMENT SPACE MANAGEMENT AUTO
Should I create a new datafile
ALTER TABLESPACE USERS ADD DATAFILE
‘/usr/lib/oracle/xe/oradata/XE/users01.dbf’ SIZE
2000M AUTOEXTEND OFF;
or increase the allocation
ALTER DATABASE DATAFILE
‘/usr/lib/oracle/xe/oradata/XE/users.dbf’ RESIZE
3000M; It is good idea to add new file and having multiple file with same size.
Also in future if needed you can relocate datafile to reduce I/O contention. -
Error while creating a new tablespace
Hi all,
i got the following errors when i tried to create a new tablespace in my database.
ORA-00604: error occurred at recursive SQL level string
ORA-01655: unable to extend cluster string.string by string in tablespace string
can anyone suggest any possible reason?
thanks in advance..Hi,
ORA-01655 unable to extend cluster string.string by string in tablespace string
Cause: Failed to allocate an extent for cluster segment in tablespace.
Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the tablespace indicated
Pls check out the disk space. The command you issued is working for me and for all. Might be some errors in your disk.
Regards,
Raj -
Add datafile in a network drive
Hi,
I mapped in my NT machine a network disk, but when I try to create a datafile there, the next error message appear.
ALTER TABLESPACE CRM_DATA ADD DATAFILE 'h:\database\crm\dbs\CRM_TAB_5.DBF' SIZE 6000M
ORA-01119: error in creating database file 'h:\database\crm\dbs\CRM_TAB_5.DBF'
ORA-27040: skgfrcre: create error, unable to create file OSD-04002: unable to open file
O/S-Error: (OS 5) Access is denied.
Somebody know if I need to do something before for Oracle identified this network drive like a other local disk? Can I create datafiles in a network disk?
Thanks.
nullThe architecture of Windows is due to this problem. Keep in mind that YOU do have this share available but the Oracle process has not. You yourself are the connecting user of the share and this share is availbale to you and not to the Oracle process. Oracle itselfs runs in the background (and not on your console) with another user (default Windows internal user: SYSTEM) and you cannot get this share available for this user. The previous reply (run the Oracle service using another DOMAIN user) will help.
-
Can I add datafile bigger then 2GB
Hi all,
Can I add datafile bigger then 2GB (on the raw device) to the tablespace ?
I get err:
ORA-01119 : error in creating database file '/opt/DISK/data02'
ORA-27042 : not enought space on raw partition to fullfill request
Aditional information : 1
And
partition has size 4096543 kB
when I use partition with size 2GB it is Ok.
Is it limitation by Linux ?
I have linux 7.1
and oracle 8.1.7
What can I do ?
thanks
nullIf you want to use raw devices with linux you have to use the utility 'raw' to map the device. You could also use the Logical Volume Manager (or both)
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Martin Silar ([email protected]):
I do not know where it is my problem.
I wont to create datafile on raw disk and
I wont to need raw disk with 4GB size, becose
I can not create more logic devices on my SCSI disk then 15 logic partition. Disk have 39GB.
I have problem with add raw datafile to tablespace.
Have you sambody idea ?
thanks Martin<HR></BLOCKQUOTE>
null -
Hi,
Can anybody let me know how to add datafile using ASM
DB- ORACLE 10.2
OS-RHELSQL> select name from v$asm_diskgroup;
NAME
DATA1
DATA
Above we are having two asm diskgorup
SQL> alter tablespace users add datafile ‘+data1′ size 5M;
Tablespace altered.
SQL> select name from v$datafile;
NAME
+DATA1/nonasmtoasm/datafile/system.259.721108803
+DATA1/nonasmtoasm/datafile/undotbs1.261.721108865
+DATA1/nonasmtoasm/datafile/sysaux.260.721108841
+DATA1/nonasmtoasm/datafile/users.262.721108873
+DATA1/nonasmtoasm/datafile/users.269.721187971 -
ORACLE error 959 encountered ORA-00959: tablespace 'xyz' does not exist
im importing a dump to a newly created BD and im using 11g. I have already tablespaces and user for the dump to be imported.
The problems is, i have a total of 5 tablespaces created, all 4 are working well except the one tablespace and im receiving a 959 error(IMP-00003: ORACLE error 959 encountered
ORA-00959: tablespace 'xyz' does not exist). The log mentions that the tablespace does not exist even if this tablespace exist in the list of tablespace and datafiles created.
Hope you could help me with this. Thanks
Edited by: user8667617 on Feb 18, 2010 11:06 PMSQL> Select name from v$datafile;
NAME
C:\APP\ORACLEADMIN\ORADATA\ORC11\SYSTEM01.DBF
C:\APP\ORACLEADMIN\ORADATA\ORC11\SYSAUX01.DBF
F:\ORC11DBUNDO\UNDOTBS01.DBF
E:\ORC11DBUSER\USERS01.DBF
E:\ORC11DBUSER\INT_TRANSACTIONS_DATA.DBF
E:\ORC11DBUSER\INT_DATA.DBF
E:\ORC11DBUSER\CAS_DATA.DBF
E:\ORC11DBUSER\COS_DATA.DBF
E:\ORC11DBUSER\INT_ONLINE_TRANSACTIONS_DATA.DBF
9 rows selected.
SQL> Select * from v$tablespace;
TS# NAME INC BIG FLA ENC
0 SYSTEM YES NO YES
1 SYSAUX YES NO YES
2 UNDOTBS1 YES NO YES
4 USERS YES NO YES
3 TEMP NO NO YES
6 INT_TRANSACTIONS_DATA YES NO YES
7 INT_DATA YES NO YES
8 CAS_DATA YES NO YES
9 COS_DATA YES NO YES
10 INT_ONLINE_TRANSACTIONS_DATA YES NO YES
10 rows selected.
SQL>
here are the result of my query and it seems that the tablespace is recognized by the DB.
is there still any reason why? also when i try to drop the said tablespace in getting a response of the "tablespace does not exist" but when i try to create the tablespace it says that "ORA-00604: error occurred at recursive SQL level 1
ORA-00001: unique constraint (SYS.I_TS1) violated"
hope you can help me with this. -
Query in adding a datafile to the tablespace ?
Hi All,
A small qry? Suppose i am having a datafile .DBF of Size 26 GB , and now i want to add another Datafile to the tablespace. Then how to stop insertion of data into that 26 GB file , while the 2nd Datafile should start accepting the data. Is it an automatic process or we have to issuse some commands ??. Kindly provide some document links.
RegardsThanks for the reply sir
But if we declare 3 datafiles at the time of DB
Creation then how is three datafiles handled.
Insertion of data is simultaneous in all of the three
files or in a single file?????The Insertion of data in the datafile can't be handled be you. Oracle manages automatically. To elaborate further the freelist in the segments are response the data insertion. Better solution for your scenario is create tablespace with ample no. of datafiles and then export and import utility.
with regards
kccrga -
Adding datafile automatically when tablespace is 90% full
Hi,
I have a tablesspace having a name user01.dbf(Auto extensible to 4 GB) user02.dbf(Auto extensible to 4GB) ..........
I am just thinking about automatically creating datafile(alter tablespace add datafile).
1. (total number of datafiel in tablespace) *4 - space used by dba_segments belonging to user tablespace. if it returns less then 1 GB space, then add a datafile.
And I will put it on CRONTAB. and it will run every 24/7.
Does not this look weired?
Advice:
1. Don't we have any option like the database server will trigger an event when it is 90% and I can trap this event and run a command to add a datafile. I know internally it will do the same but still I feel if you have a feature then why not use it.
Any information will be helpful in this regards. And the same question is for OS level do I have to check it every second, space on the file system?Do one thing ,write a script which will check free space of your tablespaces like..
SELECT NAME FROM V$DATABASE;
select to_char(sysdate,'dd-MON-yyyy hh:mi:ss')Snap_ShotTime from dual;
SELECT Total.name "Tablespace Name",
nvl(free_space, 0) free_space,
nvl(total_space-free_space, 0) Used_space,
total_space
FROM
(select tablespace_name, sum(bytes/1024/1024) free_Space
from sys.dba_free_space
group by tablespace_name
) free,
(select b.name, sum(bytes/1024/1024) TOTAL_SPACE
from sys.v_$datafile a, sys.v_$tablespace B
where a.ts# = b.ts#
group by b.name
) Total
WHERE free.Tablespace_name(+) = Total.name
AND Tablespace_name <> 'PERFSTAT'
ORDER BY Total.name;
and find the %age of used space Vs free space.Enable your mail server which will send you the alerts.
Put in crotab file and set them accordingly..
Pratap -
Missing datafile from system-tablespace?
Hello!
We've got a major power-loss yesterday. After that our database does not start correct.
I got the message:
ORA-00600: Interner Fehlercode, Argumente: [kccpb_sanity_check_2], [9577], [9542], [0x0], [], [], [], []
After that I searched the forum and recreated the controlfiles and started recover database.
Now I always got the following error-message:
ORA-01173:Data dictionary indicates missing data file from system tablespace
I'm not really shure if I created another datafile for that tablespace. Even though there is no other datafile in the "oradata-directory".
Does anyone know how to go further?
Regards, Sascha
Message was edited by:
SoreheadHello,
Need help very quickly please!
I have the same error message. ORacle 10.2.0.3 AIX 5.3 on a datawarehouse.
I need to recover one tablespace from the database.
I restored my system tablespace and the data tablespace on a test environment and recreated the controlfile. I recovered my database. Recover OK and when I open the database resetlogs the message is :
Thread 1 opened at log sequence 1
Current log# 2 seq# 1 mem# 0: /oradata5/RL_G2_1.ORA
Successful open of redo thread 1
Thu Feb 18 13:59:47 2010
SMON: enabling cache recovery
Thu Feb 18 13:59:47 2010
Errors in file /opt/app/oracle/admin/MKT1/udump/mkt1_ora_2318672.trc:
ORA-00704: bootstrap process failure
ORA-00604: error occurred at recursive SQL level 2
ORA-01173: data dictionary indicates missing data file from system tablespace
Thu Feb 18 13:59:47 2010
Error 704 happened during db open, shutting down database
USER: terminating instance due to error 704
Instance terminated by USER, pid = 2318672
ORA-1092 signalled during: alter database open resetlogs...
Thanks for help, production data ;)
Maybe you are looking for
-
DEAR EXPERTS, TABLE_A WITH 25000 REC TABLE_B WITH 300000 REC THE SELECT STATEMENT USED IN VIEW AND DATASET WILL RETURN 25000 X 2300 ie. one RESULT SET IS TABLE_A WILL GET 2300 MATCHING ROWS IN TABLE_B I NEED TOP 100 REC FROM EACH RESULTSET FROM 25000
-
SPRY IMage SlideShow Basic: Auto create UL LI list
Hope this is of some help to someone. Recently moved from CS3 to CS5. So new to the whole DW widget thing. I wanted a basic (no thumbs or titles) slideshow that will auto update when new images are added or removed from an image folder so I don't hav
-
Using a timer on mouselistener
Is javax.swing.Timer compatible with mouselistener as well as action?
-
Business Requirement: If a Project System Status is CLSD, I need to lock out users from changing this Status. I also need to allow access to a some group of user's who can re-open projects. Suggestion needed
-
Hello . I am working on the travel request approval and travel expense approval using workflow in TRIP transaction. In travel request approval, i am struck with the Special approval. Actually i dont have any feild in workflow on which i can set the c