ORA - 01665

Solution

On Primary Database
C:\Windows\system32>sqlplus sys/<password> as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Tue May 14 12:31:15 2013
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> alter database create standby controlfile as 'D:\oracle\oradata\sjcstnd\controlfile\stanctl.ctl';
Database altered.

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64 bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

On Standby Database
C:\Windows\system32>set oracle_sid=sjcstnd
C:\Windows\system32>sqlplus sys/<password> as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Tue May 14 12:31:59 2013
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.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> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64 bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

C:\Windows\system32>d:
D:\>cd oracle
D:\oracle>cd oradata
D:\oracle\oradata>dir
 Volume in drive D is Secondary
 Volume Serial Number is 0ABF-0E1D

 Directory of D:\oracle\oradata
21/04/2013  13:06    <DIR>          .
21/04/2013  13:06    <DIR>          ..
21/04/2013  12:50    <DIR>          archive
09/05/2013  09:48    <DIR>          sjcstnd
07/05/2013  14:20    <DIR>          sjctest
               0 File(s)              0 bytes
               5 Dir(s)  433,725,743,104 bytes free

D:\oracle\oradata>cd sjcstnd\controlfile
D:\oracle\oradata\sjcstnd\controlfile>dir
 Volume in drive D is Secondary
 Volume Serial Number is 0ABF-0E1D

 Directory of D:\oracle\oradata\sjcstnd\controlfile
14/05/2013  12:33    <DIR>          .
14/05/2013  12:33    <DIR>          ..
14/05/2013  12:32         7,094,272 control01OLD.ctl
14/05/2013  12:32         7,094,272 control02OLD.ctl
14/05/2013  12:32         7,094,272 control03OLD.ctl
14/05/2013  12:31         7,159,808 STANCTL.CTL
               4 File(s)     28,442,624 bytes
               2 Dir(s)  433,725,743,104 bytes free

D:\oracle\oradata\sjcstnd\controlfile>move STANCTL.CTL CONTROL01.CTL
        1 file(s) moved.

D:\oracle\oradata\sjcstnd\controlfile>COPY CONTROL01.CTL CONTROL02.CTL
        1 file(s) copied.

D:\oracle\oradata\sjcstnd\controlfile>COPY CONTROL02.CTL CONTROL03.CTL
        1 file(s) copied.

D:\oracle\oradata\sjcstnd\controlfile>set oracle_sid=sjcstnd
D:\oracle\oradata\sjcstnd\controlfile>sqlplus sys/<password> as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Tue May 14 12:36:15 2013
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
Connected to an idle instance.
SQL> startup nomount pfile='C:\oracle\product\10.2.0\db_1\database\INITsjcstnd.ora';
ORACLE instance started.

Total System Global Area 1610612736 bytes
Fixed Size                  2066080 bytes
Variable Size             385878368 bytes
Database Buffers         1207959552 bytes
Redo Buffers               14708736 bytes

SQL>  create spfile from pfile='C:\oracle\product\10.2.0\db_1\database\INITsjcstnd.ora';
File created.

SQL> shutdown immediate;
ORA-01507: database not mounted

ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 1610612736 bytes
Fixed Size                  2066080 bytes
Variable Size             385878368 bytes
Database Buffers         1207959552 bytes
Redo Buffers               14708736 bytes
Database mounted.

SQL> alter database recover managed standby database disconnect from session;
Database altered.

SQL>

ORA - 01196

Solution

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Windows\system32>set oracle_sid=sjcstnd
C:\Windows\system32>dgmgrl
DGMGRL for 64-bit Windows: Version 10.2.0.4.0 - 64bit Production

Copyright (c) 2000, 2005, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/<password>
Connected.
Error:
ORA-01034: ORACLE not available

DGMGRL> connect sys/<password>@sjcstnd
Connected.
Error:
ORA-01034: ORACLE not available

DGMGRL> connect sys/<password>@sjctest
Connected.
DGMGRL> show configuration

Configuration
  Name:                dgtest
  Enabled:             YES
  Protection Mode:     MaxPerformance
  Fast-Start Failover: DISABLED
  Databases:
    sjctest - Primary database
    sjcstnd - Physical standby database

Current status for "dgtest":
Warning: ORA-16607: one or more databases have failed

