Sql

The Backdoor Entry to Oracle Database

The backdoor entry of the Oracle database! You can enter to the database through the back door using SQL * Plus tool with “Prelim” parameter  Prelim, directly connects to the SGA but it does not open a session.

You can connect to the database with Prelim as following.

[oracle@maxerman bin]$ sqlplus /nolog
SQL*Plus: Release 12.1.0.2.0 Production on Wed Oct 18 10:42:55 2017
Copyright (c) 1982, 2014, Oracle.  All rights reserved.

SQL> set_prelim on
SQL> conn / as sysdba
Prelim connection established
SQL>

Advertisements
Standard
Oracle

DataGuard:ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA

Please check service name and db_uniquie_name on the Production server.

alter system set log_archive_dest_3=’SERVICE=  < NAME >  VALID_FOR=(ONLINE_LOGFILE,PRIMARY_ROLE) LGWR ASYNC DB_UNIQUE_NAME= <Name>’ ;

Standard
Linux, Troubleshooting

ORA-09925 Solution On Oracle Linux 6

Error :

[oracle@ErmanTestSTDBY ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Sun Oct 15 15:42:42 2017

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

ERROR:

ORA-09925: Unable to create audit trail file

Linux-x86_64 Error: 13: Permission denied

Additional information: 9925

ORA-09925: Unable to create audit trail file

Linux-x86_64 Error: 13: Permission denied

Additional information: 9925

 

[oracle@ErmanTestSTDBY ~]$ rman target / 

Recovery Manager: Release 12.1.0.2.0 – Production on Sun Oct 15 15:42:11 2017

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-00554: initialization of internal recovery manager package failed

RMAN-04005: error from target database:

ORA-09925: Unable to create audit trail file

Linux-x86_64 Error: 13: Permission denied

Additional information: 9925

ORA-09925: Unable to create audit trail file

Linux-x86_64 Error: 13: Permission denied

Additional information: 9925

Solutions :

$ORACLE_BASE/admin/$ORACLE_SID/adump exists and is not writable.

oracle@ErmanTestSTDBY ~]$ ls -lad /u01/app/oracle/admin/cdb1/adump/ —cdb1=Oracle<SID>
drwxr-xr-x. 2 root root 4096 Oct 15 13:14 /u01/app/oracle/admin/cdb1/adump/

[root@ErmanTestSTDBY ~]# chown oracle /u01/app/oracle/admin/cdb1/adump

—————————————————————————————————————————————–

[oracle@ErmanTestSTDBY ~]$ $ORACLE_HOME/bin/sqlplus -L “/ as sysdba”

SQL*Plus: Release 12.1.0.2.0 Production on Sun Oct 15 16:00:26 2017

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> exit

Disconnected

[oracle@ErmanTestSTDBY ~]$ rman target /

Recovery Manager: Release 12.1.0.2.0 – Production on Sun Oct 15 16:00:35 2017

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

connected to target database (not started)

RMAN>

 

 

Standard
Migration

Migration Error “sql error on script execution. try deleting repository before creating repository”

I got this message when try to associate migration repository.

I created a user for the migration repository

  • CREATE USER yatt IDENTIFIED BY yatt;
    user created.
  • DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP;
    Grant succeeded.

Installing Repository:

Ekran Resmi 2017-10-14 23.28.44

Error Messages:

Ekran Resmi 2017-10-14 23.31.31

Ekran Resmi 2017-10-14 23.38.35

I had the same problem, this was solved changing the GRANT statement with…

  • GRANT ALL PRIVILEGES to {migration-name} identified by {migration-name};

just be aware to remove privileges after migration tasks.

  • GRANT CONNECT, RESOURCE, CREATE SESSION, CREATE VIEW TO yatt;
    Grant succeeded.

Ekran Resmi 2017-10-14 23.39.35

Ekran Resmi 2017-10-14 23.28.33

Migration repository associated.

Standard
Mysql

MySQL show current connection info Hostname and Port Number ?

Ekran Resmi 2017-10-14 18.16.57

If you want to know the port number of your local host on which Mysql is running you can use this query on MySQL Command line client

SHOW VARIABLES WHERE Variable_name = 'port';

If you want to know the hostname of your Mysql you can use this query on MySQL Command line client

SHOW VARIABLES WHERE Variable_name = 'hostname';

Error Message:

dbc.jtds 1.2.6 Driver is not the driver which is used for MySQL connection. You have to download for example mysql-connector-java-5.1.7 jar file to get the MySQL connection working.Please download the jar file which is compatible with your mysql version.

  • Unzip the driver, giving you a  “ ….  .jar” file.
  • Open SQL Developer and navigate to “Tools > Preferences > Database > Third Party JDBC Driver”.

then connect your user.

Ekran Resmi 2017-10-14 18.30.09

 

 

 

Standard
Linux

jTDS – SQL Server and Sybase JDBC driver

Ekran Resmi 2017-10-14 16.13.10

Description

Open source JDBC 3.0 type 4 driver for Microsoft SQL Server (6.5 up to 2012) and Sybase ASE. jTDS is a complete implementation of the JDBC 3.0 spec and the fastest JDBC driver for MS SQL Server. For more information see http://jtds.sourceforge.net/

Setup

  • Download the latest “jTDS – SQL Server and Sybase JDBC driver” from here :

    -> https://sourceforge.net/projects/jtds/

  • Unzip the driver, giving you a “jtds-1.3.1.jar” file.
  • Open SQL Developer and navigate to “Tools > Preferences > Database > Third Party JDBC Driver”.

Ekran Resmi 2017-10-14 16.16.41

  • Click the “Add Entry…” button and highlight the “jtds-1.3.1.jar” file and click the “Select” button.
  • Click the “OK” button to exit the “Preferences” dialog.
  • When you create a new connection, you will notice “SQLServer” and “Sybase” tabs have now appeared. Enter the connection details and test the connection.

Ekran Resmi 2017-10-14 16.12.05

Standard
Flashback - Migration

ORA-38754: FLASHBACK DATABASE not started; required redo log is not available

ORA-38754: FLASHBACK DATABASE not started; required redo log is not available

  • Cause
    • Oracle needs to have the required archive logs in the archive destination at the time of flashback.
  • Solution
    • Use rman to restore the missing archive logs. The sequence and thread numbers are in the error message.
      rman target /
      run{
         allocate channel t1 device type 'sbt_tape';=
         FLASHBACK DATABASE TO RESTORE POINT <restore point name>;=
         }

Resume the flashback process from the RESETLOGS step.

 

Standard