码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2014-10-09 14:13:13      阅读:324      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   io   os   ar   数据   sp   div   

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

标签:style   blog   color   io   os   ar   数据   sp   div   

原文地址:http://www.cnblogs.com/illday/p/4012793.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!