怎么把自己创建的表归属于我创建的用户呢? 建synonym 可以让其他用户不加用户名也能访问当前用户建的表,不过还必须赋权。建表的时候用TABLESPACE关键字指定表空间。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1.alter table table_name owner to user1;2.在建用户时default tablespace = yourtablespace 1、首先建立表空间——tablespace12、建用户test1,设置该用户的表空间默认值为tablespace1 奋进2005 同志alter table table_name owner to user1;语句是在什么版本下运行的?我的是9i 不能运行 oracle 建表的完整语法,schema就是用户名了。CREATE TABLECreate a table.Syntax: CREATE [GLOBAL TEMPORARY] TABLE [schema.]table column datatype [DEFAULT expr] [column_constraint(s)] [,column datatype [,...]] table_constraint table_ref_constraint [ON COMMIT {DELETE|PRESERVE} ROWS] storage_options [COMPRESS int|NOCOMPRESS] [LOB_storage_clause][varray_clause][nested_storage_clause] [XML_type_clause] Partitioning_clause [[NO]CACHE] [[NO]ROWDEPENDENCIES] [[NO]MONITORING] [PARALLEL parallel_clause] [ENABLE enable_clause | DISABLE disable_clause] {ENABLE|DISABLE} ROW MOVEMENT [AS subquery] CREATE [GLOBAL TEMPORARY] TABLE [schema.]table column datatype [DEFAULT expr] [column_constraint(s)] [,column datatype [,...]] table_constraint table_ref_constraint [ON COMMIT {DELETE|PRESERVE} ROWS] CLUSTER cluster_name (col1, col2,... ) [LOB_storage_clause][varray_clause][nested_storage_clause] [XML_type_clause] Partitioning_clause [[NO]CACHE] [[NO]ROWDEPENDENCIES] [[NO]MONITORING] [PARALLEL parallel_clause] [ENABLE enable_clause | DISABLE disable_clause] {ENABLE|DISABLE} ROW MOVEMENT [AS subquery] CREATE [GLOBAL TEMPORARY] TABLE [schema.]table column datatype [DEFAULT expr] [column_constraint(s)] [,column datatype [,...]] table_constraint table_ref_constraint [ON COMMIT {DELETE|PRESERVE} ROWS] ORGANIZATION {HEAP [storage_options] [COMPRESS int|NOCOMPRESS] | INDEX idx_organized_tbl_clause | EXTERNAL external_table_clause } [LOB_storage_clause][varray_clause][nested_storage_clause] [XML_type_clause] Partitioning_clause [[NO]CACHE] [[NO]ROWDEPENDENCIES] [[NO]MONITORING] [PARALLEL parallel_clause] [ENABLE enable_clause | DISABLE disable_clause] {ENABLE|DISABLE} ROW MOVEMENT [AS subquery] CREATE TABLE [schema.]table OF XMLTYPE [XML_type_clause]storage_options: PCTFREE int PCTUSED int INITTRANS int MAXTRANS int STORAGE storage_clause TABLESPACE tablespace [LOGGING|NOLOGGING]idx_organized_tbl_clause: storage_option(s) {MAPPING TABLE | NOMAPPING} [PCTTHRESHOLD int] [COMPRESS int|NOCOMPRESS] [ [INCLUDING column_name] OVERFLOW [storage_option(s)] ]nested_storage_clause: NESTED TABLE {nested_item | COLUMN_VALUE} [ [ELEMENT] IS OF TYPE (ONLY type) ]] | [ [NOT] SUBSTITUTABLE AT ALL LEVELS ]] STORE AS storage_table [RETURN AS {LOCATOR|VALUE} ]XML_type_clause: [XMLTYPE [COLUMN] column [STORE AS OBJECT RELATIONAL] ] [[XMLSCHEMA xmlschema_URL] ELEMENT {element |xmlschema_URL#element}] [XMLTYPE [COLUMN] column [STORE AS CLOB LOB_Segname (LOB_Params)]] [[XMLSCHEMA xmlschema_URL] ELEMENT {element |xmlschema_URL#element}] [XMLTYPE [COLUMN] column [STORE AS CLOB LOB_Params] ] [[XMLSCHEMA xmlschema_URL] ELEMENT {element |xmlschema_URL#element}]external_table_clause: ([TYPE access_driver_type] DEFAULT DIRECTORY directory [ACCESS PARAMETERS {USING CLOB subquery | (opaque_format_spec) }] LOCATION (directory:'location_specifier' [,directory2:'location_specifier2'...) ) [REJECT LIMIT {int|UNLIMITED}]Missing from this page are the options for creating OBJECT TABLES - see the Oracle docs for this.Examplescreate table SIMPLE (MY_NUM number primary key);create table COPY_OF_EMP as select * from EMP;create table EMPTY_COPY as select * from EMP where 1 = 0;create table ACCOUNTS(AC_ID_PK number primary key,AC_STATUS number,AC_COUNTRY_ID number default 44,AC_CREATED date default sysdate, AC_ACCOUNT varchar2(50)) tablespace DATA; create table SALES(SA_ID_PK number primary key,SA_PRODUCT_ID number not null,SA_DATE_PART date not null,SA_COST number (12,2) not null)partition by range (SA_DATE_PART) (partition P01_JAN values less than (to_date('2005-02-01','yyyy-mm-dd')),partition P02_FEB values less than (to_date('2005-03-01','yyyy-mm-dd')),partition P03_MAR values less than (to_date('2005-04-01','yyyy-mm-dd')),partition P04_APR values less than (to_date('2005-05-01','yyyy-mm-dd')), partition P05_REST values less than (maxvalue) ); oracle 数据导入 imp错误IMP-00058: IMP-00000: 未成功终止导入 求解 关于imp的问题,新手求助! orcale 游标问题 如何用SELECT实现 怎么调试这个存储过程,帮我看看哪儿有错!!望指点,在线急等 sql中将时间段进行分段的问题 遇到过好几次这样的需求,请教 {开了三贴了}求一sql语句.@@@@@@@@@@。。。。高人进呀!!! 如何把已经备份的*.dmp文件导回到一个新的Oracle数据库中? sql语句性能问题? 各路老大,进来帮我看看,ORACLE关于SELECT的存储过程对不对? 是否有办法在存储过程中得到服务器的mac地址?
2.在建用户时default tablespace = yourtablespace
2、建用户test1,设置该用户的表空间默认值为tablespace1
alter table table_name owner to user1;
语句是在什么版本下运行的?我的是9i 不能运行
CREATE TABLECreate a table.Syntax: CREATE [GLOBAL TEMPORARY] TABLE [schema.]table
column datatype [DEFAULT expr] [column_constraint(s)]
[,column datatype [,...]]
table_constraint
table_ref_constraint
[ON COMMIT {DELETE|PRESERVE} ROWS]
storage_options [COMPRESS int|NOCOMPRESS]
[LOB_storage_clause][varray_clause][nested_storage_clause] [XML_type_clause]
Partitioning_clause
[[NO]CACHE] [[NO]ROWDEPENDENCIES] [[NO]MONITORING] [PARALLEL parallel_clause]
[ENABLE enable_clause | DISABLE disable_clause]
{ENABLE|DISABLE} ROW MOVEMENT
[AS subquery] CREATE [GLOBAL TEMPORARY] TABLE [schema.]table
column datatype [DEFAULT expr] [column_constraint(s)] [,column datatype [,...]]
table_constraint
table_ref_constraint
[ON COMMIT {DELETE|PRESERVE} ROWS]
CLUSTER cluster_name (col1, col2,... )
[LOB_storage_clause][varray_clause][nested_storage_clause] [XML_type_clause]
Partitioning_clause
[[NO]CACHE] [[NO]ROWDEPENDENCIES] [[NO]MONITORING] [PARALLEL parallel_clause]
[ENABLE enable_clause | DISABLE disable_clause]
{ENABLE|DISABLE} ROW MOVEMENT
[AS subquery] CREATE [GLOBAL TEMPORARY] TABLE [schema.]table
column datatype [DEFAULT expr] [column_constraint(s)] [,column datatype [,...]]
table_constraint
table_ref_constraint
[ON COMMIT {DELETE|PRESERVE} ROWS]
ORGANIZATION {HEAP [storage_options] [COMPRESS int|NOCOMPRESS]
| INDEX idx_organized_tbl_clause
| EXTERNAL external_table_clause }
[LOB_storage_clause][varray_clause][nested_storage_clause] [XML_type_clause]
Partitioning_clause
[[NO]CACHE] [[NO]ROWDEPENDENCIES] [[NO]MONITORING] [PARALLEL parallel_clause]
[ENABLE enable_clause | DISABLE disable_clause]
{ENABLE|DISABLE} ROW MOVEMENT
[AS subquery] CREATE TABLE [schema.]table OF XMLTYPE [XML_type_clause]storage_options:
PCTFREE int
PCTUSED int
INITTRANS int
MAXTRANS int
STORAGE storage_clause
TABLESPACE tablespace
[LOGGING|NOLOGGING]idx_organized_tbl_clause:
storage_option(s)
{MAPPING TABLE | NOMAPPING}
[PCTTHRESHOLD int]
[COMPRESS int|NOCOMPRESS]
[ [INCLUDING column_name] OVERFLOW [storage_option(s)] ]nested_storage_clause:
NESTED TABLE {nested_item | COLUMN_VALUE}
[ [ELEMENT] IS OF TYPE (ONLY type) ]] | [ [NOT] SUBSTITUTABLE AT ALL LEVELS ]]
STORE AS storage_table
[RETURN AS {LOCATOR|VALUE} ]XML_type_clause:
[XMLTYPE [COLUMN] column [STORE AS OBJECT RELATIONAL] ]
[[XMLSCHEMA xmlschema_URL] ELEMENT {element |xmlschema_URL#element}] [XMLTYPE [COLUMN] column [STORE AS CLOB LOB_Segname (LOB_Params)]]
[[XMLSCHEMA xmlschema_URL] ELEMENT {element |xmlschema_URL#element}] [XMLTYPE [COLUMN] column [STORE AS CLOB LOB_Params] ]
[[XMLSCHEMA xmlschema_URL] ELEMENT {element |xmlschema_URL#element}]external_table_clause:
([TYPE access_driver_type]
DEFAULT DIRECTORY directory [ACCESS PARAMETERS {USING CLOB subquery | (opaque_format_spec) }]
LOCATION (directory:'location_specifier' [,directory2:'location_specifier2'...)
) [REJECT LIMIT {int|UNLIMITED}]Missing from this page are the options for creating OBJECT TABLES - see the Oracle docs for this.Examplescreate table SIMPLE (MY_NUM number primary key);create table COPY_OF_EMP as
select * from EMP;create table EMPTY_COPY as
select * from EMP where 1 = 0;
create table ACCOUNTS(
AC_ID_PK number primary key,
AC_STATUS number,
AC_COUNTRY_ID number default 44,
AC_CREATED date default sysdate,
AC_ACCOUNT varchar2(50)
)
tablespace DATA;
create table SALES(
SA_ID_PK number primary key,
SA_PRODUCT_ID number not null,
SA_DATE_PART date not null,
SA_COST number (12,2) not null
)
partition by range (SA_DATE_PART) (
partition P01_JAN values less than (to_date('2005-02-01','yyyy-mm-dd')),
partition P02_FEB values less than (to_date('2005-03-01','yyyy-mm-dd')),
partition P03_MAR values less than (to_date('2005-04-01','yyyy-mm-dd')),
partition P04_APR values less than (to_date('2005-05-01','yyyy-mm-dd')),
partition P05_REST values less than (maxvalue)
);