<code id="ymukc"><xmp id="ymukc">

oracle表空間操作

wewopargt的頭像 wewopargt 0 2016-03-09 15:33 3

 基本信息

× 1   

瀏覽數: 27981

分享時間: 2 年 前

8

1,查詢表空間剩余

-- 剩余量
select tablespace_name,sum(bytes) from dba_free_space group by tablespace_name;
-- 總量
select tablespace_name,sum(bytes) from DBA_DATA_FILES group by tablespace_name;

2,查詢數據庫原始文件

 select * from DBA_DATA_FILES;

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

方法1:給表空間增加數據文件
ALTER TABLESPACE app_data ADD DATAFILE 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP03.DBF' SIZE 50M;
 
方法2:新增數據文件,并且允許數據文件自動增長
ALTER TABLESPACE app_data ADD DATAFILE 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP04.DBF' SIZE 50M AUTOEXTEND ON NEXT 5M MAXSIZE 100M;
 
方法3:允許已存在的數據文件自動增長
ALTER DATABASE DATAFILE 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP03.DBF' AUTOEXTEND ON NEXT 5M MAXSIZE 100M;
 
方法4:手工改變已存在數據文件的大小
ALTER DATABASE DATAFILE 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP02.DBF' RESIZE 100M;

4,更改表及分區表的表空間

可以通過alter方法,將一個表移動到另外一個表空間中:
sql: alter table spaceOne.tablename move tablespace spaceTwo;
解釋:以上語句就是把tablename表從spaceOne移動到spaceTwo中。
備注一:
當前的用戶必須對spaceTwo、spaceOne都有操作權限才可以。
備注二:
其實如果對兩個表空間都有權限的話,可以通過
create spaceTwo.tablename as select * from spaceOne.tablename;
之后再刪除spaceOne中tablename表的間接方式也能實現。

-- 分區表
alter table slz_ysz move partition YSZ_200901  tablespace 你要定義的tablespacename;

5,其它

查詢數據服務地址信息:tnsping service_name


12 [下一頁]

  • ossaa的頭像 ossaa 2018-05-09 16:19 代碼數:0

    This is such a great resource that you are providing and you give it away for free. I love seeing websites that understand the value of providing a quality resource for free. It is the old what goes around comes around routine.

    currency converter

  • ossaa的頭像 ossaa 2018-05-10 18:29 代碼數:0

    This is such a great resource that you are providing and you give it away for free. I love seeing websites that understand the value of providing a quality resource for free. It is the old what goes around comes around routine.

    business ideas in india

  • ossaa的頭像 ossaa 2018-05-16 19:21 代碼數:0

    Your music is amazing. You have some very talented artists. I wish you the best of success.

    SEO

  • ossaa的頭像 ossaa 2018-05-16 21:07 代碼數:0

    Your music is amazing. You have some very talented artists. I wish you the best of success.

    Nebraska SEO services

  • ossaa的頭像 ossaa 2018-05-16 22:12 代碼數:0

    Your music is amazing. You have some very talented artists. I wish you the best of success.

    Montana ranches for sale

  • gererik的頭像 gererik 2018-04-19 18:17 代碼數:0

    I admire this article for the well-researched content and excellent wording.  I got so involved in this material that I couldn’t stop reading.  I am impressed with your work and skill.  Thank you so much.I admire this article for the well-researched content and excellent wording.  I got so involved in this material that I couldn’t stop reading.  I am impressed with your work and skill.  Thank you so much.  bookkeeping services in Ottawa

  • gererik的頭像 gererik 2018-04-19 19:35 代碼數:0

    Awesome article!  I want people to know just how good this information is in your article.  It’s interesting, compelling content.  Your views are much like my own concerning this subject.             a course in miracles

  • gererik的頭像 gererik 2018-04-21 14:02 代碼數:0

    I got what you mean  , thanks  for posting .Woh I am happy  to find this website through google.cat logo

  • gererik的頭像 gererik 2018-04-21 15:07 代碼數:0

    i am always looking for some free stuffs over the internet. there are also some companies which gives free samples.fridge repair near me

  • shanghe306的頭像 shanghe306 2016-10-09 10:27 代碼數:0

    不錯的總結。

您的評論:

  
六合特码资料
<code id="ymukc"><xmp id="ymukc">
<code id="ymukc"><xmp id="ymukc">