DELETE, DROP, TRUNCATE의 비교

제품 : ORACLE SERVER
작성날짜 : 1998-06-23
DELETE, DROP, TRUNCATE의 비교
=============================
TABLE에서 행을 삭제하는 세 가지 OPTION의 비교
TABLE에서 모든 행을 삭제하는 방법에는 다음과 같은 세 가지 OPTION이 있다.
1. DELETE 명령어 사용
     DELETE 명령어를 사용하여 TABLE의 행을 삭제할 수 있다.
     예를 들어 EMP TABLE에서 모든 행을 삭제하는 명령문은 다음과 같다.
     DELETE FROM emp;
     O. DELETE 문을 사용할 때 TABLE이나 CLUSTER에 행이 많으면 행이 삭제
될 때마다 많은 SYSTEM 자원이 소모된다. 예를 들어 CPU 시간, REDO
LOG 영역, TABLE이나 INDEX에 대한 ROLLBACK SEGMENT 영역 등의 자
원이 필요하다.
     O. TRIGGER가 걸려 있다면 각 행이 삭제될 때 실행된다.
     O. 이전에 할당되었던 영역은 삭제되어 빈 TABLE이나 CLUSTER에 그대로
남아 있게 된다.
2. DROP 과 CREATE 명령어 사용
     TABLE을 삭제한 다음 재생성할 수 있다. 예를 들어 EMP TABLE을 삭제하
고 재생성하는 명령문은 다음과 같다.
     DROP TABLE emp;
     CREATE TABLE emp (......);
     O. TABLE이나 CLUSTER를 삭제하고 재생성하면 모든 관련된 INDEX,
CONSTRAINT,TRIGGER도 삭제되며, 삭제된 TABLE이나 CLUSTERED
     TABLE에 종속된 OBJECTS는 무효화 된다.
     O. 삭제된 TABLE이나 CLUSTERED TABLE에 부여된 권한도 삭제된다.
3. TRUNCATE 명령어 사용
     SQL명령어 TRUNCATE를 사용하여 TABLE의 모든 행을 삭제할 수 있다.
     예를 들어 EMP TABLE을 잘라내는 명령문은 다음과 같다.
     TRUNCATE TABLE emp:
     O. TRUNCATE 명령어는 TABLE이나 CLUSTER에서 모든 행을 삭제하는 빠르
고 효율적인 방법이다.
     O. TRUNCATE 명령어는 어떤 ROLLBACK 정보도 만들지 않고 즉시 COMMIT
한다.
     O. TRUNCATE 명령어는 DDL 명령문으로 ROLLBACK될 수 없다.
     O. TRUNCATE 명령문은 잘라 버릴 TABLE과 관련된 구조(CONSTRAINT,
     TRIGGER 등)과 권한에 영향을 주지 않는다.
     O. TRUNCATE 명령문은 현재 TABLE에 할당된 영역을 잘라버린 후에 포함
되는 TABLESPACE로 복귀되도록 지정한다.
(REUSE STORAGE, DROP STORAGE OPTION 사용)
     - DROP STORAGE OPTION 사용 시 : TABLE EXTENTS 수를 MINEXTENTS의
     원래 설정값으로 줄인다.
               해제된 확장영역은 SYSTEM에 복귀되며,
          다른 OBJECTS가 사용할 수 있다.
- REUSE STORAGE OPTION 사용 시 : 현재 TABLE이나 CLUSTER에 할당된
모든 영역이 할당된 채로 남아 있도록
지정한다.
     O. TRUNCATE 명령문이 TABLE에서 ROW를 삭제하면 해당 TABLE에 걸려 있는
TRIGGER는 실행되지 않는다.
     O. AUDIT 기능이 ENABLE되어 있으면, TRUNCATE 명령문은 DELETE 문에 해
당하는 AUDIT 정보를 생성하지 않는다. 대신 발생한 TRUNCATE 명령문
에 대한 단일 AUDIT RECORD를 생성한다.
* HASH CLUSTER는 잘라버릴 수 없다.
또한 HASH CLUSTER나 INDEX CLUSTER 내의 TABLE도 개별적으로 잘라버릴 수
없다.
INDEX CLUSTER를 잘라버리면 CLUSTER에 있는 모든 TABLE의 모든 ROW가 삭제
된다.
모든 ROW가 각각의 CLUSTERED TABLE에서 삭제되어야 한다면 DELETE 명령어를
사용하거나 TABLE을 삭제하고 재생성한다.

