1. how do you delete duplicate rows in a table?
2. can you disable and enable primary key?
3. how do you move tables from one tablespace to another
tablespace?????

Answers were Sorted based on User's Feedback



1. how do you delete duplicate rows in a table? 2. can you disable and enable primary key? 3. how ..

Answer / mohapatra.gouranga@gmail.com

1. DELETE FROM table_name A WHERE ROWID > (SELECT min
(rowid) FROM table_name B WHERE A.key_values =
B.key_values);

2. can you disable and enable primary key?
Yes,
e.g., alter table EHIS.HIPARTRANSACTIONDETAILS DISABLE
constraint FK_HIPAR_TRANS

3. how do you move tables/indexes from one tablespace to
another tablespace?

ALTER TABLE <schemaname.tablename> MOVE TABLESPACE
<tablespace_name>;

alter index <owner.indexname> rebuild online tablespace
<target_tablespace_name>;

Is This Answer Correct ?    4 Yes 0 No

1. how do you delete duplicate rows in a table? 2. can you disable and enable primary key? 3. how ..

Answer / anil kumar prajapati

1. DELETE FROM
table_name A
WHERE
a.rowid >
ANY (
SELECT
B.rowid
FROM
table_name B
WHERE
A.col1 = B.col1
AND
A.col2 = B.col2
);
2.CREATE TABLE table_name
(
column1 datatype null/not null,
column2 datatype null/not null,
...

CONSTRAINT constraint_name PRIMARY KEY (column1, column2,
... column_n)
);
3.ALTER TABLE <TABLE NAME to be moved> MOVE TABLESPACE
<destination TABLESPACE NAME>

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More DB Administration Interview Questions

wat is global index and local indes

1 Answers   Oracle,


What query tells you how much space a tablespace named "test" is taking up, and how much space is remaining?

1 Answers  


How do you resize a data file?

2 Answers  


How do you recover a datafile that has not been physically been backed up since its creation and has been deleted. Provide syntax example.

4 Answers  


What command would you use to create a backup control file?

2 Answers  






when we login sql editor using username and password then it says this error "could not resolve service name" then what can we do at client side.( here thing is tnsnames.ora file is ok till yesterday and worked well, but now it giving error.

0 Answers  


what is the use of home directory???

1 Answers   HP,


Can you take Image Backups using RMAN? . Can you use Backupsets created by RMAN with any other utility

1 Answers   Tech Mahindra,


how can you process messages in order asynchronously?

0 Answers   Oracle,


Explain the use of table functions.

1 Answers  


how will you see when the database was started using sql prompt?

2 Answers   IBM,


How would you best determine why your MVIEW couldn't FAST REFRESH?

0 Answers  


Categories