How to Remove and Drop Datafiles from Tablespace in Oracle Database כיצד להסיר ושחרר Datafiles מ Tablespace ב Oracle Database

Oracle RDBMS databases stores data logically in the form of tablespaces and physically in the form of data files. חנויות מסדי נתונים של Oracle RDBMS לוגית בצורה של Tablespaces פיזית בצורה של קבצי הנתונים. The datafiles are added to the tablespaces as database space requirement grows bigger. Datafiles מתווספים ל Tablespaces כחלל דרישת נתונים גדל יותר. However, there are several reasons you may want to remove or delete data files from a tablespace. עם זאת, ישנן כמה סיבות ייתכן שתרצה להסיר או למחוק קבצי נתונים tablespace. Such as accidentally add a wrongly sized or unwanted datafile to a tablespace, or the data space usage has became smaller and some data files want to be removed, or attempt to recover Oracle database which fails to start due to missing or corrupted datafiles by removing them, Oracle does not provide an easy way or user interface to delete or drop datafiles from a tablespace. כמו בטעות להוסיף בטעות או datafile בגודל tablespace לא רצויים, או את נתוני השימוש שטח הפכו קטנים יותר יש כמה קבצי הנתונים רוצה להסיר, או לנסות לשחזר מסד נתונים אורקל אשר נכשל להתחיל עקב חסר או פגום datafiles ידי הסרתם , אורקל אינו מספק דרך קלה או ממשק המשתמש למחוק או ירידה datafiles מ tablespace. Once a datafile is made part of a tablespace, it can no longer be detached or removed from the tablespace, albeit there are several workarounds. פעם הוא עשה datafile חלק tablespace, היא כבר לא יכולה להיות מנותקת או להסיר tablespace, גם אם יש מספר דרכים לעקיפת הבעיה.

How to Completely Drop the Whole Tablespace with All Datafiles כיצד לגמרי השלך את Tablespace שלם עם כל Datafiles

The easiest way to drop a or multiple datafiles is by dropping the entire tablespace together with its datafiles. הדרך הקלה ביותר או ירידה datafiles מרובים היא על ידי הטלת tablespace כולו יחד עם datafiles שלה. If you no longer need the data contents of the tablespace, the following command will drop the tablespace, the datafile, and the tablespace's contents from the data dictionary. אם אתה כבר לא צריך את התוכן של נתונים tablespace, את הפקודה הבאה תהיה הירידה tablespace, את datafile, ואת תוכן tablespace מן הנתונים של המילון. All of the objects that where contained in that tablespace are permanently removed. כל האובייקטים שבו הכלולים tablespace כי מוסרים לצמיתות.

DROP TABLESPACE <tablespace name> INCLUDING CONTENTS AND DATAFILES; <tablespace TABLESPACE DROP name> לרבות תכנים DATAFILES;

If you don't specify “AND DATAFILES”, Oracle will not drop the physical datafile after the DROP TABLESPACE command, but you can always delete the files from operating system shell (If the data files are locked, restart the server). אם לא תציין "ו DATAFILES", אורקל לא הטיפה datafile גופנית לאחר הפקודה DROP TABLESPACE, אבל אתה תמיד יכול למחוק את הקבצים מן מעטפת של מערכת ההפעלה (אם קבצים ונתונים נעולים, להפעיל מחדש את השרת).

But always perform a backup of the database, as the “DROP TABLESPACE” command is irreversible. אבל תמיד לבצע גיבוי של מסד הנתונים, שכן "DROP TABLESPACE" הפקודה הוא בלתי הפיך. It's also a good practice to check and identify how many datafiles a tablespace actually has before performing the drop action in order to avoid mistake. זה גם תרגול טוב כדי לבדוק ולזהות datafiles כמה tablespace בעצם יש לפני ביצוע פעולה טיפה כדי למנוע טעות.

How to Check How Many Datafiles a Tablespace Has כיצד לבדוק כיצד Datafiles רבים Tablespace האם

To determine and identify all datafiles that link to a tablespace, use the following query, with tablespace name in capital letter: כדי לקבוע ולזהות כל datafiles המקשרות tablespace, להשתמש בשאילתה הבאה, עם שם tablespace במכתב ההון:

SELECT file_name, tablespace_name File_name בחר tablespace_name
FROM dba_data_files Dba_data_files FROM
WHERE tablespace_name ='<tablespace name>'; WHERE tablespace_name = '<tablespace name>';

