Chinaunix首页 | 论坛 | 博客
  • 博客访问: 422141
  • 博文数量: 119
  • 博客积分: 5221
  • 博客等级: 大校
  • 技术积分: 972
  • 用 户 组: 普通用户
  • 注册时间: 2008-01-04 08:57
文章分类

全部博文(119)

文章存档

2011年(13)

2010年(21)

2009年(19)

2008年(66)

我的朋友

分类: Oracle

2010-10-20 17:39:29

-bash-3.00$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.1.0 Production on 星期三 10月 20 16:39:27 2010

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


连接到: 
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> 
SQL> 
SQL> Select version FROM Product_component_version 
  2  Where SUBSTR(PRODUCT,1,6)='Oracle';
Select version FROM Product_component_version
                    *
第 1 行出现错误:
ORA-01219: 数据库未打开: 仅允许在固定表/视图中查询


SQL> select status from v$instance;

STATUS
------------
MOUNTED

SQL> alter database open;
alter database open
*
第 1 行出现错误:
ORA-01589: 要打开数据库则必须使用 RESETLOGS 或 NORESETLOGS 选项


SQL> alter database open resetlogsl
  2  
SQL> 
SQL> 
SQL> alter database open resetlogs;
alter database open resetlogs
*
第 1 行出现错误:
ORA-01113: 文件 1 需要介质恢复
ORA-01110: 数据文件 1: '/usr2/ORADATA/syssystem01.dbf'


SQL> recover datafile 1;
ORA-00283: 恢复会话因错误而取消
ORA-01610: 使用 BACKUP CONTROLFILE 选项的恢复必须已完成


SQL> recover datafile 1 using backup CONTROLFILE;
ORA-00274: 非法恢复选项 USING


SQL> recover datafile 1 backup CONTROLFILE;
ORA-00905: 缺失关键字


SQL> recover datafile 1 using backup CONTROLFILE until cancel;
ORA-00274: 非法恢复选项 USING


SQL> recover datafile 1  until cancel;
ORA-00274: 非法恢复选项 UNTIL


SQL> recover datafile 1;
ORA-00283: 恢复会话因错误而取消
ORA-01610: 使用 BACKUP CONTROLFILE 选项的恢复必须已完成


SQL>  recover database until cancel;
ORA-00283: 恢复会话因错误而取消
ORA-01610: 使用 BACKUP CONTROLFILE 选项的恢复必须已完成


SQL>  recover database using backup controlfile;
ORA-00279: 更改 4599655 (在 10/14/2010 11:38:38 生成) 对于线程 1 是必需的
ORA-00289: 建议:
/usr2/ORADATA/redo_log/SI11G/archivelog/2010_10_20/o1_mf_1_80_%u_.arc
ORA-00280: 更改 4599655 (用于线程 1) 在序列 #80 中


指定日志: {=suggested | filename | AUTO | CANCEL}
auto
ORA-00308: 无法打开归档日志
'/usr2/ORADATA/redo_log/SI11G/archivelog/2010_10_20/o1_mf_1_80_%u_.arc'
ORA-27037: 无法获得文件状态
SVR4 Error: 2: No such file or directory
Additional information: 3


ORA-00308: 无法打开归档日志
'/usr2/ORADATA/redo_log/SI11G/archivelog/2010_10_20/o1_mf_1_80_%u_.arc'
ORA-27037: 无法获得文件状态
SVR4 Error: 2: No such file or directory
Additional information: 3


SQL> recover database using backup controlfile;
ORA-00279: 更改 4599655 (在 10/14/2010 11:38:38 生成) 对于线程 1 是必需的
ORA-00289: 建议:
/usr2/ORADATA/redo_log/SI11G/archivelog/2010_10_20/o1_mf_1_80_%u_.arc
ORA-00280: 更改 4599655 (用于线程 1) 在序列 #80 中


指定日志: {=suggested | filename | AUTO | CANCEL}
cancel
介质恢复已取消。
SQL> alter database open resetlogs;
alter database open resetlogs
*
第 1 行出现错误:
ORA-01113: 文件 1 需要介质恢复
ORA-01110: 数据文件 1: '/usr2/ORADATA/syssystem01.dbf'


SQL> recover datafile 1 using backup controlfile;
ORA-00274: 非法恢复选项 USING


