Showing posts with label Oracle. Show all posts
Showing posts with label Oracle. Show all posts

Wednesday, November 12, 2014

Thinking about multi reply table in oracle~!



In these days, people want to spend their more time with mobile than Pc.
Pc resolution is very high. so it is very readable in short time.
Mobile resolution size is smaller than PC. so paradigm of design is simple.
It seems that people like if something is so simple.
what I want to say is multi reply system is not many used in these days.

but I have to know how to think and make table for multi reply in board.

one way : 


column : id
subcolumn : parent id, title

Id is unique value
and parent id indicate Id
and more and more

this architecture can make limitless depth replies.

query can express by using oracle grammer connect by


In my opinion

advantage : formal and readable
disadvantage : many article, connect by spend much time to query



the other recommendable way : 

column : id
subcolumn : order_id, title, root_comment_id, depth


I want to show you ex)..

id                                   title,        depth  depth_order     root_comment_id
00000000001               root title            0     1                   00000000001  
00000000002                title                1       1                   00000000001  
00000000003                title               2        1                   00000000001
00000000004                title               2        2                   00000000001 
00000000005                root title         0        1                  00000000002 


select * from table order by root_comment_id desc, depth asc, depth_order desc


Anyway there are lots of way you can make.

what kind of way to choose is up to you~!


 

Sunday, September 8, 2013

Oracle backup exp


exp system/oracle file=/backup/export/test05.dmp owner=(scott, hr)

Tuesday, September 3, 2013

Oracle import dmp file

Step by Step


if not exist
1. create user {user_id} identified by {password}

2. GRANT CONNECT, DBA, RESOURCE TO {user_id};

$ imp {user_id}/{password} file={filename}.dmp ignore=y full=y

wow very Easy~

Monday, August 26, 2013

oracle query trace


1. first of all need to find session id if you use any tool loke toad or sqldeveloper

SELECT * FROM v$session

2. connect oracle by console

sqlplus '/as sysdba'
                                                                                sessionid  , serial
execute sys.dbms_system.set_sql_trace_in_session(1151,29373,true);

find recently maed using
ls -ltr

tkprof filename.trc customname.txt explain=user/pw sys=no

ex)tkprof neosns_ora_7274.trc t1.txt explain=neo_sns/neo_sns_dba sys=no

execute sys.dbms_system.set_sql_trace_in_session(1151,29373,false);