Oracle 基本操作

2021-08-08 14:25:50 字數 1042 閱讀 3923

1. sqlplus  system/密碼 。使用system超級使用者登入oracle

2.在system使用者下,alter user scott account unlock; 解鎖scott使用者

3.在system使用者下,alter user scott account identified by 密碼(tiger)     修改scott使用者密碼

4.alter user hr account unlock; 

解鎖 hr 使用者

5. alter user hr idendified by hr;       修改 hr 密碼

6.create user 使用者名稱identified by 密碼           建立使用者

7.在到system使用者下給新新增使用者新增session授權(才可以登入)  grant create session to 使用者名稱

8.然後在到system下給新新增使用者新增resource授權(可以操作,可以建立表)  grant resource to 使用者名稱

9.刪除使用者:(如果要刪除使用者,都必須在system/sys下)。如果使用者中帶有其他的表,那麼需要在system的使用者下通過級聯的方式刪除   drop user 使用者名稱 cascade;  。如果使用者中的表都在改使用者下被刪除了,那麼在system使用者下可以直接刪除該使用者  drop user 使用者名稱;

10. 建立表: create table stu(id int,name varchar(20));

11.插入資料:insert into 表名 values(所有列);   oracle 不支援insert 同時插入多行資料

12.更新資料:update 表名 set name ='zhangsan' where id=1;          

13.刪除資料:delete from stu where id = 1;

14.查詢資料:select * from stu;

15.oracle中:host cls 清屏

16.在使用者已登入時,不允許再用其他使用者登入,必須退出當前使用者,再登入其他使用者。或 conn 其他使用者。

Oracle基本操作

1.建立表空間 create tablespacetestdatafile c test.dbf size 10m 名字不要為數字 2.建立使用者 create user username identified by password 不要為數字 3.給使用者授權 grant dba to user...

Oracle 基本操作

在這裡詳述 oracle 基本操作。新增使用者 隨著使用者的建立,自動產生與使用者同名的schema create user tester profile default identified by tester default tablespace testdata temporary table...

oracle 基本操作

1 使用者登入 sqlplus 帳號 密碼 2 檢視當前登入使用者 show user 3 檢視所有的使用者 select username from all users 4 建立臨時表空間 create temporary tablespace test temp tempfile d oracl...