ORACLE数据导入到指定的表空间
create user 用户名 identified by 密码 default tablespace 缺省表空间 Temporary tablespace 临时表空间;
grant connect,resource,dba to 用户名;
revoke unlimited tablespace from 用户名;
alter user 用户名 quota 0 on Users;
alter user 用户名 quota unlimited on 用户缺省表空间;
--关键是后面3行命令,必须执行。
--接着使用IMP工具导入数据即可导入到用户缺省表空间.
--EXAMPLE: USER NAME: GROUPCMS; tablespace:GROUPCMS
--DROP USER GROUPCMS CASCADE;
create user GROUPCMS identified by ABC123 default tablespace GROUPCMS ;
grant connect,resource,dba to GROUPCMS;
revoke unlimited tablespace from GROUPCMS;
alter user GROUPCMS quota 0 on Users;
alter user GROUPCMS quota unlimited on GROUPCMS;
相关文档:
建表
create table <table_name>(
column_name1 column_type [not null] [check (expression)]
[default value] [primary key][references <table_name>(column_name)],
column_name2 column_type [not null] [check (expression)]
[default value] [prima ......
数学函数
1.绝对值
S:select abs(-1) value
O:select abs(-1) value from dual
2.取整(大)
S:select ceiling(-1.001) value
O:select ceil(-1.001) value from dual
3.取整(小)
S:select floor(-1.001) value
O:select floor(-1.001) value from dual
4.取整(截取)
S:select cast(-1.002 as in ......
对日常工作中用到的感觉有用的sql语句做个归纳,用于今后温故知新。
*复制表:
create table tablename as select * from table_src;
create table tablename as select * from table_src where 1 <> 1; --只复制表结构 ......
SELECT max(SYS_CONNECT_BY_PATH(COLUMN_NAME, ','))
from (SELECT A.COLUMN_NAME, ROWNUM AS ROWNO
from USER_TAB_COLUMNS A
WHERE TABLE_NAME = 'A_USER'
  ......
declare
STR VARCHAR2(400);
begin
-- 重建ORACLE索引
FOR TMP_IDX IN (SELECT TABLESPACE_NAME, OWNER, TABLE_NAME, INDEX_NAME
&nb ......