常用語句1【weber出品】

來源:互聯網
上載者:User

標籤:des   style   io   ar   sp   檔案   資料   on   log   

 

1.查看控制檔案位置:

 select * from v$controlfile

show parameter control;

2.查詢記錄檔位置  select group#,status,member from v$logfile;
3.查看資料區塊的大小 show parameter db_block_size
4.查看各個參數的內容

desc v$parameter

select name from v$parameter

5.更改資料表空間 alter user rman_user default tablespace rman_cata;
6.移動資料表空間的內容 alter table t move tablespace rman_cata;
7.讓檔案offline RMAN> sql ‘alter database datafile 5 offline’;
8.重新載入資料檔案 RMAN> restore datafile 5;
9.利用資料檔案進行恢複 RMAN> recover datafile 5;
10.刪除資料表空間 drop tablespace pioneer_indx including contents and datafile ;如果檔案被你刪了就不要加and datafiles
11.rman刪除備份組 delete backupset
12.rman刪除拷貝 delete copy
13.rman刪除歸檔日誌 delete archivelog all;
14.清除buffer——cache的緩衝 alter system flush buffer_cache
15.清楚shared-pool的緩衝 alter system flush shared_cache
16.臨時從SQL中進入作業系統 進入:SQL>!      退出:【[email protected]】:exit
17.增加一個檢查點 alter system  checkpoint
18.記錄檔從磁碟刪除後要告訴資料庫該檔案已經被刪除了 alter database clear logfile group 1;
19. 查詢某個資料表空間所在的資料檔案 select file_name from dba_data_files where tablespace_name=‘USERS‘;
20.處理壞快 blockrecover  datafile 5 block 1020
21.基於時間的恢複,首先開啟時間 set time on 
22.開啟資料庫並重設歸檔檔案序號 alter database open  resetlogs;
23.建立新的日誌組 alter database add logfile thread 2 group 4 (‘pamydb_logfile_4_2_a.log‘) size 100m;
24.添加新的日誌群組成員 alter database add logfile member ‘path‘ to goup 3;
25.切換日誌組 alter system switch logfile;
26.清理緩衝 alter system flush buffer cache
27.尋找當前串連會話 select distinct SID FROM V$MYSTAT;
28.分析 analyze table tablename compute statistics
29.ll查看檔案按照日期降序 ll -lrt
30.查詢資料表空間裡的資料檔案的位置  select file_name,tablespace_name from dba_data_files;
31.查看當前的scn select current_scn from v$database
32.從備份中恢複控制檔案 restore controlfile from autobackup

常用語句1【weber出品】

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.