oracle dba需要的基本命令

2021-08-31 15:13:06 字數 2022 閱讀 1601

oracle基礎總結

一、基礎知識

資料庫連線

sqlplus 使用者名稱/密碼 as sysdba;

sqlplus "/ as sysdba";

sqlplus /nolog;

後面兩個是忘記密碼的情況下登入資料庫

--connect / as sysdba;

一般使用者第一次連線可以更改密碼。

建立使用者

--create user 使用者名稱 identified by 密碼;

給使用者設定密碼

--alter user sys id identified by password;

--alter user system identified by password; 授權

--grant dba to scott;

--grant select on dba_users to scott;

--grant select,delete on scott emp to test;

**授權

--revoke select on dba_users from scott;

--revoke select,delete on scott emp from test;

--conn / as sysdba;

鎖定使用者

--alter user 使用者名稱account lock;

為使用者解鎖

--alter user 使用者名稱 account unlock;

強行關閉

--shutdown abort; 啟動

--startup;

檢視當前使用者

--show user;

檢視scott擁有那些表

(檢視當前連線使用者有那些表)

--select table_name from user_tables;

建立檢視

--create view emp_v as select * from emp;

--select * from emp_v;

設定環境變數

這個sqlplus環境是在系統初始化時載入的

glogin.sql

檔案,環境變數都儲存在這個文          

件中。 --

e:\oracle\product\10.1.0\db_1\sqlplus\admin目錄下

的glogin.sql文

件 開啟它 

在裡面加入: --

set linesize 100

--set pagesize 1000

--set long 20000

--set serveroutput on

授權與收回許可權測試

(授予出去的許可權可以全部收回)

create user cuug identified by cuug;

grant connect to cuug;

grant resource to cuug;

測試with grant option的含義(

意思是授權給別人)

connect / as sysdba

grant select on dba_tables to 

scott

with grant option;

connect scott/tiger

select count(*) from dba_tables;

grant select on dba_tables to cuug;

connect cuug/cuug

select count(*) from dba_tables;

connect / as sysdba

revoke select on dba_tables from scott;

connect scott/tiger

select count(*) from dba_tables;

connect cuug/cuug

select count(*) from dba_tables;

測試需要掌握docker的一些基本命令

作為測試,不僅僅會功能測試 自動化和效能測試,還有學會搭建環境 近期有測試小夥伴在看開始學習docker docker是什麼 你要知道 docker 可以讓開發者打包他們的應用以及依賴包到乙個輕量級 可移植的容器中,然後發布到任何流行的 linux 機器上,也可以實現虛擬化。web 應用的自動化打包...

mysql基本命令總結 mysql基本命令總結

1.在ubuntu上安裝mysql sudo apt get install mysql server sudo apt get install mysql client 2.安裝結束後,用命令驗證是否安裝並啟動成功 sudo netstat tap grep mysql 通過上述命令檢查之後,如果...

Gvim的基本命令

gvim的基本命令 編輯模式下 命令 說明 進入插入模式 i從游標所在位置前開始插入文字 i將游標移動到當前行行首,然後在其前插入文字 a用於在游標當前所在位置之後追加新文字 a將游標移動到所在行行尾,在那裡插入新文字 o在游標所在行的下面新開一行,並將游標置於行首,等待輸入文字 o在游標所在行的上...