Remember your dreams

Remember your dreams
Remember your dreams

Wednesday, December 7, 2011

Unlock locked statistics

ORA-20005: object statistics are locked (stattype = ALL)
ORA-06512: at “SYS.DBMS_STATS”, line 23154
ORA-06512: at “SYS.DBMS_STATS”, line 23205…
 
To unlock lock statistics for a table execute the following procedure:

exec DBMS_STATS.UNLOCK_TABLE_STATS('OWNER', 'TABLE_NAME');

Read my post about how to prevent statistics from becoming locked after expdp impdp

Preventing locked Statistics after expdp impdp

Cannot gather table statistics after data pump import impdp


exec dbms_stats.gather_table_stats(ownname=>'USER1',tabname=>'EMP');

ORA-20005: object statistics are locked (stattype = ALL)
ORA-06512: at “SYS.DBMS_STATS”, line 23154
ORA-06512: at “SYS.DBMS_STATS”, line 23205…

To unlock table Statistics see the following post:
Unlocking Table Statistics

I ran into this issue when I was exporting a schema from one database to import to another database.
I was not importing the rows only the objects and noticed the statistics came over. When trying to gather new statistic I received an error saying that the Statistics were locked. To prevent the statistic from being locked after importing I used the EXCLUDE STATISTICS parameter in the export.

This way the statistics are ignored and will not be locked on the new database.


In this example I want the entire schema with the exception of certain tables. I do not want Grants, rows, or statistics. Use the EXCLUDE STATISTICS parameter to prevent your statistics from being locked once you complete the import.

expdp_user1_tables.par
 
USERID=
DUMPFILE=user1_tables
LOGFILE=user1_tables
SCHEMAS=USER1
EXCLUDE=TABLE:"IN ('CONTRACT_TYPES','TIME_CODES','LAB_BOOK_ACCESS')",GRANT, TABLE_DATA
EXCLUDE=STATISTICS

Run the expdp to export the schema.
The following on one line:
dpdir> expdp parfile=expdp_user1_tables.par DIRECTORY=DATA_PUMP_DIR

ftp the dump file,  user1_tables.dmp, to the new database server.

impdp_user1_tables.par
USERID=
LOGFILE=imp_user1_tables
DUMPFILE=user1_tables

 dpdir> impdp parfile=imp_user1_tables.par DIRECTORY=DATA_PUMP_DIR

For more information on using Data Pump see the following post:



Wednesday, February 16, 2011

Scheduler and data pump expdb

Oracle Enterprise Edition 11.2.0.2
Linux x86_64, RH 5

I would like to routinely export some or all of my database as part of my DR strategy. I have always used crontab to call my expdp script on a routine basis. Now I want to change that from using crontab to using Oracle Scheduler.

First I will review the shell script and parfile I use. Then I will use Oracle Scheduler to schedule the execution of this shell script.

This is my full export but with subtle modifications I also export specific schemas on a more frequent basis. I am using csh for this shell script.

This is expdp_full.sh

#!/bin/csh
# set the environment
setenv ORACLE_HOME /app/oracle/product/11.2.0.2
setenv ORACLE_SID grims
setenv ORACLE_BASE /app/oracle

setenv LOGFILE expdp_full.log
setenv DUMPFILE expdp_full.dmp
setenv DMPDIR /scripts/expdp

# expdp does not like files it wants
# to create lying around so I will clean
# any up just in case.

# check for existing logfile and
# remove if found.
if ( -e ${DMPDIR}/${LOGFILE} ) then
rm ${DMPDIR}/${LOGFILE}
endif

# check for existing dump file and
# remove if found.
if ( -e ${DMPDIR}/${DUMPFILE} ) then
rm ${DMPDIR}/${DUMPFILE}
endif

# change to the working directory
chdir ${DMPDIR}

# call expdp and use the full path to it.
/app/oracle/product/11.2.0.2/bin/expdp parfile=expdp_full.par DUMPFILE=${DUMPFILE} LOGFILE=${LOGFILE} DIRECTORY=DMPDIR

# once the expdp is complete zip it to save space.
# You can use the compress command in UNIX.
zip ${DUMPFILE}.`date +%m%d`.Z ${DUMPFILE}

# Get the log status for email.
set STATUS=`grep Job ${DMPDIR}/${LOGFILE}`

# mail results.

mailx -s "${ORACLE_SID} on `uname -n` FULL export '$STATUS'" email@company.com < ${DMPDIR}/${LOGFILE}

