转 http://jingyan.baidu.com/article/425e69e6b142d1be15fc16dc.html
- Microsoft Windows [版本 6.1.7600]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。C:\Users\Administrator>TNSPING
TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 19-8月 -
2017 11:52:53Copyright (c) 1997, 2005, Oracle. All rights reserved.
TNS-03502: 参数不足。用法: tnsping <address> [<count>]
C:\Users\Administrator>TNSPING HZXM
TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 19-8月 -
2017 11:53:07Copyright (c) 1997, 2005, Oracle. All rights reserved.
已使用的参数文件:
D:\oracle\10.2.0\db_1\network\admin\sqlnet.ora已使用 TNSNAMES 适配器来解析别名
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = 192.168.254.11)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SER
VICE_NAME = hzxm)))
OK (30 毫秒)C:\Users\Administrator>SET
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\Administrator\AppData\Roaming
CLASSPATH=.;C:\Program Files\Java\jdk1.6.0_43\lib\dt.jar;C:\Program Files\Java\j
dk1.6.0_43\lib\tools.jar;
CLIENTNAME=M490_2
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=DBSERVER2
ComSpec=C:\Windows\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Users\Administrator
JAVA_HOME=C:\Program Files\Java\jdk1.6.0_43
LOCALAPPDATA=C:\Users\Administrator\AppData\Local
LOGONSERVER=\\DBSERVER2
NUMBER_OF_PROCESSORS=32
ORACLE_HOME=D:\oracle\10.2.0\db_1
ORACLE_SID=HZXM
OS=Windows_NT
Path=D:\oracle\10.2.0\client_2\bin;D:\oracle\10.2.0\db_1\bin;C:\Program Files\Ja
va\jdk1.6.0_43\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Wi
ndows\System32\WindowsPowerShell\v1.0\
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PERL5LIB=D:\oracle\10.2.0\db_1\perl\5.8.3\lib\MSWin32-x86;D:\oracle\10.2.0\db_1\
perl\5.8.3\lib;D:\oracle\10.2.0\db_1\perl\5.8.3\lib\MSWin32-x86;D:\oracle\10.2.0
\db_1\perl\site\5.8.3;D:\oracle\10.2.0\db_1\perl\site\5.8.3\lib;D:\oracle\10.2.0
\db_1\sysman\admin\scripts;
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 63 Stepping 2, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=3f02
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC=C:\Users\Public
SESSIONNAME=RDP-Tcp#0
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\ADMINI~1\AppData\Local\Temp\2
TMP=C:\Users\ADMINI~1\AppData\Local\Temp\2
USERDOMAIN=DBSERVER2
USERNAME=Administrator
USERPROFILE=C:\Users\Administrator
windir=C:\WindowsC:\Users\Administrator>SQLPLUS /NOLOG
SQL*Plus: Release 10.2.0.1.0 - Production on 星期六 8月 19 11:53:56 2017
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> CONNECT / AS SYSDBA
已连接。
SQL> select * from v$flass_recovery_area_usage
2 ;
select * from v$flass_recovery_area_usage
*
第 1 行出现错误:
ORA-00942: 表或视图不存在SQL> select * from v$flash_recovery_area_usage;
FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
------------ ------------------ ------------------------- ---------------
CONTROLFILE 0 0 0
ONLINELOG 0 0 0
ARCHIVELOG 99.93 0 913
BACKUPPIECE 0 0 0
IMAGECOPY 0 0 0
FLASHBACKLOG 0 0 0已选择6行。
SQL> select sum(percent_space_used)*3/100 from v$flash_recovery_area_usage;
SUM(PERCENT_SPACE_USED)*3/100
-----------------------------
2.9979SQL> show parameter recover;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string D:\oracle\10.2.0\flash_recover
y_area
db_recovery_file_dest_size big integer 40G
recovery_parallelism integer 0
SQL> rman target sys/pass
SP2-0734: 未知的命令开头 "rman targe..." - 忽略了剩余的行。
SQL> rman target sys/pass/
SP2-0734: 未知的命令开头 "rman targe..." - 忽略了剩余的行。
SQL> rman target sys/pass;
SP2-0734: 未知的命令开头 "rman targe..." - 忽略了剩余的行。
SQL> rman
SP2-0042: 未知命令 "rman" - 其余行忽略。
SP2-0044: 要获取已知命令的列表, 请输入 HELP;
输入 EXIT 可退出。
SQL> RMAN;
SP2-0042: 未知命令 "RMAN" - 其余行忽略。
SQL> select * from v$flash_recovery_area_usage;FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
------------ ------------------ ------------------------- ---------------
CONTROLFILE 0 0 0
ONLINELOG 0 0 0
ARCHIVELOG .33 0 3
BACKUPPIECE 0 0 0
IMAGECOPY 0 0 0
FLASHBACKLOG 0 0 0已选择6行。
SQL>
- 删除无用的archivelog。进入rman,命令如下图:查看有多少无用的log文件,命令如下图:进行删除动作!
- 我的这个动作是连今天的log都会删除,要删什么时候的log还是要看系统自身。
- 删过期的log!一下的命令是删除过期的log,没有指定日期。
删除之后显示的占用空间只有0.33%,