Posts

Drop the EMCA repository,sysman schema and objects

[oracle@linux200 bin]$ emca -deconfig dbcontrol db -repos drop STARTED EMCA at Jun 19, 2013 4:11:49 PM EM Configuration Assistant, Version 10.2.0.1.0 Production Copyright (c) 2003, 2005, Oracle.  All rights reserved. Enter the following information: Database SID: ORCL Listener port number: 1521 Password for SYS user: Password for SYSMAN user: Do you wish to continue? [yes(Y)/no(N)]: Y Jun 19, 2013 4:12:28 PM oracle.sysman.emcp.EMConfig perform INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/ORCL/emca_2013-06-19_04-11-48-PM.log. Jun 19, 2013 4:12:29 PM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration WARNING: EM is not configured for this database. No EM-specific actions can be performed. Jun 19, 2013 4:12:29 PM oracle.sysman.emcp.EMReposConfig dropRepository INFO: Dropping the EM repository (this may take a while) ... ethod 2: Drop the repository schema and object (no quiesce): Logon SQLPLUS as user SYS or SYSTEM, and drop the sys...

CREATE STANDBY DATABASE USING RMAN

[oracle@linux1 database]$ sqlplus /"As sysdba" SQL*Plus: Release 11.1.0.6.0 - Production on Sat Mar 2 19:10:41 2013 Copyright (c) 1982, 2007, Oracle.   All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> select banner from v$version; BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production PL/SQL Release 11.1.0.6.0 - Production CORE     11.1.0.6.0       Production TNS for Linux: Version 11.1.0.6.0 - Production NLSRTL Version 11.1.0.6.0 - Production SQL> select name,db_unique_name,database_role,open_mode from v$database; NAME       DB_UNIQUE_NAME                  DATABASE_ROLE     OPE...

Error 1017 received logging on to the standby

If you are working in a standby environment this is a quite common error that you will see in the alert log. There are various situations when you will see this error.Although you have a latest copy of password file copied in both PRIMARY and STANDBY DB, there is a chance that you will see this error. This is a generic error that comes to oracles's mind and warns you about it. Fetching gap sequence in thread 1, gap sequence 44212-44255 Error 1017 received logging on to the standby ------------------------------------------------------------ Check that the primary and standby are using a password file and remote_login_passwordfile is set to SHARED or EXCLUSIVE, and that the SYS password is same in the password files.       returning error ORA-16191 ------------------------------------------------------------ FAL[client, USER]: Error 16191 connecting to ORCL for fetching gap sequence Archived Log entry 5 added for thread 1 sequence 44257 rlc 839361298 ID 0xa5d555eb dest 2: ...

Create ORAPWD ORACLE PASSWORD FILE

REMOTE_PASSWORD_LOGIN parameter is set in init.ora parameter remote_login_passwordfile.  This parameter must be set to either SHARED or EXCLUSIVE. When set to SHARED, the password file can be used by multiple databases, yet only the SYS user is recognized.  When set to EXCLUSIVE, the file can be used by only one database, yet multiple users can exist in the file.  The parameter setting can be confirmed by: SQL > show parameter password NAME                          TYPE        VALUE ----------------------------- ----------- ---------- remote_login_passwordfile     string      EXCLUSIVE To Create the password file.  This is done by executing the following command $ orapwd file=filename  password=password entries=max_users The file name is the name of the file that will hold the orapwd password information.  The file location will default to the ...

Backup and restore of Database before upgrade using RMAN

Make sure you always take Database backup before any upgrades and patches.It is always good idea to do this. In the below example I am showing how to take a backup of full database to some location and how to restore it back from backup in-case of any failures. backup database before upgrade: rman "target / nocatalog" RUN { ALLOCATE CHANNEL C1 TYPE DISK; BACKUP DATABASE FORMAT '/u02/backup/backup_%U' TAG "before_upgrade"; BACKUP CURRENT CONTROLFILE FORMAT '/u02/backup/controlfilebkp.ctl'; } Restoring database from backup in-case of upgrade fail: RMAN> restore controlfile from '/u02/backup/controlfilebkp.ctl'; Starting restore at 18-JUL-12 using channel ORA_DISK_1 channel ORA_DISK_1: restoring control file channel ORA_DISK_1: restore complete, elapsed time: 00:00:01 output filename=/u01/app/oracle/oradata/test/control01.ctl output filename=/u01/app/oracle/oradata/test/control02.ctl output filename=/u01/app/oracle/oradata/test/control03.ctl ...

ORA-01113: file 13 needs media recovery

oracle@Linux01:[/u01/app/oracle/datafiles/orcl] $ sqlplus /"As sysdba" SQL*Plus: Release 11.2.0.4.0 Production on Thu Jan 21 10:09:56 2012 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 SQL> ALTER DATABASE DATAFILE '/u01/app/oracle/datafiles/orcl/USER_DATA_04.dbf' ONLINE  2 ; * ERROR at line 3: ORA-01916: keyword ONLINE, OFFLINE, RESIZE, AUTOEXTEND or END/DROP expected SQL> ALTER DATABASE DATAFILE '/u01/app/oracle/datafiles/orcl/USER_DATA_04.dbf' ONLINE; ALTER DATABASE DATAFILE '/u01/app/oracle/datafiles/orcl/USER_DATA_04.dbf' ONLINE * ERROR at line 1: ORA-01113: file 13 needs media recovery ORA-01110: data file 13: '/u01/app/oracle/datafiles/orcl/USER_DATA_04.dbf' SQL> recover datafile '/u01/app/oracle/datafiles/orcl/USER_DATA_04.dbf'; Media recovery c...

Recover data using Flashback Query

How to restore the old data using flashback query My intention is , I want to get back past data of database after erroneously updated and committed. We know that committed data can never be flashed back. But with 10g new flashback feature we can get back past data even they are committed.  Before proceed ensure that, •The UNDO_RETENTION initialization parameter is set to a value so that you can back your data far in the past that you might want to query. •UNDO_MANAGEMENT is set to AUTO. •In your UNDO TABLESPACE you have enough space. With an example I will demonstrate the whole procedure. 1)I have created a table named test_flash_table with column name and salary. SQL> create table test_flash_table(name varchar2(10), salary number); Table created. SQL> insert into test_flash_table values('ABCD',10); 1 row created. SQL> commit; Commit complete. The table contains one row. 2)I erroneously updated column salary of Arju and commited data. SQL> update test_flash_table s...