SQL> recover datafile 1 ;                    
ORA-00283: 恢复会话因错误而取消
ORA-01610: 使用 BACKUP CONTROLFILE 选项的恢复必须已完成


SQL> recover database using backup controlfile;
ORA-00279: 更改 4599655 (在 10/14/2010 11:38:38 生成) 对于线程 1 是必需的
ORA-00289: 建议:
/usr2/ORADATA/redo_log/SI11G/archivelog/2010_10_20/o1_mf_1_80_%u_.arc
ORA-00280: 更改 4599655 (用于线程 1) 在序列 #80 中


指定日志: {=suggested | filename | AUTO | CANCEL}

ORA-00308: 无法打开归档日志
'/usr2/ORADATA/redo_log/SI11G/archivelog/2010_10_20/o1_mf_1_80_%u_.arc'
ORA-27037: 无法获得文件状态
SVR4 Error: 2: No such file or directory
Additional information: 3


SQL>  recover database using backup controlfile;
ORA-00279: 更改 4599655 (在 10/14/2010 11:38:38 生成) 对于线程 1 是必需的
ORA-00289: 建议:
/usr2/ORADATA/redo_log/SI11G/archivelog/2010_10_20/o1_mf_1_80_%u_.arc
ORA-00280: 更改 4599655 (用于线程 1) 在序列 #80 中


指定日志: {=suggested | filename | AUTO | CANCEL}

ORA-00308: 无法打开归档日志
'/usr2/ORADATA/redo_log/SI11G/archivelog/2010_10_20/o1_mf_1_80_%u_.arc'
ORA-27037: 无法获得文件状态
SVR4 Error: 2: No such file or directory
Additional information: 3


SQL>  recover database using backup controlfile;
ORA-00279: 更改 4599655 (在 10/14/2010 11:38:38 生成) 对于线程 1 是必需的
ORA-00289: 建议:
/usr2/ORADATA/redo_log/SI11G/archivelog/2010_10_20/o1_mf_1_80_%u_.arc
ORA-00280: 更改 4599655 (用于线程 1) 在序列 #80 中


指定日志: {=suggested | filename | AUTO | CANCEL}
auto
ORA-00308: 无法打开归档日志
'/usr2/ORADATA/redo_log/SI11G/archivelog/2010_10_20/o1_mf_1_80_%u_.arc'
ORA-27037: 无法获得文件状态
SVR4 Error: 2: No such file or directory
Additional information: 3


ORA-00308: 无法打开归档日志
'/usr2/ORADATA/redo_log/SI11G/archivelog/2010_10_20/o1_mf_1_80_%u_.arc'
ORA-27037: 无法获得文件状态
SVR4 Error: 2: No such file or directory
Additional information: 3


SQL>  recover database using backup controlfile;
ORA-00279: 更改 4599655 (在 10/14/2010 11:38:38 生成) 对于线程 1 是必需的
ORA-00289: 建议:
/usr2/ORADATA/redo_log/SI11G/archivelog/2010_10_20/o1_mf_1_80_%u_.arc
ORA-00280: 更改 4599655 (用于线程 1) 在序列 #80 中


指定日志: {=suggested | filename | AUTO | CANCEL}
auto
ORA-00308: 无法打开归档日志
'/usr2/ORADATA/redo_log/SI11G/archivelog/2010_10_20/o1_mf_1_80_%u_.arc'
ORA-27037: 无法获得文件状态
SVR4 Error: 2: No such file or directory
Additional information: 3


ORA-00308: 无法打开归档日志
'/usr2/ORADATA/redo_log/SI11G/archivelog/2010_10_20/o1_mf_1_80_%u_.arc'
ORA-27037: 无法获得文件状态
SVR4 Error: 2: No such file or directory
Additional information: 3


SQL>  recover database using backup controlfile;
ORA-00279: 更改 4599655 (在 10/14/2010 11:38:38 生成) 对于线程 1 是必需的
ORA-00289: 建议:
/usr2/ORADATA/redo_log/SI11G/archivelog/2010_10_20/o1_mf_1_80_%u_.arc
ORA-00280: 更改 4599655 (用于线程 1) 在序列 #80 中


