TAILIEUCHUNG - OCA: Oracle Database 11g Administrator Certified Associate- P7

Tham khảo tài liệu 'oca: oracle database 11g administrator certified associate- p7', công nghệ thông tin, cơ sở dữ liệu phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Subqueries 231 If the scalar subquery returns more than one row the query will fail. If the scalar subquery returns no rows the value is NULL. Finding Total Space and Free Space Using Dictionary Views The following dictionary views are best friends of a DBA. They show the most critical aspect of the database from the user perspective the space allocated and free. If the DBA is not monitoring the growth and free space available in the database it is likely that they might get calls from the user community that they ran out of space in the tablespace. Let s build a query using four dictionary views you may need the SELECT_CATALOG_ROLE privilege to query these views . DBA_TABLESPACES Shows the tablespace name type and so on. DBA_DATA_FILES Shows the data files associated with a permanent or undo tablespace and the size of the data file. The total size of all data files associated with a tablespace gives the total size of the tablespace. DBA_TEMP_FILES Shows the temporary files associated with a temporary tablespace and their size. DBA_FREE_SPACE Shows the unallocated space free space in each tablespace. The query to get the tablespace names and type of tablespace would be as follows column tablespace_name format a18 SELECT tablespace_name contents FROM dba_tablespaces TABLESPACE_NAME CONTENTS SYSTEM PERMANENT SYSAUX PERMANENT UNDOTBS1 UNDO TEMP TEMPORARY USERS PERMANENT EXAMPLE PERMANENT To find the total space allocated to each tablespace you need to query DBA_DATA_FILES and DBA_TEMP_FILES. Since you are using a group function SUM along with a nonaggregated column tablespace_name the GROUP BY clause is a must. Notice the use of an arithmetic operation on the aggregated result to display the bytes in megabytes. SELECT tablespace_name SUM bytes 1048576 MBytes FROM dba_data_files 232 Chapter 4 Using Joins and Subqueries GROUP BY tablespace_name TABLESPACE_NAME MBYTES N B SYSAUX USERS SYSTEM EXAMPLE 730 710 100 SELECT tablespace_name SUM bytes 1048576 .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.