oa資料庫初始化

peng163fj發表於2015-04-13

SELECT USERENV('LANGUAGE') FROM DUAL;


connect system as sysdba ;

shutdown immediate ;

startup mount ;

alter system enable restricted session;

alter system set JOB_QUEUE_PROCESSES=0; 

alter system set AQ_TM_PROCESSES=0;

alter database open ; 

alter database character set internal_use ZHS16GBK ; 

shutdown immediate ;

startup ;


create tablespace Toaprd_tbs01

logging 

permanent

datafile 'F:\APP\ADMINISTRATOR\ORADATA\ORCL\tbs01.dbf' 

size 500m 

autoextend on 

next 50m maxsize 20480m 

SEGMENT SPACE MANAGEMENT AUTO

extent management local;--建立表空間


create tablespace Ioaprd_idx01

logging 

permanent

datafile 'F:\APP\ADMINISTRATOR\ORADATA\ORCL\idx01.dbf' 

size 500m 

autoextend on 

next 50m maxsize 20480m 

SEGMENT SPACE MANAGEMENT AUTO

extent management local;--建立索引表空間


--建立使用者

-- Create the user 

create user OAPRD

  default tablespace TOAPRD_TBS01

  temporary tablespace TEMP

  profile DEFAULT

  password expire;

-- Grant/Revoke role privileges 

grant connect to OAPRD;

grant resource to OAPRD;

-- Grant/Revoke system privileges 

grant alter any index to OAPRD;

grant alter any procedure to OAPRD;

grant alter any role to OAPRD;

grant alter any sequence to OAPRD;

grant alter any table to OAPRD;

grant alter session to OAPRD;

grant create any index to OAPRD;

grant create any materialized view to OAPRD;

grant create any procedure to OAPRD;

grant create any sequence to OAPRD;

grant create any synonym to OAPRD;

grant create any table to OAPRD;

grant create any view to OAPRD;

grant create database link to OAPRD;

grant create job to OAPRD;

grant create public database link to OAPRD;

grant create tablespace to OAPRD;

grant unlimited tablespace to OAPRD;



---授權語句package未寫

GRANT

  CREATE SESSION, CREATE ANY TABLE, CREATE ANY VIEW ,CREATE ANY INDEX, CREATE ANY PROCEDURE,

  ALTER ANY TABLE, ALTER ANY PROCEDURE,

  DROP ANY TABLE, DROP ANY VIEW, DROP ANY INDEX, DROP ANY PROCEDURE,

  SELECT ANY TABLE, INSERT ANY TABLE, UPDATE ANY TABLE, DELETE ANY TABLE

TO oaprd;


grant create sequence to oaprd

grant unlimited tablespace to oaprd;

grant debug connect session to oaprd;


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/21302630/viewspace-1571828/,如需轉載,請註明出處,否則將追究法律責任。

相關文章