你好,游客 登录 注册 搜索
背景:
阅读新闻

Oracle 数据库冷备份及RMAN简单使用

[日期:2012-12-14] 来源:Linux社区  作者:cswggod [字体:大 中 小]

6.修改有Oracle目录相关的权限和所用者
 
[oracle@instructor dbhome_1]$ sqlplus "/as SYSDBA"
 
SQL*Plus: Release 11.2.0.1.0 Production on Fri Nov 23 23:56:35 2012
 
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
 
ERROR:
ORA-09925: Unable to create audit trail file
Linux-x86_64 Error: 13: Permission denied
Additional information: 9925
ORA-09925: Unable to create audit trail file
Linux-x86_64 Error: 13: Permission denied
Additional information: 9925
 

Enter user-name:

[oracle@instructor dbhome_1]$ su root
Password:
[root@instructor dbhome_1]# cd /app
[root@instructor app]# chown -Rhf oracle:oinstall /app/oracle
[root@instructor app]# su oracle
[oracle@instructor app]$ sqlplus "/as SYSDBA"
 
SQL*Plus: Release 11.2.0.1.0 Production on Sat Nov 24 00:03:17 2012
 
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
 
Connected to an idle instance.
 
SQL> startup nomount pfile=/app/oracle/admin/orcl/pfile/init.ora.103201271612
ORACLE instance started.
 
Total System Global Area 263049216 bytes
Fixed Size 2212448 bytes
Variable Size 222301600 bytes
Database Buffers 33554432 bytes
Redo Buffers 4980736 bytes
SQL> alter database mount;
alter database mount
*
ERROR at line 1:
ORA-00205: error in identifying control file, check alert log for more info
 
SQL> show parameter background_dump_dest;#查看alertlog文件位置
 
#-------------------------以下是oracle缺失了一个控制文件
 
NAME TYPE VALUE
----------------------------------- ----------- ------------------------------
background_dump_dest string /app/oracle/diag/rdbms/bitc/or
cl/trace
SQL> exit
 
-----------------------------------
 
[root@instructor orcl]# cd /app/oracle/diag/rdbms/bitc/orcl/trace
 
在SERVER130上
 
[oracle@h1 ~]$ cd /app/oracle/flash_recovery_area/orcl/
[oracle@h1 orcl]$ ls
control02.ctl
 
[oracle@h1 orcl]$ sz *
rz
Starting zmodem transfer. Press Ctrl+C to cancel.
Transferring control02.ctl...
100% 9520 KB 9520 KB/s 00:00:01 0 Errors
 
在SERVER128上
 
[root@instructor ~]# cd /app/oracle/flash_recovery_area/orcl/
[root@instructor orcl]# ls
[root@instructor orcl]# rz
rz waiting to receive.
Starting zmodem transfer. Press Ctrl+C to cancel.
Transferring control02.ctl...
100% 9520 KB 9520 KB/s 00:00:01 0 Errors
 
---------------------------------------
 
[oracle@instructor ~]$ sqlplus "/as SYSDBA"
 
SQL> startup
ORACLE instance started.
 
Total System Global Area  263049216 bytes
Fixed Size                  2212448 bytes
Variable Size            226495904 bytes
Database Buffers          29360128 bytes
Redo Buffers                4980736 bytes
Database mounted.
Database opened.
 

 

以下是DB_NAME在参数文件和Control File不一致情况:
 

[root@instructor orcl]#
--------------------------------------------------------------------------
[oracle@instructor ~]$ sqlplus "/as SYSDBA"
 
SQL*Plus: Release 11.2.0.1.0 Production on Sat Nov 24 00:53:22 2012
 
Copyright (c) 1982, 2009, Oracle. All rights reserved.
 
Connected to:
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> alter database mount;
alter database mount
*
ERROR at line 1:
ORA-01103: database name 'ORCL' in control file is not 'BITC'
 
#------------------查看 alert log或查看oracle错误代码信息
 
SQL> host oerr ora 1103
01103, 00000, "database name '%s' in control file is not '%s'"
// *Cause: The database name in the control file does not match your
// database name.
// *Action: Either find the correct control file or change your database name.
 
SQL> show parameter db_name
 
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string BITC
 
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@instructor ~]$ cd //app/oracle/admin/orcl/
[oracle@instructor orcl]$ cd /app/oracle/admin/orcl/
[oracle@instructor orcl]$ cd /app/oracle/admin/orcl/pfile/
[oracle@instructor pfile]$ ls
init.ora.103201271612
[oracle@instructor pfile]$ vi init.ora.103201271612

db_name=orcl
 
"init.ora.103201271612" 62L, 1906C written
[oracle@instructor pfile]$ sqlplus "/as SYSDBA"
 
Connected to:
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> startup mount pfile=/app/oracle/admin/orcl/pfile/init.ora.103201271612;
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL> shutdown immediate
ORA-01507: database not mounted
 
ORACLE instance shut down.


SQL> startup nomount
ORACLE instance started.
 
Total System Global Area  263049216 bytes
Fixed Size                  2212448 bytes
Variable Size            234884512 bytes
Database Buffers          20971520 bytes
Redo Buffers                4980736 bytes
SQL> alter system set db_name=bitc scope=spfile;
 
System altered.
 
#-----------------在nomount下修改数据库db_name,数据库重启spfile生效

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款