데이터 베이스 MySQL 튜토리얼 Oracle 灾难恢复以及11g新特性恢复指导

Oracle 灾难恢复以及11g新特性恢复指导

Jun 07, 2016 pm 03:51 PM
oracle 다시 덮다 가이드 새로운 특성 재해 특성

实验: 数据库灾难恢复(数据文件、控制文件、参数文件、归档文件等丢失) 法一:利用冷备 法二:RMAN恢复及11g新特性(list/advise/repair failure,create spfile from memory) 1.配置catalog数据库 1)catalog目录库:创建大文件表空间、用户、授权 create

实验: 数据库灾难恢复(数据文件、控制文件、参数文件、归档文件等丢失)

法一:利用冷备

法二:RMAN恢复及11g新特性(list/advise/repair failure,create spfile from memory)

1.配置catalog数据库

1)catalog目录库:创建大文件表空间、用户、授权


create  bigfile tablespace rc_data datafile '/u01/app/oracle/oradata/ORCL/rc_data.dbf' size 20m;

create user rc_admin identified by oracle default tablespace rc_data;

grant connect,resource,recovery_catalog_owner to rc_admin;

2)创建catalog库
RMAN> rman catalog rc_admin/oracle@ORCL

RMAN> create catalog;

3)注册catalog库(在target库中)

RMAN> rman target / catalog rc_admin/oracle@ORCL

RMAN>register database;

4)配置target数据库

RMAN> rman target / catalog rc_admin/oracle@ORCL

RMAN>configure retention policy to recovery window of 7 days;
      --修改保留策略

RMAN>configure controlfile autobackup on;
      --打开控制文件自动备份

RMAN>configure device type disk parallelism  4;
      --开启并行备份,行度设置为4


2.备份target数据库

当所有文件丢失时,使用RMAN,应连接catalog库(catalog库中含有控制文件等)

[oracle@jibo admin]$ rman target / catalog rc_admin/oracle@ORCL

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Oct 16 10:19:55 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: PROD (DBID=270879665)
connected to recovery catalog database

RMAN> show all;

RMAN configuration parameters for database with db_unique_name PROD are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 4 BACKUP TYPE TO BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_PROD.f'; # default

RMAN> backup database include current controlfile plus archivelog delete all input;
     --全库备份加上归档日志文件
   

3.模拟灾难:

1)删除所有数据文件:
SYS@PROD>select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/PROD/datafile/o1_mf_system_b393xosc_.dbf
/u01/app/oracle/oradata/PROD/datafile/o1_mf_sysaux_b393xovt_.dbf
/u01/app/oracle/oradata/PROD/datafile/o1_mf_undotbs1_b393xq2d_.dbf
/u01/app/oracle/oradata/PROD/datafile/o1_mf_users_b393xqpm_.dbf
/u01/app/oracle/oradata/PROD/datafile/o1_mf_example_b393xp04_.dbf
/u01/app/oracle/oradata/PROD/datafile/tbs_users1.dbf
/u01/app/oracle/oradata/PROD/datafile/tbs_users2.dbf
/u01/app/oracle/oradata/PROD/datafile/pitr.dbf
/u01/app/oracle/oradata/PROD/datafile/pitr_ind.dbf
/u01/app/oracle/oradata/PROD/arch_tbs.dbf

10 rows selected.

