Linux环境Oracle相关操作命令行

 
 
打开Oracle监听lsnrctl start          关闭监听:   lsnrctl stop 监听关闭那么客户端无法连接
进入sqlplussqlplus /nolog 
使用sysdab角色登录sqlplusconn /as sysdba;
启动数据库startup;                       关闭数据库shutdown immediate;(只能sysdba进行关闭,应该是角色问题)    
 
连接eipdtp用户: conn eipdtp/eipdtp;   
 
授权 grant connect,resource to ***;
grant create any table to ***;
grant delete any table to ***;
grant update any table to ***;
grant select any table to ***;
 
查看表内容: select * from user_tables;
查看有哪些实例: select instance_name from v$instance; 
查看对应的用户: select username from dba_users;
创建用户: create user ts identified by ts;
 
获取表:
select table_name from user_tables; //当前用户的表      
 
select table_name from all_tables;    //所有用户的表  
 
select table_name from dba_tables; //包括系统表
 
select table_name from dba_tables where owner='用户名'
 
获取表字段:
select * from user_tab_columns where Table_Name='用户表' order by column_name;
 
获取表注释:
select * from user_tab_comments where Table_Name='用户表'order by Table_Name;
 
查看   $ORACLE_BASE和$ORACLE_HOME
进入用户主目录cd
执行   vi .bash_profile   查看
 
查看Oracle版本、主目录相关信息:
执行:echo $ORACLE_HOME
进入上述路径,cd  $ORACLE_HOME
进入目录后,进入OPatch目录,执行:   ./opatch lsinventory     即可看到版本、主目录等信息
 
 
 
 
 
 
 
 
posted on 2018-04-09 09:25  内心独白  阅读(11680)  评论(0编辑  收藏  举报