ITPub博客

首页 > 数据库 > Oracle > 学ORACLE随笔

学ORACLE随笔

Oracle 作者:tingfengjushi 时间:2014-07-02 13:55:03 0 删除 编辑

//删除用户
drop user lc0019999 cascade

//创建用户
create user lc0019999 identified by password

//给用户授DBA权限
grant dba to lc0019999

//导入数据
$imp
lc0019999/password@server file=e:back312.dmp fromuser=lc0019999 touser=lc0019999

//导出数据
$exp
lc0019999/password@server file=e:backaaa.dmp

//更改sys与system口令
alter user system(sys) identified by newpassword

//更改归档日志方式archivelog与noarchivelog
alter database archivelog(noarchivelog)

//整理蜂窝式碎片的方式
alter tablespace tablespacename coalesce

//查看缺省表空间与临时表空间
select username from dba_users where default_tablespace='system' or temporary_tablespace='system' order by username

//将缺省表空间与临时表空间改为非system
alter user rsingh default users temporary temp

//创建表空间命令
create tablespace tablespacename...(other command options)...extent management local uniform size 10M

//在不同表空间之间移动索引
alter index rebuild tablespace

//分析数据表空间(执行结果不可见)
analyze table compute statistics

//查询表最高点与表的未用块
select blocks "high water mark",empty_blocks "unused space" from dba_tables where table_name='&table_name' and owner='&owner_name'

//释放未用表空间
alter table deallocate unused[keep [K|M]]

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26400547/viewspace-1204279/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-12-02

  • 博文量
    14
  • 访问量
    82179