Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3385940
  • 博文数量: 631
  • 博客积分: 10716
  • 博客等级: 上将
  • 技术积分: 8397
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-01 22:35
文章分类

全部博文(631)

文章存档

2020年(2)

2019年(22)

2018年(4)

2017年(37)

2016年(22)

2015年(1)

2013年(12)

2012年(20)

2011年(19)

2010年(20)

2009年(282)

2008年(190)

分类: Oracle

2012-01-20 12:27:03

[oracle@RAC2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jan 9 07:38:45 2012
Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select open_mode,log_mode from v$database;
OPEN_MODE  LOG_MODE
---------- ------------
READ WRITE ARCHIVELOG
SQL> desc dba_data_files;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 FILE_NAME                                          VARCHAR2(513)
 FILE_ID                                            NUMBER
 TABLESPACE_NAME                                    VARCHAR2(30)
 BYTES                                              NUMBER
 BLOCKS                                             NUMBER
 STATUS                                             VARCHAR2(9)
 RELATIVE_FNO                                       NUMBER
 AUTOEXTENSIBLE                                     VARCHAR2(3)
 MAXBYTES                                           NUMBER
 MAXBLOCKS                                          NUMBER
 INCREMENT_BY                                       NUMBER
 USER_BYTES                                         NUMBER
 USER_BLOCKS                                        NUMBER
 ONLINE_STATUS                                      VARCHAR2(7)
SQL> select tablespace_name,sum(bytes/1024/1024) MB from dba_data_files group by tablespace_name;
TABLESPACE_NAME                        MB
------------------------------ ----------
SYSAUX                                250
UNDOTBS1                              215
USERS                                   5
SYSTEM                                480
NBS                                   220
SQL> c/dba_data_files/dba_free_space/
  1* select tablespace_name,sum(bytes/1024/1024) MB from dba_free_space group by tablespace_name
SQL> l
  1* select tablespace_name,sum(bytes/1024/1024) MB from dba_free_space group by tablespace_name
SQL> /
TABLESPACE_NAME                        MB
------------------------------ ----------
UNDOTBS1                          101.375
SYSAUX                             12.375
USERS                              4.9375
SYSTEM                             5.5625
NBS                               219.875
SQL> !cd backup
SQL> !ls -l
total 300
-rw-r--r--  1 oracle oinstall     62 Jan  9  2011 afiedt.buf
drwxr-xr-x  2 oracle oinstall   4096 Jan  9 01:15 backup
drwxr-xr-x  2 oracle oinstall   4096 Oct 25  2009 Desktop
-rw-r--r--  1 oracle oinstall  49481 Jul 16 15:28 dict.lst
-rw-r--r--  1 root   root         46 Jan  9  2011 find
-rw-r--r--  1 oracle oinstall 132635 Jul 21 11:59 fixed_table.lst
-rw-r--r--  1 oracle oinstall    197 Aug 24 06:04 free.sql
-rw-r--r--  1 oracle oinstall  64709 Jul 16 15:45 log.lst
-rw-r--r--  1 oracle oinstall   3626 Jul 16 15:47 oracle_check.sh
-rwxr-xr-x  1 oracle oinstall   1324 Aug 20  2010 racdb2.ora
-rwxr-xr-x  1 oracle oinstall    470 Jan  6  2010 res.rcv
drwxr-xr-x  4 oracle oinstall   4096 Aug 13 05:09 SQL
-rw-r--r--  1 oracle oinstall    248 Jan  9  2011 while
SQL> !cd backup
[oracle@RAC2 backup]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jan 9 07:40:37 2012
Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> get tablespace_check
  1  select
  2  a.TABLESPACE_NAME,
  3  a.total,nvl(b.used,0) USED,
  4  nvl((b.used/a.total)*100,0) PCT_USED
  5  from
  6  (select TABLESPACE_NAME,
  7  sum(bytes)/(1024*1024) total
  8  from sys.dba_data_files
  9  group by TABLESPACE_NAME) a,
 10  (select TABLESPACE_NAME,bytes/(1024*1024) used
 11  from sys.SM$TS_USED) b
 12  where a.TABLESPACE_NAME=b.TABLESPACE_NAME(+);
 13  set linesize 300
 14  select f.tablespace_name,
 15  a.total,u.used,f.free,round((u.used/a.total)*100)"% used",round((f.free/a.total)*100) "% Free"
 16  from
 17  (select tablespace_name, sum(bytes/(1024*1024)) total from dba_data_files group by tablespace_name) a,
 18  (select tablespace_name, round(sum(bytes/(1024*1024))) used from dba_extents group by tablespace_name) u,
 19  (select tablespace_name, round(sum(bytes/(1024*1024))) free from dba_free_space group by tablespace_name) f
 20* WHERE a.tablespace_name = f.tablespace_name and a.tablespace_name = u.tablespace_name;
 21 
SQL> @tablespace_check
TABLESPACE_NAME                     TOTAL       USED   PCT_USED
------------------------------ ---------- ---------- ----------
SYSAUX                                250   237.5625     95.025
UNDOTBS1                              215   113.5625 52.8197674
SYSTEM                                480   474.4375 98.8411458
USERS                                   5          0          0
NBS                                   220          0          0

TABLESPACE_NAME                     TOTAL       USED       FREE     % used     % Free
------------------------------ ---------- ---------- ---------- ---------- ----------
UNDOTBS1                              215        114        101         53         47
SYSAUX                                250        238         12         95          5
SYSTEM                                480        474          6         99          1

TABLESPACE_NAME                     TOTAL       USED       FREE     % used     % Free
------------------------------ ---------- ---------- ---------- ---------- ----------
UNDOTBS1                              215        114        101         53         47
SYSAUX                                250        238         12         95          5
SYSTEM                                480        474          6         99         
 
[oracle@RAC2 SQL]$ more top_sql
select L.sid ssid,substr(OPNAME,1,15) opname,target,trunc((sofar/totalwork)*100) pct,
to_char(60*sofar*8192/(24*60*(last_update_time - start_time))/1024/1024/60,'9999.0')
Rate,
elapsed_seconds/60 es,
time_remaining/60 tr,PROGRAM,MACHINE
from v$session_longops L,v$session S
where time_remaining > 0 and L.SID=S.SID
order by start_time
/
[oracle@RAC2 SQL]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jan 9 07:45:31 2012
Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> get top_sql
SP2-0160: unable to open "top_sql.sql"
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@RAC2 SQL]$ ll
total 72
-rwxr-xr-x  1 oracle oinstall 1313 Jul 16 11:17 123.sql
drwxr-xr-x  2 oracle oinstall 4096 Jul 24 09:03 2011-07-25
-rw-r--r--  1 oracle oinstall 1842 Aug 13 05:01 2011-08-14ts.sql
-rw-r--r--  1 oracle oinstall 2494 Jul 16 11:27 CHECK_SQL.sql
-rwxr-xr-x  1 oracle oinstall  532 Aug  3 08:05 check_ts.sql
-rw-r--r--  1 oracle oinstall  137 Jul 16 11:26 CONSTRAINT.sql
-rw-r--r--  1 oracle oinstall  125 Mar 10  2011 create_tablespace.sql
-rw-r--r--  1 oracle oinstall  172 Mar 10  2011 create_temporary.sql
-rw-rw-r--  1 oracle oinstall  644 Feb 15  2011 get_rowid.sql
-rw-r--r--  1 oracle oinstall  272 Jul 16 11:26 lock.sql
drwxr-xr-x  2 oracle oinstall 4096 Jan  9  2011 sql
-rwxr-xr-x  1 oracle oinstall 1385 Dec 19  2010 sql_tunning.sql
-rw-r--r--  1 oracle oinstall  537 Aug  3 08:09 test.sql
-rw-r--r--  1 oracle oinstall  147 Feb  8  2011 top_disk_read.sql
-rw-r--r--  1 oracle oinstall  337 Jan  9  2011 top_sql
-rw-r--r--  1 oracle oinstall  913 Jul 17 08:59 ts.sql
-rw-r--r--  1 oracle oinstall  905 Aug 13 05:09 TS.sql
-rw-r--r--  1 oracle oinstall  299 Jul 24 09:10 undo.sql
[oracle@RAC2 SQL]$ mv top_sql top.sql
[oracle@RAC2 SQL]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jan 9 07:45:48 2012
Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> get top
  1  select L.sid ssid,substr(OPNAME,1,15) opname,target,trunc((sofar/totalwork)*100) pct,
  2  to_char(60*sofar*8192/(24*60*(last_update_time - start_time))/1024/1024/60,'9999.0')
  3  Rate,
  4  elapsed_seconds/60 es,
  5  time_remaining/60 tr,PROGRAM,MACHINE
  6  from v$session_longops L,v$session S
  7  where time_remaining > 0 and L.SID=S.SID
  8* order by start_time
