Oracle to MySQL Migration Tools

 


Oracle to MySQL Migration

SQLines tools can help you transfer data, convert database schema (DDL), views, PL/SQL stored procedures, functions, packages, triggers, queries and SQL scripts from Oracle to MySQL. 

go to this website and boom . . . 

You will easily Migration your database from ORacle To MYSQL

http://www.sqlines.com/online

Laravel install vite

 

npm install --save-dev vite laravel-vite-plugin
npm install --save-dev @vitejs/plugin-vue

Laravel Oracle Error Code : 2248 Error Message : ORA-02248: invalid option for ALTER SESSION Position : 231 Statement : ALTER SESSION SET NLS_TIME_FORMAT = 'HH24:MI:SS' NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS' NLS_TIMESTAMP_FORMAT = 'YYYY-MM-


 

Error Code : 2248 Error Message : ORA-02248: invalid option for ALTER SESSION Position : 231 Statement : ALTER SESSION SET NLS_TIME_FORMAT = 'HH24:MI:SS' NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS' NLS_TIMESTAMP_FORMAT = 'YYYY-MM-....

 

add this line DB_EDITION = null on your .env

DB_CONNECTION=oracle
DB_HOST=yourhost
DB_PORT=1521(yourport)
DB_SERVICE_NAME=(your service name)
DB_DATABASE=yourdb
DB_USERNAME=user
DB_PASSWORD=pass

DB_EDITION = null

 

i fixed by adding : /*'edition' => env('DB_EDITION', 'ora$base'),*/
(Oracle 9i,10g)

return [
    'oracle' => [
        'driver'         => 'oracle',
        'tns'            => env('DB_TNS', ''),
        'host'           => env('DB_HOST', ''),
        'port'           => env('DB_PORT', '1521'),
        'database'       => env('DB_DATABASE', ''),
        'username'       => env('DB_USERNAME', ''),
        'password'       => env('DB_PASSWORD', ''),
        'charset'        => env('DB_CHARSET', 'AL32UTF8'),
        'prefix'         => env('DB_PREFIX', ''),
        'prefix_schema'  => env('DB_SCHEMA_PREFIX', ''),
       /* 'edition'        => env('DB_EDITION', 'ora$base'),*/
        'server_version' => env('DB_SERVER_VERSION', '11g'),
    ],
]

or add this line on .env file

DB_EDITION=null
 

https://docs.oracle.com/en/database/oracle/oracle-database/21/lacli/instant-client-shared-libraries.html#GUID-1D801ED9-D7DD-42D7-8BA1-1993A6CD6356
 

yajra/laravel-oci8: Oracle DB driver for Laravel 4|5|6|7|8|9|10 - GitHub


 

Laravel-OCI8

Laravel-OCI8 is an Oracle Database Driver package for Laravel. Laravel-OCI8 is an extension of Illuminate/Database that uses OCI8 extension to communicate with Oracle. Thanks to @taylorotwell.
Documentations

    You will find user-friendly and updated documentation here: Laravel-OCI8 Docs
    All about oracle and php:The Underground PHP and Oracle Manual

Laravel Version Compatibility
Laravel     Package
5.1.x     5.1.x
5.2.x     5.2.x
5.3.x     5.3.x
5.4.x     5.4.x
5.5.x     5.5.x
5.6.x     5.6.x
5.7.x     5.7.x
5.8.x     5.8.x
6.x.x     6.x.x
7.x.x     7.x.x
8.x.x     8.x.x
9.x.x     9.x.x
10.x.x     10.x.x
Quick Installation

composer require yajra/laravel-oci8:^10

Service Provider (Optional on Laravel 5.5+)

Once Composer has installed or updated your packages you need to register Laravel-OCI8. Open up config/app.php and find the providers key and add:

Yajra\Oci8\Oci8ServiceProvider::class,

Configuration (OPTIONAL)

Finally you can optionally publish a configuration file by running the following Artisan command. If config file is not publish, the package will automatically use what is declared on your .env file database configuration.

php artisan vendor:publish --tag=oracle

This will copy the configuration file to config/oracle.php.

    Note: For Laravel Lumen configuration, make sure you have a config/database.php file on your project and append the configuration below:

