oracle运维8条指令

1. 查看表空间的碎片(空闲块)个数,和最大的可用块
SQL> select tablespace_name,count(*) chunks,max(bytes/1024/1024) max_chunk
  2  from dba_free_space
  3  group by tablespace_name;

TABLESPACE_NAME                    CHUNKS  MAX_CHUNK
------------------------------ ---------- ----------
UNDOTBS1                                4         14
SYSAUX                                  5     1.9375
TBS_RMAN                                1     191.75
USERS                                   1       2.75
TEST                                    3     499.75
SYSTEM                                  2     1.9375
UNDOTBS2                               18     1.9375

2. 相邻碎片接合
alter tablespace test coalesce;

3. 查看连接进程状态
select sid,serial#,username,program,machine,statuse;

4. 杀死空连接
alter system kill session '124,96';

5. 手动备份控制文件
alter database backup controlfile to '/home/oracle/control.bak';

6. 检查数据文件的状态是否为可用的
SQL> select file_name,status from dba_data_files;

FILE_NAME
--------------------------------------------------------------------------------
STATUS
---------
+DATA/dbsid/datafile/users.259.847239411
AVAILABLE

7.sql语句重载率
SQL> select sum(pins) total_pins,sum(reloads) total_reloads,
  2  sum(reloads)/sum(pins)*100 libcache_reload_ratio
  3  from v$librarycache;

TOTAL_PINS TOTAL_RELOADS LIBCACHE_RELOAD_RATIO
---------- ------------- ---------------------
     62218            62            .099649619

8. 查看字符集
SQL> select userenv('lang') from dual;

USERENV('LANG')
----------------------------------------------------
ZHS

你可能感兴趣的:(sql语句重载率,杀死空连接,表空间碎片)