SQL> @top
no rows selected
SQL> get undo
  1  SELECT (UR * UPS * DBS + DBS * 24) / 1024 / 1024 AS "undo size(M)"
  2  FROM (SELECT value AS UR FROM v$parameter WHERE name = 'undo_retention'),
  3  (SELECT max(undoblks / ((end_time - begin_time) * 24 * 3600)) AS UPS FROM v$undostat),
  4* (SELECT value AS DBS FROM v$parameter WHERE name = 'db_block_size')
SQL> start undo
undo size(M)
------------
   .24609375
SQL> get ts
  1  --REPORT=/tmp/ora_report
  2  -->$REPORT
  3  --su - oracle -c 'sqlplus / as sysdba'>>$REPORT<  4  --select sum(bytes)/(1024*1024) as free_space,tablespace_name
  5  --from dba_free_space
  6  --group by tablespace_name;
  7  --/
  8  --SELECT A.TABLESPACE_NAME,A.BYTES TOTAL,B.BYTES USED, C.BYTES FREE,
  9  --(B.BYTES*100)/A.BYTES "% USED",(C.BYTES*100)/A.BYTES "% FREE"
 10  --FROM SYS.SM$TS_AVAIL A,SYS.SM$TS_USED B,SYS.SM$TS_FREE C
 11  --WHERE A.TABLESPACE_NAME=B.TABLESPACE_NAME AND A.TABLESPACE_NAME=C.TABLESPACE_NAME;
 12  --/
 13  --select tablespace_name,count(*) chunks,max(bytes)/1024/1024 max_chunk, sum(bytes)/1024/1024 total_space from dba_free_space group by tablespace_name;
 14  --!
 15  SELECT A.TABLESPACE_NAME,A.BYTES TOTAL,B.BYTES USED, C.BYTES FREE,
 16  (B.BYTES*100)/A.BYTES "% USED",(C.BYTES*100)/A.BYTES "% FREE"
 17  FROM SYS.SM$TS_AVAIL A,SYS.SM$TS_USED B,SYS.SM$TS_FREE C
 18* WHERE A.TABLESPACE_NAME=B.TABLESPACE_NAME AND A.TABLESPACE_NAME=C.TABLESPACE_NAME;
SQL> @ts
TABLESPACE_NAME                     TOTAL       USED       FREE     % USED
------------------------------ ---------- ---------- ---------- ----------
    % FREE
----------
SYSAUX                          262144000  249102336   12976128     95.025
      4.95
UNDOTBS1                        225443840  119078912  106299392 52.8197674
47.1511628
SYSTEM                          503316480  497483776    5767168 98.8411458
1.14583333