There Oracle says us about CASCADE keyword in ALTER TYPE ... DROP METHOD statement
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_43a.htm#2078974
CASCADE Clause
Specify the CASCADE clause if you want to propagate the type change to dependent types and tables. Oracle Database aborts the statement if any errors are found in the dependent types or tables unless you also specify FORCE.
Try to find the dependences between your super - and subtypes.
It would be better if you specify your complete objects
hierarchy in the example.
Rgds.

Similar Messages

  • How to delete/drop all the tables from SQL Server Database without using Enterprise Manager?

    How to delete/drop all the tables from SQL Server Database without using Enterprise Manager?
    I tried using DROP Tables, Truncate Database, Delete and many more but it is not working.  I want to delete all tables using Query Analyzer, i.e. through SQL Query.
    Please help me out in this concern.
    Nishith Shah

    Informative thread indeed. Wish I saw it early enough. Managed to come up with the code below before I saw this thread.
    declare @TTName Table
    (TableSchemaTableName
    varchar
    (500),
    [status] int
    default 0);
    with AvailableTables
    (TableSchemaTableName)
    as
    (select
    QUOTENAME(TABLE_SCHEMA)
    +
    +
    QUOTENAME(TABLE_NAME)
    from
    INFORMATION_SCHEMA.TABLES)
    insert into @TTName
    (TableSchemaTableName)
    select *
    from AvailableTables
    declare @TableSchemaTableName varchar
    (500)
    declare @sqlstatement nvarchar
    (1000)
    while 1=1
    begin
    set @sqlstatement
    =
    'DROP TABLE '
    + @TableSchemaTableName
    exec
    sp_executeSQL
    @sqlstatement
    print
    'Dropped Table : '
    + @TableSchemaTableName
    update @TTName
    set [status]
    = 1
    where TableSchemaTableName
    = @TableSchemaTableName
    if
    (select
    count([Status])
    from @TTName
    where [Status]
    = 0)
    = 0
    break
    end

  • Delete or Truncate statement for data purging

    Hi,
    I am writting a stored procedure to purge data from table every month. There is no constraint on table column except primary key.
    I am using 'delete' statement as it records an entry in the transaction log for each deleted row. But it's a slow process compared to 'Truncate' statement.
    Can you please suggest what should I choose (Delete or truncate) as per best practice.
    Thanks
    Sandy
    SandyLeo

    If you want to  delete all rows in the table use TRUNCATE, otherwise I would suggest the below technique
    --SQL2008 and onwards
    insert into Archive..db
    select getdate(),d.*
    from (delete  from db1
            output deleted.*
            where col=<value>
    ) d
            go
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Delete vs truncate

    Hi,
    We are using Oracle and we have a daily job of loading data to a table.
    The existing data needs to be cleaned and fresh insert need to be done. Should I use Delete or truncate to clean the data.
    If any error occurs i need to have old data ie previous load in my table.
    so which option should i use? Delete or truncate
    Thanks
    Harshini

    Given this requirement:
    If any error occurs i need to have old data ie previous load in my table.I would suggest you consider a process that uses partition exchange.
    Such as:
    Create a work_table, with the same columns as your target_table, with a single partition. It could really be partitioned on anything, since you want only 1. Probably a range partition where values < maxvalue.
    Add local indexes to your work_table, that are the same type and cover the same columns as the indexes on your target_table.
    For each load:
    Truncate table work_table; -- to instantly empty it
    insert or load your data into work_table
    alter table work_table exchange partition the_only_partition with table target_table including indexes without validation;Now your current data is in target_table, and your previous data is in work_table. At no point were you stuck with only some of your data. If your data is bad, you can just do the partition exchange to put the previous data back.

  • 실수로 TABLE을 DELETE 또는 DROP한 경우 복구 방법 (time-based recovery)

    제품 : ORACLE SERVER
    작성날짜 : 2004-07-29
    PURPOSE
    사용자의 실수로 중요한 데이타를 delete 하였거나, 테이블을 drop하였을
    경우 복구하는 절차를 정리한 자료이다.
    Explanation
    사용 중인 database 의 archive log mode 여부를 다음과 같이 확인 후
    archive log mode인지 아닌지에 따라 복구 방법이 달라진다.
    os>svrmgrl
    SVRMGR> connect internal;
    SVRMGR> archive log list
    Database log mode ARCHIVELOG
    Automatic archival ENABLED
    Archive destination ?/dbs/arch
    Oldest online log sequence 2525
    Current log sequence 2527
    1. Archive mode인 경우 복구 방법
    archive log mode로 운영중이면서 full backup및 archive file들이 모두
    존재하는 경우 복구가 항상 가능하다.
    이때 다시 다음과 같이 두가지의 경우를 구분하여 복구 작업을 수행할 필요가
    있으며 아래에 각각의 경우에 대한 절차를 자세히 설명한다.
    (1) drop이나 delete한 시점이 얼마 지나지 않았거나, 혹은 필요에 의해
    database 전체를 data 손실 이전 시점으로 돌리고자 하는 경우
    (2) 손실된 data만을 drop이나 delete이전 상태를 받아내고, 나머지 data는
    모두 drop/delete이후 발생한 transaction의 반영분을 유지시키기 위해
    현재 시점으로 맞추어햐 하는 경우
    1-1 database 전체를 drop이나 delete 이전시점으로 돌리고자 할 때
    이러한 경우는 데이타 손실이 발생하기 이전의 datafile들에 대한 backup을
    restore한 후 손실 발생 시점 직전까지 time based로 imcomplete recovery를
    수행하면 된다.
    (1) db를 shutdown시킨 후 현재 상태를 만약의 경우를 대비하여 cold
    backup을 받아둔다.
    shutdown immediate로 db를 내리고, datafiles, redo log files, control
    files 모두 tar등의 명령어를 이용하여 backup을 받아둔다.
    이것은 만약의 경우 이전 backup이나 archive file에 문제가 있는 경우,
    삭제된 data의 복구가 불가능할 경우 현재 상태로라도 돌리기 위한
    것이다.
    (2) 데이타를 삭제하기 이전 상태에서 받아둔 datafile full backup을
    restore한다.
    redo log files과 controlfiles은 현재 것을 그대로 이용하고, 현재
    상태의 모든 datafiles을 지우고 데이타가 삭제되기 전에 받아둔
    backup datafile을 restore시킨다.
    (temp datafile의 경우는 restore시간을 줄이기 위해 restore하지
    않아도된다.)
    (3) restore한 backup시점 이후의 archive file들을 archive log
    destination에 위치시킨다.
    full backup 이후의 archive file들을 일부 tape 장비등에 backup을
    받아두고 지운 상태라면 그러한 file을을 다시 원래 위치에 restore
    하여, full backup받은 시점부터 복구하고자 하는 시점까지의
    archive log file들이 모두 log archive destination에 존재하는지
    확인한다.
    (4) 데이타 삭제 이전 시점까지 time based로 recover를 수행한다.
    이때 날짜와 시간 지정은 항상 아래 예와 같은 형식으로 지정한다.
    만약 데이타를 삭제한 시간이후로 지정하게 되면 recovery후에도
    여전히 data는 지워진 상태로 보여진다.
    os>svrmgrl
    SVRMGR> connect internal
    SVRMGR> startup mount;
    SVRMGR> set autorecovery on
    SVRMGR> recover database until time '2001-01-30:21:00:00';
    SVRMGR> alter database open resetlogs;
    (a) 만약 이때, controlfile이 현재것이 존재하지 않아 datafile뿐
    아니라, controlfile도 과거것을 사용했다면, recovery command를
    다음과 같이 지정하면 된다.
    recover database using backup controlfile (아래줄과 이어짐)
    until time '2001-01-30:21:00:00';
    (b) temp datafile을 restore하지 않은 경우라면 startup mount수행
    직후 다음과 같은 문장을 추가하면 된다.
    alter databse datafile '/oracle/oradata/temp01.dbf'
    offline drop;
    /oracle/oradata/temp01.dbf는 temp datafile의 이름을 예로 든
    것이다.
    (5) 원하는 data가 제대로 조회되는지 확인한다.
    1-2. 삭제된 data만을 복구하고 나머지는 현재 상태를 유지하고자 하는 경우
    이러한 경우는 데이타가 삭제되기 이전 상태의 backup datafile 중에
    SYSTEM, RBS와 삭제된 data가 들어있는 datafile만을 restore시켜 time
    based로 recovery하여 db를 open시킨 후 원하는 table만 export를 받아낸다.
    그리고 다시 현재 상태의 db에 export받은 내용을 import시키는 것이다.
    이때 삭제된 data를 export받기까지의 절차에 대해서 다음과 같이 세가지
    경우의 방법을 생각할 수 있다.
    (a) 다른 시스템에 backup이나 test용으로 oracle이 설치되어 있는 경우
    그 시스템에 backup을 restore하여 해당 table을 export 받는 방법
    (b) 같은 시스템에 backup을 restore 하되, db name과 oracle_sid를 다른
    이름으로 변경하여 다른 db를 만들어 recovery후 open하여 export받는
    방법 <Bulletin:11616 참조>
    (c) 현재 db는 cold backup받아 두고, backup을 restore하여 export을
    받아내는 방법
    여기에서 (a)의 경우는 다른 시스템에 이용하고자 하는 datafile의 oracle
    version 이상의 oracle software가 이미 설치되어 있어야 한다.
    (b)의 경우는 현재 상태의 cold backup을 받았다가 export받은 후 다시
    현재 상태를 restore할 필요는 없애주지만, 대신 SYSTEM, RBS, user
    datafile 만큼의 disk space가 추가로 필요하며, 새로운 db를 추가로
    구성하는 것이므로 init.ora file 구성 등의 작업이 필요하다.
    이것에 관한 자세한 절차는 <Bulletin:11616>을 참조하도록 한다.
    이 자료에서는 이중 (c)에 대한 것만을 자세히 설명한다.
    (1) 현재의 모든 datafiles과 redo log files, datafiles을 다음과 같이
    신중히 cold backup을 받아두도록 한다.
    이것은 이후에 삭제한 data를 복구하여 export를 받은 후에 다시 현재
    상태의 db로 되돌아오기 위한 것이다.
    단 이 때 tar 등을 이용하여 cold backup하는 대신에 disk 상에 cold
    backup을 받아 시간을 절약할 수 있다. disk로의 backup이 가능한
    이유는 export를 위한 time based recovery를 수행하기 위해 필요한
    datafile이 SYSTEM, RBS, 삭제된 data를 포함한 user datafile
    정도이기 때문이다.
    os>svrmgrl
    SVRMGR> connect internal
    SVRMGR> shutdown immediate;
    SVRMGR> exit
    os>cp /oracle/oradata/*.ctl /oracle/backup/*.ctl
    os>cp /oracle/oradata/redo*.log /oracle/backup/redo*.log
    os>mv /oracle/oradata/system01.dbf /oracle/backup/system01.bak
    os>mv /oracle/oradata/rbs01.dbf     /oracle/backup/rbs01.bak
    os>mv /oracle/oradata/tools01.dbf /oracle/backup/tools01.bak
    redo log file이나 controlfile의 경우는 time based recovery시에도
    필요하므로 cp를 받아두고, datafile의 경우는 mv를 이용하도록 한다.
    위의 예에 제시된 file이름들은 해당 환경에 맞게 변경되어야 하며,
    tar를 이용하여 tape에 옮겨도 관계는 없으나, 단 cold backup에
    해당하는 모든 datafiles, redo log files, control files를 받아두어야
    한다.
    (2) 삭제한 data가 존재할 당시에 받아둔 backup에서 SYSTEM datafile, RBS
    datafile, 그리고 삭제한 table이 들어있는 datafile만을 restore한다.
    redo log files과 controlfiles은 현재 것을 그대로 이용한다.
    (3) restore한 backup시점 이후의 archive file들을 archive log
    destination에 위치시킨다.
    full backup 이후의 archive file들을 일부 tape 장비 등에 backup을
    받아두고 지운 상태라면 그러한 file을을 다시 원래 위치에 restore
    하여, full backup받은 시점부터 복구하고자 하는 시점까지의
    archive log file들이 모두 log archive destination에 존재하는지
    확인한다.
    (4) restore하지 않을 datafile, 즉 SYSTEM, RBS, 삭제된 data를 포함하
    는 user datafile을 제외한 모든 datafile은 모두 offline drop시키
    고, 데이타 삭제 이전 시점까지 time based로 recover를 수행한다.
    이때 날짜와 시간 지정은 항상 아래 예와 같은 형식으로 지정한다.
    만약 데이타를 삭제한 시간이후로 지정하게 되면 recovery후에도
    여전히 data는 지워진 상태로 보여진다.
    os>svrmgrl
    SVRMGR> connect internal
    SVRMGR> startup mount;
    SVRMGR> alter database datafile '/oracle/oradata/temp01.dbf'
    offline drop; (윗줄과 이어짐)
    SVRMGR> alter database datafile '/oracle/oradata/userdata05.dbf'
    offline drop; (윗줄과 이어짐)
    ... 이와 같이 resotre하지 않은 datafile을 모두 offline drop시킨다.
    SVRMGR> set autorecovery on
    SVRMGR> recover database until time '2001-01-30:21:00:00';
    SVRMGR> alter database open resetlogs;
    만약 이때, controlfile이 현재것이 존재하지 않아 datafile뿐 아니라,
    controlfile도 과거것을 사용했다면, recovery command를 다음과 같이
    지정하면 된다.
    SVRMGR>recover database using backup controlfile until time
    '2001-01-30:21:00:00'; (윗줄과 이어짐)
    (5) 원하는 data가 제대로 조회되는지 확인한 후 필요한 table을 export한다.
    예를 들어 scott user의 dept table을 복구하고자 한것이었다면 다음과
    같이 export를 받는다.
    os>exp scott/tiger file=dept.dmp tables=dept log=deptlog1
    (6) time based로 recovery후 open한 db는 shutdown하여 없애고 (1)번에서
    받아둔 현재 상태의 backup을 restore한다.
    shutdown은 immediate나 abort 모두 가능하며, shutdown후 restore한
    SYSTEM, RBS, user datafile모두 삭제하고, 사용하던 controlfiles,
    redo log files도 모두 삭제한다.
    그리고 (1)에서 mv나 cp로 (혹은 tar로) 옮겨놓은 모든 datafiles,
    controlfiles, redo log files를 원래의 directory와 이름으로
    위치시킨다. SYSTEM, RBS, user datafile도 반드시 (1)번 상태의
    현재 상태 backup을 restore하여야 한다.
    (7) db를 startup시킨 후 (5)에서 받은 export내용을 import시킨다.
    os>imp scott/tiger file=dept.dmp tables=dept ignore=y commit=y
    log=deptlog2 (윗줄과 이어짐)
    (8) 원하는 data가 제대로 조회되는지 확인한다.
    2. No archive mode 로 운영할 경우 복구 방법
    archive mode 로 운영하지 않았을 경우에는, 삭제한 data를 export 받아
    두었거나, 혹은 data가 삭제 전 받아둔 cold backup이 존재하는 경우
    복구가 가능하다.
    (1) export가 존재하는 경우
    다음과 같이 import한다. scott user의 dept가 삭제된 경우를 예로 들었다.
    os>imp scott/tiger file=dept.dmp tables=dept ignore=y commit=y log=log1
    (2) cold backup이 존재하는 경우
    다른 시스템에 사용가능한 oracle engine이 설치되어 있다면, 그곳을
    이용하거나, 혹은 현재 database를 backup받아둔후 현재 시스템에
    restore하여 export를 받아낼 수 있다.
    (1) 현재의 모든 datafiles과 redo log files, datafiles을 다음과 같이
    신중히 cold backup을 받아두도록 한다.
    이것은 이후에 삭제한 data를 복구하여 export를 받은 후에 다시 현재
    상태의 db로 되돌아오기 위한 것이다.
    단 이 때 tar 등을 이용하여 cold backup하는 대신에 disk 상에 cold
    backup을 받아 시간을 절약할 수 있다. disk로의 backup이 가능한
    이유는 export를 위한 time based recovery를 수행하기 위해 필요한
    datafile이 SYSTEM, RBS, 삭제된 data를 포함한 user datafile
    정도이기 때문이다.
    os>svrmgrl
    SVRMGR> connect internal
    SVRMGR> shutdown immediate;
    SVRMGR> exit
    os>mv /oracle/oradata/*.ctl /oracle/backup/*.ctl
    os>mv /oracle/oradata/redo*.log /oracle/backup/redo*.log
    os>mv /oracle/oradata/system01.dbf /oracle/backup/system01.bak
    os>mv /oracle/oradata/rbs01.dbf     /oracle/backup/rbs01.bak
    os>mv /oracle/oradata/tools01.dbf /oracle/backup/tools01.bak
    위의 예에 제시된 file이름들은 해당 환경에 맞게 변경되어야 하며,
    tar를 이용하여 tape에 옮겨도 관계는 없으나, 단 cold backup에
    해당하는 모든 datafiles, redo log files, control files를 받아두어야
    한다.
    (2) 삭제한 data가 존재할 당시에 받아둔 backup에서 SYSTEM datafile,
    RBS datafile, 그리고 삭제한 table이 들어있는 datafile만을
    restore한다.
    backup당시의 redo log files과 controlfiles도 restore하여야 한다.
    (3) restore하지 datafile, 즉 SYSTEM, RBS, 삭제된 data를 포함하는 user
    datafile을 제외한 모든 datafile은 모두 offline drop시키고,
    database를 open시킨다.
    os>svrmgrl
    SVRMGR> connect internal
    SVRMGR> startup mount;
    SVRMGR> alter database datafile '/oracle/oradata/temp01.dbf'
    offline drop; (윗줄과 이어짐)
    SVRMGR> alter database datafile '/oracle/oradata/userdata05.dbf'
    offline drop; (윗줄과 이어짐)
    ... 이와 같이 resotre하지 않은 datafile을 모두 offline drop시킨다.
    SVRMGR> alter database open;
    (4) 원하는 data가 제대로 조회되는지 확인한 후 필요한 table을 export
    한다.
    예를 들어 scott user의 dept table을 복구하고자 한 것이었다면
    다음과 같이 export를 받는다.
    os>exp scott/tiger file=dept.dmp tables=dept log=deptlog1
    (5) exprot받아낸 database는 shutdown하여 없애고 (1)번에서 받아둔
    현재 상태의 backup을 restore한다.
    shutdown은 immediate나 abort 모두 가능하며, shutdown후 restore한
    SYSTEM, RBS, user datafile모두 삭제하고, 사용하던 controlfiles,
    redo log files도 모두 삭제한다.
    그리고 (1)에서 mv나 tar로 옮겨놓은 모든 datafiles, controlfiles,
    redo log files를 원래의 directory와 이름으로 위치시킨다.
    (6) db를 startup시킨 후 (4)에서 받은 export내용을 import시킨다.
    os>imp scott/tiger file=dept.dmp tables=dept ignore=y commit=y
    log=deptlog2 (윗줄과 이어짐)
    (7) 원하는 data가 제대로 조회되는지 확인한다.

  • Delete dropped pin on iPad iOS 6

    How do you delete a dropped pin using maps on and iPad2 with iOS 6? Tapping the "i" in the blue circle near the pin opens a new window. However, the remove/delete dropped pin button is no longer there.

    This is what I get after tapping the "i" in the blue circle for the pin.

  • What are the differences between delete and truncate statements.

    i need few differences between executing both the above statements.like what is the effect they are going to make on the data in the table and regarding the table
    spaces

    One of the main diffrence TRUNCATE is DDL while DELETE is DML thats why
    you neednt to commit/rollbacked after TRUNCATING table.
    If you have master/child table then TRUNCATING master table will not concerned
    with child table data ,it will concerned with FK enabled KEY truncate is DDL.
    While DML will concerned with detail table data when deleting master table data.
    SQL> DESC dept
    Name                                      Null?    Type
    DEPTNO                                    NOT NULL NUMBER(2)
    DNAME                                              VARCHAR2(14)
    LOC                                                VARCHAR2(13)
    SQL> DESC emp
    Name                                      Null?    Type
    EMPNO                                     NOT NULL NUMBER(4)
    ENAME                                              VARCHAR2(10)
    JOB                                                VARCHAR2(9)
    MGR                                                NUMBER(4)
    HIREDATE                                           DATE
    SAL                                                NUMBER(7,2)
    COMM                                               NUMBER(7,2)
    DEPTNO                                    NOT NULL NUMBER(2)
    SQL> TRUNCATE TABLE emp
      2  /
    Table truncated.
    SQL> TRUNCATE TABLE dept
      2  /
    TRUNCATE TABLE dept
    ERROR at line 1:
    ORA-02266: unique/primary keys in table referenced by enabled foreign keys
    SQL> Unless you dont disable/drop FK key from child table you cant TUNCATE master
    table data.
    Khurram

  • Deleting/dropping/removing database using Enterprise Manager  (12c)

    Hi,
    I have run some searches and review the documentation... but I haven't found any way to drop/remove/delete databases using 12c EM.
    We have multi-instance environments (one physical server with several instances/database). And from time to time we have to remove one or more instances when they are decommissioned.
    So far we are using DBCA, but I wonder if there is any way to do the same with EM "out of the box ...
    Could someone point me in the right direction?
    Thanks in advance,
    Francisco Palomares

    Hello Francisco,
    the only "out of the box" methods to delete/remove a database would be:
    - Create a "User defined procedure" to do the job - Checkout the "Lifecycle Management" guide in the documentation
    - When using the Self Service Portal as part of the Cloud Management feature, users would be able to request for a database to be created. When requesting for a database to be created the user can also identify for what period he/she would need the database. Meaning that you can indicate the moment a database need to be decommissioned. In that case not only a Job will be scheduled to create the requested database, but also a job will be scheduled to remove the database after the indicated time frame has passed. Check for this the Cloud Management Guide.
    - You could of course also think about doing this using a custom made script that you could schedule from the EM job system.
    Well enough material to think about ;-)
    Regards
    Rob
    http://oemgc.wordpress.com

  • Need to delete drop down values of activity in travel request portal

    Hi,
    We need to hide/delete few of the drop down values from activity in travel request creation in portal, i know that if we delete in R/3 it will effect here, as per the client requirement we need values in R/3 system but that few of the values should not appear drop down list .
    Regards
    Ganesh

    Hi Ganesh,
    Try the below code in POSTexit of WDDOMODIFYVIEW( ) method of your view
    DATA drp_info       TYPE REF TO if_wd_context_node_info.
    data   lo_node        type ref to if_wd_context_node.
    DATA drp_value_set  TYPE wdr_context_attr_value.
    DATA drp_value_list TYPE wdr_context_attr_value_list.
    DATA index TYPE n.
    DO 5 TIMES.
    index = sy-index .
    CONCATENATE ' Value ' index  INTO drp_value_set-value SEPARATED BY space.
    CONCATENATE ' Value ' index  INTO drp_value_set-text SEPARATED BY space.
    INSERT drp_value_set INTO TABLE drp_value_list.
    ENDDO.
    SORT drp_value_list BY value.
    DELETE ADJACENT DUPLICATES FROM drp_value_list COMPARING value.
    lo_node  = drp_info->get_child_node('GENERAL_DATA').
    drp_info = lo_node->get_node_info(  ).
    drp_info->set_attribute_value_set(
    name = 'T_ACTYPE'  value_set = drp_value_list ).
    Hope this helps you.
    Regards,
    Rama

  • Delete vs truncate on materilized view

    is it possible to truncate materilized view? if yes, is it faster than using delete from materialized view?
    thanks.

    user8837158 wrote:
    is it possible to truncate materilized view? YES, for example;
    dbms_mview.refresh( 'MY_MVIW_NAME' , 'C', atomic_refresh => FALSE ); => This does a TRUNCATE
    if yes, is it faster than using delete from materialized view? Yes it is faster ; TRUNCATE is a DDL, no need as much undo as a DELETE, where a DELETE is a DML
    DELETE operation will cause all DELETE triggers on the table to fire. Where with TRUNCATE no triggers will be fired.
    thanks.

  • Delete as Truncate

    Dears,
    i don't have tablespace enough and i need to delete with condition but as i know delete statment not delete storge as truncate statment do
    how can use delete statment as (delete rows with condition and remove storge also)

    user8929623 wrote:
    Dears,
    i don't have tablespace enough and i need to delete with condition but as i know delete statment not delete storge as truncate statment do
    how can use delete statment as (delete rows with condition and remove storge also)What is your database and OS version?
    You can delete from your table(some conditions) and after can shrink this as:
    alter table  <your_table> enable row movement;
    alter table  <your_table> shrink space cascade;In additionally see below links;
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/schema.htm#CBBBIADA
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_3001.htm
    Edited by: Chinar on Jun 28, 2010 3:30 AM

  • How to clear/delete drop down list of web pages visited?

    When I type "www." in the address block, a drop down menu with a long alphabetized list of previously visited websites appears, going back for months. This list is not erased by Clear History or by quitting Safari. Is there any way to clear or delete this list for the sake of privacy? Thanks
    iMac G5   Mac OS X (10.3.8)   Safari 1.3.1 (v312.3.3)

    I use OnyX and have it open at the moment so I can inspect the various panes while I make this reply. It will let you empty browser caches, including the ones for downloads, searches, form values, cookies, bookmark icons as well as the regular cache that holds urls.
    In the Safari section, you can adjust the number of history items and the number of history items in the History menu. Unlike Safari Enhancer, there is no toggle to disable the cache. Most importantly for this topic, there is no toggle for Safari's url autocomplete.
    Just clearing caches and history will not get rid of url autocomplete because autocomplete also uses your bookmarks, plus, the cache and history will refill as you use Safari.

  • Deleting Drop Frames these days?

    In the old days you just held down Alt while dropping in your background image and one of the options was to replace drop frames (what IS the point of those anyway?) along with the background picture from the Theme (how I wish you could just start with a blank project! - sigh)
    But now, (iDVD 7.1.2) that option is no longer there. I just get 'replace background' or 'make a slideshow.'
    Surely there must stil be a way to delete these annoying boxes - or am I being even more of a dork than usual?
    Many thanks
    Tom

    And while I'm here - where is the highlight colour box these days? I can find the text colour box, but I don't want text, just frames.
    IIABDFI
    (If It Aint Broke Don't Fix It, Mr Jobs))

  • Deleting Drop Zones

    If a theme in IDVD has 4 drop zones and I want to use two, is there a way to delete the two unused zones?

    I think unused drop zones go away when you burn your project. Although I could be mistaken on that.
    Patrick

  • Deleting Drop Zone

    I'm attempting to create a custom theme with iDVD 08. Is there any way to remove / delete a drop zone completely? I basically just want to have a background that I select with buttons I've added, no drop zones.
    Thanks!

    Or try these older versions:
    iDVD5GettingStarted
    iDVD6_GettingStarted

Maybe you are looking for

  • Photo Shop For Retina Display

    I noticed sometime back that the was a photoshop tailored to the retina display on Mac. are those compatibilities built into the CC 2014? Im using a 2013 macbook Pro with retina display 2.6- 2.8 gigahertz. Could you confirm that the CC 2014 is best e

  • HP Tablet OS non responsive

    A friend gave me his old OS tablet. I reset settings to set it up with our information, but now all I get is the software Manager saying "You have no services installed". The touch screen is non responsive and I can't power it off. None of the button

  • How do I install The Dng converter to my Lightroom?

    I've followed the prompts to update but it still isn't rendering raw files when i open the program. 

  • Dependent Demand Planning of commponents

    Hi Following is the BOM structure - F (Finished Good) - > S1 (1st Intermediate) - > S2 (2st Intermediate) - > R (Raw Material) I am trying to plan the finished good (F) in an external system (like say xLPO / ECC) and transfer the dependent demand of

  • Horizontal line macbook air

    Have a Good day. Is terrible that apple sells defective equipment, i bought a macbook air in apple store miami, the machine now is displaying a horizontal line in the monitor, i called to apple , the support told me  thati it is normal, and that they