'oracle' => [
    'driver'         => 'oracle',
    'tns'            => env('DB_TNS', ''),
    'host'           => env('DB_HOST', ''),
    'port'           => env('DB_PORT', '1521'),
    'database'       => env('DB_DATABASE', ''),
    'service_name'   => env('DB_SERVICE_NAME', ''),
    'username'       => env('DB_USERNAME', ''),
    'password'       => env('DB_PASSWORD', ''),
    'charset'        => env('DB_CHARSET', 'AL32UTF8'),
    'prefix'         => env('DB_PREFIX', ''),
    'prefix_schema'  => env('DB_SCHEMA_PREFIX', ''),
    'edition'        => env('DB_EDITION', 'ora$base'),
    'server_version' => env('DB_SERVER_VERSION', '11g'),
    'load_balance'   => env('DB_LOAD_BALANCE', 'yes'),
    'dynamic'        => [],
],

    Then, you can set connection data in your .env files:

DB_CONNECTION=oracle
DB_HOST=oracle.host
DB_PORT=1521
DB_SERVICE_NAME=orcl
DB_DATABASE=xe
DB_USERNAME=hr
DB_PASSWORD=hr

    If you want to connect to a cluster containing multiple hosts, you can either set tns manually or set host as a comma-separated array and configure other fields as you wish:

DB_CONNECTION=oracle
DB_HOST=oracle1.host, oracle2.host
DB_PORT=1521
DB_SERVICE_NAME=orcl
DB_LOAD_BALANCE=no
DB_DATABASE=xe
DB_USERNAME=hr
DB_PASSWORD=hr

    If you need to connect with the service name instead of tns, you can use the configuration below:

'oracle' => [
    'driver' => 'oracle',
    'host' => 'oracle.host',
    'port' => '1521',
    'database' => 'xe',
    'service_name' => 'sid_alias',
    'username' => 'hr',
    'password' => 'hr',
    'charset' => '',
    'prefix' => '',
]

In some cases you may wish to set the connection parameters dynamically in your app. For instance, you may access more than one database, or your users may already have their own accounts on the Oracle database:

'oracle' => [
    'driver' => 'oracle',
    'host' => 'oracle.host',
    'port' => '1521',
    'service_name' => 'sid_alias',
    'prefix' => 'schemaowner',
    'dynamic' => [App\Models\Oracle\Config::class, 'dynamicConfig'],
]

The callback function in your app must be static and accept a reference to the $config[] array (which will already be populated with values set in the config file):

namespace App\Models\Oracle;

class Config {

    public static function dynamicConfig(&$config) {

        if (Illuminate\Support\Facades\Auth::check()) {
            $config['username'] = App\Oracle\Config::getOraUser();
            $config['password'] = App\Oracle\Config::getOraPass();
        }

    }
}

Then run your laravel installation...
Oracle Max Name Length

By default, DB object name are limited to 30 characters. To increase the limit, you can set the ORA_MAX_NAME_LEN=128 in your .env file.

Note: this config requires Oracle 12c02 or higher.
[Laravel 5.2++] Oracle User Provider

When using oracle, we may encounter a problem on authentication because oracle queries are case sensitive by default. By using this oracle user provider, we will now be able to avoid user issues when logging in and doing a forgot password failure because of case sensitive search.

To use, just update auth.php config and set the driver to oracle

'providers' => [
    'users' => [
        'driver' => 'oracle',
        'model' => App\User::class,
    ],
]

Credits

    Arjay Angeles
    Jimmy Felder
    All Contributors

License

The MIT License (MIT). Please see License File for more information.

 https://github.com/yajra/laravel-oci8

install oci8 on ubuntu 22.04 /opt/lampp php7 and php8

 

Hi there. . . mostly

all of you will get file when activing oci8 on lampp server (xampp for linux version)

may be you will easily activing oci8 on php 5.4 by executing

sudo /opt/lampp/lampp oci8

and boooom it will active on phpinfo()

 

but you could be headache when activing oci8 on >=5.4 php 7.* and 8.*

when you run it sudo /opt/lampp/lampp oci8

it's not event appear on phpinfo()

 

Ok then,

I explore a couple day and found the formula. . .

