//删除用户
drop user test cascade

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

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

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

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

//导出数据
$exp 
test/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<index_name> rebuild tablespace<tablespace_name>

//分析数据表空间(执行结果不可见)
analyze table <table_name> 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 <table_name> deallocate unused[keep <integer_vlaue> [K|M]]


扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