How to Remove and Drop Datafiles from Tablespace in Oracle Database Làm thế nào để Hủy bỏ và Thả Datafiles từ Tablespace trong cơ sở dữ liệu Oracle

Oracle RDBMS databases stores data logically in the form of tablespaces and physically in the form of data files. Oracle RDBMS lý cơ sở dữ liệu lưu trữ dữ liệu ở dạng tablespaces và thể chất trong các hình thức tập tin dữ liệu. The datafiles are added to the tablespaces as database space requirement grows bigger. Các datafiles được thêm vào cơ sở dữ liệu không gian tablespaces như yêu cầu phát triển lớn hơn. However, there are several reasons you may want to remove or delete data files from a tablespace. Tuy nhiên, có một số lý do bạn có thể muốn loại bỏ, hoặc xóa các tập tin dữ liệu từ một 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. Chẳng hạn như vô tình thêm một sai kích cỡ hoặc không mong muốn datafile vào một tablespace, hoặc dữ liệu không gian sử dụng đã trở nên nhỏ hơn và một số tập tin dữ liệu muốn được gỡ bỏ, hoặc cố gắng khôi phục lại cơ sở dữ liệu Oracle mà không phải là thành công để bắt đầu do thiếu hoặc datafiles hỏng bằng cách bỏ chúng , Oracle không cung cấp một cách dễ dàng hoặc giao diện người dùng để xoá hoặc thả datafiles từ một 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. Sau khi một datafile được làm một phần của một tablespace, nó có thể không còn được vô tư hoặc gỡ bỏ ra tablespace, albeit có một số workarounds.

How to Completely Drop the Whole Tablespace with All Datafiles Hoàn toàn Làm thế nào để thả các Whole Tablespace với Tất cả các Datafiles

The easiest way to drop a or multiple datafiles is by dropping the entire tablespace together with its datafiles. Cách dễ nhất để thả một hoặc nhiều datafiles là giảm toàn bộ tablespace cùng với các 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. Nếu bạn không còn cần những dữ liệu nội dung của các tablespace, các lệnh sau đây sẽ thả các tablespace, các datafile và tablespace của nội dung từ các dữ liệu từ điển. All of the objects that where contained in that tablespace are permanently removed. Tất cả các đối tượng rằng, nơi mà chứa trong tablespace được xoá vĩnh viễn.

DROP TABLESPACE <tablespace name> INCLUDING CONTENTS AND DATAFILES; Thả TABLESPACE <tablespace name> BAO GỒM NỘI DUNG VÀ 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). Nếu bạn không xác định "và DATAFILES", Oracle sẽ không thả các vật lý datafile sau khi thả TABLESPACE lệnh, nhưng bạn luôn có thể xóa các tập tin từ hệ điều hành trình bao (Nếu các tập tin dữ liệu có khóa, khởi động lại máy phục vụ).

But always perform a backup of the database, as the “DROP TABLESPACE” command is irreversible. Tuy nhiên, luôn luôn thực hiện việc sao lưu dự phòng của các cơ sở dữ liệu, như là "thả TABLESPACE" lệnh là KHÔNG THỂ THAY ĐỔI. 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. Nó còn là một thực tế để kiểm tra và xác định có bao nhiêu datafiles một tablespace trên thực tế đã có trước khi thực hiện hành động thả để tránh nhầm lẫn.

How to Check How Many Datafiles a Tablespace Has Làm thế nào để Kiểm tra như thế nào Nhiều Datafiles Có một Tablespace

To determine and identify all datafiles that link to a tablespace, use the following query, with tablespace name in capital letter: Để xác định và xác định rằng tất cả các datafiles liên kết đến một tablespace, sử dụng truy vấn sau đây, với vốn đầu tư trong tablespace tên chữ:

SELECT file_name, tablespace_name CHỌN FILE_NAME, tablespace_name
FROM dba_data_files TỪ dba_data_files
WHERE tablespace_name ='<tablespace name>'; Tìm 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. Nếu một tablespace có chứa nhiều datafiles, và bạn chỉ muốn thả một hoặc một số các datafiles và giữ datafiles còn lại cùng với các đối tượng và nội dung, đối tượng hoặc dữ liệu phải được xuất khẩu cho các bảng không gian bị ảnh hưởng. Once exported, the tablespace can be dropped with above “DROP TABLESPACE” command. Sau khi xuất khẩu, các tablespace có thể được bỏ với ở trên "thả TABLESPACE" lệnh. Then, recreate the tablespace with the datafile(s) required (that you initially want to keep), and then import the objects into the recreated tablespace. Sau đó, các tablespace lí với các datafile (s) yêu cầu (ban đầu mà bạn muốn giữ lại), và sau đó nhập khẩu các đối tượng vào recreated 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. Nếu một hoặc nhiều datafiles là mất tích sau khi một quá trình khôi phục hoặc xóa tình cờ, bạn có thể sử dụng thay đổi cơ sở dữ liệu DATAFILE <datafile name> Offline thả lệnh để làm cho datafile ngoại tuyến để các cơ sở dữ liệu có thể bắt đầu sau khi lên mà không tablespace có thể được bỏ. (See (Xem instruction to recover from missing datafiles hướng dẫn việc phục hồi từ thiếu datafiles .) .)