# delete the existing dump file. Zip does not remove it.
if ( -e ${DMPDIR}/${DUMPFILE} ) then
rm ${DMPDIR}/${DUMPFILE}
endif

# rename the log file to preserve it.
if ( -e ${DMPDIR}/${LOGFILE} ) then
mv ${DMPDIR}/${LOGFILE} ${DMPDIR}/${LOGFILE}.`date +%m%d`
endif
exit


The par files. This is both the full expdp and another with specific schemas.
expdp_full.par
USERID="/ as sysdba"
FULL=Y

expdp_users.par
USERID="/ as sysdba"
SCHEMAS=SCOTT,HR,APPS

Of course you can stop here and use crontab to execute expdp_full.sh, but I am going to now use the Oracle Scheduler.

First I will create the scheduled job to run every morning at 2:05am. Once it runs successfully for a few days and I like the out put I will update the schedule to run this task once a week.

From sqlplus enter the new scheduled job.

BEGIN
dbms_scheduler.CREATE_JOB (
job_name => 'expdp_full',
job_type => 'EXECUTABLE',
job_action => '/oracle/scripts/expdp/expdp_full.sh',
start_date => to_date('02/14/2011 14:00:00','mm/dd/yyyy hh24:mi:ss'),
repeat_interval => 'FREQ=DAILY;BYHOUR=2;BYMINUTE=5;BYSECOND=0',
end_date => null,
enabled => TRUE,
comments => 'expdp full database');
END;

To update the frequency interval to once a week, Friday morning at 2:05am:

BEGIN
sys.dbms_scheduler.disable( '"SYS"."EXPDP_FULL"' );
sys.dbms_scheduler.set_attribute( name => '"SYS"."EXPDP_FULL"', attribute => 'repeat_interval', value => 'FREQ=WEEKLY;BYDAY=FRI;BYHOUR=2;BYMINUTE=5;BYSECOND=0');
sys.dbms_scheduler.enable( '"SYS"."EXPDP_FULL"' );
END;

Here are some useful queries to examine the scheduler jobs.

SQL> SELECT JOB_NAME, STATE FROM DBA_SCHEDULER_JOBS where job_name = 'EXPDP_FULL';
JOB_NAME STATE
------------------------------ ---------------
EXPDP_FULL SCHEDULED

SQL> SELECT * FROM ALL_SCHEDULER_RUNNING_JOBS;
no rows selected

The following will show the history of a specific job and whether it succeeded or not. Just because the job succeeded does not mean the script ran without errors. The next query is an example where this first query said SUCCEEDED yet the script failed to run.

SELECT to_char(log_date, 'DD-MON-YY HH24:MM:SS') TIMESTAMP, job_name,
job_class, operation, status FROM USER_SCHEDULER_JOB_LOG
WHERE job_name = 'EXPDP_FULL' ORDER BY log_date;

Show more detail about an job history. This is the output before I gave the full path in my shell script to extdp.

SELECT to_char(log_date, 'DD-MON-YY HH24:MM:SS') TIMESTAMP, job_name, status,
SUBSTR(additional_info, 1, 40) ADDITIONAL_INFO
FROM user_scheduler_job_run_details
WHERE job_name = 'EXPDP_FULL'
ORDER BY log_date;

14-FEB-11 14:02:02 EXPDP_FULL SUCCEEDED STANDARD_ERROR="expdp: Command not found

Friday, December 3, 2010

Cannot find backups when restoring database to new host.


Restore database to different host.

Oracle 11gR2. 11.2.0.1.0
Linux RH5
NetBackup 6.5.5

You may want to restore your production database to a different host, for example, to the development host database server, for testing purposes. This allows you to test your current backups and rehearse the necessary steps required in the event of a real emergency or hardware failure on the production host. In the event that you cannot rebuild the production environment in a reasonable time frame whether waiting on parts or technical expertise, this may be the answer to getting your production back up and running in hours compared to days.

Regardless of your reasons, it is a great method of testing backups and your restoration capabilities.

* RECOMMENDATION *
Rehearse, document, and practice your ability to recover the database on a regular basis. This should be part of your regular monthly tasks. When disaster strikes you will be glad you have routinely rehearsed these procedures.

I am using a development environment identical to my production environment (I know, nice eh?). Identical versions of Oracle are on both severs and my production specific directories already exist on my development server.

