欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

Oracle体系结构及备份(十八)bg-database

程序员文章站 2022-06-12 12:45:40
...

一 操作示例 SQL show parameter db_name;NAME TYPE VALUE------------------------------------ ----------- ------------------------------db_name string orclSQL select name from v$database;NAME---------ORCLSQL select instance_name from v$instan

一 操作示例

SQL> show parameter db_name;

NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
db_name 			     string	 orcl
SQL> select name from v$database;

NAME
---------
ORCL

SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
orcl

SQL> show parameter instance_name;

NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
instance_name			     string	 orcl
SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/oracle/oracle/product/10.2.0/oradata/orcl/system01.dbf
/oracle/oracle/product/10.2.0/oradata/orcl/undotbs01.dbf
/oracle/oracle/product/10.2.0/oradata/orcl/sysaux01.dbf
/oracle/oracle/product/10.2.0/oradata/orcl/users01.dbf
/oracle/oracle/product/10.2.0/oradata/orcl/example01.dbf

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/oracle/oracle/product/10.2.0/oradata/orcl/control01.ctl
/oracle/oracle/product/10.2.0/oradata/orcl/control02.ctl
/oracle/oracle/product/10.2.0/oradata/orcl/control03.ctl

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/oracle/oracle/product/10.2.0/oradata/orcl/redo03.log
/oracle/oracle/product/10.2.0/oradata/orcl/redo02.log
/oracle/oracle/product/10.2.0/oradata/orcl/redo01.log

SQL> desc v$archived_log;
 Name					   Null?    Type
 ----------------------------------------- -------- ----------------------------
 RECID						    NUMBER
 STAMP						    NUMBER
 NAME						    VARCHAR2(513)
 DEST_ID					    NUMBER
 THREAD#					    NUMBER
 SEQUENCE#					    NUMBER
 RESETLOGS_CHANGE#				    NUMBER
 RESETLOGS_TIME 				    DATE
 RESETLOGS_ID					    NUMBER
 FIRST_CHANGE#					    NUMBER
 FIRST_TIME					    DATE
 NEXT_CHANGE#					    NUMBER
 NEXT_TIME					    DATE
 BLOCKS 					    NUMBER
 BLOCK_SIZE					    NUMBER
 CREATOR					    VARCHAR2(7)
 REGISTRAR					    VARCHAR2(7)
 STANDBY_DEST					    VARCHAR2(3)
 ARCHIVED					    VARCHAR2(3)
 APPLIED					    VARCHAR2(3)
 DELETED					    VARCHAR2(3)
 STATUS 					    VARCHAR2(1)
 COMPLETION_TIME				    DATE
 DICTIONARY_BEGIN				    VARCHAR2(3)
 DICTIONARY_END 				    VARCHAR2(3)
 END_OF_REDO					    VARCHAR2(3)
 BACKUP_COUNT					    NUMBER
 ARCHIVAL_THREAD#				    NUMBER
 ACTIVATION#					    NUMBER
 IS_RECOVERY_DEST_FILE				    VARCHAR2(3)
 COMPRESSED					    VARCHAR2(3)
 FAL						    VARCHAR2(3)
 END_OF_REDO_TYPE				    VARCHAR2(10)


SQL> select name from v$archived_log;

NAME
--------------------------------------------------------------------------------
/oracle/oracle/product/10.2.0/db_1/flash_recovery_area/ORCL/archivelog/2013_06_0
6/o1_mf_1_19_8v0083nd_.arc


SQL> select value from v$spparamerer where name='spfile';
select value from v$spparamerer where name='spfile'
                  *
ERROR at line 1:
ORA-00942: table or view does not exist

ls /oracle/oracle//product/10.2.0/db_1/dbs/orapworcl/$ORACLE_SID

ls $ORACLE_BASE/admin/$ORACLE_SID/bdump/alert_$ORACLE_SID.log

ls $ORACLE_BASE/admin/ora10g


二 总结

库名的查找

show parameter db_name;

select name from v$database;

实例名

select instance_name from v$instance;

show parameter instance_name;

Oracle服务器:库名+访问名

数据文件

select name from v$datafile;

控制文件

select name from v$controlfile;

日志文件

select member from v$logfile;

归档日志

desc v$archived_log;

select name from v$archived_log;

参数文件

select value from v$spparamerer where name=’spfile’;

select value from v$paramerer where name=’spfile’;

密码文件

ho ls $ORACLE_HOME/dbs/orapw$ORACLE_SID

告警日志

ho ls$ORACLE_BASE/admin/$ORACLE_SID/bdump/alert_$ORACLE_SID.log

ho ls $ORACLE_BASE/admin/ora10g



我的邮箱wgbno27@163.com  新浪微博@Wentasy27
  微信公众平台:JustOracle(微信号:justoracle)
  数据库技术交流群:336882565(加群时验证 From CSDN XXX)
  Oracle交流讨论组:https://groups.google.com/d/forum/justoracle
  By Larry Wen


Oracle体系结构及备份(十八)bg-database Oracle体系结构及备份(十八)bg-databaseOracle体系结构及备份(十八)bg-database
@Wentasy