altersystemsetdb_create_file_dest='/oradata/data/standby'scope=both;Systemaltered.SQL>showparameterdb_createNAMETYPEVALUE-------------" />

欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

轉(zhuǎn):Oracle:刪除表空間

系統(tǒng) 2043 0

原文: http://space.itpub.net/40239/viewspace-365948

?

OMF和非OMF管理的數(shù)據(jù)文件在DROP TABLESPACE時(shí)是否會(huì)自動(dòng)刪除,做了測(cè)試:

SQL> alter system set db_create_file_dest='/oradata/data/standby' scope=both;

System altered.

?

SQL> show parameter db_create

NAME???????????????????????????????? TYPE??????? VALUE
------------------------------------ ----------- ------------------------------
db_create_file_dest????????????????? string????? /oradata/data/standby
db_create_online_log_dest_1????????? string
db_create_online_log_dest_2????????? string
db_create_online_log_dest_3????????? string
db_create_online_log_dest_4????????? string
db_create_online_log_dest_5????????? string


SQL> create tablespace t3 datafile size 10m;

Tablespace created.

SQL> select * from v$tablespace;

?????? TS# NAME?????????????????????????? INC
---------- ------------------------------ ---
???????? 0 SYSTEM???????????????????????? YES
???????? 1 UNDOTBS1?????????????????????? YES
???????? 2 TEMP?????????????????????????? YES
???????? 3 INDX?????????????????????????? YES
???????? 4 USR??????????????????????????? YES
???????? 5 KONG?????????????????????????? YES
???????? 6 TEST?????????????????????????? YES
???????? 9 T1???????????????????????????? YES
???????? 8 LOGMNRTS?????????????????????? YES
??????? 10 T2???????????????????????????? YES
??????? 11 T3???????????????????????????? YES

11 rows selected.

SQL> select name from v$datafile??where ts# = 11;

NAME
--------------------------------------------------------------------------------
/oradata/data/standby/o1_mf_t3_464smo7s_.dbf

?

SQL> create table t100 (id int) tablespace t3;

Table created.

SQL> drop tablespace t3;
drop tablespace t3
*
ERROR at line 1:
ORA-01549: tablespace not empty, use INCLUDING CONTENTS option


SQL> drop tablespace t3 including contents?;

Tablespace dropped.

SQL> !ls -l /oradata/data/standby/o1_mf_t3_464smo7s_.dbf
ls: 0653-341 The file /oradata/data/standby/o1_mf_t3_464smo7s_.dbf does not exist.

看到在DROP TABLESPACE時(shí),就算沒(méi)有加上 and datafiles是選項(xiàng), ORACLE 也會(huì)自動(dòng)刪除數(shù)據(jù)文件;

?

?

SQL> create tablespace t3 datafile '/oradata/data/standby/data/t3.dbf' size 10m;

Tablespace created.

SQL> create table t100 (a int) tablespace t3;

Table created.

SQL> drop tablespace t3 ;
drop tablespace t3
*
ERROR at line 1:
ORA-01549: tablespace not empty, use INCLUDING CONTENTS option


SQL> drop tablespace t3? including contents;

Tablespace dropped.

SQL> !ls -l /oradata/data/standby/data/t3.dbf
-rw-r-----?? 1 oracle?? dba??????? 10493952 Jun 25 23:42 /oradata/data/standby/data/t3.dbf

沒(méi)有加上and datafiles參數(shù)時(shí),oracle不會(huì)自動(dòng)刪除datafiles。

?

SQL> create tablespace t3 datafile '/oradata/data/standby/data/t4.dbf' size 10m;

Tablespace created.

SQL> create table t100 (a int) tablespace t3;

Table created.

SQL> drop tablespace t3? including contents and datafiles;

Tablespace dropped.

SQL> !ls -l /oradata/data/standby/data/t4.dbf
ls: 0653-341 The file /oradata/data/standby/data/t4.dbf does not exist.

加上and datafiles參數(shù)時(shí),oracle會(huì)自動(dòng)刪除datafiles。

?

?

SQL> alter system set db_create_file_dest='' scope=both;

System altered.

SQL> create tablespace t3 datafile '/oradata/data/standby/data/t4.dbf' size 10m;

Tablespace created.

SQL> create table t100 (a int) tablespace t3;

Table created.

SQL> drop tablespace t3? including contents and datafiles;

Tablespace dropped.

SQL> !ls -l /oradata/data/standby/data/t4.dbf
ls: 0653-341 The file /oradata/data/standby/data/t4.dbf does not exist.

SQL>

?

===============================================

SQL code:


--刪除空的表空間,但是不包含物理文件
drop tablespace tablespace_name;


--刪除非空表空間,但是不包含物理文件
drop tablespace tablespace_name including contents;


--刪除空表空間,包含物理文件
drop tablespace tablespace_name including datafiles;


--刪除非空表空間,包含物理文件
drop tablespace tablespace_name including contents and datafiles;


--如果其他表空間中的表有外鍵等約束關(guān)聯(lián)到了本表空間中的表的字段,就要加上CASCADE CONSTRAINTS
drop tablespace tablespace_name including contents and datafiles CASCADE CONSTRAINTS;

?

轉(zhuǎn):Oracle:刪除表空間


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對(duì)您有幫助就好】

您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長(zhǎng)會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 一本大道香蕉中文日本不卡高清二区 | 久久国内精品 | 可以免费看黄色 | 无码国产精品成人午夜视频 | 欧美成人精品一区二区三区 | 艹逼免费视频 | 久久AV亚洲精品一区无码 | av国产精品| 日本黄a | 欧美三级一区 | 国产精品国产a | 久久久一区二区 | 美国三级日本三级久久99 | 九九色网站 | 播五月婷婷 | 日韩福利视频 | 久久九九国产精品 | 奇米影视色 | 四虎影视国产884a精品亚洲 | 国产免费网址 | 国产 麻豆| 日本在线网站 | 午夜影院免费视频 | 日本人成年视频在线观看 | 亚洲精品在线看 | 青娱乐中文字幕 | 黑色丝袜美女自安慰视频 | 欧美两性人xxxx高清免费 | 一级一级毛片看看 | 亚洲精品一区中文字幕乱码 | 亚洲成人另类 | 欧美成人精品第一区首页 | 午夜社区 | www.av在线免费观看 | 成人av在线播放 | 男女爽爽无遮挡午夜动态图 | 日日摸夜夜添夜夜 | 久草福利资源网站免费 | 免费看一级视频 | 久久久婷 | 免费区一级欧美毛片 |