If a tablespace contains multiple datafiles, and you just want to drop one or some of the datafiles and keep the remaining datafiles together with the objects and contents, the objects or data must be exported for the affected table space. אם tablespace מכיל datafiles מרובים, ואתה רק רוצה טיפה אחת או כמה datafiles ולשמור datafiles הנותרים יחד עם אובייקטים ואת תוכנו, את האובייקטים או נתונים חייב להיות מיוצא במרחב המושפע בטבלה. Once exported, the tablespace can be dropped with above “DROP TABLESPACE” command. לאחר ייצוא, את tablespace ניתן ירד עם מעל הפקודה "DROP TABLESPACE". Then, recreate the tablespace with the datafile(s) required (that you initially want to keep), and then import the objects into the recreated tablespace. ואז, לשחזר את tablespace עם datafile (s) נדרש (בתחילה שאתה רוצה לשמור), ולאחר מכן לייבא את החפצים לתוך tablespace מחדש.

If one or more datafiles is missing after a recovery process or accidental deletion, you can use ALTER DATABASE DATAFILE <datafile name> OFFLINE DROP command to make the datafile offline so that database can starts up after which the troubled tablespace can be dropped. אם אחד או יותר datafiles חסר לאחר תהליך החלמה או מחיקה בשוגג, אתה יכול להשתמש <datafile ALTER DATABASE DATAFILE name> OFFLINE הפקודה DROP להפוך את מחובר datafile כך באתר יכולים מתחיל לעלות אחרי בה tablespace מוטרד ניתן ירד. (See (ראה instruction to recover from missing datafiles הוראה להתאושש חסר datafiles .) .)

How to Resize a Datafile to Minimum Size כיצד לשנות גודל של גודל Datafile כדי מינימום

Another alternative to drop the datafile is by shrinking the size of datafile instead of dropping. חלופה נוספת עד טיפת datafile היא על ידי כיווץ גודל datafile במקום להפיל. This option is only possible if there is no extents in the datafile. אופציה זו אפשרית רק אם אין extents ב datafile. If there are none, it's possible to resize the data file down to a very small file (2 blocks), where Oracle database will no longer create any extent in the datafile. אם אין כאלה, אפשר לשנות את גודל קובץ הנתונים אל קובץ קטן מאוד (2 קוביות), שם מסד נתונים אורקל לא תיצור עוד ב datafile במידה כלשהי. However, this workaround does not remove the datafile from tablespace nor delete the file physically, but it reduce the risk as no data will be truncated as only empty blocks are reduced. עם זאת, פתרון זה אינו מסיר את datafile מ tablespace ולא למחוק את הקובץ פיזית, אבל זה להפחית את הסיכון כפי נתונים לא יהיה מקוצץ כמו חוסם רק ריק מופחתים. It simply makes it unusable and takes up almost close to no disk space. זה פשוט הופך אותו שמיש ולא תופס כמעט מקום קרוב לא דיסק. To resize a datafile, use the following query: כדי לשנות גודל של datafile, להשתמש בשאילתה הבאה:

alter database datafile '<datafile name>' resize 8M; <datafile לשנות datafile באתר 'name> "8M גודל;

How to Determine the Extents inside Datafile כיצד לקבוע Extents בתוך Datafile

To check and determine the extents that exists in a datafile, use this query: כדי לבדוק ולקבוע את extents הקיים datafile, להשתמש בשאילתה:

SELECT owner, segment_name הבעלים בחר segment_name
FROM dba_extents a, dba_data_files b FROM dba_extents, dba_data_files B
WHERE a.file_id = b.file_id WHERE a.file_id = b.file_id
AND b.file_name = '<datafile name>' ו b.file_name = '<datafile name>'

IMPORTANT : The page is machine translated and provided "as is" without warranty. חשוב: הדף מכונת תירגם מתפרסם "כמות שהוא" ללא אחריות. Machine translation may be difficult to understand. תרגום מכונה יכול להיות קשה להבין. Please refer to נא עיין original English article המאמר המקורי באנגלית whenever possible. בכל הזדמנות אפשרית.


