免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
Oracle 快速創(chuàng)建 N 個表空間數(shù)據(jù)文件

Oracle 數(shù)據(jù)庫是由無數(shù)個表空間組成,表空間是由無數(shù)個數(shù)據(jù)文件組成,數(shù)據(jù)文件存放在磁盤中。

隨著時間和業(yè)務量的增長,數(shù)據(jù)文件會不斷的增長,默認的數(shù)據(jù)文件一個為 32G,因此,需要不斷的新增數(shù)據(jù)文件!

那么,問題來了!需要新增很多數(shù)據(jù)文件怎么辦?

以下示例以 LUCIFER 表空間進行演示!默認開啟 OMF!

?? 如何開啟 OMF 請參考:Oracle OMF參數(shù)

1、新增一個數(shù)據(jù)文件,小意思,一行命令搞定!

alter tablespace LUCIFER add datafile size 30G autoextend off;

2、新增 10 個數(shù)據(jù)文件,麻煩點,復制 10 行也能搞定!

alter tablespace LUCIFER add datafile size 30G autoextend off;
alter tablespace LUCIFER add datafile size 30G autoextend off;
alter tablespace LUCIFER add datafile size 30G autoextend off;
alter tablespace LUCIFER add datafile size 30G autoextend off;
alter tablespace LUCIFER add datafile size 30G autoextend off;
alter tablespace LUCIFER add datafile size 30G autoextend off;
alter tablespace LUCIFER add datafile size 30G autoextend off;
alter tablespace LUCIFER add datafile size 30G autoextend off;
alter tablespace LUCIFER add datafile size 30G autoextend off;
alter tablespace LUCIFER add datafile size 30G autoextend off;

3、新增 100 個數(shù)據(jù)文件,頭疼,復制 100 行?那 1000 個呢?10000個呢?

當然,只是打個比方,無需較真,只是為了說明一個理念!

像這種需要一次性增加多個表空間數(shù)據(jù)文件的,可以直接通過循環(huán)語句,短短幾行代碼就可以搞定:

begin
  for i in 1 .. 100 loop
    execute immediate 'alter tablespace LUCIFER add datafile size 30G autoextend off';
  end loop;
end;
/

通過以上短短的代碼,就可以實現(xiàn)創(chuàng)建 100 個數(shù)據(jù)文件,如果需要 10000 個,就把 100 改成 10000 就行了!

如果你說你不使用 OMF 參數(shù),當然可以,稍微改一下就行:

begin
  for i in 1 .. 100 loop
    execute immediate 'alter tablespace LUCIFER add datafile ''/oradata/orcl/lucifer'||i||'.dbf'' size 30G autoextend off';
  end loop;
end;
/

只需要將數(shù)據(jù)文件路徑 /oradata/orcl/ 和 數(shù)據(jù)文件名稱 lucifer 拼接以下,然后傳入 i 作為編號即可!

?? 記住,本文講的是一個技巧,也是一個理念,不要鉆牛角尖!


本次分享到此結(jié)束啦~

如果覺得文章對你有幫助,點贊、收藏、關(guān)注、評論,一鍵四連支持,你的支持就是我創(chuàng)作最大的動力。

本站僅提供存儲服務,所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
Oracle中Datafiles的管理
oracle數(shù)據(jù)庫表空間擴容方法
oracle表空間 添加數(shù)據(jù)文件 日志文件
oracle大表空間預分配問題
ORACLE數(shù)據(jù)庫創(chuàng)建表空間ORA
最新分享
更多類似文章 >>
生活服務
分享 收藏 導長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服