How to Resize a Datafile to Minimum Size Làm thế nào để Resize một Datafile Kích thước tối thiểu để

Another alternative to drop the datafile is by shrinking the size of datafile instead of dropping. Khác để thay thế cho thả các datafile của shrinking là kích thước của datafile thay vì rơi. This option is only possible if there is no extents in the datafile. Tùy chọn này chỉ có thể được nếu không có sự extents trong 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. Nếu có không có gì, có thể để thay đổi kích cỡ của tập tin dữ liệu xuống một tập tin rất nhỏ (2 khối), nơi Oracle cơ sở dữ liệu sẽ không còn tạo ra bất kỳ mức độ trong 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. Tuy nhiên, điều này workaround không xóa các datafile từ tablespace cũng không xóa các tập tin thể chất, nhưng nó làm giảm các nguy cơ như không có dữ liệu sẽ được rút ngắn như là khối trống rỗng, chỉ là giảm. It simply makes it unusable and takes up almost close to no disk space. Nó đơn giản chỉ làm cho nó unusable và sẽ lên gần gần như không có không gian đĩa. To resize a datafile, use the following query: Để thay đổi kích cỡ của một datafile, sử dụng truy vấn sau đây:

alter database datafile '<datafile name>' resize 8M; thay đổi cơ sở dữ liệu datafile '<datafile name>' thay đổi kích cỡ 8m;

How to Determine the Extents inside Datafile Làm thế nào để Xác định các Extents bên trong Datafile

To check and determine the extents that exists in a datafile, use this query: Để kiểm tra và xác định rằng extents có thể có được ở datafile, hãy sử dụng các truy vấn này:

SELECT owner, segment_name CHỌN chủ sở hữu, segment_name
FROM dba_extents a, dba_data_files b TỪ dba_extents a, b dba_data_files
WHERE a.file_id = b.file_id Tìm a.file_id = b.file_id
AND b.file_name = '<datafile name>' VÀ b.file_name = '<datafile name>'

IMPORTANT : The page is machine translated and provided "as is" without warranty. Lưu ý: Các trang web là máy tính dịch và cung cấp "như là" mà không có bảo hành. Machine translation may be difficult to understand. Máy dịch thuật có thể là khó hiểu. Please refer to Xin vui lòng tham khảo original English article Tiếng Anh bản gốc bài viết whenever possible. bất cứ khi nào có thể.


One Response to “How to Remove and Drop Datafiles from Tablespace in Oracle Database” Một trong những đáp ứng với "Làm thế nào để Hủy bỏ và Thả Datafiles từ Tablespace trong cơ sở dữ liệu Oracle"

  1. How Drop Tablespace and Recover Oracle Database When Accidentally Delete Datafile » My Digital Life Làm thế nào Thả Tablespace và Cơ sở dữ liệu Oracle Recover Khi vô tình Xóa Datafile »My Digital Life
    August 4th, 2007 02:55 4 tháng tám, 2007 02:55
    1 1

    [...] Tip: How to check datafiles that belong to tablespace. [...] Mẹo: Làm thế nào để kiểm tra rằng datafiles thuộc tablespace. [...] [...]

Leave a Reply Để lại một trả lời

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> Bạn có thể sử dụng các thẻ:<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. Đăng ký nhận xét tính năng đã bị vô hiệu hoá. To receive notification of latest comments posted, subscribe to Để nhận được thông báo về ý kiến mới nhất được đăng, đăng ký với My Digital Life Comments RSS feed Cuộc sống kỹ thuật số Bình luận của tôi nguồn cấp dữ liệu RSS or hoặc register to receive đăng ký để nhận được new comments in daily email digest. Các ý kiến mới trong thư điện tử tiêu hàng ngày.
Custom Search

New Articles Bài viết mới

Incoming Search Terms for the Article Tìm kiếm các điều khoản cho các Điều

