Newsgroups: comp.databases.oracle.server Date: Tue, 15 Apr 2003 10:10:47 -0400 Message-ID: <157A4D97A88D7143B80E43C1B000B6E83D9F91@comail1.comanage.net> From: "Jeffrey Hunter" References: Subject: Re: Quota on nonexistent tablespace... Lines: 247 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0011_01C30337.4889F070" X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: srv26.comanagecorp.com X-Trace: 15 Apr 2003 10:07:58 -0500, srv26.comanagecorp.com Path: news.easynews.com!core-easynews!newsfeed1.easynews.com!newsfeed2.easynews.com!easynews.com!easynews!newsfeed.news2me.com!newshosting.com!news-xfer1.atl.newshosting.com!129.250.35.142.MISMATCH!iad-feed.news.verio.net!phl-feed.news.verio.net!news.nauticom.net!COMANAGE.CoManageCorporation.com Xref: core-easynews comp.databases.oracle.server:183511 X-Received-Date: Tue, 15 Apr 2003 07:12:09 MST (news.easynews.com) ------=_NextPart_000_0011_01C30337.4889F070 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable You would need to first create a tablespace with the same name as the one dropped, set the quota of the user to "0" for the tablespace, and then drop the tablespace (again): =20 =20 SQL> select username, tablespace_name, bytes from dba_ts_quotas; =20 USERNAME TABLESPACE_NAME MAX_BYTES ------------ ------------------ --------- ODM ODM -1 ODM_MTR ODM -1 OLAPSYS CWMLITE -1 JHUNTER TEMP_TBS 516096 =20 SQL> DROP TABLESPACE temp_tbs INCLUDING CONTENTS AND DATAFILES; =20 SQL> select username, tablespace_name, bytes from dba_ts_quotas; -- Still there???? =20 USERNAME TABLESPACE_NAME MAX_BYTES ------------ ------------------ --------- ODM ODM -1 ODM_MTR ODM -1 OLAPSYS CWMLITE -1 JHUNTER TEMP_TBS 516096 =20 SQL> alter user jhunter quota 0 on temp_tbs; -- Ouch!!! alter user jhunter quota 0 on temp_tbs * ERROR at line 1: ORA-00959: tablespace 'TEMP_TBS' does not exist =20 SQL> create tablespace temp_tbs datafile '/u10/app/oradata/TRUESRC/temp_tbs01.dbf' size 1M; =20 SQL> alter user jhunter quota 0 on temp_tbs; -- Yes!!! =20 SQL> select username, tablespace_name, max_bytes from dba_ts_quotas; = -- It's Miller time =20 USERNAME TABLESPACE_NAME = MAX_BYTES ------------------------------ ------------------------------ = ---------- ODM ODM = -1 ODM_MTR ODM = -1 OLAPSYS CWMLITE = -1 =20 SQL> DROP TABLESPACE temp_tbs INCLUDING CONTENTS AND DATAFILES; =20 Hope this helps... =20 Kindest Regards, -- jeff Jeffrey M. Hunter Sr. Database Administrator jhunter@idevelopment.info www.idevelopment.info "Volker Hetzer" < volker.hetzer@ieee.org> wrote in message news:b7gvh5$p36$1@dackel.pdb.sbs.de... > Hi! > I just deleted a tablespace but an user had a quota on it. > How do I get rid of the quota? > I hesitate to delete the row from dba_ts_quotas. >=20 > Lots of thanks! > Volker > -- > While it is a known fact that programmers > never make mistakes, it is still a good idea > to humor the users by checking for errors at > critical points in your program. > -Robert D. Schneider, "Optimizing INFORMIX > Applications" >=20 >=20 ------=_NextPart_000_0011_01C30337.4889F070 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
You would need to first create a = tablespace with=20 the same name as the one dropped, set the quota of the user to "0" for = the=20 tablespace, and then drop the tablespace (again):
 
 
SQL> select = username,=20 tablespace_name, bytes from dba_ts_quotas;
 
USERNAME    =20 TABLESPACE_NAME    MAX_BYTES
------------ = ------------------=20 ---------
ODM         =20 ODM           &nb= sp;           -1<= /FONT>
ODM_MTR     =20 ODM           &nb= sp;          =20 -1
OLAPSYS     =20 CWMLITE           = ;       =20 -1
JHUNTER    =20  TEMP_TBS         &nbs= p;   =20 516096
 
SQL> DROP = TABLESPACE=20 temp_tbs INCLUDING CONTENTS AND DATAFILES;
 
SQL> select = username,=20 tablespace_name, bytes from dba_ts_quotas; -- Still=20 there????
 
USERNAME    =20 TABLESPACE_NAME    MAX_BYTES
------------ = ------------------=20 ---------
ODM         =20 ODM           &nb= sp;           -1<= /FONT>
ODM_MTR     =20 ODM           &nb= sp;          =20 -1
OLAPSYS     =20 CWMLITE           = ;       =20 -1
JHUNTER    =20  TEMP_TBS         &nbs= p;   =20 516096
 
SQL> alter user = jhunter quota 0=20 on temp_tbs;  -- Ouch!!!
alter user jhunter quota 0 on=20 temp_tbs
*
ERROR at line 1:
ORA-00959: tablespace 'TEMP_TBS' = does not=20 exist
 
SQL> create = tablespace temp_tbs=20 datafile '/u10/app/oradata/TRUESRC/temp_tbs01.dbf' size=20 1M;
 
SQL> alter = user jhunter=20 quota 0 on temp_tbs;  -- Yes!!!
 
SQL> select = username,=20 tablespace_name, max_bytes from dba_ts_quotas;  -- It's Miller=20 time
 
USERNAME         &= nbsp;           &= nbsp;=20 TABLESPACE_NAME         &nb= sp;      =20 MAX_BYTES
------------------------------ = ------------------------------=20 ----------
ODM         &= nbsp;           &= nbsp;     =20 ODM           &nb= sp;           &nb= sp;           =20 -1
ODM_MTR          = ;            = ; =20 ODM           &nb= sp;           &nb= sp;           =20 -1
OLAPSYS          = ;            = ; =20 CWMLITE           = ;            = ;        =20 -1
 
SQL> DROP = TABLESPACE=20 temp_tbs INCLUDING CONTENTS AND DATAFILES;
 
 Hope this = helps...
 
Kindest Regards,
-- jeff

Jeffrey M. Hunter
Sr. Database=20 Administrator
jhunter@idevelopment.info

www.idevelopment.info
"Volker Hetzer" <volker.hetzer@ieee.org> wrote in=20 message news:b7gvh5$p36$1@dackel.pdb.sbs.de...
> Hi!
> I = just deleted a=20 tablespace but an user had a quota on it.
> How do I get rid of = the=20 quota?
> I hesitate to delete the row from dba_ts_quotas.
> =
>=20 Lots of thanks!
> Volker
> --
> While it is a known = fact that=20 programmers
> never make mistakes, it is still a good = idea
> to=20 humor the users by checking for errors at
> critical points in = your=20 program.
> -Robert D. Schneider, "Optimizing INFORMIX
>=20  Applications"
>
>
------=_NextPart_000_0011_01C30337.4889F070--