Move db-file of system temp tablespace

Hallo all,
There is the need to move the system temp tablespace file to another disk. The database version is 9.2.0.1 and runs on an M$ Windows 2000 version 5.00.2195 sp 4 Server.
What is the work around for this task?
Thanks!
Best regards

Hallo!
Thanks for your efforts.
I followed your instructions exactly and it's works for e. g. "system01.dbf". But it doesn't work for the datafile or temp tablespace (TEMP01.DBF). Here is a print out of alert.log. It shows the error-messages and the status of the database:
Tue Feb 15 07:18:17 2005
starting up 1 shared server(s) ...
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
Tue Feb 15 07:18:17 2005
ALTER DATABASE MOUNT
Tue Feb 15 07:18:22 2005
Successful mount of redo thread 1, with mount id 3673729017.
Tue Feb 15 07:18:22 2005
Database mounted in Exclusive Mode.
Completed: ALTER DATABASE MOUNT
Tue Feb 15 07:22:57 2005
alter database rename file 'D:\oracle\oradata\ho01\temp01.dbf' to 'D:\oracle\oradata\TS-temp\temp01.dbf'
Tue Feb 15 07:22:57 2005
ORA-1511 signalled during: alter database rename file 'D:\oracle\oradata\ho01...
Tue Feb 15 07:26:55 2005
alter database rename file 'D:\oracle\oradata\HO01\TEMP01.DBF' to 'D:\oracle\oradata\TS-temp\TEMP01.DBF'
Tue Feb 15 07:26:55 2005
ORA-1511 signalled during: alter database rename file 'D:\oracle\oradata\HO01...
May be there is something sqecial with this datafile.
Bye!
Stefan

