Skip to main content

Restoring rman backups.

C:\Documents and Settings\201910>sqlplus sys/mysecretpassword as sysdba

SQL*Plus: Release 10.1.0.2.0 - Production on Wed Nov 12 14:32:28 2008

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
C:\AUG\SYSTEM.DBF
C:\AUG\UNDOTBS1.DBF
C:\AUG\SYSAUX.DBF
C:\AUG\USERS.DBF

SQL> show parameter spfile;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string
SQL> create spfile from pfile;

File created.

SQL> show parameter spfile

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 1048576000 bytes
Fixed Size 792200 bytes
Variable Size 942401912 bytes
Database Buffers 104857600 bytes
Redo Buffers 524288 bytes
Database mounted.
Database opened.
SQL> show parameter spfile

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string C:\ORACLE\PRODUCT\10.1.0\DB_1\
DATABASE\SPFILEAUG.ORA
SQL> create pfile from spfile;

File created.

SQL> EXIT
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

C:\Documents and Settings\201910>oradim -new -sid NOV -intpwd MYSECRETPASSWORD -startmode M
Instance created.

C:\Documents and Settings\201910>sqlplus sys/mysecretpassword@NOV AS SYSDBA

SQL*Plus: Release 10.1.0.2.0 - Production on Wed Nov 12 14:56:41 2008

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> startup nomount;
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1048576000 bytes
Fixed Size 792200 bytes
Variable Size 942401912 bytes
Database Buffers 104857600 bytes
Redo Buffers 524288 bytes
SQL> EXIT
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

C:\Documents and Settings\201910>set ORACLE_SID=NOV

C:\Documents and Settings\201910>rman target sys/mysecretpasswd

Recovery Manager: Release 10.1.0.2.0 - Production

Copyright (c) 1995, 2004, Oracle. All rights reserved.

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04005: error from target database:
ORA-01017: invalid username/password; logon denied

C:\Documents and Settings\201910>rman target sys/mysecretpassword

Recovery Manager: Release 10.1.0.2.0 - Production

Copyright (c) 1995, 2004, Oracle. All rights reserved.

connected to target database (not started)

RMAN> set controlfile autobackup format for device type disk to 'C:\RMAN2\RMANBKP%F';

executing command: SET CONTROLFILE AUTOBACKUP FORMAT
using target database controlfile instead of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of CSET command at 11/12/2008 15:07:21
RMAN-06403: could not obtain a fully authorized session
ORA-01034: ORACLE not available

RMAN> shutdown immediate;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of shutdown command at 11/12/2008 15:07:38
RMAN-06403: could not obtain a fully authorized session
ORA-01034: ORACLE not available

RMAN> exit


Recovery Manager complete.

C:\Documents and Settings\201910>sqlplus sys/mysecretpassword@NOV AS SYSDBA

SQL*Plus: Release 10.1.0.2.0 - Production on Wed Nov 12 15:07:46 2008

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> shut immediate;
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

C:\Documents and Settings\201910>rman target sys/mysecretpassword

Recovery Manager: Release 10.1.0.2.0 - Production

Copyright (c) 1995, 2004, Oracle. All rights reserved.

connected to target database (not started)

RMAN> startup nomount;

Oracle instance started

Total System Global Area 1048576000 bytes

Fixed Size 792200 bytes
Variable Size 942401912 bytes
Database Buffers 104857600 bytes
Redo Buffers 524288 bytes

RMAN> set controlfile autobackup format for device type disk to 'C:\RMAN2\RMANBKP%F';

executing command: SET CONTROLFILE AUTOBACKUP FORMAT
using target database controlfile instead of recovery catalog

RMAN> restore controlfile from autobackup;

Starting restore at 12-NOV-08
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=160 devtype=DISK

recovery area destination: C:\oracle\flash_recovery_area
database name (or lock name space) used for search: NOV
channel ORA_DISK_1: no autobackups found in the recovery area
autobackup search outside recovery area not attempted because DBID was not set
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 11/12/2008 15:09:13
RMAN-06172: no autobackup found or specified handle is not a valid copy or piece

RMAN> set controlfile autobackup format for device type disk to 'C:\RMAN2\RMANBKP\%F';

executing command: SET CONTROLFILE AUTOBACKUP FORMAT

RMAN> restore controlfile from autobackup;

Starting restore at 12-NOV-08
using channel ORA_DISK_1

recovery area destination: C:\oracle\flash_recovery_area
database name (or lock name space) used for search: NOV
channel ORA_DISK_1: no autobackups found in the recovery area
autobackup search outside recovery area not attempted because DBID was not set
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 11/12/2008 15:11:41
RMAN-06172: no autobackup found or specified handle is not a valid copy or piece

RMAN> shutdown immediate;

Oracle instance shut down

RMAN> set dbid 4202246879;

executing command: SET DBID

RMAN> startup nomount;

connected to target database (not started)
Oracle instance started

Total System Global Area 1048576000 bytes

Fixed Size 792200 bytes
Variable Size 942401912 bytes
Database Buffers 104857600 bytes
Redo Buffers 524288 bytes

RMAN> set controlfile autobackup format for device type disk to 'C:\RMAN2\RMANBKP\%F';

executing command: SET CONTROLFILE AUTOBACKUP FORMAT

RMAN> shutdown immediate;

Oracle instance shut down

RMAN> startup nomount;

connected to target database (not started)
Oracle instance started

Total System Global Area 1048576000 bytes

Fixed Size 792200 bytes
Variable Size 942401912 bytes
Database Buffers 104857600 bytes
Redo Buffers 524288 bytes

RMAN> set controlfile autobackup format for device type disk to 'C:\RMAN2\RMANBKP\%F';

executing command: SET CONTROLFILE AUTOBACKUP FORMAT

RMAN> RESTORE CONTROLFILE FROM AUTOBACKUP;

Starting restore at 12-NOV-08
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=160 devtype=DISK

recovery area destination: C:\oracle\flash_recovery_area
database name (or lock name space) used for search: NOV
channel ORA_DISK_1: no autobackups found in the recovery area
channel ORA_DISK_1: looking for autobackup on day: 20081112
channel ORA_DISK_1: autobackup found: C:\RMAN2\RMANBKP\c-4202246879-20081112-01
channel ORA_DISK_1: controlfile restore from autobackup complete
output filename=C:\NOV\CONTROL23.CTL
output filename=C:\NOV\CONTROL33.CTL
output filename=C:\NOV\CONTROL34.CTL
Finished restore at 12-NOV-08

RMAN> alter database mount;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 11/12/2008 15:20:43
ORA-01103: database name 'AUG' in controlfile is not 'NOV'

RMAN>

Comments

Unknown said…
Wow!! excellent stuff. Thanks for sharing this info.

Thanks,
Mm

Popular posts from this blog