|
¡ß DB¿¡ ÀÖ´Â ¸ðµç Table À̸§º¸±â
select table_name from user_tables
¡ß TableÀÇ Primary Key ã±â
select * from user_ind_columns where table_name = 'CodeTable'
¡ß ÀμöÀü´Þ
select * from user_ind_columns where table_name = '&1'
===>; save key
SQL> start key CodeTable
¡ß ¼·Î ¿¬°áµÇ´Â Key¸¦ ã´Â ¹æ¹ý
select constraint_name, constraint_type, r_constraint_name
from user_constraints where table_name = 'TABLE_NAME
¡ß TABLE ±¸Á¶ º¸±â
DESC TABLE_NAME
¡ß Constraint È®ÀÎ
select table_name, constraint_name, constraint_type
from user_constraints
where table_name in ('DEPARTMENT','EMPLOYEE');
¡ß Å×À̺í COPY Çϱâ
create table emp_41
as
select id, last_name, userid, start_date from s_emp
where dept_id = 41;
===> whereÀý¿¡ ¾û¶×ÇÑ Á¶°ÇÀ» ÁÖ¸é emp_41À̶õ À̸§À¸·Î Å×À̺íÀÌ ¸¸µé¾îÁø´Ù.
¡ß ¼±ÅÃÇÑ Row¸¸Å¸¸ º¸¿©ÁÖ±â
select * from tmp_table
where rownum <= 100
---> ÀÌ·¸°Ô ÇÏ¸é µ¥ÀÌÅÍ°¡ 10000°ÇÀÌ ÀÖ´õ¶óµµ, 1~100°Ç¸¸ º¸¿©ÁÖ°Ô µÈ´Ù.
¡ß ¿À¶óŬÀÇ ¸ðµç À¯Àú º¸±â
select * from all_users
¡ß ParameterÁ¤º¸ º¸±â (ÇÑ/¿µÄڵ尪, ¹öÁ¯Á¤º¸µîÀ» º¼¼öÀÖ´Ù.)
select * from nls_database_parameters
---> À̶§, NLS_CHARACTERSETÀÇ Value°¡ KO16KSC5601 À̸é ÇѱÛ...
US7ASCII ÀÌ¸é ¿µ¹®ÀÌ´Ù. ---> regedit¿¡¼ ÆíÁýÇÏ¸é °£´ÜÈ÷ ÇØ°á.
¡ß Space ÀÖ´Â °ªÀ» Null·Î ºñ±³
RTRIM(a.ymd_myun) IS NULL
¡ß Desc¸í·ÉÀ¸·Î Table±¸Á¶ º¸´Â È¿°ú¿Í °°Àº ¹æ¹ý
SELECT column_name, data_type, data_length, nullable FROM cols
WHERE table_name = 'YTB_CARCOM'
---> ¹Ýµå½Ã Å×À̺í¸íÀº ´ë¹®ÀÚ À̾î¾ß ÇÑ´Ù.
¡ß Function Script º¸´Â ¹æ¹ý.
select text from user_source where name = 'FUNCTION_NAME'
¡ß ¿äÀÏ Ã£´Â ¹æ¹ý.
select TO_CHAR(sysdate,'D') from dual
|