Skip to main content

Posts

LOST DATAFILE RECOVERY IN ORACLE DATABASE

Microsoft Windows [Version 6.1.7600] Copyright (c) 2009 Microsoft Corporation.  All rights reserved. C:\Users\computer>sqlplus Enter user-name: sys as sysdba Enter password: Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> select name from v$database; NAME --------- ORACLE ------------------------------------------------------------------------------ NOTE - DATABASE SHOULD BE IN ARCHIVE LOG MODE ------------------------------------------------------------------------------ SQL> archive log list; Database log mode              Archive Mode Automatic archival             Enabled Archive destination            USE_DB_RECOVERY_FILE_DEST Oldest online log sequence     8 Next log sequence to archive   10 Curr...

Convert standby database to standby Snapshot database

PROD - Primary database COB  - Physical standby database 2. Convert COB to standby Snapshot database and confirm it is in read/Write  (i)SQL> alter database recover standby database cancel; or DGMGRL > EDIT DATABASE 'COB_DATABASE' SET STATE = 'APPLY-OFF'; (ii)DGMGRL > convert database 'COB_DATABASE' to snapshot standby; (iii)shutdown the database on the node and start the database like below SRVCTL status database - d COB_DATABASE SRVCTLstop database - d COB_DATABASE SRVCTL start database - d COB_DATABASE SRVCTL status database - d COB_DATABASE (iv) SQL > SELECT database_role role, name, db_unique_name, platform_id, open_mode, log_mode, flashback_on, protection_mode, protection_level FROM v$ database;

ORA-02289 SEQUENCE DOES NOT EXIST

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Note: here we are trying to insert  values in a table from another user Which has access. SQL Error: ORA-02289: sequence does not exist 02289. 00000 - "sequence does not exist" *Cause: The specified sequence does not exist, or the user does            not have the required privilege to perform this operation. *Action: Make sure the sequence name is correct, and that you have            the right to perform the desired operation on this sequence. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ generating query is not having SCHEMA NAME suffixed before the SEQUENCE NAME. Please see below example’s for easy understanding. Please see painted values in the below queries. SQL> show user; USER is "RKPYTE" FAILING SQL: SQL> insert into RKPYTE.TRANSACTION_IMPORT(TRANSACTION_IMPORT_ID,IMPORT_RUN_CODE,...

RESTORE CONTROL FILES FROM BACKUP 11G

C:\Users\computer>set ORACLE_SID=TEST C:\Users\computer>sqlplus / as sysdba SQL*Plus: Release 11.1.0.7.0 - Production on Thu May 10 23:05:45 2013 Copyright (c) 1982, 2008, Oracle.  All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> select name from v$database; NAME --------- TEST TAKEN BACKUP OF THE CONTROL FILE; SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS 'D:\TEST1\CONTROL.BKP'; Database altered. SQL> shut immediate Database closed. Database dismounted. ORACLE instance shut down. NOTE: EDITED PFILE AND REMOVED THE EXISTS CONTROLFILE PARAMETER FROM IT & TRY STARTED THE DATABASE IN MOUNT. SQL> startup mount; ORACLE instance started. Total System Global Area  535662592 bytes Fixed Size                  1348508 bytes Variable Size ...

FLASHBACK TABLE TO BEFORE DROP ORACLE 11G

C:\Users\computer>sqlplus / as sysdba SQL*Plus: Release 11.1.0.7.0 - Production on Thu Jan 10 22:13:29 2013 Copyright (c) 1982, 2008, Oracle.  All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> grant dba to scott; Grant succeeded. SQL> conn scott Enter password: Connected. SQL> SQL> show user; USER is "SCOTT" SQL> SQL> create table bemp as select * from emp; create table bemp as select * from emp              * ERROR at line 1: ORA-00955: name is already used by an existing object SQL> drop table bemp; Table dropped. SQL> flashback table bemp to before drop; Flashback complete. SQL> desc bemp;  Name                                      Null? ...

CHANGING DBID FOR ORACLE DATABASE 11G

C:\Users\computer>sqlplus SQL*Plus: Release 11.1.0.7.0 - Production on Thu Sep 10 21:03:33 2013 Copyright (c) 1982, 2008, Oracle.  All rights reserved. Enter user-name: sys as sysdba Enter password: Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> select dbid from v$database;       DBID ---------- 2188161033 SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options C:\Users\computer>nid DBNEWID: Release 11.1.0.7.0 - Production on Thu Sep 10 21:04:44 2013 Copyright (c) 1982, 2007, Oracle.  All rights reserved. Keyword     Description                    (Default) ---------------------------------------------------- TARGET ...

ORA-39168: Object path GRANT was not found EXCLUDE=GRANT

C:\Users\>sqlplus SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 11 20:55:55 2013 Copyright (c) 1982, 2005, Oracle.  All rights reserved. Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production SQL> create user exp identified by exp; User created. SQL> create user imp identified by imp; User created. SQL> grant dba to exp; Grant succeeded. SQL> grant dba to imp; Grant succeeded. SQL> conn exp Enter password: Connected. SQL> SQL> create table Test (col1 char(10)); Table created. SQL> grant select on Test to rishi; Grant succeeded. SQL> insert into Test values('hello'); 1 row created. SQL> commit; Commit complete. NOTE:Directory already exists. So used the existng one SQL> select * from dba_directories; OWNER                          DIRECTORY_NAME ------------------------------ --------------------...