Oracle入侵常用操作命令整理_oracle

來源:互聯網
上載者:User
1、su – oracle 不是必需,適合於沒有DBA密碼時使用,可以不用密碼來進入sqlplus介面。 

2、sqlplus /nolog 或sqlplus system/manager 或./sqlplus system/manager@ora9i; 

3、SQL>connect / as sysdba ;(as sysoper)或 

connect internal/oracle AS SYSDBA ;(scott/tiger) 

conn sys/change_on_install as sysdba; 

4、SQL>startup; 啟動資料庫執行個體 

5、查看當前的所有資料庫: select * from v$database; 

select name from v$database; 

6、desc v$databases; 查看資料庫結構欄位 

7、怎樣查看哪些使用者擁有SYSDBA、SYSOPER許可權: 

SQL>select * from V_$PWFILE_USERS; 

Show user;查看當前資料庫連接使用者 

8、進入test資料庫:database test; 

9、查看所有的資料庫執行個體:select * from v$instance; 

如:ora9i 

10、查看當前庫的所有資料表: 

SQL> select TABLE_NAME from all_tables; 

select * from all_tables; 

SQL> select table_name from all_tables where table_name like '%u%'; 

TABLE_NAME 

------------------------------ 

_default_auditing_options_ 

11、查看錶結構:desc all_tables; 

12、顯示CQI.T_BBS_XUSER的所有欄位結構: 

desc CQI.T_BBS_XUSER; 

13、獲得CQI.T_BBS_XUSER表中的記錄: 

select * from CQI.T_BBS_XUSER; 

14、增加資料庫使用者:(test11/test) 

create user test11 identified by test default tablespace users Temporary TABLESPACE Temp; 

15、使用者授權: 

grant connect,resource,dba to test11; 

grant sysdba to test11; 

commit; 

16、更改資料庫使用者的密碼:(將sys與system的密碼改為test.) 

alter user sys indentified by test; 

alter user system indentified by test;

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.