oracle常用命令收集

2021-08-30 03:49:53 字數 1675 閱讀 8421

//建立表空間

create tablespace tx_db

logging

datafile 'f:\oracle\product\10.2.0\oradata\txdb\tx_db.dbf' size 1024m

autoextend on

next 32m maxsize 2048m

extent management local;

//建立臨時表空間

create temporary tablespace tx_dbtemp

tempfile 'f:\oracle\product\10.2.0\oradata\txdb\tx_dbtemp.dbf' size 1024m

autoextend on

next 32m maxsize 2048m

extent management local;

//建立使用者並賦予相關許可權(有dba許可權),並預設相關表空間

create user txdb identified by txdb;

grant create session to tx_db;

grant connect,resource,dba to txdb;

default tablespace tx_db

temporary tablespace tx_dbtemp;

//建立使用者並賦予相關許可權(有sysdba許可權)

create user njtxdb identified by njtxdb;

grant connect,resource,dba,sysdba to njtxdb;

//匯出資料

exp txdb/txdb@orcl full=y file=d:\txdb.dmp ignore=y

//匯入相關資料庫

imp txdb/txdb@orcl full=y file=d:\txdb.dmp ignore=y

// 提交已有操作

commit;

//刪使用者

drop user txdb cascade

//刪除表空間

drop tablespace txdb_db

//賦予使用者相關許可權

grant create session to 使用者名稱;

grant create table to 使用者名稱;

grant create view to 使用者名稱;

//查詢當前預設表空間中的使用者

select username,default_tablespace from dba_users;

//預設使用者使用的表空間

alter user txdb default tablespace zcb_db;

// 忘記sys、system密碼,重新設定

su - oracle

sqlplus /nolog

conn / as sysdba

startup (如果資料庫不是處於啟動狀態則啟動)

alter user sys identified by 123456

然後就可以使用sys使用者密碼登陸了

// 使用者解鎖

su - oracle

sqlplus /nolog

conn / as sysdba

alter user system account unlock;

Linux常用命令收集

1.linux系統用命令刪除資料夾?rm rf dir note dir 資料夾路徑 2.linux 返回根目錄命令?cd 3.複製資料夾命令 cp r usr xu usr liu note usr xu 檔案或資料夾的路徑 usr liu 複製路徑 參考 linux複製檔案 資料夾命令 其它 1...

linux常用命令收集

1.啟動命令相關 shutdown h now 立刻關機 shutdown r now 立刻重啟 2.vim命令 進入編輯模式 a 在游標所在字元後插入 a 在游標所在行尾插入 i 在游標所在字元前插入 i 在游標所在行行首插入 o 在游標下插入新行 o 在游標上插入新行 行號相關 set nu 設...

Git常用命令收集

git clone將所有檔案新增到版本控制中 git add 本地執行提交操作 git commit m 提交說明 同步到遠端版本庫,也就是github git push origin master在github上刪除某個目錄或檔案,但是保留本地的,以刪除.idea資料夾為例 git rm r ca...