Sie sind auf Seite 1von 5

sql> ------------------------------useage of temporary tablespace-----------

sql> ------it use sorting,orderby,having,distinct,index


sql> ------show the temporary tablespace
sql> select * from dba_users where username='sh';

username user_id password


------------------------------ ---------- ------------------------------
account_status lock_date expiry_da
-------------------------------- --------- ---------
default_tablespace temporary_tablespace created
------------------------------ ------------------------------ ---------
profile initial_rsrc_consumer_group
------------------------------ ------------------------------
external_name
--------------------------------------------------------------------------------
sh 49 e856cf3971f8a45e
open
example temp 12-may-02

username user_id password


------------------------------ ---------- ------------------------------
account_status lock_date expiry_da
-------------------------------- --------- ---------
default_tablespace temporary_tablespace created
------------------------------ ------------------------------ ---------
profile initial_rsrc_consumer_group
------------------------------ ------------------------------
external_name
--------------------------------------------------------------------------------
default default_consumer_group

sql> set linesize 200;


sql> set pagesize 200;
sql> /

username user_id password


account_status lock_date expiry_da default_tablespace
temporary_tablespace created
------------------------------ ---------- ------------------------------
-------------------------------- --------- ---------
------------------------------ ------------------------------ ---------
profile initial_rsrc_consumer_group

------------------------------ ------------------------------

external_name

----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
------------------------------------
sh 49 e856cf3971f8a45e open
example temp 12-may-02
default default_consumer_group
sql> flagger off
flagger off
flagger off
pagesize 200
flagger off
flagger off
/

username user_id password


account_status lock_date expiry_da default_tablespace
temporary_tablespace created
------------------------------ ---------- ------------------------------
-------------------------------- --------- ---------
------------------------------ ------------------------------ ---------
profile initial_rsrc_consumer_group

------------------------------ ------------------------------

external_name

----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
------------------------------------
sh 49 e856cf3971f8a45e open
example temp 12-may-02
default default_consumer_group

sql> desc dba_users


name
null? type
---------------------------------------------------------------------------------
-------------------------------- --------
----------------------------------------------------------------------------
username
not null varchar2(30)
user_id
not null number
password
varchar2(30)
account_status
not null varchar2(32)
lock_date
date
expiry_date
date
default_tablespace
not null varchar2(30)
temporary_tablespace
not null varchar2(30)
created
not null date
profile
not null varchar2(30)
initial_rsrc_consumer_group
varchar2(30)
external_name
varchar2(4000)

sql> select username,default_tablespace,temporary_tablespace from dba_users where


username='sh';

username default_tablespace temporary_tablespace

------------------------------ ------------------------------
------------------------------

sh example temp

sql> ------temp is default remporary tablespace. its cant be drop


sql>
----------------------------------------------------------------------------------
------------------
sql> -----create temporary tablespace
sql> create temporary tablespace sue tempfile 'd:\oracle\oradata\sue\tabtemp.ora'
size 1m;
create temporary tablespace sue tempfile 'd:\oracle\oradata\sue\tabtemp.ora' size
1m
*
error at line 1:
ora-01543: tablespace 'sue' already exists

sql> create temporary tablespace sue1 tempfile 'd:\oracle\oradata\sue\tabtemp.ora'


size 1m;
create temporary tablespace sue1 tempfile 'd:\oracle\oradata\sue\tabtemp.ora' size
1m
*
error at line 1:
ora-03214: file size specified is smaller than minimum required

sql> create temporary tablespace sue1 tempfile 'd:\oracle\oradata\sue\tabtemp.ora'


size 3m;

tablespace created.

sql>
----------------------------------------------------------------------------------
-----------------------------------
sql> -------show the default temp tablespace name
sql> select * from database_properties where
property_name='default_temp_tablespace';

property_name

------------------------------
property_value

----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
------------------------------------
description

----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
------------------------------------
default_temp_tablespace

temp

name of default temporary tablespace

sql> ------------------------------------------------------
sql> ----change the default temp tablespace
sql> alter database default temporary tablespace sue1;

database altered.

sql> -------show the default temp tablespace name


sql> select * from database_properties where
property_name='default_temp_tablespace';

property_name

------------------------------

property_value

----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
------------------------------------
description

----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
------------------------------------
default_temp_tablespace

sue1

name of default temporary tablespace

sql> ----------------drop temp tablespace


sql> deop temp tablespace sue1;
sp2-0734: unknown command beginning "deop temp ..." - rest of line ignored.
sql> drop temp tablespace sue1;
drop temp tablespace sue1
*
error at line 1:
ora-00950: invalid drop option

sql> drop tablespace temp sue1;


drop tablespace temp sue1
*
error at line 1:
ora-02173: invalid option for drop tablespace

sql> drop tablespace temp;

tablespace dropped.

sql> drop tablespace sue1


2 ;
drop tablespace sue1
*
error at line 1:
ora-12906: cannot drop default temporary tablespace

sql> spool off

Das könnte Ihnen auch gefallen