To create tablespaces

set echo off;
spool ./dba_create_tablespace.log;

-------------------------------------------------------------------------
--   DB script executed by DBA USER to create database tablespaces
-------------------------------------------------------------------------  
-- 1. Drop data tablespace
DROP TABLESPACE GXDATA INCLUDING CONTENTS AND DATAFILES
/

-- 2. Drop index tablespace
DROP TABLESPACE GXINDEX INCLUDING CONTENTS AND DATAFILES
/

-- 3. Drop temporary tablespace
DROP TABLESPACE GXTEMP INCLUDING CONTENTS AND DATAFILES
/

accept xxx prompt '----- Press any key to continue to create tablespace -----'

-- 1. Create data tablespace
CREATE TABLESPACE GXDATA datafile '& DataPath/GXDATA.DBF' SIZE 100 K REUSE AUTOEXTEND ON NEXT 100 K MAXSIZE UNLIMITED;

-- 2. Create index tablespace
CREATE TABLESPACE GXINDEX datafile '&DataPath/GXINDEX.DBF' SIZE 100 K REUSE AUTOEXTEND ON NEXT 100 K MAXSIZE UNLIMITED;

-- 3. Create temporary tablespace
CREATE TEMPORARY TABLESPACE GXTEMP TEMPFILE '&DataPath/GXTEMP.DBF' SIZE 10M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED;

spool off;

你可能感兴趣的:(To create tablespaces)