Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 933
  • Last Modified:

Move TEMP datafile to ASM

Hi,

  I have my TEMP tablesapce as normal datafile using regular filesystem, and i want to move it to ASM.  How can i do that ?

Regards,
0
joe_echavarria
Asked:
joe_echavarria
  • 4
  • 3
1 Solution
 
sdstuberCommented:
-- set size and other space options to whatever you need, specifying whatever ASM disk group you want to use

CREATE TEMPORARY TABLESPACE TEMP2 tempfile '+DG_DATA' size 256M;

-- assuming TEMP was the default change everyone to use the new temp space
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP2;

-- get rid of the old one
DROP TABLESPACE TEMP INCLUDING CONTENTS AND DATAFILES;
0
 
sdstuberCommented:
---optionally can then rename the new one back to temp

alter tablespace temp2 rename to temp;
0
 
joe_echavarriaDatabase AdministratorAuthor Commented:
What  "Select" statament can i execute to confirm all this  configuration ?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
joe_echavarriaDatabase AdministratorAuthor Commented:
how can i increase the size of the temp datafile in the ASM ?
0
 
sdstuberCommented:
select * from dba_temp_files;

alter database tempfile 'xxxxx' resize 100G; -- adjust size as needed

where xxxxx is the full path for the tempfile  (not datafile) you see in the query above.
0
 
joe_echavarriaDatabase AdministratorAuthor Commented:
I need the temp file to larger  , and i can 't make it larger.   Below the error getting.   The size can not be bigger than 31G.  How can i make it bigger ?, i just want to have one TEMP data file, no adding others datafiles.

SQL> alter database tempfile '+DATA_DEV/qms01dev/tempfile/temp3.269.863443027' r
esize 32G;
alter database tempfile '+DATA_DEV/qms01dev/tempfile/temp3.269.863443027' resize
 32G
*
ERROR at line 1:
ORA-01144: File size (4194304 blocks) exceeds maximum of 4194303 blocks


SQL> alter database tempfile '+DATA_DEV/qms01dev/tempfile/temp3.269.863443027' r
esize 31G;

Database altered.
0
 
sdstuberCommented:
if you can't make the files bigger, then add more files


ALTER TABLESPACE TEMP ADD TEMPFILE  SIZE 31G;
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now