指定日志: {=suggested | filename | AUTO | CANCEL}
cancel
介质恢复已取消。
SQL> alter database open resetlogs;
alter database open resetlogs
*
第 1 行出现错误:
ORA-01113: 文件 1 需要介质恢复
ORA-01110: 数据文件 1: '/usr2/ORADATA/syssystem01.dbf'


SQL> select file#,error from v$recover_file;

未选定行

SQL> shutdown immediate
ORA-01109: 数据库未打开


已经卸载数据库。








ORACLE 例程已经关闭。
SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> quit
从 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options 断开
-bash-3.00$ ls
Desktop     Documents   core        marven.cvs  zc
-bash-3.00$ cd $ORACLE_HOME
-bash-3.00$ cd dbs
-bash-3.00$ ls
hc_DBUA0.dat     hc_SI11g.dat     init.ora         lkSI11G          orapwSI11g       snapcf_SI11g.f   spfileSI11g.ora
-bash-3.00$ ls -lrt
总数 19724
-rw-r--r--   1 oracle   oinstall    2851 2009   5月 15 init.ora
-rw-r-----   1 oracle   oinstall      24  9月  7日 15:20 lkSI11G
-rw-r-----   1 oracle   oinstall    1536  9月 28日 22:00 orapwSI11g
-rw-r-----   1 oracle   oinstall 10076160 10月 15日 09:03 snapcf_SI11g.f
-rw-r-----   1 oracle   oinstall    3584 10月 17日 12:08 spfileSI11g.ora
-rw-rw----   1 oracle   oinstall    1544 10月 20日 16:26 hc_DBUA0.dat
-rw-rw----   1 oracle   oinstall    1544 10月 20日 17:12 hc_SI11g.dat
-bash-3.00$ ls -lrt
总数 19724
-rw-r--r--   1 oracle   oinstall    2851 2009   5月 15 init.ora
-rw-r-----   1 oracle   oinstall      24  9月  7日 15:20 lkSI11G
-rw-r-----   1 oracle   oinstall    1536  9月 28日 22:00 orapwSI11g
-rw-r-----   1 oracle   oinstall 10076160 10月 15日 09:03 snapcf_SI11g.f
-rw-r-----   1 oracle   oinstall    3584 10月 17日 12:08 spfileSI11g.ora
-rw-rw----   1 oracle   oinstall    1544 10月 20日 16:26 hc_DBUA0.dat
-rw-rw----   1 oracle   oinstall    1544 10月 20日 17:12 hc_SI11g.dat
-bash-3.00$ strings spfileSI11g.ora
SI11g.__db_cache_size=352321536
SI11g.__java_pool_size=16777216
SI11g.__large_pool_size=16777216
SI11g.__oracle_base='/opt/app/oracle'#ORACLE_BASE set from environment
SI11g.__pga_aggregate_target=536870912
SI11g.__sga_target=1040187392
SI11g.__shared_io_pool_size=0
SI11g.__shared_pool_size=603979776
SI11g.__streams_pool_size=33554432
*.audit_file_dest='/opt/app/oracle/admin/SI11g/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/usr2/ORADATA/sysdata/control01.ctl
','/usr2/ORADATA/sysdata/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='SI11g'
*.db_recovery_file_dest='/usr2/ORADATA/redo_log'
*.db_recovery_file_dest_size=4294967296
*.diagnostic_dest='/opt/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=SI11gXDB)'
*.memory_target=1572864000
*.nls_language='SIMPLIFIED CHINESE'
*.nls_territory='CHINA'
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.trace_enabled=FALSE
*.undo_management='auto'
*.undo_tab
lespace='UNDOTBS1'
-bash-3.00$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.1.0 Production on 星期三 10月 20 17:13:25 2010

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

已连接到空闲例程。

SQL> create pfile from spfile;

文件已创建。

