日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

查看表空间大小和使用率,增加表空间大小的四种方法

發布時間:2023/12/9 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 查看表空间大小和使用率,增加表空间大小的四种方法 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

**

查看表空間大小和使用率**

  • 查看當前用戶使用的表空間情況,使用命令select * from user_users即可,其中username標識用戶名,default_tablespace表示默認的表空間。
  • 如果我們想查看表空間的使用情況,比如表空間利用率等指標,首先我們查詢的用戶必須有dba權限,使用如下的命令查詢即可
    select a.tablespace_name as tablespace_name,total,free,total-free as used,(total-free) as usepercent
    from (select tablespace_name,sum(bytes)/1024/1024 total from dba_data_files group by tablespace_name) a,
    (select tablespace_name,sum(bytes)/1024/1024 free from dba_data_files group by tablespace_name) b where
    a.tablespace_name = b.tablespace_name;
  • 查看oracle下面所有的表空間,使用命令select * from Dba_Tablespaces即可,呈現的信息包括表空間名稱以及表空間的大小等。
  • 查看表空間物理文件的名稱、位置及大小信息,表空間文件通常以dbf的后綴方式存儲。
    select tablespace_name,file_id,file_name,round(bytes/(1024*1024),0) total_space from dba_data_files order by tablespace_name;
    5.有些查詢表空間的語句需要執行用戶需要高的權限,如何查看當前用戶的角色呢?使用命令select * from user_role_privs即可。
  • **

    增加表空間大小的四種方法

    **
    Meathod1:給表空間增加數據文件
    ALTER TABLESPACE app_data ADD DATAFILE
    ‘D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP03.DBF’ SIZE 50M;

    Meathod2:新增數據文件,并且允許數據文件自動增長
    ALTER TABLESPACE app_data ADD DATAFILE
    ‘D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP04.DBF’ SIZE 50M
    AUTOEXTEND ON NEXT 5M MAXSIZE 100M;

    Meathod3:允許已存在的數據文件自動增長
    ALTER DATABASE DATAFILE ‘D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP03.DBF’
    AUTOEXTEND ON NEXT 5M MAXSIZE 100M;

    Meathod4:手工改變已存在數據文件的大小
    ALTER DATABASE DATAFILE ‘D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP02.DBF’
    RESIZE 100M;

    英文版
    **

    View table space size and usage

    **

  • View the table space used by the current user, and use the command select * from user_ Users, where user name identifies the user name and default_ A tablespace represents the default tablespace.
  • If we want to view the usage of table space, such as the utilization of table space and other indicators, first of all, the user we query must have DBA permission. Use the following command to query
    select a.tablespace_ name as tablespace_ name,total,free,total-free as used,(total-free) as usepercent
    from (select tablespace_ name,sum(bytes)/1024/1024 total from dba_ data_ files group by tablespace_ name) a,
    (select tablespace_ name,sum(bytes)/1024/1024 free from dba_ data_ files group by tablespace_ name) b where
    a.tablespace_ name = b.tablespace_ name;
  • View all the table spaces under Oracle and use the command select * from DBA_ The information presented includes the name of the table space and the size of the table space.
  • View the name, location and size information of the physical file in the table space. The table space file is usually stored in the form of DBF suffix.
    select tablespace_ name,file_ id,file_ name,round(bytes/(1024*1024),0) total_ space from dba_ data_ files order by tablespace_ name;
  • Some query table space statements need to be executed, and the user needs high permissions. How to view the role of the current user? Use the command select * from user_ role_ PRIVS.
  • **

    Four ways to increase the size of table space

    **
    Meathod1: add data file to table space
    ALTER TABLESPACE app_ data ADD DATAFILE
    ‘D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP03.DBF’ SIZE 50M;

    Meathod2: add new data files and allow them to grow automatically
    ALTER TABLESPACE app_ data ADD DATAFILE
    ‘D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP04.DBF’ SIZE 50M
    AUTOEXTEND ON NEXT 5M MAXSIZE 100M;

    Meathod3: allow existing data files to grow automatically
    ALTER DATABASE DATAFILE ‘D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP03.DBF’
    AUTOEXTEND ON NEXT 5M MAXSIZE 100M;

    Meathod4: manually changing the size of existing data files
    ALTER DATABASE DATAFILE ‘D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP02.DBF’
    RESIZE 100M;

    總結

    以上是生活随笔為你收集整理的查看表空间大小和使用率,增加表空间大小的四种方法的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。