首页 > 代码库 > Oracle初始化数据库表空间、用户、表(索引、分区)等

Oracle初始化数据库表空间、用户、表(索引、分区)等

[oracle@bogon orcl]$ sqlplus sys/sys as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Wed Oct 8 18:54:09 2014Copyright (c) 1982, 2009, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> CREATE TEMPORARY TABLESPACE anos_temp2 TEMPFILE ‘/home/oracle/app/oradata/orcl/anos_temp01.dbf‘3 SIZE 32M4 AUTOEXTEND ON5 NEXT 32M MAXSIZE 2048M6 EXTENT MANAGEMENT LOCAL;Tablespace created.SQL> CREATE TABLESPACE anos_data2 LOGGING3 DATAFILE ‘/home/oracle/app/oradata/orcl/anos_data01.dbf‘ 4 SIZE 32M 5 AUTOEXTEND ON 6 NEXT 32M MAXSIZE 2048M7 EXTENT MANAGEMENT LOCAL;Tablespace created.SQL> ALTER USER anoscfg2 DEFAULT TABLESPACE anos_data3 TEMPORARY TABLESPACE anos_temp;User altered.

 

create user anoscfg identified by anoscfg;  grant connect, resource,dba to anoscfg;

 

-- Create tablecreate table PAPU_1440(  TIME_START             NUMBER,  INTERFACE              NUMBER,  SGSN_SIGNAL_IP         NUMBER,  ATTACH_NETWORK_SUCCESS NUMBER,  ATTACH_NETWORK_FAILED  NUMBER,  ACTIVATE_PDP_SUCCESS   NUMBER,  ACTIVATE_PDP_FAILED    NUMBER,  DEACTIVATE_PDP_SUCCESS NUMBER,  DEACTIVATE_PDP_FAILED  NUMBER,  MOD_PDP_SUCCESS        NUMBER,  MOD_PDP_FAILED         NUMBER,  RAU_SUCCESS            NUMBER,  RAU_FAILED             NUMBER,  IDENTITY_SUCCESS       NUMBER,  IDENTITY_FAILED        NUMBER)partition by range (TIME_START)(  partition TBL_EVENT_1406995200 values less than (1408723200)    tablespace ANOS_DATA    pctfree 10    initrans 1    maxtrans 255    storage    (      initial 160K      next 1M      minextents 1      maxextents unlimited    ));-- Create/Recreate indexes create index PAPU_1440_TIME_START on PAPU_1440 (TIME_START)  tablespace ANOS_DATA  pctfree 10  initrans 2  maxtrans 255  storage  (    initial 64K    next 1M    minextents 1    maxextents unlimited  );

 

Oracle初始化数据库表空间、用户、表(索引、分区)等