天天看點

Oracle 建立本地資料庫sql語句

建立資料庫

CREATE TABLESPACE localhost LOGGING DATAFILE \'D:\Oracle\database\localhost.dbf\' SIZE 100M AUTOEXTEND ON NEXT 32M MAXSIZE 500M EXTENT MANAGEMENT LOCAL;      
create temporary TABLESPACE localhost_temp tempfile \'D:\Oracle\database\localhost_temp.dbf\' SIZE 100M AUTOEXTEND ON NEXT 32M MAXSIZE 500M EXTENT MANAGEMENT LOCAL;

      
CREATE USER username IDENTIFIED BY password DEFAULT TABLESPACE localhost TEMPORARY TABLESPACE localhost_temp;//建立使用者      
grant connect,resource,dba to username;//給使用者添權重限
grant create session to username;

      

删除資料庫

conn sys/dwh as sysdba;

drop tablespace localhost including contents and datafiles;

drop tablespace localhost_temp including contents and datafiles;      

删除使用者

drop user username cascade;