Skip to main content

Posts

Showing posts from September, 2015

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             167775332 bytes Database Buffers  

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?    Type  ----------------------------------------- -------- ----------------------------  EMPNO                                

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      Username/Password              (NONE) DBNAME      New database name