2009/02/27

Unregister Database from Catalog When Database is Already Deleted

The following steps can help unregister database when database is already deleted.

1. Connect to catalog database in SQL*Plus using the user having the catalog schema and find out what databases are in there.

SQL> SELECT db_id FROM db;
2. Connect to catalog database in RMAN using the user having the catalog schema and unregister the database.

$ RMAN CATALOG user/pwd@catalog
If you know which dbid is the database you want to unregister, using this command:

RMAN> RUN {
2> SET DBID 1334531173;
3> UNREGISTER DATABASE;
4> }
If you are not sure which dbid, you can try all the dbid is 'db' table in the first step and RMAN will show you database name and ask you if you want to unregister the database.

2009/02/25

9i Agent and 10g Agent on the Same Host

OS: windows 2003
Database: 9.2.0.5

Currently, some problem happened when both 9i Agent and 10g Agent are running on the
same host. The database is configured in both OEM 9i and Grid Control 10g. The database
was originally monitored by OEM 9i. There was a backup job schedule inside OEM 9i.
After installing agent 10g and configuring the database under Grid Control 10g, the
new backup job inside Grid Control is fine. But the backup job inside OEM 9i stays
'started' status while the job is actually successfully executed. Rescheduling job in
OEM 9i can not always resolve the problem. The resule is random.

No idea about the reason!

2009/02/23

RMAN 9i Fails selecting from v$session_longops

Oracle Database: 9.2.0.5

Error:
RMAN-10006: error running SQL statement: select sofar, context, start_time
from v$session_longops where (start_time > nvl(:1, sysdate-100) or
start_time = nvl(:2, sysdate+100)) and sid = :3 and serial#
= :4 and opname like 'RMAN:%' order by start_time desc, context
desc
RMAN-10002: ORACLE : ORA-01041: internal error. hostdef extension doesn't exist

Cause:
It is possible for longop statistics to be corrupted and possibly
cause internal errors or core dumps. This problem can also result in NULL values in V$SESSION_LONGOPS.

Solution:
1) Restart instance may solve the problem.
2) Bug 3123232 is fixed in 9.2.0.6 so apply 9206 PSR.
3) Use the workaround:
Add to the init.ora/spfile of the target database. Switch off long-op statistics by setting the following (9.2 specific) settings in the (s)pfile:

optimizer_features_enable=9.2.0.1
_subquery_pruning_mv_enabled=false

Instance will have to be restarted.

2009/02/20

RMAN-20242 While Trying To Restore ArchiveLogs on RAC

Oracle DB RAC: 10.2.0.2

On RAC database, when you want to restore archivelog files from backup using RMAN,
always remember to specify which thread you want to restore. Otherwise, you will have
the following error:

RMAN-20242: specification does not match any archive log in the recovery catalog

For example, if you want to restore archivelog logseq=9455 for thread 2, then insread of using

RMAN> resoter archivelog logseq=9455;
you shold use

RMAN> resoter archivelog logseq=9455 thread 2;

2009/02/09

Unsecure AS Control

OAS 10.1.2.0.2

1. Stop the AS Control

$ emctl stop iasconsole
2. Update AS Control's standalone OC4J container to support unsecure port in $ORACLE_HOME/sysman/j2ee/config/emd-web-site.xml.

Change the following line:

<web-site host="ALL" port="<port>" display-name="Oracle Enterprise Manager iAS Console Website" secure="true">

Into:

<web-site host="ALL" port="<port>" display-name="Oracle Enterprise Manager iAS Console Website" secure="false">

3. In the same file (emd-web-site.xml), you also need to modify the ssl-config section at the bottom of the file.

Change the following line:

<ssl-config needs-client-auth="true" keystore="server/keystore.test" keystore-password="%EMD_KEYSTORE_PASSWORD%" />

Into:

<ssl-config needs-client-auth="false" keystore="server/keystore.test" keystore-password="%EMD_KEYSTORE_PASSWORD%" />

4. Update AS Control Local Management Agent to support the unsecure HTTP protocol.
The EMD_URL property in $ORACLE_HOME/sysman/config/emd.properties needs to get switched back to the HTTP (non-secure) protocol.

Change:

EMD_URL=https://<hostname>:<port>/emd/main

Into:

EMD_URL=http://<hostname>:<port>/emd/main

5. Update the standAloneConsoleURL property of oracle_ias target. Edit the file $ORACLE_HOME/sysman/emd/targets.xml to change the StandaloneConsoleURL property of oracle_ias target to switch back to the HTTP (non-secure) protocol.

Change the following lines:

<Target TYPE="oracle_ias" NAME="EnterpriseManager.<hostname>" ...> ... <Property NAME="StandaloneConsoleURL" VALUE="https://<hostname>:<port>/emd/console"/>

Into:

<Target TYPE="oracle_ias" NAME="EnterpriseManager.<hostname>" ...> ... <Property NAME="StandaloneConsoleURL" VALUE="http://<hostname>:<port>/emd/console"/>

6. Start the AS Control Application:

$ emctl start iasconsole

2009/02/06

Configuring Database for RMAN Operations

1. Create RMAN user with sysdba privilege and default tablespace.

SQL> CRAETE USER <user> IDENTIFIED BY <password>
SQL> DEFAULT TABLESPACE users;
SQL> GRANT sysdba TO <user>;
2. Create password file so that RMAN user can log in from remote via Oracle Net.
3.

SQL> ALTER SYSTEM SET REMOTE_LOGIN_PASSWORDFILE='exclusive';
4. Set CONTROL_FILE_RECORD_KEEP_TIME Parameter to a value no less than your selected database backup retention period.
5. Configure RMAN default settings.