SQL> quit
已断开连接
-bash-3.00$ ls
hc_DBUA0.dat     init.ora         lkSI11G          snapcf_SI11g.f
hc_SI11g.dat     initSI11g.ora    orapwSI11g       spfileSI11g.ora
-bash-3.00$ ls -lrt
总数 19726
-rw-r--r--   1 oracle   oinstall    2851 2009   5月 15 init.ora
-rw-r-----   1 oracle   oinstall      24  9月  7日 15:20 lkSI11G
-rw-r-----   1 oracle   oinstall    1536  9月 28日 22:00 orapwSI11g
-rw-r-----   1 oracle   oinstall 10076160 10月 15日 09:03 snapcf_SI11g.f
-rw-r-----   1 oracle   oinstall    3584 10月 17日 12:08 spfileSI11g.ora
-rw-rw----   1 oracle   oinstall    1544 10月 20日 16:26 hc_DBUA0.dat
-rw-rw----   1 oracle   oinstall    1544 10月 20日 17:12 hc_SI11g.dat
-rw-r--r--   1 oracle   oinstall     995 10月 20日 17:13 initSI11g.ora
-bash-3.00$ ls -lrt
总数 19726
-rw-r--r--   1 oracle   oinstall    2851 2009   5月 15 init.ora
-rw-r-----   1 oracle   oinstall      24  9月  7日 15:20 lkSI11G
-rw-r-----   1 oracle   oinstall    1536  9月 28日 22:00 orapwSI11g
-rw-r-----   1 oracle   oinstall 10076160 10月 15日 09:03 snapcf_SI11g.f
-rw-r-----   1 oracle   oinstall    3584 10月 17日 12:08 spfileSI11g.ora
-rw-rw----   1 oracle   oinstall    1544 10月 20日 16:26 hc_DBUA0.dat
-rw-rw----   1 oracle   oinstall    1544 10月 20日 17:12 hc_SI11g.dat
-rw-r--r--   1 oracle   oinstall     995 10月 20日 17:13 initSI11g.ora
-bash-3.00$ vi initSI11g.ora
"initSI11g.ora" 29 行,995 字符 
SI11g.__db_cache_size=352321536
SI11g.__java_pool_size=16777216
SI11g.__large_pool_size=16777216
SI11g.__oracle_base='/opt/app/oracle'#ORACLE_BASE set from environment
SI11g.__pga_aggregate_target=536870912
SI11g.__sga_target=1040187392
SI11g.__shared_io_pool_size=0
SI11g.__shared_pool_size=603979776
SI11g.__streams_pool_size=33554432
_allow_resetlogs_corruption = true
*.audit_file_dest='/opt/app/oracle/admin/SI11g/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/usr2/ORADATA/sysdata/control01.ctl','/usr2/ORADATA/sysdata/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='SI11g'
*.db_recovery_file_dest='/usr2/ORADATA/redo_log'
*.db_recovery_file_dest_size=4294967296
*.diagnostic_dest='/opt/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=SI11gXDB)'
*.memory_target=1572864000
*.nls_language='SIMPLIFIED CHINESE'
*.nls_territory='CHINA'
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.trace_enabled=FALSE
*.undo_management='auto'
*.undo_tablespace='UNDOTBS1'
~
~
~
~
~
~
~
~
"initSI11g.ora" 30 行,1030 字符 
-bash-3.00$ pwd
/opt/app/oracle/product/11.2.0/dbs
-bash-3.00$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.1.0 Production on 星期三 10月 20 17:14:36 2010

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

已连接到空闲例程。

SQL> startup pfile='$ORACLE_HOME/dbs/initSI11g.ora'
ORACLE 例程已经启动。

Total System Global Area 1570471936 bytes
Fixed Size                  2148432 bytes
Variable Size            1207965616 bytes
Database Buffers          352321536 bytes
Redo Buffers                8036352 bytes
数据库装载完毕。
ORA-01589: 要打开数据库则必须使用 RESETLOGS 或 NORESETLOGS 选项


SQL> alter database open resetlogs;  

数据库已更改。

SQL> select status from v$instance;

STATUS
------------
OPEN

SQL> shutdown immediate
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup
ORACLE 例程已经启动。

Total System Global Area 1570471936 bytes
Fixed Size                  2148432 bytes
Variable Size            1207965616 bytes
Database Buffers          352321536 bytes
Redo Buffers                8036352 bytes
数据库装载完毕。
数据库已经打开。
SQL> Select version FROM Product_component_version 
Where SUBSTR(PRODUCT,1,6)='Oracle';  2  

VERSION
--------------------------------------------------------------------------------
11.2.0.1.0

SQL> 

直接粘贴,啥也不说了。
阅读(4028) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-10-21 10:59:06

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com