|
2019-05-22
第一个advisor
备份控制文件恢复(8a):
- [oracle@station80 ~]$ . oraenv
- ORACLE_SID = [orcl] ? +ASM
- The Oracle base remains unchanged with value /u01/app/oracle
- [oracle@station80 ~]$ asmcmd
- ASMCMD> ls
- DATA/
- FRA/
- ASMCMD> cd data
- ASMCMD> ls
- ASM/
- ORCL/
- ASMCMD> cd orcl
- ASMCMD> ls
- CONTROLFILE/
- DATAFILE/
- PARAMETERFILE/
- TEMPFILE/
- spfileorcl.ora
- ASMCMD> cd +FRA
- ASMCMD> ls
- ORCL/
- ASMCMD> cd orcl
- ASMCMD> ls
- CONTROLFILE/
- ASMCMD> exit
- [oracle@station80 ~]$ . oraenv
- ORACLE_SID = [+ASM] ? orcl
- The Oracle base remains unchanged with value /u01/app/oracle
- [oracle@station80 ~]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.4.0 Production on Wed May 22 21:08:19 2019
- Copyright (c) 1982, 2013, Oracle. All rights reserved.
- SQL> conn / as sysdba
- Connected to an idle instance.
- SQL> startup mount
- ORACLE instance started.
- Total System Global Area 1536602112 bytes
- Fixed Size 2253504 bytes
- Variable Size 939527488 bytes
- Database Buffers 587202560 bytes
- Redo Buffers 7618560 bytes
- Database mounted.
- SQL> alter database open resetlogs;
- alter database open resetlogs
- *
- ERROR at line 1:
- ORA-01139: RESETLOGS option only valid after an incomplete database recovery
- SQL> recover database until cancel ;
- Media recovery complete.
- SQL> alter database open ;
- alter database open
- *
- ERROR at line 1:
- ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
- SQL> alter database open resetlogs;
- Database altered.
- SQL> select open_mode from v$database;
- OPEN_MODE
- --------------------
- READ WRITE
- SQL> archive log list
- Database log mode No Archive Mode
- Automatic archival Disabled
- Archive destination USE_DB_RECOVERY_FILE_DEST
- Oldest online log sequence 1
- Current log sequence 1
- SQL> alter database backup controlfile to '/home/oracle/control.f';
- Database altered.
- SQL> exit
- Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production
- With the Partitioning, Automatic Storage Management, OLAP, Data Mining
- and Real Application Testing options
- [oracle@station80 ~]$ rman target /
- Recovery Manager: Release 11.2.0.4.0 - Production on Wed May 22 21:28:41 2019
- Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
- connected to target database: ORCL (DBID=1535788302)
- RMAN> backup current controlfile;
- Starting backup at 22-MAY-19
- using target database control file instead of recovery catalog
- allocated channel: ORA_DISK_1
- channel ORA_DISK_1: SID=34 device type=DISK
- channel ORA_DISK_1: starting full datafile backup set
- channel ORA_DISK_1: specifying datafile(s) in backup set
- including current control file in backup set
- channel ORA_DISK_1: starting piece 1 at 22-MAY-19
- channel ORA_DISK_1: finished piece 1 at 22-MAY-19
- piece handle=+FRA/orcl/backupset/2019_05_22/ncnnf0_tag20190522t212937_0.260.1008 970179 tag=TAG20190522T212937 comment=NONE
- channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
- Finished backup at 22-MAY-19
- RMAN> list backup;
- List of Backup Sets
- ===================
- BS Key Type LV Size Device Type Elapsed Time Completion Time
- ------- ---- -- ---------- ----------- ------------ ---------------
- 1 Full 9.33M DISK 00:00:01 22-MAY-19
- BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20190522T212937
- Piece Name: +FRA/orcl/backupset/2019_05_22/ncnnf0_tag20190522t212937_0.2 60.1008970179
- Control File Included: Ckp SCN: 1137211 Ckp time: 22-MAY-19
- RMAN> exit
- Recovery Manager complete.
- [oracle@station80 ~]$ ls -l /home/oracle/control.f
- -rw-r-----. 1 oracle asmadmin 9748480 May 22 21:27 /home/oracle/control.f
- [oracle@station80 ~]$ file /home/oracle/control.f
- /home/oracle/control.f: data
- [oracle@station80 ~]
- select * from v$log;
- select * from v$logfile;
- alter database add logfile member '/home/oracle/redo02c.log' to group 2;
- alter database drop logfile member '/home/oracle/redo02c.log';
- alter system switch logfile;
- alter database drop logfile member '/home/oracle/redo02c.log';
复制代码 nbsp; . oraenv
- -bash: ▒.: command not found
- [oracle@station80 ~]$ . oraenv
- ORACLE_SID = [orcl] ? +ASM
- The Oracle base remains unchanged with value /u01/app/oracle
- [oracle@station80 ~]$ asmcmd
- ASMCMD> ls
- DATA/
- FRA/
- ASMCMD> cd DATA/
- ASMCMD> ls
- ASM/
- ORCL/
- ASMCMD> cd orcl
- ASMCMD> ls
- DATAFILE/
- ONLINELOG/
- PARAMETERFILE/
- TEMPFILE/
- spfileorcl.ora
- ASMCMD> cd +FRA
- ASMCMD> ls
- ORCL/
- ASMCMD> cd orcl
- ASMCMD> ls
- BACKUPSET/
- ONLINELOG/
- ASMCMD> exit
- [oracle@station80 ~]$ . oraenv
- ORACLE_SID = [+ASM] ? orcl
- The Oracle base remains unchanged with value /u01/app/oracle
- [oracle@station80 ~]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.4.0 Production on Wed May 22 21:41:49 2019
- Copyright (c) 1982, 2013, Oracle. All rights reserved.
- SQL> conn / as sysdba
- Connected to an idle instance.
- SQL> startup
- ORACLE instance started.
- Total System Global Area 1536602112 bytes
- Fixed Size 2253504 bytes
- Variable Size 939527488 bytes
- Database Buffers 587202560 bytes
- Redo Buffers 7618560 bytes
- ORA-00205: error in identifying control file, check alert log for more info
- SQL> show parameter control
- NAME TYPE
- ------------------------------------ ---------------------------------
- VALUE
- ------------------------------
- control_file_record_keep_time integer
- 7
- control_files string
- +DATA/orcl/controlfile/current
- .260.1008007567, +FRA/orcl/con
- trolfile/current.256.100800756
- 7
- control_management_pack_access string
- DIAGNOSTIC+TUNING
- SQL> exit
- Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production
- With the Partitioning, OLAP, Data Mining and Real Application Testing options
- [oracle@station80 ~]$ rman target /
- Recovery Manager: Release 11.2.0.4.0 - Production on Wed May 22 21:43:56 2019
- Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
- connected to target database: ORCL (not mounted)
- RMAN> list backup of controlfile;
- using target database control file instead of recovery catalog
- RMAN-00571: ===========================================================
- RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
- RMAN-00571: ===========================================================
- RMAN-03002: failure of list command at 05/22/2019 21:45:23
- ORA-01507: database not mounted
- RMAN> exit
- Recovery Manager complete.
- [oracle@station80 ~]$ . oraenv
- ORACLE_SID = [orcl] ? +ASM
- ORACLE_HOME = [/home/oracle] ?
- ORACLE_BASE environment variable is not being set since this
- information is not available for the current user ID oracle.
- You can set ORACLE_BASE manually if it is required.
- [oracle@station80 ~]$ . oraenv
- ORACLE_SID = ['+ASM] ? +ASM
- The Oracle base has been set to /u01/app/oracle
- [oracle@station80 ~]$ asmcmd
- ASMCMD> ls
- DATA/
- FRA/
- ASMCMD> cd fra
- ASMCMD> ls
- ORCL/
- ASMCMD> cd orcl
- ASMCMD> ls
- BACKUPSET/
- ONLINELOG/
- ASMCMD> cd BACKUPSET/
- ASMCMD> ls
- 2019_05_22/
- ASMCMD> cd 2019_05_22/
- ASMCMD> ls
- ncnnf0_LABS-8A-CONTROLFILE_0.261.1008970613
- ncnnf0_TAG20190522T212937_0.260.1008970179
- ASMCMD> pwd
- +fra/orcl/BACKUPSET/2019_05_22
- ASMCMD> exit
- [oracle@station80 ~]$ . oraenv
- ORACLE_SID = [+ASM] ? orcl
- The Oracle base remains unchanged with value /u01/app/oracle
- [oracle@station80 ~]$ rman target /
- Recovery Manager: Release 11.2.0.4.0 - Production on Wed May 22 21:46:45 2019
- Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
- connected to target database: ORCL (not mounted)
- RMAN> restore controlfile from '+fra/orcl/BACKUPSET/2019_05_22/ncnnf0_LABS-8A-CO NTROLFILE_0.261.1008970613';
- Starting restore at 22-MAY-19
- using target database control file instead of recovery catalog
- allocated channel: ORA_DISK_1
- channel ORA_DISK_1: SID=12 device type=DISK
- channel ORA_DISK_1: restoring control file
- channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
- output file name=+DATA/orcl/controlfile/current.260.1008971239
- output file name=+FRA/orcl/controlfile/current.256.1008971239
- Finished restore at 22-MAY-19
- RMAN> alter database mount;
- database mounted
- released channel: ORA_DISK_1
- RMAN> exit
- Recovery Manager complete.
- [oracle@station80 ~]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.4.0 Production on Wed May 22 21:47:51 2019
- Copyright (c) 1982, 2013, Oracle. All rights reserved.
- SQL> conn / as sysdba
- Connected.
- SQL> show parameter control
- NAME TYPE VALUE
- ------------------------------------ ----------- ------------------------------
- control_file_record_keep_time integer 7
- control_files string +DATA/orcl/controlfile/current
- .260.1008971239, +FRA/orcl/con
- trolfile/current.256.100897123
- 9
- control_management_pack_access string DIAGNOSTIC+TUNING
- SQL> exit
- Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production
- With the Partitioning, Automatic Storage Management, OLAP, Data Mining
- and Real Application Testing options
- [oracle@station80 ~]$rman target /
- -bash: ▒rman: command not found
- [oracle@station80 ~]$ ▒rman target /
- -bash: ▒rman: command not found
- [oracle@station80 ~]$
- [oracle@station80 ~]$
- [oracle@station80 ~]$
- [oracle@station80 ~]$ rman target /
- -bash: ▒rman: command not found
- [oracle@station80 ~]$
- [oracle@station80 ~]$
- [oracle@station80 ~]$
- [oracle@station80 ~]$ . oraenv
- ORACLE_SID = [orcl] ?
- The Oracle base remains unchanged with value /u01/app/oracle
- [oracle@station80 ~]$ rman target /
- Recovery Manager: Release 11.2.0.4.0 - Production on Wed May 22 21:49:57 2019
- Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
- connected to target database: ORCL (DBID=1535788302, not open)
- RMAN> alter database open ;
- using target database control file instead of recovery catalog
- RMAN-00571: ===========================================================
- RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
- RMAN-00571: ===========================================================
- RMAN-03002: failure of alter db command at 05/22/2019 21:50:13
- ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
- RMAN> alter database open resetlogs;
- RMAN-00571: ===========================================================
- RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
- RMAN-00571: ===========================================================
- RMAN-03002: failure of alter db command at 05/22/2019 21:50:23
- ORA-01194: file 1 needs more recovery to be consistent
- ORA-01110: data file 1: '+DATA/orcl/datafile/system.256.1008007421'
- RMAN> recover database;
- Starting recover at 22-MAY-19
- Starting implicit crosscheck backup at 22-MAY-19
- allocated channel: ORA_DISK_1
- channel ORA_DISK_1: SID=12 device type=DISK
- Crosschecked 1 objects
- Finished implicit crosscheck backup at 22-MAY-19
- Starting implicit crosscheck copy at 22-MAY-19
- using channel ORA_DISK_1
- Crosschecked 2 objects
- Finished implicit crosscheck copy at 22-MAY-19
- searching for all files in the recovery area
- cataloging files...
- cataloging done
- List of Cataloged Files
- =======================
- File Name: +fra/ORCL/BACKUPSET/2019_05_22/ncnnf0_LABS-8A-CONTROLFILE_0.261.10089 70613
- using channel ORA_DISK_1
- starting media recovery
- archived log for thread 1 with sequence 5 is already on disk as file +DATA/orcl/ onlinelog/group_2.262.1008969079
- archived log for thread 1 with sequence 6 is already on disk as file +DATA/orcl/ onlinelog/group_3.261.1008969081
- archived log for thread 1 with sequence 7 is already on disk as file +DATA/orcl/ onlinelog/group_1.263.1008969079
- archived log file name=+DATA/orcl/onlinelog/group_2.262.1008969079 thread=1 sequ ence=5
- archived log file name=+DATA/orcl/onlinelog/group_3.261.1008969081 thread=1 sequ ence=6
- archived log file name=+DATA/orcl/onlinelog/group_1.263.1008969079 thread=1 sequ ence=7
- media recovery complete, elapsed time: 00:00:00
- Finished recover at 22-MAY-19
- RMAN> alter database open;
- RMAN-00571: ===========================================================
- RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
- RMAN-00571: ===========================================================
- RMAN-03002: failure of alter db command at 05/22/2019 21:51:36
- ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
- RMAN> alter database open resetogs;
- RMAN-00571: ===========================================================
- RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
- RMAN-00571: ===========================================================
- RMAN-00558: error encountered while parsing input commands
- RMAN-01009: syntax error: found "identifier": expecting one of: "resetlogs, ;"
- RMAN-01008: the bad identifier was: resetogs
- RMAN-01007: at line 1 column 21 file: standard input
- RMAN> alter database open resetlogs;
- database opened
- RMAN> list incarnation of database ;
- List of Database Incarnations
- DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
- ------- ------- -------- ---------------- --- ---------- ----------
- 1 1 ORCL 1535788302 PARENT 1 24-AUG-13
- 2 2 ORCL 1535788302 PARENT 925702 11-MAY-19
- 3 3 ORCL 1535788302 PARENT 1134795 22-MAY-19
- 4 4 ORCL 1535788302 CURRENT 1138641 22-MAY-19
- RMAN>
复制代码 关于日志成员:- select * from v$log;
- select * from v$logfile;
- alter database add logfile member '/home/oracle/redo02c.log' to group 2;
- alter database drop logfile member '/home/oracle/redo02c.log';
- alter system switch logfile;
- alter database drop logfile member '/home/oracle/redo02c.log';
复制代码
|
|