DB/Oracle/ޥ/SQL*Plus

Top / DB / Oracle / ޥ / SQL*Plus

ܼ

Oracle Database 򰷤Ƿ礫ʤ SQL*Plus á


³

SYSDBA Ȥ³롣

  • SQL*Plus ư³
    -- nolog ץǥ󤻤˵ư
    sqlplus /nolog
    
    -- OS ǧڤξϥ桼̾ʤɤסas sysdba  sys Ȥ³Ǥ
    conn / as sysdba 
    
  • SQL*Plus ư³
    -- OS ǧڤξϥ桼̾ʤɤסas sysdba  sys Ȥ³Ǥ
    sqlplus / as sysdba
    

إפα

ޥɤλȤ狼ʤʤäꡢ⤽⥳ޥɲäʾ֤˴٤äꤷȤˡ

-- ΥޥɤλȤĴ٤
? <command>
help <command>

-- ޥɤΰɽ
? index
help index

OS ޥɤμ¹

SQL*Plus ΥץץȤ OS Υޥɤ¹Ԥ롣

-- 
host <command>

-- ȤХȥǥ쥯ȥγǧ
host pwd

-- ȤХȥǥ쥯ȥѹ
host cd /home/hoge

ե

SQL*Plus 鳰եɤ߹Խꤹ롣

-- ե¹Ԥ
@hoge.sql

-- եԽ
edit hoge.sql

ѥˤĤ

եꤹȤե̾Τߡʤ⤷Хѥˤ򵭽ҤϥǥեȤǤ SQL*Plus ưǥ쥯ȥʥȥǥ쥯ȥˤƤФ롣եѥξϤ˽

ȥǥ쥯ȥ host pwd ʤɤƳǧǽѹƱͤ host cd /home/hoge ʤɡ

Windows ĶǤͤƱ硼ȥåȤˡغȥե٤ꤷƤȳڡ

Хåե

SQL*Plus Ū¹ԤޥɤǼƤХåեФ

-- ХåեƤƼ¹Ԥ
/

-- ХåեƤϤ
run

-- ХåեƤԽ
edit

-- ХåեƤե¸
save hoge.sql

ѹ

-- Τꤹ
set linesize <byte>

-- ꤹ
column <column-name> format a<byte>

̥¸

Ϥե¸롣Ϥޥɤְ̡㤨ȤΥ顼ޤǡפ˥桼̤ǸƤեǤ롣Ԥʤˤ⤽Τޤޡ

-- ¸
spool <outputfile.log>

-- ɵ¸
spool <outputfile.log> app

-- ¸λ
spool off

PL/SQL β̽Ϥͭ

PL/SQL dbms_output.put_line ѤȤʤɤ˻ȤϤͭˤ롣ʤ PL/SQL 鲿Ǥʤ衪

-- ͭ
set serveroutput on

-- ̵
set serveroutput off

Last-modified: 2011-11-07 () 12:12:23 (2362d)