DGMGRL> exit
C:\Windows\system32>set oracle_sid=sjcstnd
C:\Windows\system32>sqlplus sys/<password> as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Tue May 14 10:00:11 2013
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area 1610612736 bytes
Fixed Size                  2066080 bytes
Variable Size             385878368 bytes
Database Buffers         1207959552 bytes
Redo Buffers               14708736 bytes
Database mounted.
ORA-16004: backup database requires recovery
ORA-01196: file 1 is inconsistent due to a failed media recovery session
ORA-01110: data file 1: 'D:\ORACLE\ORADATA\SJCSTND\SYSTEM01.DBF'

SQL> shutdown immediate;
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.

SQL> startup
ORACLE instance started.

Total System Global Area 1610612736 bytes
Fixed Size                  2066080 bytes
Variable Size             385878368 bytes
Database Buffers         1207959552 bytes
Redo Buffers               14708736 bytes
Database mounted.
ORA-16004: backup database requires recovery
ORA-01196: file 1 is inconsistent due to a failed media recovery session
ORA-01110: data file 1: 'D:\ORACLE\ORADATA\SJCSTND\SYSTEM01.DBF'

SQL> shutdown immediate;
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1610612736 bytes
Fixed Size                  2066080 bytes
Variable Size             385878368 bytes
Database Buffers         1207959552 bytes
Redo Buffers               14708736 bytes

SQL> ALTER DATABASE MOUNT STANDBY DATABASE;
Database altered.

SQL> alter database activate standby database;
alter database activate standby database
*
ERROR at line 1:
ORA-01196: file 1 is inconsistent due to a failed media recovery session
ORA-01110: data file 1: 'D:\ORACLE\ORADATA\SJCSTND\SYSTEM01.DBF'

SQL> recover managed standby database cancel;
Media recovery complete.

SQL> recover automatic standby database;
ORA-00279: change 1201121 generated at 05/14/2013 10:04:49 needed for thread 1
ORA-00289: suggestion :

D:\ORACLE\FLASH_RECOVERY_AREA\SJCSTND\ARCHIVELOG\ARC00055_0814701730.001
ORA-00280: change 1201121 for thread 1 is in sequence
#55 ORA-00278: log file'D:\ORACLE\FLASH_RECOVERY_AREA\SJCSTND\ARCHIVELOG\ARC00055_0814701730.001' nolonger needed for this recovery
ORA-16145: archival for thread# 1 sequence# 55 in progress

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
CANCEL
Media recovery cancelled.

SQL> alter database activate standby database;
Database altered.

SQL> select CONTROLFILE_TYPE from v$database;
CONTROL
-------
CURRENT

SQL> ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE;
Database altered.

SQL> ALTER DATABASE OPEN;
Database altered.

SQL> select name,open_mode from gv$database;
NAME      OPEN_MODE
--------- ----------
SJCTEST   READ WRITE

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

C:\Windows\system32>set oracle_sid=sjcstnd
C:\Windows\system32>sqlplus sys/<password> as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Tue May 14 10:11:51 2013
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> ALTER DATABASE OPEN;
ALTER DATABASE OPEN
*
ERROR at line 1:
ORA-01531: a database already open by the instance

SQL> select name,open_mode from gv$database;
NAME      OPEN_MODE
--------- ----------
SJCTEST   READ WRITE

SQL> select controlfile_type from gv$database;
CONTROL
-------
CURRENT

SQL> desc dba_users
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------

 USERNAME                                  NOT NULL VARCHAR2(30)
 USER_ID                                   NOT NULL NUMBER
 PASSWORD                                           VARCHAR2(30)
 ACCOUNT_STATUS                            NOT NULL VARCHAR2(32)
 LOCK_DATE                                          DATE
 EXPIRY_DATE                                        DATE
 DEFAULT_TABLESPACE                        NOT NULL VARCHAR2(30)
 TEMPORARY_TABLESPACE                      NOT NULL VARCHAR2(30)
 CREATED                                   NOT NULL DATE
 PROFILE                                   NOT NULL VARCHAR2(30)
 INITIAL_RSRC_CONSUMER_GROUP                        VARCHAR2(30)
 EXTERNAL_NAME                                      VARCHAR2(4000)

SQL>

How to fix: ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)

Open your terminal and type mysql -u root -p Enter your password. Hopefully your MySQL is logged in now.