SQL> get TS
  1  SELECT tablespace_name,max_m, sum_m  as "sum(M) " , sum_free as "sum_free(M) ",to_char(101*(sum_m-sum_free)/sum_m, '99.99') || '%' AS pct_used
  2  FROM ( SELECT tablespace_name,sum(bytes)/1024/1024 AS sum_m,sum(maxbytes)/1024/1024 max_m FROM dba_data_files GROUP BY tablespace_name),
  3  ( SELECT tablespace_name AS ts_name, sum(bytes/1024/1024) AS sum_free FROM dba_free_space GROUP BY tablespace_name )
  4  WHERE tablespace_name = ts_name (+)
  5  Union
  6  SELECT tablespace_name, max_m,sum_m  as "sum(M) " , sum_free as "sum_free(M) " , to_char(100*(sum_m-sum_free)/sum_m, '99.99') || '%' AS pct_used
  7  FROM (select tablespace_name, sum(bytes)/1024/1024 AS sum_m,sum(maxbytes)/1024/1024 max_m  from dba_temp_files group by tablespace_name),
  8  (select tablespace_name AS ts_name, sum(BYTES_FREE /1024/1024) AS sum_free from v$temp_space_header group by tablespace_name)
  9  Where tablespace_name = ts_name (+)
 10* order by pct_used
 11 
SQL> @TS
TABLESPACE_NAME                     MAX_M    sum(M)  sum_free(M)  PCT_USE
------------------------------ ---------- ---------- ------------ -------
NBS                            32767.9844        220      219.875    .06%
USERS                          32767.9844          5       4.9375   1.26%
TEMP                                 1024         64           57  10.94%
UNDOTBS1                       32767.9844        215      101.375  53.38%
SYSAUX                         32767.9844        250       12.375  96.00%
SYSTEM                         32767.9844        480          5.5  99.84%
6 rows selected.
SQL> get lock
  1  SELECT /*+ rule */ lpad(' ',decode(l.xidusn ,0,3,0))||l.oracle_username User_name,
  2  o.owner,o.object_name,o.object_type,s.sid,s.serial#
  3  FROM v$locked_object l,dba_objects o,v$session s
  4  WHERE l.object_id=o.object_id AND l.session_id=s.sid
  5* ORDER BY o.object_id,xidusn DESC;
  6 
SQL> @lock
no rows selected
SQL> get get_rowid
  1  create or replace function get_rowid
  2  (l_rowid in varchar2)
  3  return varchar2
  4  is
  5  ls_my_rowid  varchar2(200);
  6  rowid_type  number;
  7  object_number  number;
  8  relative_fno  number;
  9  block_number  number;
 10  row_number  number;
 11  begin
 12  dbms_rowid.rowid_info
 13  (l_rowid,rowid_type,object_number,relative_fno, block_number, row_number);
 14  ls_my_rowid := 'Object# is      :'||to_char(object_number)||chr(10)||
 15    'Relative_fno is :'||to_char(relative_fno)||chr(10)||
 16    'Block number is :'||to_char(block_number)||chr(10)||
 17    'Row number is   :'||to_char(row_number);
 18  return ls_my_rowid ;
 19* end;
 20 
 21 
 22 
 23  /
Function created.
SQL> start get_rowid
Function created.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@RAC2 SQL]$ ll
total 72
-rwxr-xr-x  1 oracle oinstall 1313 Jul 16 11:17 123.sql
drwxr-xr-x  2 oracle oinstall 4096 Jul 24 09:03 2011-07-25
-rw-r--r--  1 oracle oinstall 1842 Aug 13 05:01 2011-08-14ts.sql
-rw-r--r--  1 oracle oinstall 2494 Jul 16 11:27 CHECK_SQL.sql
-rwxr-xr-x  1 oracle oinstall  532 Aug  3 08:05 check_ts.sql
-rw-r--r--  1 oracle oinstall  137 Jul 16 11:26 CONSTRAINT.sql
-rw-r--r--  1 oracle oinstall  125 Mar 10  2011 create_tablespace.sql
-rw-r--r--  1 oracle oinstall  172 Mar 10  2011 create_temporary.sql
-rw-rw-r--  1 oracle oinstall  644 Feb 15  2011 get_rowid.sql
-rw-r--r--  1 oracle oinstall  272 Jul 16 11:26 lock.sql
drwxr-xr-x  2 oracle oinstall 4096 Jan  9  2011 sql
-rwxr-xr-x  1 oracle oinstall 1385 Dec 19  2010 sql_tunning.sql
-rw-r--r--  1 oracle oinstall  537 Aug  3 08:09 test.sql
-rw-r--r--  1 oracle oinstall  147 Feb  8  2011 top_disk_read.sql
-rw-r--r--  1 oracle oinstall  337 Jan  9  2011 top.sql
-rw-r--r--  1 oracle oinstall  913 Jul 17 08:59 ts.sql
-rw-r--r--  1 oracle oinstall  905 Aug 13 05:09 TS.sql
-rw-r--r--  1 oracle oinstall  299 Jul 24 09:10 undo.sql
[oracle@RAC2 SQL]$ more top_disk_read.sql
select * from
(select parsing_user_id,executions,sorts,
command_type,disk_reads,sql_text from v$sqlarea
order by disk_reads desc)where rownum<10
/
[oracle@RAC2 SQL]$ sqplus / as sysdba
-bash: sqplus: command not found
[oracle@RAC2 SQL]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jan 9 07:47:34 2012
Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> get top_disk_read
  1  select * from
  2  (select parsing_user_id,executions,sorts,
  3  command_type,disk_reads,sql_text from v$sqlarea
  4* order by disk_reads desc)where rownum<10
SQL> @top_disk_read
PARSING_USER_ID EXECUTIONS      SORTS COMMAND_TYPE DISK_READS
--------------- ---------- ---------- ------------ ----------
SQL_TEXT
--------------------------------------------------------------------------------
              0          2          2            3       8074
select f.tablespace_name, a.total,u.used,f.free,round((u.used/a.total)*100)"% us
ed",round((f.free/a.total)*100) "% Free" from (select tablespace_name, sum(bytes
/(1024*1024)) total from dba_data_files group by tablespace_name) a, (select tab
lespace_name, round(sum(bytes/(1024*1024))) used from dba_extents group by table
space_name) u, (select tablespace_name, round(sum(bytes/(1024*1024))) free from
dba_free_space group by tablespace_name) f WHERE a.tablespace_name = f.tablespac
e_name and a.tablespace_name = u.tablespace_name