If your production directory structure does not exist on the development server then restore those folders from a backup of the production server. You can create them, but it is much easier to just restore them.

* IMPORTANT *
Be sure to delete any prod archive log folders on the dev server that were restored from the production server. This is important because you do not want this information cataloged during the restore (it will prevent you from finding the desired backup sets to restore). Our assumption is a total failure of the production sever so the only archive logs we want have been included in our last backup.

In this example I will restore my production instance, prod, to the development database, dev, server. I will shutdown the dev instance although you can opt to modify your memory parameters (modifying Oracle memory parameters to run both prod and dev on the same server).

-- On the development server. --
1. Recreate your production directory structure.

2. Delete any production archive log file directories.

3. Create a prod password file.
\
4. Shut down emctl for dev.

%
emctl stop dbconsole
Stopping Oracle Enterprise Manager 11g Database Control ...

... Stopped.


Shutdown the DEV instance

%
sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Fri Dec 3 08:38:12 2010

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> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> quit


Thursday, October 14, 2010

ORA-24247: network access denied by access control list (ACL) - Enabling UTL_MAIL

I first came across this issue when migrating from version 10 to 11gR2. It continues to rear its ugly head even as I migrate to version 12.2.0.1 causing my my email alert package to no longer work.

I use a custom mail package to send email to users and alerts to the DBA. 

Executing returns the following error:
ORA-24247: network access denied by access control list (ACL).

What is this ACL business all about? It all started as a new feature in 11g and now just a feature in 12c. Oracle likes to call it Fine-Grain Access to External Network Services.

I am going to focus on my need to get the utl_mail.send procedure working again. This is how to resolve the issue and
more on enabling UTL_MAIL.

This original information I used to resolve this came from the 11gR2 documentation, but as I recently discovered still holds true in 12.2.0.1. For the 11gR2 documentation, including writing a custom mail package of your own, look to the following Oracle documentation.

Oracle® Database Security Guide
11g Release 2 (11.2)

Part Number E16543-02


If this link does not work for you,
Google for "Verifying Security Access with Auditing"

Search for "
Install and Configure the UTL_MAIL PL/SQL Package" within the document.
You may see an error like the following:

ERROR at line 1:
ORA-29278: SMTP transient error: 421 Service not available
ORA-06512: at "SYS.UTL_MAIL", line 654
ORA-06512: at "SYS.UTL_MAIL", line 671
ORA-06512: at line 2

or

ERROR at line 1:
ORA-24247: network access denied by

access control list (ACL)


Let's start by testing the utl_mail.send procedure.

SQL> begin

utl_mail.send(

sender => 'hackworthho@lilly.com',

recipients => 'hackworthho@lilly.com',

subject => 'Subject',

message => 'Test Message');

end;

/