One Response to “How to Remove and Drop Datafiles from Tablespace in Oracle Database” תגובה אחת ל "כיצד להסיר ושחרר Datafiles מ Tablespace של אורקל"

  1. How Drop Tablespace and Recover Oracle Database When Accidentally Delete Datafile » My Digital Life איך זרוק Tablespace ולשחזר Oracle Database כאשר בטעות מחק Datafile »Digital My Life
    August 4th, 2007 02:55 4 אוגוסט 2007 02:55
    1 1

    [...] Tip: How to check datafiles that belong to tablespace. [...] עצה: כיצד לבדוק datafiles השייכים tablespace. [...] [...]

Leave a Reply השאירו תגובה

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> באפשרותך להשתמש בתגים אלה: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. כדי להירשם הערות תכונה הושבת. To receive notification of latest comments posted, subscribe to כדי לקבל הודעה העדכנית של תגובות, כדי להירשם My Digital Life Comments RSS feed החיים שלי דיגיטליות תגובות RSS Feed or או register to receive הרשמה לקבלת new comments in daily email digest. תגובות חדש ב דוא"ל תקציר יומי.
Custom Search

New Articles מאמרים חדשים

Incoming Search Terms for the Article תנאי נכנסות חיפוש עבור מאמרים

oracle drop datafile datafile ירידה Oracle - -- drop datafile oracle ירידה Oracle datafile - -- drop tablespace oracle ירידה Oracle tablespace - -- oracle drop tablespace including datafiles tablespace ירידה Oracle כולל datafiles - -- delete tablespace למחוק tablespace - -- drop datafile ירידה datafile - -- oracle drop tablespace tablespace ירידה Oracle - -- oracle remove datafile Oracle להסיר datafile - -- oracle alter tablespace drop datafile Oracle לשנות datafile ירידה tablespace - -- delete tablespace oracle למחוק Oracle tablespace - -- drop datafiles in oracle datafiles ירידה Oracle - -- drop tablespace including datafiles ירידה tablespace כולל datafiles - -- how to delete tablespace כיצד למחוק tablespace - -- select datafile tablespace "oracle" tablespace datafile בחר "אורקל" - -- alter database tablespace resize with data tablespace לשנות את גודל מסד הנתונים עם נתוני - -- drop tablespace datafiles datafiles tablespace טיפה - -- удаление tablespace в Oracle tablespace удаление в אורקל - -- ALTER TABLESPACE DROP DATAFILE TABLESPACE ALTER DROP DATAFILE - -- alter tablespace drop datafile datafile לשנות טיפה tablespace - -- can I empty a oracle datafile אני יכול לרוקן datafile Oracle - -- check datafile for a tablespace datafile לבדוק tablespace - -- datafile dropped datafile שמט - -- delete tablespace users למחוק משתמשים tablespace - -- delete tablespace in oracle למחוק tablespace ב Oracle - -- delete data file in oracle למחוק קובץ הנתונים ב-Oracle - -- delete a datafile from tablespace למחוק datafile מ tablespace - -- delete user, datafile & tablespace in oracle למחוק את המשתמש, datafile & tablespace ב Oracle - -- delete datafile oracle למחוק Oracle datafile - -- delete oracle datafile למחוק datafile Oracle - -- drop one data file נתונים טיפה אחת קובץ - -- dropping of tablespace ts$ השמטת TS tablespace $ - -- drop datafile in oracle 10g ירידה datafile ב Oracle 10g - -- drop data file נתונים טיפה הקובץ - -- drop tablespace +datafile ירידה tablespace + datafile - -- drop tablespace does it remove the datafile ירידה tablespace זה להסיר את datafile - -- drop file tablespace oracle ירידה קובץ Oracle tablespace - -- drop datafiles from table sapce datafiles ירידה מ sapce השולחן - -- drop tablespace with file ירידה tablespace עם הקובץ - -- drop datafile in oracle ירידה datafile ב Oracle - -- drop datafile include contents ירידה datafile לכלול תוכן - -- drop tablespace without datafile ירידה tablespace ללא datafile - -- droping tablespace on oracle droping tablespace על Oracle - -- drop tablespace in oracle ירידה tablespace ב Oracle - -- drop tablespace did not delete file tablespace טיפה לא למחוק את הקובץ - -- drop datafile + oracle ירידה datafile + Oracle - -- drop datafile from tablespace ירידה datafile מ tablespace - -- drop tablespace in oracle 10g ירידה tablespace ב Oracle 10g - -- drop tablespace destroy tablespace ירידה להרוס - -- DROP TABLESPACE DATAFILE DROP TABLESPACE DATAFILE - -- how to drop tablespace in oracle 10g איך ירידה tablespace ב Oracle 10g - --