PARSING_USER_ID EXECUTIONS      SORTS COMMAND_TYPE DISK_READS
--------------- ---------- ---------- ------------ ----------
SQL_TEXT
--------------------------------------------------------------------------------
             51          6          0           47        289
DECLARE job BINARY_INTEGER := :job; next_date DATE := :mydate;  broken BOOLEAN :
= FALSE; BEGIN EMD_MAINTENANCE.EXECUTE_EM_DBMS_JOB_PROCS(); :mydate := next_date
; IF broken THEN :b := 1; ELSE :b := 0; END IF; END;
              0        554        554            3        286
select /*+ rule */ bucket, endpoint, col#, epvalue from histgrm$ where obj#=:1 a
nd intcol#=:2 and row#=:3 order by bucket

PARSING_USER_ID EXECUTIONS      SORTS COMMAND_TYPE DISK_READS
--------------- ---------- ---------- ------------ ----------
SQL_TEXT
--------------------------------------------------------------------------------
              0         77          0            3        150
select /*+ index(idl_ub1$ i_idl_ub11) +*/ piece#,length,piece from idl_ub1$ wher
e obj#=:1 and part=:2 and version=:3 order by piece#
             51          7          0          170        130
CALL MGMT_ADMIN_DATA.EVALUATE_MGMT_METRICS(:tguid, :mguid, :result)
              0       2736          0            3        109
select /*+ rule */ bucket_cnt, row_cnt, cache_cnt, null_cnt, timestamp#, sample_
PARSING_USER_ID EXECUTIONS      SORTS COMMAND_TYPE DISK_READS
--------------- ---------- ---------- ------------ ----------
SQL_TEXT
--------------------------------------------------------------------------------
size, minimum, maximum, distcnt, lowval, hival, density, col#, spare1, spare2, a
vgcln from hist_head$ where obj#=:1 and intcol#=:2
              0        197        197            3        102
select owner#,name,namespace,remoteowner,linkname,p_timestamp,p_obj#, nvl(proper
ty,0),subname,d_attrs from dependency$ d, obj$ o where d_obj#=:1 and p_obj#=obj#
(+) order by order#
              0        197          0            3         91
PARSING_USER_ID EXECUTIONS      SORTS COMMAND_TYPE DISK_READS
--------------- ---------- ---------- ------------ ----------
SQL_TEXT
--------------------------------------------------------------------------------
select order#,columns,types from access$ where d_obj#=:1
              0         77          0            3         75
select /*+ index(idl_ub2$ i_idl_ub21) +*/ piece#,length,piece from idl_ub2$ wher
e obj#=:1 and part=:2 and version=:3 order by piece#

9 rows selected.
SQL> !ls -l
total 72
-rwxr-xr-x  1 oracle oinstall 1313 Jul 16 11:17 123.sql
drwxr-xr-x  2 oracle oinstall 4096 Jul 24 09:03 2011-07-25
-rw-r--r--  1 oracle oinstall 1842 Aug 13 05:01 2011-08-14ts.sql
-rw-r--r--  1 oracle oinstall 2494 Jul 16 11:27 CHECK_SQL.sql
-rwxr-xr-x  1 oracle oinstall  532 Aug  3 08:05 check_ts.sql
-rw-r--r--  1 oracle oinstall  137 Jul 16 11:26 CONSTRAINT.sql
-rw-r--r--  1 oracle oinstall  125 Mar 10  2011 create_tablespace.sql
-rw-r--r--  1 oracle oinstall  172 Mar 10  2011 create_temporary.sql
-rw-rw-r--  1 oracle oinstall  644 Feb 15  2011 get_rowid.sql
-rw-r--r--  1 oracle oinstall  272 Jul 16 11:26 lock.sql
drwxr-xr-x  2 oracle oinstall 4096 Jan  9  2011 sql
-rwxr-xr-x  1 oracle oinstall 1385 Dec 19  2010 sql_tunning.sql
-rw-r--r--  1 oracle oinstall  537 Aug  3 08:09 test.sql
-rw-r--r--  1 oracle oinstall  147 Feb  8  2011 top_disk_read.sql
-rw-r--r--  1 oracle oinstall  337 Jan  9  2011 top.sql
-rw-r--r--  1 oracle oinstall  913 Jul 17 08:59 ts.sql
-rw-r--r--  1 oracle oinstall  905 Aug 13 05:09 TS.sql
-rw-r--r--  1 oracle oinstall  299 Jul 24 09:10 undo.sql
SQL> get  2011-08-14ts
  1  set pagesize 66
  2  set linesize 90
  3  set verify off
  4  set feedback off
  5  set pause off
  6  set space 1
  7  break on TODAY
  8  column TODAY noprint new_value _DATE
  9  select to_char(SYSDATE, 'fmMonth DD, YYYY') TODAY
 10  from dual;
 11  clear breaks
 12  ttitle left _DATE right 'Page: ' format 99 SQL.PNO skip 1 -
 13  center 'ORACLE Tablespace Usage Report'
 14  col tb_name heading 'Tablespace|Name' format a15
 15  col tot heading 'Total|Size MB' format 999,999.99
 16  col used heading 'Used|Spc MB' format 999,999.99
 17  col free heading 'Free|Spc MB' format 999,999.99
 18  col max_free_extent heading 'Max Free|Extent MB' format 999,999.99
 19  col max_next_extent heading 'Max Next|Extent MB' format 999,999.99
 20  col pct heading 'Pct Free%' format 999
 21  break on report
 22  compute sum of tot on report
 23  compute sum of used on report
 24  compute sum of free on report
 25  select t.tablespace_name tb_name, d.tot_size/1024/1024 tot,
 26          (d.tot_size - f.free_size)/1024/1024 used,
 27          free_size/1024/1024 free,
 28          f.max_free_extent/1024/1024 max_free_extent,
 29          n.max_next_extent/1024/1024 max_next_extent,
 30          round(free_size/tot_size * 100,0) pct
 31     from dba_tablespaces t,
 32          (select tablespace_name, sum(bytes) tot_size from dba_data_files
 33            where status = 'AVAILABLE'
 34            group by tablespace_name) d,
 35          (select tablespace_name, sum(bytes) free_size, max(bytes) max_free_extent
 36      from dba_free_space
 37            group by tablespace_name ) f,
 38          (select tablespace_name, max(next_extent) max_next_extent  --assume pcs_increase=0
 39      from dba_segments
 40      group by tablespace_name ) n
 41    where t.tablespace_name = d.tablespace_name
 42      and d.tablespace_name = f.tablespace_name
 43      and f.tablespace_name = n.tablespace_name
 44      and status = 'ONLINE'
 45  -- and d.tablespace_name like upper('1%')
 46    order by 7,1
 47* /
 48 
SQL> @ 2011-08-14ts
 

January 9, 2012                                                                  Page:   1
                              ORACLE Tablespace Usage Report
Tablespace            Total        Used        Free    Max Free    Max Next
Name                Size MB      Spc MB      Spc MB   Extent MB   Extent MB Pct Free%
--------------- ----------- ----------- ----------- ----------- ----------- ---------
SYSTEM               480.00      474.50        5.50        4.94        1.00         1
SYSAUX               250.00      237.63       12.38        7.88                     5
UNDOTBS1             215.00      113.63      101.38       10.00         .06        47
                ----------- ----------- -----------
sum                  945.00      825.75      119.25
 
[oracle@RAC2 SQL]$ more CHECK_SQL.sql
--1check segment
select segment_name, tablespace_name,  extents  from dba_segments where owner not in ('SYS','SYSTEM') and extents >200;
   
--2check index
select index_name,owner,table_name,tablespace_name from dba_indexes where owner not in ('SYS','SYSTEM') and status != 'VALID';
--3check seqence
select sequence_owner,sequence_name,  min_value, max_value,increment_by, last_number, cache_size,cycle_flag  from dba_sequences;
select  job,this_date,this_sec,next_date, next_sec,failures,what from dba_jobs where failures !=0 or failures is not null;
-- 4check user
col default_tablespace form a25
col temporary_tablespace form a25
col username form a15
select username,default_tablespace, temporary_tablespace from dba_users;
--5check file autoextend
select file_name,autoextensible from dba_data_files  where autoextensible='YES';
--6check rollstat
select n.name,wraps,extends,shrinks,optsize,waits,xacts,aveactive,hwmsize  from v$rollstat r, v$rollname n where r.usn=n.usn;
--check CONSTRAINT
SELECT OWNER,CONSTRAINT_NAME,CONSTRAINT_TYPE,TABLE_NAME FROM DBA_CONSTRAINTS
WHERE owner not in ('SYS','SYSTEM')
and STATUS='DISABLED';

--7check sga
select *  from v$sga;
--8check tablespace
select sum(bytes)/(1024*1024) as free_space,tablespace_name
from dba_free_space
group by tablespace_name;
 
SELECT A.TABLESPACE_NAME,A.BYTES TOTAL,B.BYTES USED, C.BYTES FREE,
(B.BYTES*100)/A.BYTES "% USED",(C.BYTES*100)/A.BYTES "% FREE"
FROM SYS.SM$TS_AVAIL A,SYS.SM$TS_USED B,SYS.SM$TS_FREE C
WHERE A.TABLESPACE_NAME=B.TABLESPACE_NAME AND A.TABLESPACE_NAME=C.TABLESPACE_NAME;
/
select tablespace_name,count(*) chunks,max(bytes)/1024/1024 max_chunk, sum(bytes)/1024/1024 total_space from dba_free_space group by
 tablespace_name;

--9check object
select object_name,object_type, owner, status  from dba_objects  where status !='VALID' and owner not in ('SYS','SYSTEM') and object
_type in  ('TRIGGER','VIEW','PROCEDURE','FUNCTION');
--10check job

select  job,this_date,this_sec, next_date,next_sec,  failures,what from dba_jobs where failures !=0 or failures is not null;
SELECT OWNER,CONSTRAINT_NAME,CONSTRAINT_TYPE,TABLE_NAME FROM DBA_CONSTRAINTS
WHERE owner not in ('SYS','SYSTEM')
and STATUS='DISABLED';
SELECT /*+ rule */ lpad(' ',decode(l.xidusn ,0,3,0))||l.oracle_username User_name,
o.owner,o.object_name,o.object_type,s.sid,s.serial#
FROM v$locked_object l,dba_objects o,v$session s
WHERE l.object_id=o.object_id AND l.session_id=s.sid
ORDER BY o.object_id,xidusn DESC;
[oracle@RAC2 SQL]$     
[oracle@RAC2 SQL]$
[oracle@RAC2 SQL]$
[oracle@RAC2 SQL]$
[oracle@RAC2 SQL]$
[oracle@RAC2 SQL]$ ll
total 72
-rwxr-xr-x  1 oracle oinstall 1313 Jul 16 11:17 123.sql
drwxr-xr-x  2 oracle oinstall 4096 Jul 24 09:03 2011-07-25
-rw-r--r--  1 oracle oinstall 1842 Aug 13 05:01 2011-08-14ts.sql
-rw-r--r--  1 oracle oinstall 2494 Jul 16 11:27 CHECK_SQL.sql
-rwxr-xr-x  1 oracle oinstall  532 Aug  3 08:05 check_ts.sql
-rw-r--r--  1 oracle oinstall  137 Jul 16 11:26 CONSTRAINT.sql
-rw-r--r--  1 oracle oinstall  125 Mar 10  2011 create_tablespace.sql
-rw-r--r--  1 oracle oinstall  172 Mar 10  2011 create_temporary.sql
-rw-rw-r--  1 oracle oinstall  644 Feb 15  2011 get_rowid.sql
-rw-r--r--  1 oracle oinstall  272 Jul 16 11:26 lock.sql
drwxr-xr-x  2 oracle oinstall 4096 Jan  9  2011 sql
-rwxr-xr-x  1 oracle oinstall 1385 Dec 19  2010 sql_tunning.sql
-rw-r--r--  1 oracle oinstall  537 Aug  3 08:09 test.sql
-rw-r--r--  1 oracle oinstall  147 Feb  8  2011 top_disk_read.sql
-rw-r--r--  1 oracle oinstall  337 Jan  9  2011 top.sql
-rw-r--r--  1 oracle oinstall  913 Jul 17 08:59 ts.sql
-rw-r--r--  1 oracle oinstall  905 Aug 13 05:09 TS.sql
-rw-r--r--  1 oracle oinstall  299 Jul 24 09:10 undo.sql
[oracle@RAC2 SQL]$ cd sql
[oracle@RAC2 sql]$ ll
total 20
-rwxr-xr-x  1 oracle oinstall  742 Aug 24  2010 create_controlfile.sql
-rwxr-xr-x  1 oracle oinstall  703 Aug 28  2010 dbinfo.sql
-rw-r--r--  1 oracle oinstall 2259 Aug 28  2010 top.sql
-rw-r--r--  1 oracle oinstall  386 Aug 28  2010 ts.sql
-rwxr-xr-x  1 oracle oinstall 3609 Aug 28  2010 tuning.sql
[oracle@RAC2 sql]$
[oracle@RAC2 sql]$
[oracle@RAC2 sql]$ more dbinfo.sql
SET PAGESIZE 1000
SET LINESIZE 100
SET FEEDBACK OFF
SELECT *
FROM   v$database;
SELECT *
FROM   v$instance;
SELECT *
FROM   v$version;
SELECT a.name,
       a.value
FROM   v$sga a;
SELECT Substr(c.name,1,60) "Controlfile",
       NVL(c.status,'UNKNOWN') "Status"
FROM   v$controlfile c
ORDER BY 1;
SELECT Substr(d.name,1,60) "Datafile",
       NVL(d.status,'UNKNOWN') "Status",
       d.enabled "Enabled",
       LPad(To_Char(Round(d.bytes/1024000,2),'9999990.00'),10,' ') "Size (M)"
FROM   v$datafile d
ORDER BY 1;
SELECT l.group# "Group",
       Substr(l.member,1,60) "Logfile",
       NVL(l.status,'UNKNOWN') "Status"
FROM   v$logfile l
ORDER BY 1,2;
PROMPT
set feedback on
set pagesize 200
[oracle@RAC2 sql]$ 
[oracle@RAC2 sql]$
[oracle@RAC2 sql]$
[oracle@RAC2 sql]$
[oracle@RAC2 sql]$ ll
total 20
-rwxr-xr-x  1 oracle oinstall  742 Aug 24  2010 create_controlfile.sql
-rwxr-xr-x  1 oracle oinstall  703 Aug 28  2010 dbinfo.sql
-rw-r--r--  1 oracle oinstall 2259 Aug 28  2010 top.sql
-rw-r--r--  1 oracle oinstall  386 Aug 28  2010 ts.sql
-rwxr-xr-x  1 oracle oinstall 3609 Aug 28  2010 tuning.sql
[oracle@RAC2 sql]$
[oracle@RAC2 sql]$
[oracle@RAC2 sql]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jan 9 07:48:55 2012
Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> get dbinfo
  1  SET PAGESIZE 1000
  2  SET LINESIZE 100
  3  SET FEEDBACK OFF
  4  SELECT *
  5  FROM   v$database;
  6  SELECT *
  7  FROM   v$instance;
  8  SELECT *
  9  FROM   v$version;
 10  SELECT a.name,
 11         a.value
 12  FROM   v$sga a;
 13  SELECT Substr(c.name,1,60) "Controlfile",
 14         NVL(c.status,'UNKNOWN') "Status"
 15  FROM   v$controlfile c
 16  ORDER BY 1;
 17  SELECT Substr(d.name,1,60) "Datafile",
 18         NVL(d.status,'UNKNOWN') "Status",
 19         d.enabled "Enabled",
 20         LPad(To_Char(Round(d.bytes/1024000,2),'9999990.00'),10,' ') "Size (M)"
 21  FROM   v$datafile d
 22  ORDER BY 1;
 23  SELECT l.group# "Group",
 24         Substr(l.member,1,60) "Logfile",
 25         NVL(l.status,'UNKNOWN') "Status"
 26  FROM   v$logfile l
 27  ORDER BY 1,2;
 28  PROMPT
 29  set feedback on
 30* set pagesize 200
 31 
SQL> @dbinfo
      DBID NAME      CREATED   RESETLOGS_CHANGE# RESETLOGS PRIOR_RESETLOGS_CHANGE# PRIOR_RES
---------- --------- --------- ----------------- --------- ----------------------- ---------
LOG_MODE     CHECKPOINT_CHANGE# ARCHIVE_CHANGE# CONTROL CONTROLFI CONTROLFILE_SEQUENCE#
------------ ------------------ --------------- ------- --------- ---------------------
CONTROLFILE_CHANGE# CONTROLFI OPEN_RESETL VERSION_T OPEN_MODE  PROTECTION_MODE
------------------- --------- ----------- --------- ---------- --------------------
PROTECTION_LEVEL     REMOTE_A ACTIVATION# SWITCHOVER# DATABASE_ROLE    ARCHIVELOG_CHANGE# ARCHIVEL
-------------------- -------- ----------- ----------- ---------------- ------------------ --------
SWITCHOVER_STATUS    DATAGUAR GUARD_S SUPPLEME SUP SUP FOR PLATFORM_ID
-------------------- -------- ------- -------- --- --- --- -----------
PLATFORM_NAME
----------------------------------------------------------------------------------------------------
RECOVERY_TARGET_INCARNATION# LAST_OPEN_INCARNATION# CURRENT_SCN FLASHBACK_ON       SUP SUP
---------------------------- ---------------------- ----------- ------------------ --- ---
DB_UNIQUE_NAME                 STANDBY_BECAME_PRIMARY_SCN FS_FAILOVER_STATUS
------------------------------ -------------------------- ---------------------
FS_FAILOVER_CURRENT_TARGET     FS_FAILOVER_THRESHOLD FS_FAIL
------------------------------ --------------------- -------
FS_FAILOVER_OBSERVER_HOST
----------------------------------------------------------------------------------------------------
4241907545 RACDB1    24-AUG-10            750711 11-APR-11                       1 17-JAN-10
ARCHIVELOG               935206          806571 CURRENT 24-AUG-10                  3115
             943839 09-JAN-12 NOT ALLOWED 24-AUG-10 READ WRITE MAXIMUM PERFORMANCE
MAXIMUM PERFORMANCE  ENABLED   4281600053  4281600053 PRIMARY                      901063 DISABLED
SESSIONS ACTIVE      DISABLED NONE    NO       NO  NO  YES          10
Linux IA (32-bit)
                           2                      2      943919 NO                 NO  NO
racdb2                                                  0 DISABLED
                                                   0
 
INSTANCE_NUMBER INSTANCE_NAME    HOST_NAME
--------------- ---------------- ----------------------------------------------------------------
VERSION           STARTUP_T STATUS       PAR    THREAD# ARCHIVE LOG_SWITCH_WAIT LOGINS     SHU
----------------- --------- ------------ --- ---------- ------- --------------- ---------- ---
DATABASE_STATUS   INSTANCE_ROLE      ACTIVE_ST BLO
----------------- ------------------ --------- ---
              1 racdb2           RAC2
10.2.0.1.0        09-JAN-12 OPEN         NO           1 STARTED                 ALLOWED    NO
ACTIVE            PRIMARY_INSTANCE   NORMAL    NO

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE    10.2.0.1.0      Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
NAME                      VALUE
-------------------- ----------
Fixed Size              1218316
Variable Size          62916852
Database Buffers      100663296
Redo Buffers            2973696
Controlfile
----------------------------------------------------------------------------------------------------
Status
-------
/opt/oracle/stage/std.ctl
UNKNOWN
/opt/oracle/stage/std1.ctl
UNKNOWN

Datafile
----------------------------------------------------------------------------------------------------
Status  Enabled    Size (M)
------- ---------- --------------------
/opt/oracle/oradata/datafile/nbs.dbf
ONLINE  READ WRITE      204.8
/opt/oracle/oradata/datafile/nbs1.dbf
ONLINE  READ WRITE       20.4
/opt/oracle/oradata/datafile/sysaux.dbf
ONLINE  READ WRITE      256.0
/opt/oracle/oradata/datafile/system.dbf
SYSTEM  READ WRITE      491.5
/opt/oracle/oradata/datafile/undotbs1.dbf
ONLINE  READ WRITE      220.1
/opt/oracle/oradata/datafile/users.dbf
ONLINE  READ WRITE        5.1

     Group
----------
Logfile
----------------------------------------------------------------------------------------------------
Status
-------
         2
/opt/oracle/oradata/group_2.260.708527535
STALE
         2
/opt/oracle/oradata/group_2.261.708527539
STALE
         3
/opt/oracle/oradata/group_3.262.708527543
STALE
         3
/opt/oracle/oradata/group_3.263.708527547
STALE
         4
/opt/oracle/oradata/group4_log4
UNKNOWN
         4
/opt/oracle/oradata/group4_log5
UNKNOWN

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@RAC2 sql]$
[oracle@RAC2 sql]$
[oracle@RAC2 sql]$ exit
logout
[root@RAC2 ~]# ll
total 36
-rw-r--r--  1 root   root     2403 Sep 19 05:54 aix_check.sh
-rw-r--r--  1 root   root     1833 Sep 19 05:40 aix.sh
-rwxr-xr-x  1 oracle oinstall 1438 Oct 23  2009 anaconda-ks.cfg
-rwxr-xr-x  1 root   root      712 Sep 19  2010 clean.sh
drwxr-xr-x  2 oracle oinstall 4096 Oct 23  2009 Desktop
-rw-r--r--  1 root   root        0 Jun 21  2011 file
-rwxr-xr-x  1 root   root       67 Sep 19  2010 startORA.sh
-rwxr-xr-x  1 root   root       99 Feb  8  2011 stopORA.sh
-rw-r--r--  1 root   root       80 Sep 19 03:02 test.sh
[root@RAC2 ~]# netstat -ni
Kernel Interface table
Iface       MTU Met    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0       1500   0     3111      0      0      0     2658      0      0      0 BMRU
eth1       1500   0       35      0      0      0       12      0      0      0 BMRU
lo        16436   0     3629      0      0      0     3629      0      0      0 LRU
[root@RAC2 ~]# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:0C:29:E5:DA:6C 
          inet addr:192.168.1.101  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fee5:da6c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3150 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2689 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:261151 (255.0 KiB)  TX bytes:308933 (301.6 KiB)
          Interrupt:185 Base address:0x1480
eth1      Link encap:Ethernet  HWaddr 00:0C:29:E5:DA:76 
          inet addr:192.168.2.101  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fee5:da76/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:35 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3324 (3.2 KiB)  TX bytes:672 (672.0 b)
          Interrupt:193 Base address:0x1800
lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:3629 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3629 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4507318 (4.2 MiB)  TX bytes:4507318 (4.2 MiB)
sit0      Link encap:IPv6-in-IPv4 
          NOARP  MTU:1480  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
[root@RAC2 ~]# fdisk -l
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        1305    10377990   8e  Linux LVM
Disk /dev/sdb: 107 MB, 107374080 bytes
64 heads, 32 sectors/track, 102 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         102      104432   83  Linux
Disk /dev/sdc: 107 MB, 107374080 bytes
64 heads, 32 sectors/track, 102 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1         102      104432   83  Linux
Disk /dev/sdd: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1         261     2096451   83  Linux
Disk /dev/sde: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1         261     2096451   83  Linux
[root@RAC2 ~]# lvdisplay
  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol00
  VG Name                VolGroup00
  LV UUID                iJV2yk-MMDp-dqa3-MqqG-iFH0-el19-w61HCV
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                8.84 GB
  Current LE             283
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:0
  
  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol01
  VG Name                VolGroup00
  LV UUID                ngpFmM-BUBv-oOu3-pJ1h-X122-4L0v-1NskOo
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                1.00 GB
  Current LE             32
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:1
  
[root@RAC2 ~]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               VolGroup00
  PV Size               9.88 GB / not usable 0  
  Allocatable           yes
  PE Size (KByte)       32768
  Total PE              316
  Free PE               1
  Allocated PE          315
  PV UUID               WtdL07-JdYn-u2Ir-y1rE-j4v7-RiWF-6Fgxd5
  
[root@RAC2 ~]# vgdisplay
  --- Volume group ---
  VG Name               VolGroup00
  System ID            
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               9.88 GB
  PE Size               32.00 MB
  Total PE              316
  Alloc PE / Size       315 / 9.84 GB
  Free  PE / Size       1 / 32.00 MB
  VG UUID               59FsXH-Xsdh-n7Rf-AoRr-cRcq-uiQd-J4o1Vl
  
[root@RAC2 ~]# vgs
  VG         #PV #LV #SN Attr   VSize VFree
  VolGroup00   1   2   0 wz--n- 9.88G 32.00M
[root@RAC2 ~]# pvs
  PV         VG         Fmt  Attr PSize PFree
  /dev/sda2  VolGroup00 lvm2 a-   9.88G 32.00M
[root@RAC2 ~]# lvs
  LV       VG         Attr   LSize Origin Snap%  Move Log Copy%
  LogVol00 VolGroup00 -wi-ao 8.84G                             
  LogVol01 VolGroup00 -wi-ao 1.00G                             
[root@RAC2 ~]# last reboot
reboot   system boot  2.6.9-42.ELsmp   Mon Jan  9 07:34          (00:15)   
reboot   system boot  2.6.9-42.ELsmp   Mon Jan  9 01:07          (00:27)   
reboot   system boot  2.6.9-42.ELsmp   Thu Jan  5 00:39          (00:38)   
reboot   system boot  2.6.9-42.ELsmp   Fri Dec 16 09:30         (19+15:47) 
wtmp begins Mon Sep 19 05:27:37 2011
[root@RAC2 ~]# who
root     pts/1        Jan  9 07:38 (192.168.1.254)
[root@RAC2 ~]# service vsftpd status
vsftpd is stopped
[root@RAC2 ~]# service vsftpd start
Starting vsftpd for vsftpd: [  OK  ]
[root@RAC2 ~]# more /etc/
Display all 246 possibilities? (y or n)
[root@RAC2 ~]# more /etc/
*** /etc/: directory ***
[root@RAC2 ~]# more /etc/vsftpd
vsftpd/           vsftpd.ftpusers   vsftpd.user_list 
[root@RAC2 ~]# more /etc/vsftpd
vsftpd/           vsftpd.ftpusers   vsftpd.user_list 
[root@RAC2 ~]# more /etc/vsftpd.ftpusers
# Users that are not allowed to login via ftp
#root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
[root@RAC2 ~]# ftp localhost
Connected to localhost.
220 (vsFTPd 2.0.1)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (localhost:root):
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
ftp>
ftp> ls -l
227 Entering Passive Mode (127,0,0,1,25,142)
150 Here comes the directory listing.
drwxr-xr-x    2 500      502          4096 Oct 23  2009 Desktop
-rw-r--r--    1 0        0            1833 Sep 18 21:40 aix.sh
-rw-r--r--    1 0        0            2403 Sep 18 21:54 aix_check.sh
-rwxr-xr-x    1 500      502          1438 Oct 23  2009 anaconda-ks.cfg
-rwxr-xr-x    1 0        0             712 Sep 19  2010 clean.sh
-rw-r--r--    1 0        0               0 Jun 20  2011 file
-rwxr-xr-x    1 0        0              67 Sep 19  2010 startORA.sh
-rwxr-xr-x    1 0        0              99 Feb 08  2011 stopORA.sh
-rw-r--r--    1 0        0              80 Sep 18 19:02 test.sh
226 Directory send OK.
ftp> quit
221 Goodbye.
[root@RAC2 ~]#
[root@RAC2 ~]#
[root@RAC2 ~]#
[root@RAC2 ~]#
[root@RAC2 ~]# pwd
/root
[root@RAC2 ~]# ll
total 36
-rw-r--r--  1 root   root     2403 Sep 19 05:54 aix_check.sh
-rw-r--r--  1 root   root     1833 Sep 19 05:40 aix.sh
-rwxr-xr-x  1 oracle oinstall 1438 Oct 23  2009 anaconda-ks.cfg
-rwxr-xr-x  1 root   root      712 Sep 19  2010 clean.sh
drwxr-xr-x  2 oracle oinstall 4096 Oct 23  2009 Desktop
-rw-r--r--  1 root   root        0 Jun 21  2011 file
-rwxr-xr-x  1 root   root       67 Sep 19  2010 startORA.sh
-rwxr-xr-x  1 root   root       99 Feb  8  2011 stopORA.sh
-rw-r--r--  1 root   root       80 Sep 19 03:02 test.sh
[root@RAC2 ~]# sh stopORA.sh
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jan 9 07:50:23 2012
Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Broadcast message from root (pts/1) (Mon Jan  9 07:50:50 2012):
The system is going down for system halt NOW!
阅读(3945) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~