随笔分类 -  Oracle database

Oracle related tips, DBA tips, Pro C tips
List tables and their corresponding tablespace name and data file
摘要:List tables and their corresponding tablespace name and data fileFollowing is a way to list a table name and its corresponding tablespace name and data file.SQL>select t.table_name,t.tablespace_name,df.file_name from dba_tables t, dba_data_files df2 where t.tablespace_name = df.tablespace_name;Fu 阅读全文
posted @ 2013-01-24 06:48 Simon Han 阅读(200) 评论(0) 推荐(0)
Remove Duplicate Rows from Oracle Database Table
摘要:If you need to remove duplicate rows from an Oracle Database Table, you can use different approaches. For example, you can use the DELETE command with a criteria that selects only duplicates. Usually it is faster to create a new table with distinct rows and replace the old table with the new one.-- 阅读全文
posted @ 2013-01-23 07:55 Simon Han 阅读(247) 评论(0) 推荐(0)
Dynamic SQL Using OPEN FOR in Oracle PL/SQL
摘要:This example illustrates how you can create and use dynamic cursor in Oracle PL/SQL. The example is pretty simple, but I hope you can get the idea and apply it to more complicated cases.DECLARE t_cursor IS REF CURSOR; my_cursor t_cursor; v_customer RECORD ( customer_id NUMBER(18), amount NUM... 阅读全文
posted @ 2013-01-23 07:53 Simon Han 阅读(934) 评论(0) 推荐(0)