//登录数据库
sqlplus / as sysdba
1
//切换到scott数据库
conn scott / tiger
1
//查看所有数据文件位置
select name from v$datafile;
1
//查看所有控制文件位置
select name from v$controlfile;
1
//查看所有日志文件位置
select member from v$logfile;
1
//查看Oracle版本
select * from v$version;
1
//查看是否开启归档
select name , log_mode from v$database;
1
//登录到rman工具
rman target/
1
//查看Oracle的ID名称
select instance_name from v$instance;
1
//查看当前scn(系统修订编号)
select current_scn from database;
1
//查看数据文件scn
select checkpoint_change from v$datafile_header;
1
//查看控制文件csn
select checkpoint_change# from v$datafile;
1
//手动切换日志
alter system switch logfile;
1
//手动生成检查点
akter system checkpinot;
捕捉运行很久的SQL
column username format a12
column opname format a16
column progress format a8
select username,sid,opname,
round(sofar*100 / totalwork,0) || '%' as progress,
time_remaining,sql_text
from v$session_longops , v$sql
where time_remaining <> 0
and sql_address = address
and sql_hash_value = hash_value
/