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. בכל הזדמנות אפשרית.
Related Articles מאמרים קשורים
- How Drop Tablespace and Recover Oracle Database When Accidentally Delete Datafile איך זרוק Tablespace ולשחזר Oracle Database כאשר בטעות מחק Datafile
- Oracle ORA-01658 Unable to Create INITIAL Extent for Segment in Tablespace Error אורקל ORA-01658 ניתן ליצור INITIAL היקף עבור קטע ב Tablespace שגיאה
- How to Rename or Move Oracle Tablespace Datafile to Another Location כיצד לשנות שם או להעביר אורקל Tablespace Datafile אל מיקום אחר
- ORA-25153 Temporary Tablespace is Empty Error in Oracle ORA-25153 זמניים Tablespace היא שגיאה ריק אורקל
- Delete, Remove or Drop Oracle Stored Packages with Drop Package מחיקה, הסרה או זרוק אורקל חבילות מאוחסן עם חבילת זרוק
- Oracle Database Link קישור מסד נתונים אורקל
- Change Oracle Database User Password שינוי Oracle Database משתמש סיסמא
- ORA-02449 Oracle Drop Table Error ORA-02449-Oracle זרוק טבלה שגיאה
- Oracle Database Import Error 3113/3114 Oracle Database ייבוא שגיאה 3113/3114
- Oracle EXP-00091 Error When Export Database אורקל EXP-00091 שגיאה בעת ייצוא מסד נתונים










































August 4th, 2007 02:55 4 אוגוסט 2007 02:55
[...] Tip: How to check datafiles that belong to tablespace. [...] עצה: כיצד לבדוק datafiles השייכים tablespace. [...] [...]