oracle数据库基本操作

// oracle 连接数据库
#sqlplus
#connect sys/huaxing as sysdba

// 显示所有用户
select * from dba_users

// 显示所有表
select * from user_tables where table_name = '用户名'

// 创建用户
create user username identified by password
// 授权dba权限
grant dba to username;

grant unlimited tablespace to zhangsan;//授予zhangsan用户使用表空间的权限
grant create table to zhangsan;//授予创建表的权限
grante drop table to zhangsan;//授予删除表的权限
grant insert table to zhangsan;//插入表的权限
grant update table to zhangsan;//修改表的权限

 

// 导入dmp文件
imp 用户名/密码@网络服务名 file=xxx.dmp full=y;
// 导出dmp文件
exp 用户名/密码@网络服务名 file=xxx.dmp tables=(表名);

// 字符串拼接,后面加3个0
update t_bc_rkqh set SJQHDM=concat(SJQHDM,'000')

// 字符串截取
update T_SI_YH set QHDM=substr(QHDM,0,12)

posted @ 2017-06-23 09:09  河在谈  阅读(125)  评论(0编辑  收藏  举报