Home » RDBMS Server » Server Administration » tablespace
tablespace [message #208277] Sat, 09 December 2006 00:49 Go to next message
orafacjublu
Messages: 95
Registered: May 2006
Location: KOLKATA
Member
Is there any specific difference between read-only tablespace and offline tablespace ?
Re: tablespace [message #208281 is a reply to message #208277] Sat, 09 December 2006 01:05 Go to previous message
Mohammad Taj
Messages: 2412
Registered: September 2006
Location: Dubai, UAE
Senior Member

hi,

If your tablespace is "read only" mode then you cann't perform dml operation on it.

or if your tablespace is "offline" then you cann't perform any operation on it.

eg:

SQL> create tablespace deni datafile 'c:\deni01.dbf' size 3m;

Tablespace created.

SQL> create user deniusr identified by deni default tablespace deni quota 2m on
deni;

User created.

SQL> grant connect to deniusr;

Grant succeeded.


SQL> create table deniusr.test as select * from all_objects where rownum <= 100;


Table created.

SQL> alter tablespace deni offline;

Tablespace altered.

SQL> select count(*) from deniusr.test;
select count(*) from deniusr.test
                             *
ERROR at line 1:
ORA-00376: file 8 cannot be read at this time
ORA-01110: data file 8: 'C:\DENI01.DBF'


SQL> truncate table deniusr.test;
truncate table deniusr.test
                       *
ERROR at line 1:
ORA-00376: file 8 cannot be read at this time
ORA-01110: data file 8: 'C:\DENI01.DBF'


SQL> alter tablespace deni online;

Tablespace altered.

SQL> alter tablespace deni read only;

Tablespace altered.

SQL> select count(*) from deniusr.test;

  COUNT(*)
----------
       100

SQL> insert into deniusr.test select * from all_objects where rownum <=10;
insert into deniusr.test select * from all_objects where rownum <=10
                    *
ERROR at line 1:
ORA-00372: file 8 cannot be modified at this time
ORA-01110: data file 8: 'C:\DENI01.DBF'


SQL> truncate table deniusr.test;
truncate table deniusr.test
                       *
ERROR at line 1:
ORA-00372: file 8 cannot be modified at this time
ORA-01110: data file 8: 'C:\DENI01.DBF'


SQL>




regards
Taj
Previous Topic: Gathering Satistics
Next Topic: How to create tnsnames.ora
Goto Forum:
  


Current Time: Fri Dec 09 17:10:14 CST 2016

Total time taken to generate the page: 0.24595 seconds