Similar Messages

  • How to remove data file from System tablespace

    Hi All,
    I have wrongly added data file in SYSTEM tablespace, now I want remove it. I have tried to set datafile offline but it is giving me the error system tableapce can not set offline. so please help me. I am working Oracle 10g .
    thanks in advance
    sv

    In 10gR2, you can drop a datafile from tablespace, as long it's empty (and of course not the last one):
    ALTER TABLESPACE tbs_03 DROP DATAFILE 'tbs_f04.dbf';
    Otherwise, there's no direct way to get rid of the file. You can just shrink it and move (i.e. "rename") it another location. For a non-system tablespace, move of all segments to another tablespace (and later renaming it) would be an option, but this of course won't work with system tablespace.

  • HT1338 Purchased a used macbook pro with Mountain Lion. My old Mac runs Snow Leopard is backed up to Time machine. How do I register the operating system to me and how do I use Time Machine to move my files to the new used computer?

    Purchased a used macbook pro with Mountain Lion. My old Mac runs Snow Leopard is backed up to Time machine. How do I register the operating system to me and how do I use Time Machine to move my files to the new used computer?

    If you look at the User Tips tab, you will find a write up on just this subject:
    https://discussions.apple.com/docs/DOC-4053
    The subject of buying/selling a Mac is quite complicated.  Here is a guide to the steps involved. It is from the Seller's point of view, but easily read the other way too:
    SELLING A MAC A
    Internet Recovery, and Transferability of OS & iLife Apps
    Selling an Old Mac:
    • When selling an old Mac, the only OS that is legally transferable is the one that came preinstalled when the Mac was new. Selling a Mac with an upgraded OS isn't doing the new owner any favors. Attempting to do so will only result in headaches since the upgraded OS can't be registered by the new owner. If a clean install becomes necessary, they won't be able to do so and will be forced to install the original OS via Internet Recovery. Best to simply erase the drive and revert back to the original OS prior to selling any Mac.
    • Additionally, upgrading the OS on a Mac you intend to sell means that you are leaving personally identifiable information on the Mac since the only way to upgrade the OS involves using your own AppleID to download the upgrade from the App Store. So there will be traces of your info and user account left behind. Again, best to erase the drive and revert to the original OS via Internet Recovery.
    Internet Recovery:
    • In the event that the OS has been upgraded to a newer version (i.e. Lion to Mountain Lion), Internet Recovery will offer the version of the OS that originally came with the Mac. So while booting to the Recovery Disk will show Mountain Lion as available for reinstall since that is the current version running, Internet Recovery, on the other hand, will only show Lion available since that was the OS shipped with that particular Mac.
    • Though the Mac came with a particular version of Mac OS X, it appears that, when Internet Recovery is invoked, the most recent update of that version may be applied. (i.e. if the Mac originally came with 10.7.3, Internet Recovery may install a more recent update like 10.7.5)
    iLife Apps:
    • When the App Store is launched for the first time it will report that the iLife apps are available for the user to Accept under the Purchases section. The user will be required to enter their AppleID during the Acceptance process. From that point on the iLife apps will be tied to the AppleID used to Accept them. The user will be allowed to download the apps to other Macs they own if they wish using the same AppleID used to Accept them.
    • Once Accepted on the new Mac, the iLife apps can not be transferred to any future owner when the Mac is sold. Attempting to use an AppleID after the apps have already been accepted using a different AppleID will result in the App Store reporting "These apps were already assigned to another Apple ID".
    • It appears, however, that the iLife Apps do not automatically go to the first owner of the Mac. It's quite possible that the original owner, either by choice or neglect, never Accepted the iLife apps in the App Store. As a result, a future owner of the Mac may be able to successfully Accept the apps and retain them for themselves using their own AppleID. Bottom Line: Whoever Accepts the iLife apps first gets to keep them.
    SELLING A MAC B
    Follow these instructions step by step to prepare a Mac for sale:
    Step One - Back up your data:
    A. If you have any Virtual PCs shut them down. They cannot be in their "fast saved" state. They must be shut down from inside Windows.
    B. Clone to an external drive using using Carbon Copy Cloner.
    1. Open Carbon Copy Cloner.
    2. Select the Source volume from the Select a source drop down menu on the left side.
    3. Select the Destination volume from the Select a destination drop down menu on the right
    side.
    4. Click on the Clone button. If you are prompted about creating a clone of the Recovery HD be
    sure to opt for that.
    Destination means a freshly erased external backup drive. Source means the internal
    startup drive. 
    Step Two - Prepare the machine for the new buyer:
    1. De-authorize the computer in iTunes! De-authorize both iTunes and Audible accounts.
    2, Remove any Open Firmware passwords or Firmware passwords.
    3. Turn the brightness full up and volume nearly so.
    4. Turn off File Vault, if enabled.
    5. Disable iCloud, if enabled: See.What to do with iCloud before selling your computer
    Step Three - Install a fresh OS:
    A. Snow Leopard and earlier versions of OS X
    1. Insert the original OS X install CD/DVD that came with your computer.
    2. Restart the computer while holding down the C key to boot from the CD/DVD.
    3. Select Disk Utility from the Utilities menu; repartition and reformat the internal hard drive.
    Optionally, click on the Security button and set the Zero Data option to one-pass.
    4. Install OS X.
    5. Upon completion DO NOT restart the computer.
    6. Shutdown the computer.
    B. Lion and Mountain Lion (if pre-installed on the computer at purchase*)
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because
    it is three times faster than wireless.
    1. Restart the computer while holding down the COMMAND and R keys until the Mac OS X
    Utilities window appears.
    2. Select Disk Utility from the Mac OS X Utilities window and click on the Continue button. 
    3. After DU loads select your startup volume (usually Macintosh HD) from the left side list. Click
    on the Erase tab in the DU main window.
    4. Set the format type to Mac OS Extended (Journaled.) Optionally, click on the Security button
    and set the Zero Data option to one-pass.
    5. Click on the Erase button and wait until the process has completed.
    6. Quit DU and return to the Mac OS X Utilities window.
    7. Select Reinstall Lion/Mountain Lion and click on the Install button.
    8. Upon completion shutdown the computer.
    *If your computer came with Lion or Mountain Lion pre-installed then you are entitled to transfer your license once. If you purchased Lion or Mountain Lion from the App Store then you cannot transfer your license to another party. In the case of the latter you should install the original version of OS X that came with your computer. You need to repartition the hard drive as well as reformat it; this will assure that the Recovery HD partition is removed. See Step Three above. You may verify these requirements by reviewing your OS X Software License.

  • How to create temp files in temp tablespace

    Dear all,
    Due to outage of our SAN, we our out of production for the
    last 3 days. By the grace of Almighty we have restored production by
    database recovery from our standby backup. Since temp tablespace and
    temp data files do not taken as backup for standby, now after recovery
    we are getting abap dumps asking for temp_1 and temp_2 datafiles.
    Please guide us how to create temp files. v$tablespace is showing tablespace PSAPTEMP but datafile are not there
    Abap dumps are giving these errors as mentioned below
    ====================================================
    The exception must either be prevented, caught within the procedure            
    "DATA_SELECTION"                                                              
    "(FORM)", or declared in the procedure's RAISING clause.                       
    To prevent the exception, note the following:                                  
    Database error text........: "ORA-01157: cannot identify/lock data file 256 -  
    see DBWR trace file#ORA-01110: data file 256:                                 
    '/oracle/SD1/sapdata4/temp_2/temp.data2'"                                     
    Internal call code.........: "[RSQL/FTCH/MARA ]"                               
    ===================================================
    another one asking for 
    '/oracle/SD1/sapdata3/temp_1/temp.data1'"
    Best Regards
    Waqas

    if you want to add a new tempfile to your TEMP Tablespace,you can do like that.
    <i>ALTER TABLESPACE</i> <<b><u>name of TEMP Tablespace</u></b>> ADD TEMPFILE <<b><u><b><u>pfad to the file_and_file name</u></b></u></b>> <b>SIZE</b> <size>;
    You can use also the options <i>REUS</i>E <i>autoextend off</i> or <i>on</i> .
    e.g:
    <i>alter tablespace</i> <u><b>PSAPTEMP</b></u> add <i>tempfile</i> <b><u>'/oracle/SD1/sapdata4/temp_2/temp.data2'</u></b> <i>SIZE 1000K</i> <i>REUSE</i>;
    The directory <b><u>temp_2</u></b> should exist.
    Or you can use the BR*Tools to create a new datafile. Enter brtools and follow the instructions or menu.
    More to TEMP Tablespaces see please following SAP notes:
    <u><b>659946</b></u> - FAQ: Temporary tablespaces
    <u><b>600513</b></u> - ORA-25153 after recovery due to missing tempfiles
    and the Oracle Note:
    <u><b>160426.1</b></u>: TEMPORARY Tablespaces : Tempfiles or Datafiles ?
    I hope it helps.

  • ASSM and system, temp, undo tablespaces(10g)

    Hi, all.
    I created a database(10.2.0.2.0) by using DBCA.
    SYSAUX and USERS tablespaces are set to "auto" in
    SEGMENT_SPACE_MANAGEMENT column.
    However, system, temp and temp tablespaces have the value of "Manual" in
    SEGMENT_SPACE_MANAGEMENT column.
    Can I change this Value, "Manual" to "Auto" ??
    (system, temp, undo tablespace)
    Best Regards.

    Hi,
    The document states that there are certain restrictions on Automatic Segment-space Management.
    Firstly, you can specify this clause only for a permanent, locally managed tablespace.Secondly, you cannot specify this clause for the SYSTEM tablespace.
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7003.htm
    Adith

  • Does rebuild of indexes uses temp tablespace or system tablespace?

    Does rebuild of indexes uses temp tablespace or system tablespace?
    If so why?

    If you combine the answers from Aman and Burleson, they cover most of the picture.
    When rebuilding an index, you may end up sorting a large amount of information. The sort may spill into the temporary tablespace - if you haven't configured your database and users properly, it is possible that the SYSTEM tablespace may be used for the temporary tablespace.
    As the new copy of the index is built, it has to be built in the right place (tablespace), and the space used to build it will be marked as a temporary segment as the build takes place. When the build is complete, this temporary segment will take on the name of the origrinal index, and the original index will be re-badged as a temporary segment and dropped. (Again, you might see temporary segments in the SYSTEM tablespace if the index was originally in, or was rebuilt into, the SYSTEM tablespace).
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk

  • Chmod 640 (Datafile,UNDO,TEMP Tablespace, Controlfile, Redo Log Files, Arch

    If i change the permssion of these file to 640, will this break any thing?
    what are the suggested permission of Oracle files and directories?

    here i am doing to secure my DBs Just doing research that it dont break any thing
    These are the permission i am going to change in my DBs , any suggestion?
    chmod 750 /u02/oradata/sid_name
    Chmod 640 (Datafile,UNDO,TEMP Tablespace, Controlfile, Redo Log Files, Archivelogs)
    chmod 644 (alert Logs, init.ora files, config.ora files)
    Chmod 640 $ORACLE_HOME/rdbms/admin/utlpwdmg.sql
    Verify umask = 022 - type "umask" - should return 022; if not, modify in .profile
    Verify all files are readable--run the following:
    select file_name, status from dba_data_files where status != 'AVAILABLE'--should return 0 rows
    SUN - ls -al /var/opt/oracle/oratab = should be owner=oracle group=dba
    IF NOT, OPEN SR TO UNIX TEAM TO CHANGE
    Verify oraInst.loc - look at /u01/app/oracle/security/*.info - setting A271-
    /var/opt/oracle/oraInst.loc - owned by oracle:dba
    *IF NOT, OPEN SR TO UNIX TEAM TO CHANGE
    Verify ownership of $ORACLE_HOME/network/admin/listener.ora,$ORACLE_HOME/network/admin/tnsnames.ora
    = oracle:dba
    *IF NOT, OPEN SR TO UNIX TEAM TO CHANGE
    Verification:
    1. run gsd331 scan and verify fixed--
    execute /u01/app/oracle/security/orashc -m -a *output will go to [email protected]
    BACKOUT:
    Change permission back to 755

  • Recreating of TEMP file and TEMP Tablespace

    Hi!
    I have a problem with recreating of TEMP file and TEMP Tablespace after I made a copy of my database.
    I made a new TEMP file and TEMP Tablespace and set them as default:
    SQL> CREATE TEMPORARY TABLESPACE TEMP3 TEMPFILE 'C:\app\Orcldata\orclcopy\TEMP05.DBF' SIZE 2000M;
    SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP3;
    But when a made a select to see them:
    SQL> SELECT tablespace_name, file_name, bytes FROM dba_temp_files WHERE tablespace_name = 'TEMP3';
    SELECT tablespace_name, file_name, bytes FROM dba_temp_files WHERE tablespace_name = 'TEMP3'
    ERROR at line 1:
    ORA-01157: cannot identify/lock data file 202 - see DBWR trace file
    ORA-01110: data file 202: 'C:\APP\ORCLDATA\ORCL\TEST_IASTEMP.DBF'
    I can't understand where is the problem.
    Thx!

    1006067 wrote:
    Hi!
    I have a problem with recreating of TEMP file and TEMP Tablespace after I made a copy of my database.
    I made a new TEMP file and TEMP Tablespace and set them as default:
    SQL> CREATE TEMPORARY TABLESPACE TEMP3 TEMPFILE 'C:\app\Orcldata\orclcopy\TEMP05.DBF' SIZE 2000M;
    SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP3;
    But when a made a select to see them:
    SQL> SELECT tablespace_name, file_name, bytes FROM dba_temp_files WHERE tablespace_name = 'TEMP3';
    SELECT tablespace_name, file_name, bytes FROM dba_temp_files WHERE tablespace_name = 'TEMP3'
    ERROR at line 1:
    ORA-01157: cannot identify/lock data file 202 - see DBWR trace file
    ORA-01110: data file 202: 'C:\APP\ORCLDATA\ORCL\TEST_IASTEMP.DBF'
    I can't understand where is the problem.
    Thx!Im gonna throw 2c in the ring and say "someone" (bunny fingers) deleted 'C:\APP\ORCLDATA\ORCL\TEST_IASTEMP.DBF' without dropping from the database first.
    in dos, see if the file exists, Id be surprised if it does
    dir C:\APP\ORCLDATA\ORCL\TEST_IASTEMP.DBF
    drop the temp tablespace associated with it

  • How can you move video files to a PC operating system windows xp that are bigger than 500mb?

    Iam trying to move video files from my iPad to my PC but because they are all over 500mb my OS (windows Xp) will not let me. So I am presently stuck with them on my iPad. Is there another way to move them. Please help!

    OS (windows Xp) will not let me.
    Why will it not?  What is the error message?  How are you trying to transfer them?
    There are lots of ways of moving files.
    A simple and popular way to copy files and share files amoung your devices. This will depend on you internet connection speed.
    https://www.dropbox.com/
    Using iTures to transfer files:
    http://support.apple.com/kb/HT4094?viewlocale=en_US&locale=en_US
    Files Connect -- The swiss army knife of remote file connect
    https://itunes.apple.com/us/app/files-connect/id404324302?mt=8
    Windows File server
    http://itunes.apple.com/us/app/filebrowser-access-files-on/id364738545?mt=8
    "In education and business users increasingly expect to be able to access their data anytime, anywhere and from any device."
    http://www.minnow.it/
    This thread has good info.
    https://discussions.apple.com/thread/3708341?tstart=0
    How to transfer files from your iPad to your PC with iPad to Computer Transfer
    http://www.iphone-mac.com/how-to-transfer-and-sync-contents-from-ipad-to-pc.html
    Try the combo of:
    Diskaid on your computer and FileAppPro on your iPad
    Good old FTP
    FileApp and FileApp Pro

  • TEMP tablespace getting full while inserting a CLOB in Trigger

    We have a Oracle 10g (10.2.0.4.0) DB on a Solaris 9 box which also runs our J2EE web-service application on Weblogic 8sp6 server.
    We get around 220K web-service requests from upstream callers daily to insert data in the main table, say TABLE1, which has daily partitions on a date column. This table has around 21 columns out of which 1 is a CLOB column.
    Now this table has an AFTER INSERT trigger which calls a package procedure to insert the same record into another table, say TABLE2.
    From Java application insert statement in executed in below format using a weblogic jdbc connection pool :
    INSERT INTO TABLE1(COLUMN1, COLUMN2, ........., CLOB_COLUMN,........, COLUMN21) VALUES (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19, :20);
    Clob object is prepared in application using ojdbc14.jar.
    We are observing a strange issue here. The TEMP tablespace utilization keeps on growing as more and more inserts are executed by application and after ~125K inserts the TEMP tablespace gets full and we start getting ORA-01652 error.
    On further analysis we could see that there are only 7-10 session being maintained but as more and more inserts happen TEMP tablespace utilization goes on increasing for each of these sessions.
    When we tried with inserting just few records and then watching the session details in v$session_wait then we could see that it is in INACTIVE state and waiting for the event ‘SQL*Net message from client’. This does not seem correct as the session has successfully inserted the data and committed the transaction and we can see the data in the tables as well.
    The confusing thing here is when we modify the trigger to pass blank string('' ) instead of the CLOB column to TABLE2 then this issue does not occur. All 200K records are inserted properly and TEMP tablespace utilization also keep always below 1%.
    Can you please help us in solving this issue. Is this related to any oracle issue?
    Inside the package we have tried using DBMS_COPY statement to copy the CLOB column after insert but still same result.
    Code for reference:
    Trigger:
    =====================================
    CREATE OR REPLACE TRIGGER trg
    AFTER INSERT OR UPDATE
    ON TABLE1
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    BEGIN
    IF (:NEW.date_col > SYSDATE - 2)
    THEN
    IF (:NEW.cat IN (1001, 1002))
    THEN
    pkg.process_change
         (:NEW.COLUMN1,
              :NEW.COLUMN2,
              :NEW.CLOB_COLUMN,
    FLAG
    END IF;
    END IF;
    END;
    =====================================
    Package:
    =====================================
    procedure PKG.Process_change(
    p_COLUMN1 number,
    p_COLUMN2 varchar2,
    p_CLOB_COLUMN clob,
    flag boolean
    ) is
    v_watermark pls_integer;
    v_type varchar2(1);
    begin
    if (flag) then
    v_type := 'U';
    else
    v_type := 'I';
    end if;
    select t_seq.nextval into v_watermark from dual;
    insert into TABLE2(
    COLUMN1 number,
    COLUMN2 varchar2,
    CLOB_COLUMN clob,
    watermark,
    dml_type
    )values (
    p_COLUMN1 number,
    p_COLUMN2 varchar2,
    p_CLOB_COLUMN clob,
    v_watermark,
    v_dml_type
    end;
    =====================================

    My first thought on reading your post is that not only are you using a database version that is now so old it is in extended support and even then not even the most recent patchset for it.
    The first thing I would do is move to 11gR2 and if you can't do that at least get to 10.2.0.5 and apply CLOB relevant patches as well.
    Same goes for your operating system. Solaris 9 is ancient: So move to 10 which has vastly improved memory management.
    To help you further it would be really valuable to know the table layout. For example is this a heap table or an IOT? Is it partitioned? Is this RAC? What size are the CLOBs? Are they stored in-line? Chunk size? etc.
    This page should start you down the right road:
    http://docs.oracle.com/cd/B19306_01/appdev.102/b14249/adlob_tables.htm#sthref204
    But I am also wondering why you would use a trigger to, as you say, "insert the same record into another table." This description is a poster child for "bad design."

  • ORA-01652 in TEMP Tablespace

    Hi,
    We have the following errors:
    RMAN> crosscheck archivelog all;
    starting full resync of recovery catalog
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of crosscheck command at 01/07/2009 14:26:10
    RMAN-03014: implicit resync of recovery catalog failed
    RMAN-03009: failure of full resync command on default channel at 01/07/2009 14:26:10
    ORA-01652: unable to extend temp segment by in tablespace
    RMAN>
    We have tried to increase the size of the TEMP tablespace, but this operation keeps using up the entire temp tablespace. It's the temp tablespace in the target database that is filling up.
    We cannot keep increasing the size of the TEMP ts to fill the disk.
    We have also tried to create a new repository but this had the same outcome.
    I reckon there is something in the database tables, as one of our backups used the target control file as its repository. Should I remove the entries from these tables in the target tablespace to make the repository think there is no re-synching to be done?
    Regards,
    Tim.

    If you are sure that it is on the target DB what you can do is enable a trace for the event to see what triggers this error
    it doesnt have to be on temporary table because there are temp segments on normal tables used for index creation type operations as well so you need to find the problem before assuming it is temp tablespace error
    alter system set events '1652 trace name errorstack level 1';
    to turn off
    alter system set events '1652 trace name context off';
    If you cant find anything from trace then you can send the trace output here maybe somebody can catch something.
    Coskan Gundogar
    http://coskan.wordpress.com
    Edited by: coskan on Mar 30, 2009 4:28 PM

  • Maximum Temp tablespace size you've seen

    DB version: 10.2.0.4
    Our DB caters a retail application . Total DB Size of 3TB. Its is a bit of mix of both OLTP and Batch processing environment.
    Our temp tablespace has 1 file and we had set the tempfile as AUTOEXTEND. Somehow its size has reached 25GB now !
    We don't actually need this. Do we?
    For a fairly busy DB of around 3TB size, what is the maximum temp tablespace size you've ever seen?
    What is the maximum temp tablespace size you've ever seen for Big DB like Telecom, Banking?

    The point about temp space is that your requirements are dynamic - the actively used area shrinks and grows.
    Comparing apples with oranges, tempfile sizes on system where I am currently here amount to 50 GB but to be honest that's mainly due to a not insignificant number of pretty poor queries, run concurrently, with multipass operations, etc.
    Kellyn Pedersen had an example of a process using 720GB here:
    http://dbakevlar.com/?p=43
    Whilst 25GB may not be earth shattering, a "large" temp area may perhaps be an indicator that you want to review some of your application code.
    (What is "large"? "unusual" compared to what is "normal" for your system may be a better metric)
    If you're using automatic pga memory management, then there's a limit to what each session can get, it may be that automatic work areas are not suitable for some of your code and some manual sizing is required to prevent operations spilling unnecessarily.
    Also, inaccurate CBO estimates on your queries can lead to inaccurately sized work areas that then spill into temp.
    There was a reminder of this in one of Randolf Geist's articles on hash aggregation:
    http://oracle-randolf.blogspot.com/2011/01/hash-aggregation.html

  • Temp tablespace drop 관련 질문임다!

    temp tablespace가 거의 100%사용이어서, db shutdown하고 다시 살렸는데도
    줄지 않아서 (사실 이것도 왜 안주는지 궁금하거등요~!)
    우선 old_temp tablespace를 new_temp tablespace를 만들었습니다.
    즉,,,제가 한작업들을 개략 적어보면요
    1) create temporary tablespace new_temp tempfile~~~~;
    2) drop tablespace old_temp;
    3) alter database default temporary tablespace new_temp;
    하고 나서 모든 유저에 지정되어있는 temporary tablespace를 new_temp로 지정
    해줘야 하쟎아요
    즉, alter user scott temporary tablespace new_temp; 이렇게요...
    근데 이걸 안해줬는데도 에러없이 scott유저는 소트를 수행하드라구요...
    이거...정상인건가요????
    ***추가질문~!
    그리고 템프싸이즈가 줄지않고 계속늘어날때의 원인과 체크포인트좀 부탁드립니다.

    8i에서는 tempfile이란 개념은 있었으나 default temporary tablespace라는
    개념은 없었습니다. 그래서 유저에게 직접 default tablespace를 지정해주어야
    했었습니다.
    하지만.. 9i부터는 alter database default temporary tablespace new_temp;
    명령을 하기만 하면 모든 유저의 default temporary tablespace가 default로
    지정되어 있지 않으면 new_temp로 됩니다.
    물론 이 경우에도 수동으로 temp를 지정할 수 있으니 실제로 유저가
    temp공간을 어디에 사용하는지는..
    select username, temporary_tablespace from dba_users; 를 통해서
    확인해야 합니다.
    scott유저는 default temporary tablespace로 지정되어서 그 쪽 temp를
    사용하게 되니, 에러가 나지 않겠죠.
    default temporary tablespace가 무엇으로 지정되어 있는지는,
    select * from database_properties; 또는 select * from sys.props$; 로 조회하면
    temporary tablespace라는 이름으로 어떤 값이 들어가 있는지 보입니다.
    그리고 temp는 DB를 내렸다가 올리면 smon프로세스가 clear시켜줍니다.
    temp는 아시다 싶이 당연히 sort를 해서 발생하는 것이구요. 그렇다면..
    temp가 계속해서 full이 난다면.. temp를 사용하는 세션을 확인하고
    temp를 사용하는 세션의 쿼리를 뽑아낸다면 쉽게 해결이 되겠죠.
    아래는 제가 경험해서 처리한 것입니다.
    저는 temporary tablespace가 full 났는데 도대체 쿼리를 못잡는 것이었습니다.
    그래서 어떻게 했을까요? Secure CRT에 세션로그를 걸어두고 모니터링을 했죠.
    vi stat.sh
    interval=30 # Sleep interval in seconds
    reps=1000000 # n times
    j=1 # Loop variable
    while [ $j -le ${reps} ]
    do
    echo " ----cycle ${j} / ${reps} --------"
    sqlplus -s system/패스워드<<EOF
    @sw.sql ${j}
    exit
    EOF
    cat sess_${j}.dat >> sw.dat
    rm sess_${j}.dat
    sleep ${interval}
    j=`expr ${j} + 1`
    done
    exit 0
    vi sw.sql
    set line 150
    set concat "+"
    col username format a10
    col osuser format a10
    col tablespace format a15
    spool sess_&1.dat
    SELECT b.tablespace,
    b.segfile#,
    b.segblk#,
    b.blocks,
    a.sid,
    a.serial#,
    c.spid,
    a.username,
    a.osuser,
    a.status,
    a.sql_hash_value
    FROM v$session a,
    v$sort_usage b,
    v$process c
    WHERE a.saddr = b.session_addr and a.paddr=c.addr
    ORDER BY b.tablespace, b.segfile#, b.segblk#, b.blocks;
    spool off
    stats.sh 를 수행하고 PC킨 상태로 그냥두고 다음날 왔더니 아래처럼 temp를
    계속 쓰는 넘이 나온거죠..
    딱걸렸습니다.ㅎㅎ
    TEMP 93 2550817 13824 92 58284 3193 PVB oracle ACTIVE 1126923165
    ----cycle 1792 / 1000000 --------
    TEMP 93 2550817 43008 92 58284 3193 PVB oracle ACTIVE 1126923165
    ----cycle 1793 / 1000000 --------
    TEMP 93 2550817 72192 92 58284 3193 PVB oracle ACTIVE 1126923165
    ----cycle 1794 / 1000000 --------
    TEMP 93 2550817 101376 92 58284 3193 PVB oracle ACTIVE 1126923165
    ----cycle 1795 / 1000000 --------
    TEMP 93 2550817 131072 92 58284 3193 PVB oracle ACTIVE 1126923165
    ----cycle 1796 / 1000000 --------
    TEMP 93 2416673 18944 123 5171 3197 PVB oracle ACTIVE 1126923165
    TEMP 93 2550817 159744 92 58284 3193 PVB oracle ACTIVE 1126923165
    ----cycle 1797 / 1000000 --------
    TEMP 93 2416673 48128 123 5171 3197 PVB oracle ACTIVE 1126923165
    TEMP
    sql_hash_value값이 1126923165 이니 아래 쿼리에다가 넣으면 full 쿼리가 나오죠..
    결국엔 개발자가 모든 소스코드에서 변경을 했어야 했는데.. 그렇게 하지 않아서
    일부 웹서버에서의 쿼리가 이상하게 where조건없이 수행되었고 그래서 temp가
    full 났던 것이랍니다.
    vi sidhashsql.sql
    set pages 1000
    col sql_text format a120
    select sql_text from v$sqltext_with_newlines
    where hash_value=&hash_value order by piece;
    SQL> @sidhashsql
    Enter value for hash_value: 1126923165
    old 2: where hash_value=&hash_value order by piece
    new 2: where hash_value=1126923165 order by piece
    SQL_TEXT
    boan~~~~!!
    아래 너무 자세하게 나와있죠?
    No. 18484
    TEMPORARY TABLESPACE에서 TEMPFILE 과 DATAFILE의 차이점 (8.1.X ~ 9I)
    ============================================================
    PURPOSE
    이 문서에서는 Oracle 7.3부터 사용되어 오던 create tablespace ... temporary
    형태와, 8i부터 사용되는 create temporary tablespace... 의 차이점을 정리해
    본다.
    tablespace의 temporay type과 permanent type에 대한 비교는 <Bulletin#: 11938>
    를 참조하도록 하고 여기에서는 permanent에 대해서는 논외로 한다.
    Explanation
    temporary segment가 생성 가능한 tablespace의 type과 temporary tablesapce에서
    datafile과 tempfile의 차이점을 설명한다.
    1. temporary segment를 생성가능한 tablespace type 정리
    temporary tablespace의 tempfile과 datafile을 비교하기 전에, tablespace의
    type들을 확인해 보고, 이 중 temporary segment가 생성될 수 있는 tablespace
    type을 version별로 정리해본다.
    tablespace는 7.2까지는 permanent type으로 dictionary managed방식으로
    space를 할당/해제하던 방식만이 존재했다. db user의 temporary tablespace로
    임의의 tablespace를 지정가능하였고, 해당 db user의 sort operation은
    지정된 tablespace에서 발생하며, 다른 tablespace와 특별히 구분되는 것은
    없었다.
    이후, 7.3에 temporary type이 추가되고, 8i에서 locally managed type과 일반
    datafile이 아닌 tempfile이 소개되면서 8i를 기준으로 기본적으로 다음과 같이
    4가지 형태의 tablespace 형태가 가능하다.
    이중 (1) ~ (3)번까지는 일반 datafile형태이고, (4)번의 경우는 이 문서에서
    자세히 살펴볼 tempfile이다.
    (locally managed와 dictionary managed의 차이점 및 사용 방법은
    <Bulletin #: 18261>과 <Bulletin #: 11860> 참조)
    (1) permanent-dictionary managed
    (2) permanent-locally managed
    (3) temporary-dictionary managed
    (4) tempfile-locally managed
    [주의] 위의 종류에 temporary datafile에 locally managed 형태의 tablespace는
    없는것에 주의한다.
    그리고 만약 system tablespace가 locally managed로 이미 생성된 경우에는
    이후 모든 tablespace는 locally managed로 생성이 가능하고, dictionary
    managed 형태는 생성하면 ORA-12913 (Cannot create dictionary managed
    tablespace) 오류가 발생하게 된다.
    이러한 여러가지 type의 tablespace중 temporary segment를 생성할 수 있는
    tablespace에 제약이 존재한다.
    - 8i: 어떠한 형태의 tablespace라도 db user의 temporary tablespace로 지정
    가능하다. 단, permanent-locally managed 형태의 tablespace에 sort가
    발생하게 되면 ORA-3212 (Temporary Segment cannot be created in
    locally-managed tablespace) 오류가 발생하게 된다.
    SQL> alter user scott temporary tablespace PERM_LOCAL;
    User altered.
    connect scott/tiger
    SQL> select * from dept order by 1;
    ORA-03212: Temporary Segment cannot be created in locally-managed
    tablespace
    - 9i: db user의 default temporary tablespace 지정 자체가 다음 두 가지
    type만이 가능한다.
    -temporary-dictionary managed
    -tempile-locally managed
    만약 permanent type의 tablespace를 db user의 tempoary tablespace로
    지정하면, ORA-12911 (permanent tablespace cannot be temporary tablespace)
    오류가 발생한다.
    2. tempfile과 datafile의 비교
    아래에서 tablespace지정시 tempfile과 datafile형태를 비교하게 되는데,
    단, datafile형태의 경우 permanent type에 대해서는 언급하지 않는다.
    (1) tempile의 특징
    Oracle7.3에서 tablespace에 생성시 temporary option을 이용하여 생성되는
    tablespace를 구성하는 화일은 datafile이다. 단지 이것이 기존의 permanent
    type과 구별되는것은 이 tablespace에 생성되는 segment들이 매번 sort
    operation마다 별도로 생성되는 대신, 하나의 segment로 만들어지면서
    다른 session에서의 sort operation이 같은 segment를 공유하는 것이다.
    (자세한 것은 <Bulletin#: 11938> 참조)
    Oracle8.1부터 추가된 tempfile형태의 중요한 특징은 tempfile에 발생하는
    변경사항은 redo log file에 기록되지 않는다는 것이다. tempfile에
    checkpoint정보도 기록하지 않고 이에 따라 datafile recovery시에도
    tempfile에 대해서는 recovery가 필요없게 된다.
    이와 같은 이유로 standby database에서 read-only mode로 open하고
    조회시 sort가 발생하여 tempfile이 변경되는것은 문제가 되지 않아
    사용이 가능하다.
    그리고 이미 앞에서 설명한 것과 같이 tempfile은 항상 locally managed
    type으로만 생성이 되며, datafile형태의 temporary tablespace는 다음과
    같이 locally managed type으로 생성 자체가 불가능하다.
    SQL> create tablespace temp_datafile_local
    2 DATAFILE '/ora/oradata/V920/temp_data.dbf' size 100M
    3 TEMPORARY
    4 EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;
    ORA-25144: invalid option for CREATE TABLESPACE with TEMPORARY contents
    (2) temporary tablespace 생성 방법 비교
    - tempfile형태의 경우
    tempfile로 temporary tablespace를 생성하는 경우는 다음과 같이
    생성하여야 하며, 반드시 locally managed 형태로만 생성 가능하다.
    SQL> create TEMPORARY tablespace temp_tempfile_local
    2 TEMPFILE '/ora/V920/temp_temp.dbf' size 100M
    3 EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;
    아래 명령어에서 3번 line을 제거하고 생성하여도 default로 locally
    managed로 생성이 되며, dictionary managed 형태로 생성하고자
    3번 line대신 storage option을 추가하면
    ORA-2180 (invalid option for CREATE TABLESPACE) 오류가 발생한다.
    - datafile형태의 경우
    다음과 같은 형태로 생성하게 되면, dictionary managed type의
    temporary datafile형태로 tablespace가 만들어진다. 단, 9i의 경우
    이미 앞에서 언급한대로 system tablespace가 locally managed인 경우에는
    이와 같은 dictionary managed tablespace 생성은 ORA-12913이 발생하면서
    불가능하게 된다.
    SQL> create tablespace temp_datafile_dict
    2 datafile '/ora/oradata/V920/temp_data.dbf' size 100M
    3 TEMPORARY;
    (3) dictionary view 의 차이
    먼저 dba_tablespaces를 통해
    SQL> select tablespace_name, contents, extent_management,
    allocation_type from dba_tablespaces;
    TABLESPACE_NAME CONTENTS EXTENT_MAN ALLOCATIO
    TEMP_TEMPFILE_LOCAL TEMPORARY LOCAL UNIFORM
    TEMP_DATAFILE_DICT TEMPORARY DICTIONARY
    - tempfile의 경우
    SQL> select STATUS, ENABLED, NAME from v$tempfile;
    STATUS ENABLED NAME
    ONLINE READ WRITE /ora/V920/temp_temp.dbf
    SQL> select FILE_NAME, TABLESPACE_NAME from dba_temp_files;
    FILE_NAME TABLESPACE_NAME
    /ora/V920/temp_temp.dbf TEMP_TEMPFILE_LOCAL
    - datafile 형태의 경우
    다음과 같이 v$datafile과 dba_data_files를 통해 조회한다.
    SQL> select STATUS, ENABLED, NAME from v$datafile;
    STATUS ENABLED NAME
    ONLINE READ WRITE /ora/oradata/V920/temp_data.dbf
    SQL> select FILE_NAME, TABLESPACE_NAME from dba_data_files;
    FILE_NAME TABLESPACE_NAME
    /ora/oradata/V920/temp_data.dbf TEMP_DATAFILE_DICT
    (4) tempfile의 삭제에 대해서
    datafile의 경우 tablespace를 삭제하지 않고 datafile만 삭제하는 방법은
    존재하지 않는다. 물론 alter database datafile 'filename' offline drop;
    과 같은 command가 있지만 이것도 datafile을 데이타베이스에서 지워주는
    것이 아니며 이렇게 offline drop된 datafile을 포함하는 tablespace는
    recovery가 불가능한 경우라면 tablespace자체를 삭제해야 한다.
    그런데 tempfile의 경우는 temporary tablespace는 그대로 유지한 채,
    tempfile만 삭제하는 것이 가능하다.
    SQL> alter database tempfile '/oradata/V817/temp_temp01.dbf'
    2 drop;
    8i의 경우라면 이와 같은 명령어 후 실제 directory로 이동하여 직접
    tmep_temp01.dbf를 삭제하여야 한다.
    9i에서는 drop뒤에 including datafiles 라는 option을 추가하여 tempfile의
    drop시 바로 os상에서도 삭제되도록 할 수 있다.
    SQL> alter database tempfile '/oradata/V817/temp_temp01.dbf'
    2 drop including contents;
    만약 이러한 방법으로, tempfile을 해당 temporary tablespace에서 모두
    삭제한 경우, 실제 해당 tablespace에 disk sort가 필요하게 되면,
    그때는 ORA-25153 (Temporary Tablespace is Empty) 오류가 발생하게 된다.
    이때는 다음과 같이 임의의 tempfile을 다시 추가할 수 있다.
    SQL> alter tablespace TEMP_TEMPFILE_LOCAL
    2 add tempfile '/oradata/V817/temp_temp02.dbf';
    Reference Documents
    <Note:160426.1> TEMPORARY Tablespaces : Tempfiles or Datafiles ?
    글 수정:
    민천사 (민연홍)
    글 수정:
    민천사 (민연홍)
    가장 중요한 v$session의 sql_hash_value 컬럼이 안들어가서
    수정하였습니다. 죄송합니다.

  • How to move a file to a different folder in webdynpro?

    Hi all
    i ve created a file in some folder using fileoutput stream(). now i want to delete this file from folder  and copy that file into some different folder.
    can anyone tell me.How to delete and move a file?

    try {
         File inputFile = new File("C:\test\fold1\abc.txt");
         File outputFile = new File("C:\test\fold2\def.txt");
         FileInputStream in = new FileInputStream(inputFile);
         FileOutputStream out = new FileOutputStream(outputFile);
         FileChannel inc = in.getChannel();
         FileChannel outc = out.getChannel();
         inc.transferTo(0, inc.size(), outc);
         inc.close();
         outc.close();
         in.close();
         out.close();
         boolean fileDeleteSuccess = inputFile.delete();
         if(!fileDeleteSuccess)
              System.out.println("File couldnot be deleted");
         else
              System.out.println("File deleted!!");
         } catch (FileNotFoundException e) {
         e.printStackTrace();
         } catch (IOException e) {
         e.printStackTrace();

  • Can't move any files... "The operation can't be completed because you don't have permission to access some of the items."

    This is a strange one... I just recently did a complete format/reinstall of Lion because of very poor performance after upgrading.
    So I'm on a totally fresh system, no TimeMachine restore or anything. I've installed all my apps from scratch - no prefrence file backups or anything. Everything is fresh.
    Yesterday I tried to copy a file from one folder to another and I got the error "The operation can’t be completed because you don’t have permission to access some of the items". Checked file permissions... repaired disk permissions... made sure I was logged in as admin (I only have one account)... everything looks good.
    This is now happening when trying to copy any files anywhere on my machine... Very frustrating.
    There's a couple strange side-effects I've noticed:
    - I can move & copy files just fine in terminal... without sudo...
    - The little lock icon in the bottom right of the Get Info window doesn't do anything - I can't unlock it. I can still edit the permissions for the file/folder but I can't select the "apply to enclosed items..." option.
    Does anybody know what the heck is going on?

    jsd2 wrote:
    Try creating a new admin user account, logging into it, and then creating some new items on the Desktop and elsewhere. Does the same thing happen there?
    Ok the strangeness continues!
    I created a new "TestAdmin" account, but it doesn't show up in the Users & Groups prefrences sidebar... The /Users/testadmin folder was created, but the account doesn't show up in the prefrences or login window...
    I tried a reboot to see if the account would show up and it still doesnt.... However after the reboot I am now able to copy files again!
    I'm paranoid that the problem will show up again since I have no idea what fixed it. I tried rebooting previously after repairing permissions which didn't solve the issue so it's not like I haven't rebooted since it started.
    And now I have the issue of not being able to create user accounts.
    A little dissapointed with Lion to be honest... the new features are cool but there are so many little bugs it really feels half-baked.

Maybe you are looking for

  • Address Book Sync

    Not a new subject but an unresolved one, I know that because I just spent the last 90 minutes reviewing 166 pages of discussions. Had to restore my IPhone yesterday, lost my contacts and now I cannot get my address book to sync to my phone contacts l

  • Desktop App reverts to older version after closing.

    I am running version 1.0.1.1060gc75ebdfd, and it tells me that there is a new version available (1.0.8.59)so I download and install version 1.0.8.59.  And that works just fine.  But as soon as I close the desktop app, and restart it, I'm back to vers

  • Down Arrow Key Problem

    Ok, so i was just messing around on my computer like always.  I held down the up arrow key to scroll up to a page, and when doing so the bottom arrow key came off.  This is where the fun begins .... I have tried numerous attempts to put the arrow key

  • Why is Firefox STILL allowing website drive by browser hijacking by LAME "Your broswer has been blocked" exploit-NO other malware-just clicked the wrong link.

    This silly ass "window-won't-close-just-keeps-relaunching" exploit is so ancient it has whiskers. Incredibly embarrassed that this happened to my friend, since I was the one that encouraged him to use Firefox in the first place. ... and NO he didn't

  • Flash CC jsfl document.selection causing property resetting

    If document.selection is accessed while a Flash CC user is attempting to adjust a property ( stage size, font size, almost any number based property ) via slider or manual entry, the number is reset to what it was prior to document.selection being ac