ORACLE经常使用命令
1 怎样查看数据库中都有什么表?
select * from sys.user_tables;
2 怎样链接数据库
sqlplus /nolog;conn sys/oracle as sysdba;
3 怎样启动数据库
startup;
4 查看ORACLE实例结构
desc V$instance;
5 查看用户默认表空间、暂时表空间信息
select distinct username,DEFAULT_TABLESPACE,TEMPORARY_TABLESPACE from dba_users where username in('SYSTEM','PRODUCTDB','PROCESS_USER','DICTIONARY','OBSERVE','FORECAST')
6 创建用户
create user OBSERVE identified by 123456;(默认表空间USERS,暂时表空间 TEMP)
7 查看当前用户角色权限
desc role_sys_privs;
8 查看ORACLE全部角色
select ROLE from dba_roles order by ROLE;
9 查看全部用户具有的角色
select distinct GRANTEE,GRANTED_ROLE from dba_role_privs order by GRANTEE;
10 用户绑定角色
grant DBA to KFSYS ;
11 查看ORACLE 创建的目录
select * from dba_directories;
12 ORACLE 数据导出
expdp SYSTEM/123456@wilson directory=data_dump_dir dumpfile=MATEDATA.dmp logfile=METEDATA.log owner=METEDATA
13 ORACLE 数据导入
impdp SYSTEM/123456@wilson directory=data_dump_dir dumpfile=MATEDATA.dmp
14 仅仅导出数据结构
expdp SYSTEM/123456@wilson rows=n directory=data_dump_dir dumpfile=MATEDATA.dmp logfile=METEDATA.log owner=MATEDATA
15 查看ORACLE是否处于归档模式
SQL》 archive log list
16 RMAN对数据库进行全库备份
posted on 2017-04-11 17:48 gavanwanggw 阅读(122) 评论(0) 编辑 收藏 举报