Windows啟動ServerDB Script

tolilong發表於2015-08-21
LocalDB.bat:
set PATH=E:\app\oracle\product\10.2.0\db_1\BIN;C:\Windows\System32;
set nls_lang=AMERICAN_AMERICA.UTF8;
sc start OracleOraDb10g_home1TNSListener
sc start OracleServiceBRUCE
ping localhost -n 15 >nul
lsnrctl status
sqlplus / as sysdba @e:\app\SelectDB.sql @e:\xxxxxx\plsql common use sql\sp



SelectDB.sql:
set pagesize 100
set linesize 160
--set timing on
col tablespace_name format a25
select x.tablespace_name,y.bytes/1024/1024 total_size_mb,x.bytes/1024/1024 free_size_mb,(y.bytes-x.bytes)/1024/1024 use_size_mb,round((y.bytes-x.bytes)/y.bytes,4)*100 usage
from
(select tablespace_name,sum(bytes) bytes from dba_free_space group by tablespace_name) x,
(select tablespace_name,sum(bytes) bytes from dba_data_files group by tablespace_name) y
where x.tablespace_name=y.tablespace_name
order by  5 desc;
select instance_name from v$instance;
select open_mode from v$database;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-1778535/,如需轉載,請註明出處,否則將追究法律責任。

相關文章