linux 學習——linux下的oracle基本操作(二)

Linux SQL DBA 鏡音雙子 馬上碼 2017-05-12

馬上碼特色~先來點詩句:

人生若只如初見,何事秋風悲畫扇。 —— 納蘭性德《木蘭詞·擬古決絕詞柬友》

曾經滄海難為水,除卻巫山不是雲。 —— 元稹《離思五首·其四》

linux 學習——linux下的oracle基本操作(二)

1、創建用戶

create user t_sms

identified by sms

default tablespace sms_data;

grant dba,connect,resource to t_sms;

2、查看當前用戶

Sql> show user;

3、---刪除用戶

--drop user t_sms cascade;

4、查看當前用戶的缺省表空間

SQL>select username,default_tablespace from user_users;

5、查詢表空間存放的位置

SQL> select ddf.file_name from Dba_Data_Files ddf where ddf.tablespace_name = 'TEST01'

6、查詢表空間存放的位置

SQL> select name from v$datafile;

linux 學習——linux下的oracle基本操作(二)

7、---刪除論壇空間

--drop tablespace forum including contents and datafiles;

8、創建表空間

create tablespace sms_data

datafile 'd:/Oracle_GuiZhou_DB_tablespace/sms_data.dbf' size 80m

autoextend on next 10m maxsize 300m;

9、查詢當前數據庫版本號

select * from v$version;

10、查看當前字符集

SQL> select * from nls_database_parameters where parameter like '%SET%';

<更多內容請關注 馬上碼百家號/ 馬上碼頭條號 >

11、如何查出某張表中,某個字段長度的最大值和最小值,值是多少select max(len),min(len) from (select length(colname) as len from yourtable)

用length查出來的是字符數,lengthb查出來的是字節數。

length('我')為1

lengthb('我')為2

length('abc')和lengthb('abc')都為3

12、windows 下面的導出/導入

1>exp user/password @orcl file=d:\200909dump.dmp log=d:\200909log.log owner=maria_usp

2>imp user/password @orcl file=d:\200909dump.dmp fromuser=maria_usp touser=maria log=d:\20091209imptab.log

linux 學習——linux下的oracle基本操作(二)

linux 學習——linux下的oracle基本操作(一)

linux 學習——Shell命令組合(二)之 相得益彰

相關推薦

推薦中...