2013年8月29日 星期四

OracleDB-直接在資料庫建立空的資料庫

在TIPTOP GP 5.25版之前,鼎新提供一個Shell→Createdb,可以輕鬆的建立空的資料庫(不含任何table schema),但在新版TIPTOP 5.25以後,就把這個Shell關閉,只能透過鼎新提供的程式建立DB Schema,對於建立測試資料庫很不方便。
在此就簡單說明如何直接在資料庫裡建立不含任何table schema的資料庫指令。


  1. 先使用DBA權限登入sqlplus
    sqlplus ‘/as sysdba’
  2. 依序執行下列指令
    create user ds identified by ds
    default tablespace dbs1
    temporary tablespace temp;
    grant create session,create table to ds;
    grant resource to ds;
    grant drop any table to ds;
    grant drop any sequence to ds;
    grant create public synonym to ds;
    grant create synonym to ds;
    grant drop public synonym to ds;
    grant select on sys.v_$session to ds;
上述是以建立DS資料庫為例,若要建立其他的db請置換ds即可。
另外grant的部份,如果要允許跨DB做指令操作,則需grant to public這部份後續另章說明,或是到Google上搜尋一下,應該可以找到很多說明。

沒有留言:

張貼留言