oracle drop datafile oracle thả datafile - -- oracle drop tablespace oracle thả tablespace - -- drop datafile oracle thả datafile oracle - -- drop datafile thả datafile - -- drop tablespace oracle thả tablespace oracle - -- delete tablespace xóa tablespace - -- oracle remove datafile oracle xóa datafile - -- drop tablespace datafile thả tablespace datafile - -- oracle delete tablespace oracle xóa tablespace - -- oracle drop tablespace datafile oracle tablespace thả datafile - -- drop oracle datafile thả oracle datafile - -- oracle delete datafile oracle xóa datafile - -- remove datafile xoá datafile - -- oracle drop tablespace including datafiles oracle tablespace thả bao gồm các datafiles - -- remove tablespace xóa tablespace - -- drop tablespace command thả tablespace lệnh - -- oracle remove datafile from tablespace oracle xóa datafile từ tablespace - -- delete tablespace oracle xóa tablespace oracle - -- remove datafile oracle xoá datafile oracle - -- drop datafiles thả datafiles - -- oracle drop datafiles oracle thả datafiles - -- delete datafile xóa datafile - -- alter tablespace remove datafile thay đổi tablespace xóa datafile - -- drop tablespace in oracle thả tablespace trong oracle - -- delete datafile in oracle xóa datafile trong oracle - -- delete datafile oracle xóa datafile oracle - -- drop datafile in oracle thả datafile trong oracle - -- drop datafile from tablespace thả datafile từ tablespace - -- remove datafile from tablespace xoá datafile từ tablespace - -- drop tablespace and datafiles thả tablespace và datafiles - -- HOW TO DELETE DATAFILE IN ORACLE LÀM THẾ NÀO ĐỂ XOÁ DATAFILE TRONG ORACLE - -- how to drop datafile in oracle làm thế nào để thả datafile trong oracle - -- oracle drop tablespace and datafile oracle thả tablespace và datafile - -- delete oracle datafile xóa oracle datafile - -- drop tablespace and datafile thả tablespace và datafile - -- oracle remove datafiles oracle xóa datafiles - -- drop datafile + oracle thả datafile + oracle - -- drop tablespace including datafile thả tablespace bao gồm datafile - -- drop tablespace including contents and datafiles thả tablespace bao gồm các nội dung và các datafiles - -- how to delete tablespace làm thế nào để xóa tablespace - -- oracle drop datafile from tablespace oracle thả datafile từ tablespace - -- delete oracle tablespace xóa oracle tablespace - -- oracle resize tablespace thay đổi kích cỡ oracle tablespace - -- drop datafiles oracle thả datafiles oracle - -- delete tablespace in oracle xóa tablespace trong oracle - -- Oracle drop tablespace datafiles Oracle thả tablespace datafiles - -- drop tablespace including datafiles thả tablespace bao gồm cả datafiles - -- Oracle dropping datafile Oracle rơi datafile - -- remove oracle datafile xóa oracle datafile - -- drop datafile tablespace thả datafile tablespace - -- oracle drop tablespace with datafile oracle tablespace thả với datafile - -- how to remove tablespace làm thế nào để loại bỏ tablespace - -- drop file oracle thả tập tin oracle - -- how to drop datafile làm thế nào để thả datafile - -- delete a tablespace xóa một tablespace - -- DROP TABLESPACE WITH DATAFILE Thả TABLESPACE VỚI DATAFILE - -- remove datafile from tablespace oracle xoá datafile từ tablespace oracle - -- drop tablespace file thả tập tin tablespace - -- drop datafile thả datafile - -- drop oracle tablespace thả oracle tablespace - -- how to remove a datafile làm thế nào để loại bỏ một datafile - -- alter tablespace drop datafile thay đổi tablespace thả datafile - -- how to drop oracle datafile làm thế nào để thả oracle datafile - -- how to delete datafile from tablespace làm thế nào để xóa datafile từ tablespace - -- oracle tablespace drop file oracle tablespace thả tập tin - -- how to drop datafiles in oracle làm thế nào để thả datafiles trong oracle - -- drop tablespace command in oracle thả tablespace lệnh trong oracle - -- HOW TO DELETE DATAFILE LÀM THẾ NÀO ĐỂ XOÁ DATAFILE - -- remove datafile tablespace xoá datafile tablespace - -- ORACLE DATAFILE DELETE ORACLE DATAFILE XOÁ - -- oracle drop datafile oracle thả datafile - -- oracle drop data file oracle thả các tệp dữ liệu - -- Dropping datafile from tablespace Rơi datafile từ tablespace - -- deleting oracle datafile xóa oracle datafile - -- delete tablespace name xoá tên tablespace - --