SYS@PROD>!rm /u01/app/oracle/oradata/PROD/datafile/*.dbf

SYS@PROD>!rm /u01/app/oracle/oradata/PROD/arch_tbs.dbf

SYS@PROD>desc v$controlfile;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 STATUS                                             VARCHAR2(7)
 NAME                                               VARCHAR2(513)
 IS_RECOVERY_DEST_FILE                              VARCHAR2(3)
 BLOCK_SIZE                                         NUMBER
 FILE_SIZE_BLKS                                     NUMBER


2)删除所有控制文件:
SYS@PROD>select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/PROD/controlfile/o1_mf_b2255k12_.ctl
/u01/app/oracle/fast_recovery_area/PROD/controlfile/o1_mf_b2255kjo_.ctl

SYS@PROD>!rm /u01/app/oracle/oradata/PROD/controlfile/o1_mf_b2255k12_.ctl
SYS@PROD>!rm /u01/app/oracle/fast_recovery_area/PROD/controlfile/o1_mf_b2255kjo_.ctl


3)删除参数文件:
SYS@PROD>show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/11.2.0
                                                 /dbhome_1/dbs/spfilePROD.ora
SYS@PROD>!rm /u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfilePROD.ora


4)删除归档文件:
desc v$archived_log --归档文件
SYS@PROD>select name from v$archived_log;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/fast_recovery_area/PROD/archivelog/2014_10_16/o1_mf_1_7_b3y4y1s8_.arc

/u01/app/oracle/fast_recovery_area/PROD/archivelog/2014_10_16/o1_mf_1_8_b3y56mno

...

8 rows selected.

SYS@PROD>!rm /u01/app/oracle/fast_recovery_area/PROD/archivelog/2014_10_16/*;

alter system checkpoint;
  --触发错误

5)退出重新进入:
SYS@PROD>stutdown immediate
SP2-0734: unknown command beginning "stutdown i..." - rest of line ignored.
SYS@PROD>shutdown immediate
ORA-01116: error in opening database file 2
ORA-01110: data file 2: '/u01/app/oracle/oradata/PROD/datafile/o1_mf_sysaux_b393xovt_.dbf'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
SYS@PROD>shutdown abort
ORACLE instance shut down.
SYS@PROD>startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initPROD.ora'
  --报错

4.利用catalog恢复target数据库

1)在catalog库查看target数据库DBID

sqlplus rc_admin/oracle

RC_ADMIN@ORCL>select * from rc_database;

    DB_KEY  DBINC_KEY       DBID NAME     RESETLOGS_CHANGE# RESETLOGS
---------- ---------- ---------- -------- ----------------- ---------
       241        242 1385095721 ORCL                925702 03-SEP-14
         1         61  270879665 PROD               1107625 08-OCT-14


2)连接catalog数据库
[oracle@jibo ~]$ rman target / catalog rc_admin/oracle@ORCL

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Oct 16 14:08:59 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database (not started)
connected to recovery catalog database
    --可以连接,但数据库没有启动

3)设置dbid,并启动数据库到nomount状态
RMAN> set dbid=270879665;

executing command: SET DBID
database name is "PROD" and DBID is 270879665


RMAN> startup nomount;

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initPROD.ora'

starting Oracle instance without parameter file for retrieval of spfile


Oracle instance started

Total System Global Area    1068937216 bytes

Fixed Size                     2260088 bytes
Variable Size                281019272 bytes
Database Buffers             780140544 bytes
Redo Buffers                   5517312 bytes

4)还原参数文件和数据文件
RMAN>restore spfile;

RMAN>restore controlfile;
或者:
RMAN>restore spfile from autobackup;
RMAN>restore controlfile from autobackup;
或者:
RMAN>restore spfile from '/u01/app/oracle/fast_recovery_area/PROD/autobackup/2014_10_16/o1_mf_s_861103939_b3yh28ts_.bkp';
RMAN>restore controlfile from '/u01/app/oracle/...';
  --如果Oracle无法找到自动备份文件,则需要手工制定该文件的具体位置

5)启动数据库到mount状态并使用11g数据库的新特性(list/advise/repair failure)
RMAN> startup mount;

database is already started
database mounted
released channel: ORA_DISK_1
released channel: ORA_DISK_2
released channel: ORA_DISK_3
released channel: ORA_DISK_4

新特性:
list failure;
   --如果list failure 没有输出结果,则需要我们手动恢复数据库;
advise failure;
   --如果advise failure 输出的最后,显示没有可用的自动修复选项,则同样需要我们手动恢复;
repair failure;
   --三条命令顺序不能改变

补充:
 如果list failure没有输出结果,
则可以尝试打开数据库,查看报错信息,然后进行相应的处理;
eg:
 alter database open;
 alter database open resetlogs;
 restore datafile 1;
 list failure;
 advise failure;
 repair failure;

指令:
RMAN>list failure;

RMAN>advise failure;

RMAN>repair failure;

具体执行过程:
RMAN> list failure;

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
1702       CRITICAL OPEN      16-OCT-14     Control file needs media recovery
1522       CRITICAL OPEN      16-OCT-14     System datafile 1: '/u01/app/oracle/oradata/PROD/datafile/o1_mf_system_b393xosc_.dbf' is missing
709        CRITICAL OPEN      08-OCT-14     System datafile 1: '/u01/app/oracle/oradata/PROD/datafile/o1_mf_system_b393xosc_.dbf' needs media recovery
469        CRITICAL OPEN      08-OCT-14     System datafile 1: '/u01/app/oracle/oradata/PROD/datafile/o1_mf_system_b2251bs1_.dbf' is missing
242        HIGH     OPEN      29-SEP-14     One or more non-system datafiles are missing
974        HIGH     OPEN      10-OCT-14     Tablespace 11: 'PITR_IND' is offline
644        HIGH     OPEN      08-OCT-14     One or more non-system datafiles need media recovery
817        HIGH     OPEN      09-OCT-14     Name for datafile 7 is unknown in the control file
808        HIGH     OPEN      09-OCT-14     Name for datafile 6 is unknown in the control file

RMAN> advise failure;

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
1702       CRITICAL OPEN      16-OCT-14     Control file needs media recovery
1522       CRITICAL OPEN      16-OCT-14     System datafile 1: '/u01/app/oracle/oradata/PROD/datafile/o1_mf_system_b393xosc_.dbf' is missing
709        CRITICAL OPEN      08-OCT-14     System datafile 1: '/u01/app/oracle/oradata/PROD/datafile/o1_mf_system_b393xosc_.dbf' needs media recovery
469        CRITICAL OPEN      08-OCT-14     System datafile 1: '/u01/app/oracle/oradata/PROD/datafile/o1_mf_system_b2251bs1_.dbf' is missing
242        HIGH     OPEN      29-SEP-14     One or more non-system datafiles are missing
974        HIGH     OPEN      10-OCT-14     Tablespace 11: 'PITR_IND' is offline
644        HIGH     OPEN      08-OCT-14     One or more non-system datafiles need media recovery
817        HIGH     OPEN      09-OCT-14     Name for datafile 7 is unknown in the control file
808        HIGH     OPEN      09-OCT-14     Name for datafile 6 is unknown in the control file

analyzing automatic repair options; this may take some time
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
analyzing automatic repair options complete

Not all specified failures can currently be repaired.
The following failures must be repaired before advise for others can be given.

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
1702       CRITICAL OPEN      16-OCT-14     Control file needs media recovery
1522       CRITICAL OPEN      16-OCT-14     System datafile 1: '/u01/app/oracle/oradata/PROD/datafile/o1_mf_system_b393xosc_.dbf' is missing
709        CRITICAL OPEN      08-OCT-14     System datafile 1: '/u01/app/oracle/oradata/PROD/datafile/o1_mf_system_b393xosc_.dbf' needs media recovery
469        CRITICAL OPEN      08-OCT-14     System datafile 1: '/u01/app/oracle/oradata/PROD/datafile/o1_mf_system_b2251bs1_.dbf' is missing
242        HIGH     OPEN      29-SEP-14     One or more non-system datafiles are missing
644        HIGH     OPEN      08-OCT-14     One or more non-system datafiles need media recovery
817        HIGH     OPEN      09-OCT-14     Name for datafile 7 is unknown in the control file
808        HIGH     OPEN      09-OCT-14     Name for datafile 6 is unknown in the control file

Mandatory Manual Actions
========================
no manual actions available

Optional Manual Actions
=======================
1. If you have the correct version of the control file, then shutdown the database and replace the old control file
2. If file /u01/app/oracle/oradata/PROD/datafile/o1_mf_system_b393xosc_.dbf was unintentionally renamed or moved, restore it
3. If you restored the wrong version of data file /u01/app/oracle/oradata/PROD/datafile/o1_mf_system_b393xosc_.dbf, then replace it with the correct one
4. If file /u01/app/oracle/oradata/PROD/datafile/o1_mf_system_b2251bs1_.dbf was unintentionally renamed or moved, restore it
5. If file /u01/app/oracle/oradata/PROD/ind_tbs.dbs was unintentionally renamed or moved, restore it
6. If file /u01/app/oracle/oradata/PROD/datafile/o1_mf_sysaux_b2251bvo_.dbf was unintentionally renamed or moved, restore it
7. If file /u01/app/oracle/oradata/PROD/datafile/o1_mf_undotbs1_b2251bw5_.dbf was unintentionally renamed or moved, restore it
8. If file /u01/app/oracle/oradata/PROD/datafile/o1_mf_users_b2251byw_.dbf was unintentionally renamed or moved, restore it
9. If file /u01/app/oracle/oradata/PROD/datafile/o1_mf_example_b2257d0c_.dbf was unintentionally renamed or moved, restore it
10. If file /u01/app/oracle/oradata/PROD/datafile/tbs_move_01.dbf was unintentionally renamed or moved, restore it
11. If file /u01/app/oracle/oradata/PROD/datafile/o1_mf_sysaux_b393xovt_.dbf was unintentionally renamed or moved, restore it
12. If file /u01/app/oracle/oradata/PROD/datafile/o1_mf_undotbs1_b393xq2d_.dbf was unintentionally renamed or moved, restore it
13. If file /u01/app/oracle/oradata/PROD/datafile/o1_mf_users_b393xqpm_.dbf was unintentionally renamed or moved, restore it
14. If file /u01/app/oracle/oradata/PROD/datafile/o1_mf_example_b393xp04_.dbf was unintentionally renamed or moved, restore it
15. If file /u01/app/oracle/oradata/PROD/datafile/tbs_users1.dbf was unintentionally renamed or moved, restore it
16. If file /u01/app/oracle/oradata/PROD/datafile/tbs_users2.dbf was unintentionally renamed or moved, restore it
17. If file /u01/app/oracle/oradata/PROD/datafile/pitr.dbf was unintentionally renamed or moved, restore it
18. If file /u01/app/oracle/oradata/PROD/datafile/pitr_ind.dbf was unintentionally renamed or moved, restore it
19. If file /u01/app/oracle/oradata/PROD/arch_tbs.dbf was unintentionally renamed or moved, restore it
20. If you restored the wrong version of data file /u01/app/oracle/oradata/PROD/datafile/o1_mf_users_b393xqpm_.dbf, then replace it with the correct one
21. If you restored the wrong version of data file /u01/app/oracle/oradata/PROD/datafile/tbs_move_01.dbf, then replace it with the correct one
22. If you restored the wrong version of data file /u01/app/oracle/oradata/PROD/datafile/o1_mf_sysaux_b393xovt_.dbf, then replace it with the correct one
23. If you restored the wrong version of data file /u01/app/oracle/oradata/PROD/datafile/o1_mf_undotbs1_b393xq2d_.dbf, then replace it with the correct one
24. If you restored the wrong version of data file /u01/app/oracle/oradata/PROD/datafile/pitr_ind.dbf, then replace it with the correct one
25. If the file exists, rename data file 7 to the name of the real file using ALTER DATABASE RENAME FILE command.  If the file does not exist, create a new data file using ALTER DATABASE CREATE DATAFILE command.
26. If the file exists, rename data file 6 to the name of the real file using ALTER DATABASE RENAME FILE command.  If the file does not exist, create a new data file using ALTER DATABASE CREATE DATAFILE command.

Automated Repair Options
========================
Option Repair Description
------ ------------------
1      Restore and recover database 
  Strategy: The repair includes complete media recovery with no data loss
  Repair script: /u01/app/oracle/diag/rdbms/prod/PROD/hm/reco_2998735934.hm


RMAN> repair failure;

Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/prod/PROD/hm/reco_2998735934.hm

contents of repair script:
   # restore and recover database
   restore database;
   recover database;
   alter database open resetlogs;

Do you really want to execute the above repair (enter YES or NO)? yes
executing repair script

Starting restore at 16-OCT-14
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/PROD/datafile/o1_mf_undotbs1_b393xq2d_.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/PROD/datafile/o1_mf_users_b393xqpm_.dbf
channel ORA_DISK_1: restoring datafile 00010 to /u01/app/oracle/oradata/PROD/arch_tbs.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/PROD/backupset/2014_10_16/o1_mf_nnndf_TAG20141016T105733_b3yf194z_.bkp
channel ORA_DISK_2: starting datafile backup set restore
channel ORA_DISK_2: specifying datafile(s) to restore from backup set
channel ORA_DISK_2: restoring datafile 00005 to /u01/app/oracle/oradata/PROD/datafile/o1_mf_example_b393xp04_.dbf
channel ORA_DISK_2: restoring datafile 00008 to /u01/app/oracle/oradata/PROD/datafile/pitr.dbf
channel ORA_DISK_2: restoring datafile 00009 to /u01/app/oracle/oradata/PROD/datafile/pitr_ind.dbf
channel ORA_DISK_2: reading from backup piece /u01/app/oracle/fast_recovery_area/PROD/backupset/2014_10_16/o1_mf_nnndf_TAG20141016T105733_b3yf12ln_.bkp
channel ORA_DISK_3: starting datafile backup set restore
channel ORA_DISK_3: specifying datafile(s) to restore from backup set
channel ORA_DISK_3: restoring datafile 00002 to /u01/app/oracle/oradata/PROD/datafile/o1_mf_sysaux_b393xovt_.dbf
channel ORA_DISK_3: restoring datafile 00006 to /u01/app/oracle/oradata/PROD/datafile/tbs_users1.dbf
channel ORA_DISK_3: restoring datafile 00007 to /u01/app/oracle/oradata/PROD/datafile/tbs_users2.dbf
channel ORA_DISK_3: reading from backup piece /u01/app/oracle/fast_recovery_area/PROD/backupset/2014_10_16/o1_mf_nnndf_TAG20141016T105733_b3yf10lb_.bkp
channel ORA_DISK_4: starting datafile backup set restore
channel ORA_DISK_4: specifying datafile(s) to restore from backup set
channel ORA_DISK_4: restoring datafile 00001 to /u01/app/oracle/oradata/PROD/datafile/o1_mf_system_b393xosc_.dbf
channel ORA_DISK_4: reading from backup piece /u01/app/oracle/fast_recovery_area/PROD/backupset/2014_10_16/o1_mf_nnndf_TAG20141016T105733_b3yf0zo6_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/PROD/backupset/2014_10_16/o1_mf_nnndf_TAG20141016T105733_b3yf194z_.bkp tag=TAG20141016T105733
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:04:30
channel ORA_DISK_2: piece handle=/u01/app/oracle/fast_recovery_area/PROD/backupset/2014_10_16/o1_mf_nnndf_TAG20141016T105733_b3yf12ln_.bkp tag=TAG20141016T105733
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: restore complete, elapsed time: 00:05:01
channel ORA_DISK_3: piece handle=/u01/app/oracle/fast_recovery_area/PROD/backupset/2014_10_16/o1_mf_nnndf_TAG20141016T105733_b3yf10lb_.bkp tag=TAG20141016T105733
channel ORA_DISK_3: restored backup piece 1
channel ORA_DISK_3: restore complete, elapsed time: 00:11:10
channel ORA_DISK_4: piece handle=/u01/app/oracle/fast_recovery_area/PROD/backupset/2014_10_16/o1_mf_nnndf_TAG20141016T105733_b3yf0zo6_.bkp tag=TAG20141016T105733
channel ORA_DISK_4: restored backup piece 1
channel ORA_DISK_4: restore complete, elapsed time: 00:16:35
Finished restore at 16-OCT-14

Starting recover at 16-OCT-14
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
datafile 6 not processed because file is read-only
datafile 7 not processed because file is read-only

starting media recovery

archived log for thread 1 with sequence 13 is already on disk as file /u01/app/oracle/fast_recovery_area/PROD/onlinelog/o1_mf_1_b395df1j_.log
archived log for thread 1 with sequence 14 is already on disk as file /u01/app/oracle/fast_recovery_area/PROD/onlinelog/o1_mf_2_b395dqql_.log
archived log file name=/u01/app/oracle/fast_recovery_area/PROD/onlinelog/o1_mf_1_b395df1j_.log thread=1 sequence=13
archived log file name=/u01/app/oracle/fast_recovery_area/PROD/onlinelog/o1_mf_2_b395dqql_.log thread=1 sequence=14
media recovery complete, elapsed time: 00:00:30
Finished recover at 16-OCT-14

database opened
new incarnation of database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
repair failure complete

RMAN>

5.查看恢复结果
1)登陆数据库,查看当前数据库状态,查看数据文件等重要文件的状态;

[oracle@jibo ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Oct 16 14:59:53 2014

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SYS@PROD>select status from v$instance;

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

  --数据库已经打开
或者:
SYS@PROD>select open_mode from v$database;

2)重新生成spfile;
数据库打开,查看spfile,没有spfile文件,生成spfile文件,再查看:

SYS@PROD>show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string

SYS@PROD>create spfile from memory;

File created.
 
SYS@PROD>shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@PROD>startup;
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2260088 bytes
Variable Size             285213576 bytes
Database Buffers          775946240 bytes
Redo Buffers                5517312 bytes
Database mounted.
Database opened.
SYS@PROD>show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/11.2.0
                                                 /dbhome_1/dbs/spfilePROD.ora
SYS@PROD>


6.重新备份数据库

RMAN> backup database include current controlfile plus archivelog;

본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

AI Hentai Generator

AI Hentai Generator

AI Hentai를 무료로 생성하십시오.

인기 기사

R.E.P.O. 에너지 결정과 그들이하는 일 (노란색 크리스탈)
3 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 최고의 그래픽 설정
3 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 아무도들을 수없는 경우 오디오를 수정하는 방법
3 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25 : Myrise에서 모든 것을 잠금 해제하는 방법
4 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌

뜨거운 도구

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

SublimeText3 Mac 버전

SublimeText3 Mac 버전

신 수준의 코드 편집 소프트웨어(SublimeText3)

Oracle의 테이블 스페이스 크기를 확인하는 방법 Oracle의 테이블 스페이스 크기를 확인하는 방법 Apr 11, 2025 pm 08:15 PM

Oracle 테이블 스페이스 크기를 쿼리하려면 다음 단계를 따르십시오. 쿼리를 실행하여 테이블 스페이스 이름을 결정하십시오. 쿼리를 실행하여 테이블 스페이스 크기를 쿼리하십시오. sum (bytes)을 total_size, sum (bytes_free)으로 sum (bytes_free), sum (bytes) - sum (bytes_free)으로 dba_data_fices where tablespace_.

Oracle 데이터베이스를 가져 오는 방법 Oracle 데이터베이스를 가져 오는 방법 Apr 11, 2025 pm 08:06 PM

데이터 가져 오기 방법 : 1. SQLLOADER 유틸리티 사용 : 데이터 파일 준비, 제어 파일 작성 및 SQLLOADER 실행; 2. IMP/EXP 도구를 사용하십시오 : 데이터 내보내기, 데이터 가져 오기. 팁 : 1. 빅 데이터 세트에 권장되는 SQL*로더; 2. 대상 테이블이 존재해야하고 열 정의가 일치해야합니다. 3. 가져 오기 후에는 데이터 무결성을 확인해야합니다.

Oracle에 테이블 필드를 추가하는 방법 Oracle에 테이블 필드를 추가하는 방법 Apr 11, 2025 pm 07:30 PM

Alter Table 문을 사용하십시오. 특정 구문은 다음과 같습니다. Alter Table_Name Add Column_name Data_Type [제한 조건 -Clause]. 여기서 : table_name은 테이블 이름, column_name은 필드 이름, data_type는 데이터 유형이며, 제한 조건은 선택적 제한 조건입니다. 예 : Alter Table 직원 이메일 추가 Varchar2 (100) 직원 테이블에 이메일 필드를 추가합니다.

Oracle에서 테이블을 만드는 방법 Oracle에서 테이블을 만드는 방법 Apr 11, 2025 pm 08:00 PM

Oracle 테이블 작성에는 다음 단계가 필요합니다. 테이블 작성 구문을 사용하여 테이블 이름, 열 이름, 데이터 유형, 제약 조건 및 기본값을 지정하십시오. 테이블 이름은 간결하고 설명 적이어야하며 30자를 초과해서는 안됩니다. 열 이름은 설명 적이어야하며 데이터 유형은 열에 저장된 데이터 유형을 지정합니다. NOT NULL 제약 조건은 열에서 NULL 값이 허용되지 않도록하고 기본 조항은 열의 기본값을 지정합니다. 테이블의 고유 한 레코드를 식별하기위한 주요 주요 제약. 외국 키 제약 조건은 테이블의 열이 다른 테이블의 기본 키를 지칭하도록 지정합니다. 기본 키, 고유 한 제약 조건 및 기본값이 포함 된 샘플 테이블 학생의 생성을 참조하십시오.

Oracle에서 Barbled 코드를 해결하는 방법 Oracle에서 Barbled 코드를 해결하는 방법 Apr 11, 2025 pm 10:09 PM

데이터베이스 문자 세트를 확인하여 데이터와 일치하는지 확인하여 Oracle Garbled 문제를 해결할 수 있습니다. 클라이언트 문자 세트를 데이터베이스와 일치하도록 설정하십시오. 데이터베이스 문자 세트와 일치하도록 데이터 변환 또는 열 문자 세트를 수정하십시오. 유니 코드 문자 세트를 사용하고 멀티 바이트 문자 세트를 피하십시오. 데이터베이스 및 클라이언트의 언어 설정이 올바른지 확인하십시오.

Oracle 설치를 제거하는 방법에 실패했습니다 Oracle 설치를 제거하는 방법에 실패했습니다 Apr 11, 2025 pm 08:24 PM

Oracle 설치 실패에 대한 방법 제거 : Oracle Service를 닫고 Oracle Program 파일 및 레지스트리 키 삭제, Oracle 환경 변수를 제거하고 컴퓨터를 다시 시작하십시오. 제거되지 않으면 Oracle 범용 제거 도구를 사용하여 수동으로 제거 할 수 있습니다.

Oracle을 수반하는 방법 Oracle을 수반하는 방법 Apr 11, 2025 pm 07:33 PM

Oracle은 여러 가지 중복 제거 쿼리 방법을 제공합니다. 별개의 키워드는 각 열에 고유 한 값을 반환합니다. 그룹 별 조항은 결과를 그룹화하고 각 그룹에 대해 비 반복 값을 반환합니다. 고유 한 키워드는 고유 한 행만 포함 된 인덱스를 만드는 데 사용되며 인덱스 쿼리는 자동으로 망상됩니다. row_number () 함수는 고유 한 숫자를 할당하고 1 행 만 포함하는 결과를 필터링합니다. 최소 () 또는 max () 함수는 숫자 열의 비 반복 값을 반환합니다. 교차 연산자는 두 결과 세트의 공통 값을 반환합니다 (중복 없음).

Oracle View를 암호화하는 방법 Oracle View를 암호화하는 방법 Apr 11, 2025 pm 08:30 PM

Oracle View 암호화를 사용하면보기에서 데이터를 암호화 할 수 있으므로 민감한 정보의 보안을 향상시킬 수 있습니다. 단계에는 다음이 포함됩니다. 1) 마스터 암호화 키 생성 (MEK); 2) 암호화 된 뷰 생성, 암호화 할보기 및 MEK를 지정하는 것; 3) 사용자가 암호화 된보기에 액세스하도록 승인합니다. 암호화 된 뷰 작동 방식 : 사용자가 암호화 된보기를 쿼리 할 때 Oracle은 MEK를 사용하여 데이터를 해독하여 공인 사용자 만 읽기 쉬운 데이터에 액세스 할 수 있도록합니다.

See all articles