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

[oracle@bogon orcl]$ sqlplus sys/sys as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Wed Oct 8 18:54:09 2014

Copyright (c) 1982, 2009, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> CREATE TEMPORARY TABLESPACE anos_temp
2 TEMPFILE ‘/home/oracle/app/oradata/orcl/anos_temp01.dbf‘
3 SIZE 32M
4 AUTOEXTEND ON
5 NEXT 32M MAXSIZE 2048M
6 EXTENT MANAGEMENT LOCAL;

Tablespace created.

SQL> CREATE TABLESPACE anos_data
2 LOGGING
3 DATAFILE ‘/home/oracle/app/oradata/orcl/anos_data01.dbf‘ 
4 SIZE 32M 
5 AUTOEXTEND ON 
6 NEXT 32M MAXSIZE 2048M
7 EXTENT MANAGEMENT LOCAL;

Tablespace created.

SQL> ALTER USER anoscfg
2 DEFAULT TABLESPACE anos_data
3 TEMPORARY TABLESPACE anos_temp;

User altered.

 

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

 

-- Create table
create 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初始化数据库表空间、用户、表(索引、分区)等

上一篇:js下载doxc 文件示例和部分后缀对应的content-type 总结


下一篇:诺禾-php