this is it

you could copy this path and active your oci8 easily on php 7.* and 8.*

and it run under Ubuntu.22.04 any way :) 

check the steps below

Install lampp

1.

sudo chmod+x ./xampp-linux-x64-8.1.12-0-installer.run

2.

sudo ./xampp-linux-x64-8.1.12-0-installer.run

next until it's finish

btw this is my lampp path : /opt/lampp

3

ACTIVING OCI8

----------------------------
download instantclient-basic-linux.x64-21.7.0.0.0dbru.zip
download instantclient-sdk-linux.x64-21.7.0.0.0dbru.zip 

and unzip to /opt/oracle/instantclient_21_1
----------------------------

Use 'pecl install oci8' to install for PHP 8.1.

Use 'pecl install oci8-3.0.1' to install for PHP 8.0.

Use 'pecl install oci8-2.2.0' to install for PHP 7.

Use 'pecl install oci8-2.0.12' to install for PHP 5.2 - PHP 5.6.

Use 'pecl install oci8-1.4.10' to install for PHP 4.3.9 - PHP 5.1.


When you are prompted for the Instant Client location, enter the following:
Code: Select all
    instantclient,/opt/oracle/instantclient_21_1
 

or i prefer to use this method


1. Extract the package:

tar -zxf oci8-3.0.0.tgz
cd oci8-3.0.0

2. Prepare the package:

phpize

3. Configure the package, either using $ORACLE_HOME or Instant Client

./configure -with-oci8=shared,$ORACLE_HOME
 
or

./configure -with-oci8=shared,instantclient,/opt/oracle/instantclient_21_1

4. Install the package:

make install

5. If you get an error oci8_dtrace_gen.h: No such file or directory, it means PHP was built with DTrace Dynamic Tracing enabled. Re-run the configure and make commands after setting this environment variable:

$ export PHP_DTRACE=yes

6. Edit your php.ini file and add the line:
in my case i edited /opt/lampp/etc/php.ini
or find php.ini file by typing this command
 
php --ini
add this extension on php ini
maybe you will find your php ini full off dll's file like this event you use linux
but still
 
;extension=php_oci8_11g.dll  ; Use with Oracle 11g Instant Client    
;extension=php_openssl.dll    
;extension=php_pdo_firebird.dll    
;extension=php_pdo_mssql.dll    
;extension=php_pdo_mysql.dll    
;extension=php_pdo_oci.dll    
;extension=php_pdo_odbc.dll    
;extension=php_pdo_pgsql.dll    
;extension=php_pdo_sqlite.dll    
;extension=php_pgsql.dll    
 
 ;use this extension because oci8 generate file oci8.so for ubuntu
extension=oci8.so


7.restart your lampp

sudo /opt/lampp/lampp restart

so far you will find your oci8 active in your phpinfo()
 
 
 
but it finds null when you type this command

php --ri oci8

heheh yes. . . it make me confuse when  making this oci8 on Laravel
it found no oci8 extension. . .
 
add this magic part of

export LD_LIBRARY_PATH=/opt/oracle/instantclient_21_1

 
cd ~
xed .bashrc

add this types
export LD_LIBRARY_PATH=/opt/oracle/instantclient_21_1

it will export automatic when the computer start

check your oci8 active

php --ri oci8



Install Composer and configure with XAMPP /opt/lampp ubuntu

 




After reading on web, I learned that XAMPP has php-cli pre-installed and it is accessed by /opt/lampp/bin/php . I installed composer using the following and all went well:

cd /opt/lampp/bin

sudo curl -s https://getcomposer.org/installer | /opt/lampp/bin/php


Composer was installed perfectly. After that, I did this to make it global:

sudo mv composer.phar /usr/local/bin/composer


done!!!

check composer version

composer -V


 

https://askubuntu.com/questions/604522/install-composer-and-configure-with-xampp

@vite(['resources/css/app.css', 'resources/js/app.js']) Laravel 8

 Laravel 8 does'not support vite

Removing @vite(['resources/css/app.css', 'resources/js/app.js']) and replacing it with


<link rel="stylesheet" href="{{ asset('css/app.css') }}">
<script src="{{ asset('js/app.js') }}" defer></script>