Linux環境Oracle相關操作命令行


 
 
打開Oracle監聽lsnrctl start          關閉監聽:   lsnrctl stop 監聽關閉那么客戶端無法連接
進入sqlplussqlplus /nolog 
使用sysdab角色登錄sqlplus conn /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     即可看到版本、主目錄等信息
 
 
 
 
 
 
 
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM