查看oracle 10g 视图
1、 查看数据库的名字和归档状态
sql> select name,log_mode from v$database;
name log_mode
——— ————
hb130000 archivelog
2、 查看数据库的instance名字和状态
sql> select instance_name,status from v$instance;
instance_name status
—————- ————
hb130000 open
3、查看表空间名称、状态和管理方式
sql> select tablespace_name,status,extent_management from dba_tablespaces;
tablespace_name status extent_man
—————————— ——— ———-
system online local
undotbs1 online local
sysaux online local
temp online local
users online local
gfb online local
yszx130000002004 online local
rman online local
8 rows selected.
4、查看控制文件的位置和名字
sql> select name from v$controlfile;
name
/oracle/app/oracle/orahome/dbs/hb130000/control01.ctl
/oradata/hb130000/control02.ctl
/oradata/hb130000/control03.ctl
5、查看日志文件的组名、成员数量、状态和大小
sql> select group#,members,bytes,status from v$log;
group# members bytes status
———- ———- ———- —————-
1 2 52428800 inactive
2 2 52428800 inactive
3 2 52428800 current
6、查看日志文件的位置
sql> select group#,member from v$logfile;
group#
———-
member
3
/oradata/hb130000/redo03.log
3
/oracle/app/oracle/orahome/dbs/hb130000/redo03.rdo
2
/oradata/hb130000/redo02.log
group#
———-
member
2
/oracle/app/oracle/orahome/dbs/hb130000/redo02.rdo
1
/oradata/hb130000/redo01.log
1
/oracle/app/oracle/orahome/dbs/hb130000/redo01.rdo
6 rows selected.
7、查看数据文件的位置和大小
sql> select name,bytes from v$datafile;
name
bytes
———-
/oradata/hb130000/system01.dbf
492830720
/oradata/hb130000/undotbs01.dbf
41943040
/oradata/hb130000/sysaux01.dbf
346030080
name
bytes
———-
/oradata/hb130000/users01.dbf
5242880
/oradata/hb130000/gfb.dbf
20971520
/oradata/hb130000/yszx130000002004.dbf
176160768
name
bytes
———-
/oradata/hb130000/rman.dbf
104857600
7 rows selected.
8、查看用户拥有的对象和类型
sql> select object_name,object_type from dba_objects where owner=scott;
object_name
object_type
——————————————————————————–
———————————————— ——————-
dept
table
pk_dept
index
emp
table
pk_emp
index
bonus
table
salgrade
table
6 rows selected.
9、查看临时文件的信息
sql> select name,bytes from v$tempfile;
name
bytes
———-
/oradata/hb130000/temp01.dbf
20971520
10、查看归档日志信息
sql> select name, first_change#,next_change# from v$archived_log;
name
——————————————————————————–
first_change# next_change#
————- ————
/oracle/app/oracle/orahome/dbs/archive/hb130000_1_53_532853380.dbf
1669178 1707392
/oracle/app/oracle/orahome/dbs/archive/hb130000_1_54_532853380.dbf
1707392 1734524
/oracle/app/oracle/orahome/dbs/archive/hb130000_1_55_532853380.dbf
1734524 1772848
name
——————————————————————————–
first_change# next_change#
————- ————
/oracle/app/oracle/orahome/dbs/archive/hb130000_1_56_532853380.dbf
1772848 1798092
/oracle/app/oracle/orahome/dbs/archive/hb130000_1_57_532853380.dbf
1798092 1831478
/oracle/app/oracle/orahome/dbs/archive/hb130000_1_58_532853380.dbf
1831478 1865033