utl_mail.send(

*

ERROR at line 2:

ORA-06550: line 2, column 1:

PLS-00201: identifier 'UTL_MAIL.SEND' must be declared

ORA-06550: line 2, column 1:

PL/SQL: Statement ignored

For starters the utl_mail package is not installed.
UTL_MAIL is not installed in by default 11g and 12c.
You must install it manually.

Install and Configure the UTL_MAIL PL/SQL Package
% sqlplus / as sysdba
SQL> @?/rdbms/admin/utlmail.sql

SQL> @?/rdbms/admin/prvtmail.plb

If are not going to be sys then be sure to grant execute to utl_mail package to the user you are going to be executing the mail send procedure as. In this example I'll use HOWARD and the user HOWARD will own the custom mail package. Replace user HOWARD with your desired user.
GRANT EXECUTE ON SYS.UTL_MAIL TO HOWARD;

Now determine your smtp outgoing mail server. Once you have this you need to configure the database parameter set smtp_out_server.
Set the SMTP_OUT_SERVER parameter
SQL> alter system set smtp_out_server = smtp server:port scope=both;

As in
SQL> alter system set smtp_out_server = 'smtp-server.com:25’ scope=both;

System altered.

Now you need to create and configure the ACL (Access Control List).
Configuring the ACL (Access Control List) File for Network Services.


Before you can use PL/SQL network utility packages such as UTL_MAIL, you must configure an access control list (ACL) file that enables fine-grained access to external network services.
To configure an access control list for the e-mail alert.

Start by creating the ACL
SQL> begin
dbms_network_acl_admin.create_acl (
acl => 'utl_mail.xml',
description => 'Enables mail to be sent',
principal => 'HOWARD',is_grant => true,
privilege => 'connect');
end;
/

PL/SQL procedure successfully completed.

SQL> commit;

Commit complete.

Assign the access control list to the outgoing SMTP network host for your e-mail server.

SQL> begin

dbms_network_acl_admin.assign_acl (

acl => 'utl_mail.xml',

host => 'your smtp-server.com',

lower_port => 25);

end;

/


PL/SQL procedure successfully completed.


SQL> commit;

Commit complete.


Finally grant permission to use it,
SQL> begin
DBMS_NETWORK_ACL_ADMIN.add_privilege (
acl => 'utl_mail.xml',
principal => 'HOWARD',
is_grant => TRUE,
privilege => 'connect');
end;
/

Let's try the utl_mail send package again and see if it works.


SQL> begin
utl_mail.send(
sender => 'hackworthho@lilly.com',
recipients => 'hackworthho@lilly.com',
subject => 'Subject',
message => 'Test Message from HOWARD');
end;
/
PL/SQL procedure successfully completed.

SQL> commit;

Commit complete.
Looks like we are back in business and I did receive an email.


To Drop the ACL and start over issue the drop ACL command:
SQL> begin
DBMS_NETWORK_ACL_ADMIN.drop_acl(acl=>'utl_mail.xml');
end;
/
SQL> commit;

Commit complete.

Here are some useful queries you can use to verify the information on your database:

SELECT host,lower_port,upper_port,acl,DECODE(DBMS_NETWORK_ACL_ADMIN.check_privilege_aclid(aclid, 'HOWARD', 'connect'),
1, 'GRANTED', 0, 'DENIED', null) PRIVILEGE FROM dba_network_acls
WHERE host IN (SELECT * FROM TABLE(DBMS_NETWORK_ACL_UTILITY.domains('your smtp server.com')))
ORDER BY DBMS_NETWORK_ACL_UTILITY.domain_level(host) desc, lower_port, upper_port;

SELECT acl,principal,privilege,is_grant,TO_CHAR(start_date, 'DD-MON-YYYY') AS start_date,TO_CHAR(end_date, 'DD-MON-YYYY') AS end_date
FROM dba_network_acl_privileges;

select host, lower_port, upper_port, acl,DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE_ACLID(aclid,null,'connect') GRANTED from dba_network_acls;

Friday, July 30, 2010

Oracle Disaster Recovery Test.

I will intentionally destroy my DEV instance in order to provide an example of restoring and recovering the database using Oracle RMAN an and RMAN Catalog.

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 – Production

Create a new pfile and backup the spfile just for kicks
SQL> create pfile from spfile;
mv spfiledev.ora spfiledev.old.ora

cd /u01/oradata/dev
# ls
control01.ctl
sysaux01.dbf
system01.dbf

#pwd
/u01/oradata/dev
# rm *

#cd /u02/oradata/dev/

# ls
control02.ctl
redo01a.rdo
redo02a.rdo
redo03a.rdo

#pwd
/u02/oradata/dev
# rm *

#cd /u03/oradata/dev/

# ls
control03.ctl
redo01b.rdo
redo02b.rdo
redo03b.rdo

#pwd
/u03/oradata/dev
# rm *

# cd /u04/oradata/dev/
# ls
undotbs01.dbf

#pwd
/u04/oradata/dev
# rm *

-- Login to sqlplus
SQL> select * from tab;
select * from tab
*
ERROR at line 1:
ORA-01116: error in opening database file 1
ORA-01110: data file 1: '/oracle/u01/oradata/dev/system01.dbf'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3













SQL> shutdown immediate;
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/oracle/u01/oradata/dev/control01.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

SQL> shutdown abort;
ORACLE instance shut down.

# sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Jul 29 09:45:59 2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.

SQL> startup
ORACLE instance started.
ORA-00205: error in identifying control file, check alert log for more info

SQL> shutdown abort;
ORACLE instance shut down.

# sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Jul 29 09:58:42 2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.

SQL> startup nomount
ORACLE instance started.

-- login to rman and the rman catalog
#rman target / rcvcat_login/rcvcat_passwd@rcvcat
Recovery Manager: Release 11.2.0.1.0 - Production on Thu Jul 29 10:00:20 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: DEV (not mounted)
connected to recovery catalog database

RMAN> list incarnation of database dev;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
198582917 198582918 DEV 3800958841 CURRENT 1 25-JUN-10

RMAN> set dbid 3800958841
executing command: SET DBID
database name is "DEV" and DBID is 3800958841

RMAN> RESTORE SPFILE FROM AUTOBACKUP;

Starting restore at 29-JUL-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=98 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=114 device type=DISK
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=130 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: Veritas NetBackup for Oracle - Release 6.5 (2010011113)
allocated channel: ORA_SBT_TAPE_2
channel ORA_SBT_TAPE_2: SID=146 device type=SBT_TAPE
channel ORA_SBT_TAPE_2: Veritas NetBackup for Oracle - Release 6.5 (2010011113)

channel ORA_SBT_TAPE_1: looking for AUTOBACKUP on day: 20100729
channel ORA_SBT_TAPE_1: AUTOBACKUP found: c-3800958841-20100729-01
channel ORA_SBT_TAPE_2: looking for AUTOBACKUP on day: 20100729
channel ORA_SBT_TAPE_2: skipped, AUTOBACKUP already found
recovery area destination: /app/oracle/flash_recovery_area
database name (or database unique name) used for search: DEV
channel ORA_DISK_1: no AUTOBACKUPS found in the recovery area
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20100729
channel ORA_DISK_1: skipped, AUTOBACKUP already found
recovery area destination: /app/oracle/flash_recovery_area
database name (or database unique name) used for search: DEV
channel ORA_DISK_2: no AUTOBACKUPS found in the recovery area
channel ORA_DISK_2: looking for AUTOBACKUP on day: 20100729
channel ORA_DISK_2: skipped, AUTOBACKUP already found
channel ORA_SBT_TAPE_1: restoring spfile from AUTOBACKUP c-3800958841-20100729-01
channel ORA_SBT_TAPE_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 29-JUL-10

RMAN>
RMAN> SHUTDOWN IMMEDIATE;
Oracle instance shut down

RMAN> STARTUP FORCE NOMOUNT;
Oracle instance started

RMAN> run {
2> RESTORE CONTROLFILE FROM AUTOBACKUP;
3> ALTER DATABASE MOUNT;
4> }

Starting restore at 29-JUL-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=98 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=114 device type=DISK
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=130 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: Veritas NetBackup for Oracle - Release 6.5 (2010011113)
allocated channel: ORA_SBT_TAPE_2
channel ORA_SBT_TAPE_2: SID=146 device type=SBT_TAPE
channel ORA_SBT_TAPE_2: Veritas NetBackup for Oracle - Release 6.5 (2010011113)

channel ORA_SBT_TAPE_1: looking for AUTOBACKUP on day: 20100729
channel ORA_SBT_TAPE_2: skipped, AUTOBACKUP already found
recovery area destination: /app/oracle/flash_recovery_area
database name (or database unique name) used for search: DEV
channel ORA_DISK_1: no AUTOBACKUPS found in the recovery area
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20100729
channel ORA_DISK_1: skipped, AUTOBACKUP already found
recovery area destination: /app/oracle/flash_recovery_area
database name (or database unique name) used for search: DEV
channel ORA_DISK_2: no AUTOBACKUPS found in the recovery area
channel ORA_DISK_2: looking for AUTOBACKUP on day: 20100729
channel ORA_DISK_2: skipped, AUTOBACKUP already found
channel ORA_SBT_TAPE_1: restoring control file from AUTOBACKUP c-3800958841-20100729-01
channel ORA_SBT_TAPE_1: control file restore from AUTOBACKUP complete
output file name=/u01/oradata/dev/control01.ctl
output file name=/u02/oradata/dev/control02.ctl
output file name=/u03/oradata/dev/control03.ctl
Finished restore at 29-JUL-10

database mounted
released channel: ORA_DISK_1
released channel: ORA_DISK_2
released channel: ORA_SBT_TAPE_1
released channel: ORA_SBT_TAPE_2

-- Restore to the last archive log file backed up.
RMAN> list backup of archivelog from scn=1;
List of Backup Sets
===================
List of Archived Logs in backup set 208615940
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 40 5138860 27-JUL-10 5214805 28-JUL-10

RMAN> RUN {
2> SET UNTIL SEQUENCE 40 THREAD 1;
3> RESTORE DATABASE;
4> RECOVER DATABASE;
5> ALTER DATABASE OPEN RESETLOGS;
6> }

executing command: SET until clause

Starting restore at 30-JUL-10
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_SBT_TAPE_1
using channel ORA_SBT_TAPE_2

channel ORA_SBT_TAPE_1: starting datafile backup set restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
channel ORA_SBT_TAPE_1: restoring datafile 00001 to /u01/oradata/dev/system01.dbf
channel ORA_SBT_TAPE_1: restoring datafile 00004 to /u06/oradata/dev/users01.dbf
channel ORA_SBT_TAPE_1: reading from backup piece bk_62_1_725106021
channel ORA_SBT_TAPE_2: starting datafile backup set restore
channel ORA_SBT_TAPE_2: specifying datafile(s) to restore from backup set
channel ORA_SBT_TAPE_2: restoring datafile 00002 to /u01/oradata/dev/sysaux01.dbf
channel ORA_SBT_TAPE_2: restoring datafile 00003 to /u04/oradata/dev/undotbs01.dbf
channel ORA_SBT_TAPE_2: reading from backup piece bk_61_1_725106021
channel ORA_SBT_TAPE_1: piece handle=bk_62_1_725106021 tag=HOT_DB_BK_LEVEL0
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:01:55
channel ORA_SBT_TAPE_2: piece handle=bk_61_1_725106021 tag=HOT_DB_BK_LEVEL0
channel ORA_SBT_TAPE_2: restored backup piece 1
channel ORA_SBT_TAPE_2: restore complete, elapsed time: 00:02:05
Finished restore at 30-JUL-10

Starting recover at 30-JUL-10
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_SBT_TAPE_1
using channel ORA_SBT_TAPE_2

starting media recovery

channel ORA_SBT_TAPE_1: starting archived log restore to default destination
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=1 sequence=36
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=1 sequence=37
channel ORA_SBT_TAPE_1: reading from backup piece al_69_1_725533318
channel ORA_SBT_TAPE_2: starting archived log restore to default destination
channel ORA_SBT_TAPE_2: restoring archived log
archived log thread=1 sequence=38
channel ORA_SBT_TAPE_2: restoring archived log
archived log thread=1 sequence=39
channel ORA_SBT_TAPE_2: reading from backup piece al_70_1_725533318
channel ORA_SBT_TAPE_2: piece handle=al_70_1_725533318 tag=TAG20100728T090157
channel ORA_SBT_TAPE_2: restored backup piece 1
channel ORA_SBT_TAPE_2: restore complete, elapsed time: 00:00:45
channel ORA_SBT_TAPE_1: piece handle=al_69_1_725533318 tag=TAG20100728T090157
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:01:15
archived log file name=/app/oracle/flash_recovery_area/DEV/archivelog/2010_07_30/o1_mf_1_36_655w8sr0_.arc thread=1 sequence=36
channel default: deleting archived log(s)
archived log file name=/app/oracle/flash_recovery_area/DEV/archivelog/2010_07_30/o1_mf_1_36_655w8sr0_.arc RECID=36 STAMP=725704495
archived log file name=/app/oracle/flash_recovery_area/DEV/archivelog/2010_07_30/o1_mf_1_37_655w8sqg_.arc thread=1 sequence=37
channel default: deleting archived log(s)
archived log file name=/app/oracle/flash_recovery_area/DEV/archivelog/2010_07_30/o1_mf_1_37_655w8sqg_.arc RECID=37 STAMP=725704496
archived log file name=/app/oracle/flash_recovery_area/DEV/archivelog/2010_07_30/o1_mf_1_38_655w7xmk_.arc thread=1 sequence=38
channel default: deleting archived log(s)
archived log file name=/app/oracle/flash_recovery_area/DEV/archivelog/2010_07_30/o1_mf_1_38_655w7xmk_.arc RECID=35 STAMP=725704470
archived log file name=/app/oracle/flash_recovery_area/DEV/archivelog/2010_07_30/o1_mf_1_39_655w7xm0_.arc thread=1 sequence=39
channel default: deleting archived log(s)
archived log file name=/app/oracle/flash_recovery_area/DEV/archivelog/2010_07_30/o1_mf_1_39_655w7xm0_.arc RECID=34 STAMP=725704469
media recovery complete, elapsed time: 00:00:14
Finished recover at 30-JUL-10

database opened
new incarnation of database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN>exit

-- log into sqlplus and check the database status.
SQL> select status from v$instance;
STATUS
------------
OPEN

SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 1
Next log sequence to archive 1
Current log sequence 1

Proactive Oracle DBA

This is a series of posts. I am working this to share some of the many scripts I schedule to automatically run to alert me of any current o...