#sqlplus
Explore tagged Tumblr posts
Text
MANAGE ORACLE PLUGGABLE DATABASES IN 23AI
Step 1: Open a PDB in Hybrid Read-Only Mode Oracle 23ai introduces a new hybrid read-only mode. In this mode, common users can write to the database, but local users can only read. Connect to the root container as SYSDBAExample: connect using sqlplus / as sysdba Close the PDBCommand: ALTER PLUGGABLE DATABASE pdb_name CLOSE IMMEDIATE Open the PDB in hybrid read-only modeCommand: ALTER…
0 notes
Text
DOCKER ORACLE APEX
Title: Powering Up Oracle APEX with Docker: A Streamlined Development and Deployment Workflow
Introduction
Oracle Application Express (APEX) is a powerful low-code development framework for building scalable, enterprise-grade web applications on Oracle databases. Docker simplifies application deployment by packaging everything—code, configurations, and dependencies—into portable and consistent containers. Combining these technologies results in a fantastic way to streamline your APEX development process.
Why Docker for Oracle APEX?
Portability: Build your APEX environment once, and then run it anywhere Docker is supported, from development machines to production servers.
Consistency: Eliminate “works on my machine” issues. Docker images provide the same environment everywhere.
Scalability: Scale your APEX application by easily replicating Docker containers as needed.
Isolation: Run different APEX versions or multiple applications on the same host without conflicts.
Enhanced DevOps: Integrate Docker into your CI/CD pipelines for automated builds, testing, and deployments.
Step-by-Step Guide
Prerequisites
Basic familiarity with Docker concepts
Obtain Oracle Database Image
The official Oracle Database container image is on the Docker registry: [invalid URL removed]
Pull the image: docker pull container-registry.oracle.com/database/express:latest
Get Oracle APEX
Download the latest Oracle APEX version from [invalid URL removed]
Create a Dockerfile
# Start with an Oracle Linux base image
FROM oraclelinux:8
# Install dependencies
RUN yum install -y unzip wget nano
# Install Oracle database prerequisites
# (Refer to Oracle documentation for the correct package list)
RUN yum install -y oracle-database-preinstall-21c
# Create directories for database and ORDS
RUN mkdir -p /u01/app/oracle/product/21c/dbhomeXE /u02/app/ords
# Set environment variables
ENV ORACLE_HOME=/u01/app/oracle/product/21c/dbhomeXE \
PATH=$ORACLE_HOME/bin:$PATH
# Copy Oracle database installation files (adjust for the version you downloaded)
COPY linuxx64_213000_db_home.zip /tmp
# Unzip the database installation
RUN cd /tmp && unzip linuxx64_213000_db_home.zip
# Run the database installation (follow Oracle’s guide)
RUN /tmp/database/install.sh # … provide necessary inputs
# Copy Oracle APEX and ORDS
COPY apex /tmp/apex
COPY ords /u02/app/ords
# Install APEX
WORKDIR /tmp/apex
RUN sqlplus / as sysdba @apexins SYSAUX SYSAUX TEMP /i/
# Install ORDS (refer to ORDS installation guides)
WORKDIR /u02/app/ords
RUN java -jar ords.war install advanced
# Expose ports
EXPOSE 1521 8080
# Start script for the container (adjust as needed)
COPY start.sh /
CMD [“/bin/bash”, “start.sh”
Run the Container
docker run -d -p 8080:8080 –name my-apex-container my-apex-image
Access Your APEX Application
Open a browser and access your APEX application at http://localhost:8080/ords/
Additional Notes
Persist database data using Docker volumes.
Explore more advanced Docker networking concepts.
Integrate with a reverse proxy like Nginx for better production setups.
youtube
You can find more information about Oracle Apex in this Oracle Apex Link
Conclusion:
Unogeeks is the No.1 IT Training Institute for Oracle Apex Training. Anyone Disagree? Please drop in a comment
You can check out our other latest blogs on Oracle Apex here – Oarcle Apex Blogs
You can check out our Best In Class Oracle Apex Details here – Oracle Apex Training
Follow & Connect with us:
———————————-
For Training inquiries:
Call/Whatsapp: +91 73960 33555
Mail us at: [email protected]
Our Website ➜ https://unogeeks.com
Follow us:
Instagram: https://www.instagram.com/unogeeks
Facebook: https://www.facebook.com/UnogeeksSoftwareTrainingInstitute
Twitter: https://twitter.com/unogeeks
0 notes
Text
Check the Oracle database is Exadata
How do you check that the Oracle database is running on Exadata? From the v$cell view, we can check whether the Oracle database is running as Exadata. For checking we have to run the following command in SQLPLUS: select decode(count(cell_path),0,'Non-Exadata','Exadata') "System" from v$cell;
View On WordPress
0 notes
Text
JAVMost
JAVMostPopulate (java.util.Script and multiple set) code : jdk1.6.0_2.16 [sqlplus] do { char name[1024*768], group by list, titles; } if(name == ‘NET’ ){ //System.curator 클래스의 인스턴스를 생성한다. public virtual ~Children ServletRequest reader(SecureWriter) throw new RunteamExceedionInteractiveHandshake(Hookable hwnd, HOffice words); } The Internal Config file is including the CONFIG:INTERNAL constructors…
View On WordPress
0 notes
Link
Linux/Unix: Execute Oracle Commands from Shell Script In this tutorial, you will learn how to execute Oracle commands from the shell script in Linux/Unix systems. Syntax To execute Oracle commands from a shell script use the following syntax: sqlplus -silent username/psw@dbname
0 notes
Text
How to load data from CSV file into oracle using SQL Loader
How to load data from CSV file into oracle using SQL Loader
Hi Friends, in this article, we will load data from CSV file into oracle using SQL loader. SQL Loader is a tool which is providing by oracle. Read: How to create a SEQUENCE step by step What is SQL Loader? SQL Loader helps us to load data from external files into tables of the oracle database. For more details Click Here. Load data in empty or non-empty table We can load data in the empty or…
View On WordPress
#how to read data from csv file in oracle#import csv file into oracle table using sql developer#import csv file into oracle table using stored procedure#import data from csv file to oracle table using shell script#load csv file into oracle table using python#load data from CSV file into oracle using sql loader#oracle load data from csv sqlplus#oracle sql query to read data from csv file#shell script to load data into oracle table from csv file
0 notes
Text
Connecting with Oracle Sqlplus
Connecting with Oracle Sqlplus
To connect to the Sqlplus through the command line:
sqlplus username/password@host:port/service Example: sqlplus store/[email protected]/orcl (default port)
View On WordPress
0 notes
Text
Warning: Procedure created with compilation errors.
sqlplus에서 procedure를 생성할 때, Warning: Procedure created with compilation errors. 이와 같은 오류가 발생되면 ‘show error’로 에러를 파악할 수 있다.
SQL> SHOW ERROR Errors for PROCEDURE SAMPLE01:
LINE/COL ERROR -------- ----------------------------------------------------------------- 14/3 PL/SQL: SQL Statement ignored 14/17 PLS-00201: identifier 'V_DETP.DEPTNO' must be declared
0 notes
Text
Shell Script To Compare Objects From A File To Database
#!/bin/bash export ORACLE_SID=$1 export ORACLE_HOME=/opt/app/oracle/product/19CR3 #trap 'rm -f $tables $ddl' EXIT rm -f $tables $ddl touch tab.sql ddlsync.sql tables=tab.sql ddl=ddlsync.sql configfile=$2 owner=$3 if [ $# -ne 0 ] then for tab in `grep $owner $configfile|grep -v '#'|awk -F '.' '{print $2}'|awk '{print $1}'|tr '[:lower:]' '[:upper:]'` do echo -e $tab >> $tables sqlplus -S '/ as…
0 notes
Text
How to get tablespace DDL in oracle
To get the tablespace DDL (Data Definition Language) in Oracle, you can use the DBMS_METADATA package. “tablespace DDL in oracle” Get DDL for specific tablespace Step 1: To get tablespace ddl in oracle first connect to your Oracle database using a tool such as SQL*Plus or SQL Developer. SQL> sqlplus / as sysdba Step 2: Execute the following SQL statement to set the output format for the DDL…
View On WordPress
0 notes
Text
ORA-15260: permission denied on ASM disk group
ORA-15032: not all alterations performed Error: While operating from the grid user in the EXADATA, We are getting this permission denied error. [grid@qr01dbadm01 ~]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jan 25 06:43:24 2024 Version 19.9.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release…
View On WordPress
0 notes
Text
'adop -status' Command Produces a "FATAL ERROR"
@oracleebs @oracleappsdba #oracle #oracleappsdba #oracleebs #oracleerp
ERROR path=../~/$ adop -status Enter the password:FATAL ERRORPROGRAM : (…/R12/fs1/dir=/appl/ad/12.0.0/bin/adzdoptl.pl)TIME : Thu Feb 21 09:33:54 2019FUNCTION: TXK::SQLPLUS::setConnectInfo [ Level 2 ]MESSAGES:Argument must be a scalar STACK TRACEat /ofpr02/R12/fs1/dir=/appl/au/12.0.0/perl/TXK/Error.pm line 168TXK::Error::abort(‘TXK::Error’, ‘HASH(0x103b6da60)’) called at…
View On WordPress
0 notes
Text
Remove dashed box in sequencher output

#Remove dashed box in sequencher output code
These unique target sites can then be output as before. You can test this feature in your own beta instance. The dashed lines to the sequence boxes represent two possible branches of the. If you actually want to permanently remove the dashed from the field, keeping just the.
#Remove dashed box in sequencher output code
Canvas code has been updated to remove the dashes when points are entered in the field. If you want to keep the dashes in the record in the table, but just display the acctno without dashes in a query (or a form or report), you can put a calculated field in the query by typing. This behavior occurred because the points field was not focusing correctly on the dashes. Username, address, phone Ram, MUMBAI, 444555 John, Pune, 999877 sqlplus. Just if you want to 'reduce' the impact of them (I did) - Tools -> Options -> Environment -> Fonts and Colors -> (Show settings for: Text Editor) -> 'Structure Guide Lines' and you can change the colour. This change resolves a fixed bug in Canvas:Įxplanation: When an instructor opened a manually graded quiz in SpeedGrader and clicked the dashes in the points field, any scores typed in the field were inserted around the dashes instead of remove them completely. Want to remove the dash line from output, check below Expected output. There is an option under Tools Options Text Editor called Show structure guide lines that should remove that. If you want to remove the information in the Comments: box, select the text and. However, if no value is entered and dashes are still present, the question is still considered ungraded. Viewing results with Sequencher Connections. Once an instructor starts typing a score, the dashes are removed automatically. In a manually graded quiz question, instructors no longer have to remove the dashes in the point field. About a few days ago, we ran our WPF application, some of us (in several developer's computers) found very a lot controls has dashed border when they got focused, such as below: The outer control is Grid, and in other place, Border and others also has same issue. Please take a look at the Canvas Beta Release Notes () Greetings all! We often remind the Community that even archived ideas can become a real feature, and this one is proof of that!

0 notes
Text
Menumeters yosemite

#Menumeters yosemite how to#
#Menumeters yosemite password#
#Menumeters yosemite windows 7#
#Menumeters yosemite windows#
I was hoping I could customize my favorites by creating my own icons files I have in Internet Explorer. So far, I really like the overall look of the interface, and I like the ability to create to look and work the way I want it. How to change icons in my favorites toolbar? Enter the desired name, and select update. The network name can be changed in the field "name of the wireless network.Select the AirPort base station and then, select change.You can change the name of the network using AirPort Utility as follows: I would change the name of my network and I don't know how or where to do this. I use OS X 10.11.4 and utility Airport 6.3.6. And once this is done, have what I would do with my extreme and Express to continue them to work? Any help would be appreciated. How can I change the name of my wireless network? If you do not already have an icon to use, save it to your computer If this does not work, or otherwise, is not available in your version installed, you may need to nuke the user settings directory.īasically, what I tried to do is change the icon for bookmarked on my desktop for a web-link the link is for the Droid Air (I also have the addon of Firefox on my phone) to transfer files but the icon is quite bad and easy to miss a white icon with a green paper airplane I tried for several hours if you have knowledge on the subject, you can tell me please share
#Menumeters yosemite windows#
If you use a major version 4.0.x of SQL Developer, the menu bar to try window > Windows reset to factory settings. If this isn't the right forum, please direct me to the right. That's what I used to redirect the spool. Which would affect DBMS output Sql developer? trying to write off all the possibilities I changed the coil to redirect to my local folder in sqlplus a few days back. Y at - it a setting I could have turned off without knowing?
#Menumeters yosemite how to#
But is no longer.Īnyone can shed light on how to bring this window? I go to the view menu and selecting the menu option out Dbms. I used the window out of DBMS until a few days back and it stops suddenly appear. I'm not able to get the DBMS output window appears.
#Menumeters yosemite password#
Go to view available wireless networks, find yours, click connection and enter the new password when you are prompted.Īlternatively, instead of removing your network in the list of preferred networks, you can click 'Properties' and then change the key in the tab "Association." I suggest that you remove the network and let Windows find just in case something other that the key has been changed (for example, the type of encryption or algorithm).ĭBMS output window popping up in sql developer.
Assuming you use Windows to configure your wireless network card, find the SSID of your router (network name) in the list of preferred networks and 'delete '.
If you are not looking to the display shown in the screenshot or the box at the top to "Use Windows to configure my wireless network" is unchecked, STOP: you use a 3 rd-party utility to configure your wireless adapter and you need to figure out how to use that yourself or at least identification.
Right-click on the icon for your wireless adapter and select Properties.
Open network connections (start > run > ncpa.cpl > OK).
What version of XP, including service pack (if of course, start > run > winver > OK)? I can not find the screen on my XP machine, which allows me to change the key.
#Menumeters yosemite windows 7#
He's changed on my router and my iPad & Windows 7 laptop computer can connect to it. I needed to change the key for my wireless network. Key change for an existing XP wireless network

0 notes
Text
Database for mac os x

#Database for mac os x how to#
#Database for mac os x for mac os#
#Database for mac os x update#
#Database for mac os x zip#
Instant Client 12.2 supports macOS High Sierra, Sierra and El Capitan.
#Database for mac os x update#
To use binaries such as sqlplus from the SQL*Plus package, unzip the package to the same directory as the Basic package and then update your PATH environment variable, for example:.Then set the environment variable TNS_ADMIN to that directory name. This is the default Oracle configuration directory for applications linked with this Instant Client.Īlternatively, Oracle configuration files can be put in another, accessible directory. If you intend to co-locate optional Oracle configuration files such as tnsnames.ora, sqlnet.ora, ldap.ora, or oraaccess.xml with Instant Client, put them in the instantclient_18_1/network/admin subdirectory.Note: Custom OCI applications, such as those that bundle Instant Client, may want to link with -rpath set to the directory containing Instant Client 18.1 instead of relying on libraries being in ~/lib. Ln -s ~/lib/libclntsh.dylib.18.1 ~/lib/libclntsh.dylib For example:Ĭp /opt/oracle/instantclient_18_1/libclntsh.dylib.18.1 ~/lib/Ĭp /opt/oracle/instantclient_18_1/libclntshcore.dylib.18.1 ~/lib/Ĭp /opt/oracle/instantclient_18_1/libons.dylib ~/lib/Ĭp /opt/oracle/instantclient_18_1/libnnz18.dylib ~/lib/Ĭp /opt/oracle/instantclient_18_1/libociei.dylib ~/lib/ Unzip the packages into a single directory such as ~/instantclient_18_1 that is accessible to your application.All installations require the Basic or Basic Light package.
#Database for mac os x zip#
Download the desired Instant Client ZIP files.
Instant Client 18.1 supports macOS Mojave and High Sierra.
#Database for mac os x how to#
Sqlplus Refer to your application's installation instructions for how to use
Run SQL*Plus and connect using your database credentials and connection string:.
Package to the same directory as the Basic package and then update yourĮxport PATH=~/Downloads/instantclient_19_8:$PATH
To use binaries such as sqlplus from the SQL*Plus package, unzip the.
Then set the environment variable TNS_ADMIN to that The default Oracle configuration directory for applications linked withĪlternatively, Oracle configuration files can be put in another,Īccessible directory. Put them in the instantclient_19_8/network/admin subdirectory. Tnsnames.ora, sqlnet.ora, ldap.ora, or oraaccess.xml with Instant Client,
If you intend to co-locate optional Oracle configuration files such as.
In Finder, eject the mounted Instant Client packages.
Packages to /User/$USER/Downloads/instantclient_19_8 MySQL, PostgreSQL or anything else that runs on multiple platforms, and can be accessed over the network should be mandatory these days.This copies the contents of all currently mounted Instant Client. Mind you, FileMaker used to be at least decent, with built-in web server and all, before they moved all innovating from R&D to the marketing department. And just like FileMaker, it's a plague as soon as you want to share the database with others. It's very convenient to use as a stand alone database on your own desktop, much like FileMaker. Set up Access to connect to MySQL on the Mac, and transfer the database that way. CSV or SQL dump), clean it up and import it in your application on the Mac (e.g. Dump the data from Access into a file (e.g. If you have Access up and running in Windows, and want to move your data to a Mac, there are two ways that I know of that would work:ġ.
#Database for mac os x for mac os#
Access isn't based on ODBC, but on Jet, and as far as I am aware, there is no Jet engine for Mac OS X. Even when ODBC is set up properly and working on the Mac, Microsoft Query might not.ģ. If Microsoft Query is to work, ODBC has to work on the Mac, even when the server is somewhere else. Setting up ODBC on the Mac is generally a pain in the you-know-what.

0 notes
Text
Using Ora2Pg to Migrate Data from Oracle to openGauss
Introduction to Ora2Pg
Ora2Pg is an open-source tool for migrating data from Oracle to PostgreSQL. By connecting to Oracle, Ora2Pg automatically scans and extracts object structures and data, generates SQL scripts, and applies the scripts to PostgreSQL manually or automatically.
Official website: https://ora2pg.darold.net/
Advantages of Ora2Pg
Supports exporting most types of database objects, including tables, views, sequences, indexes, foreign keys, constraints, functions, stored procedures, and others.
Automatically converts the PL/SQL syntax to the PL/pgSQL syntax, avoiding manual modification to some extent.
Generates migration reports, containing migration difficulty evaluation and person-day estimation.
Compresses exported data to reduce disk overhead as required.
Provides various configuration items, allowing you to customize migration operations.
Application of Ora2Pg in openGauss
The main language of Ora2Pg is Perl. It uses the Perl DBI module and connects to the target PostgreSQL database by using DBD: Pg. openGauss is compatible with PostgreSQL communication protocols and most syntaxes. As such, you only need to modify some names. Ora2Pg can also be used in openGauss.
Usage Example of Ora2Pg
Ora2Pg exports DDL statements of object structures to SQL files. Table data can be exported to files by running the INSERT or COPY statement or be directly imported to the target database without generating intermediate SQL files.
Ora2Pg provides the ora2pg command to complete these processes. Generally, multiple commands need to be executed for one migration. Ora2Pg provides a more convenient method to obtain the export and import scripts and the migration directory template by creating a migration project. The scripts integrate several ora2pg commands and the psql command (gsql for openGauss) required for importing SQL files. You only need to run the two scripts to complete the migration. The demonstration in this document uses the scripts.
Installing Dependencies
The language of Ora2Pg is Perl. Therefore, you need to install the required Perl module.
# Perform the following operations as the root user: yum install -y perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker yum install perl-CPAN
Install DBI, DBD:Pg, DBD:Oracle on which Ora2Pg depends to connect to the database.
perl -MCPAN -e 'install DBI' perl -MCPAN -e 'install DBD:Pg'
Install Oracle Instant Client or Oracle on the local host before installing DBD:Oracle.
# Download Oracle Instant Client from the Oracle official website and install it. rpm -ivh oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm rpm -ivh oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm rpm -ivh oracle-instantclient12.2-jdbc-12.2.0.1.0-1.x86_64.rpm rpm -ivh oracle-instantclient12.2-sqlplus-12.2.0.1.0-1.x86_64.rpm # Set the environment variable ORACLE_HOME. export ORACLE_HOME=/usr/lib/oracle/11.2/client64 # Set ORACLE_HOME as follows if Oracle has been installed on the local host: export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1 export LD_LIBRARY_PATH=$ORACLE_HOME/lib # Install DBD:Oracle. perl -MCPAN -e 'install DBD:Oracle'
Installing Ora2Pg and Creating a Migration Project
Source code path: https://github.com/darold/ora2pg
# Go to the code directory. <you_install_dir> is the target installation path. perl Makefile.PL PREFIX=<your_install_dir> make && make install # Set environment variables and check whether the installation is successful. <source_code_dir> is the path for downloading the code. export PERL5LIB=<source_code_dir>/lib export PATH=$PATH:<your_install_dir>/usr/local/bin ora2pg –help # Create a migration project. ora2pg --init_project oramig
After a migration project is created, the oramig directory template is generated in the current directory, as shown in the following figure. The directory template contains the export_schema.sh and import_all.sh scripts, which are used for subsequent data export and import. The schema and sources directories store DDL statements of each object. The schema directory stores statements after the PL/SQL syntax is converted into the PL/pgSQL syntax, while the sources directory stores PL/SQL statements before conversion. The data directory stores table data files, the config directory contains the ora2pg.conf configuration file, and the reports directory stores migration reports.
./oramig/ schema/ dblinks/ directories/ functions/ grants/ mviews/ packages/ partitions/ procedures/ sequences/ synonyms/ tables/ tablespaces/ triggers/ types/ views/ sources/ functions/ mviews/ packages/ partitions/ procedures/ triggers/ types/ views/ data/ config/ reports/
Now, you can run the ora2pg command. The following lists some command-line parameters that can be specified when you run the ora2pg command. These parameters can be set in the ora2pg.conf file. When you specify a configuration file, the values of the command-line parameters overwrite the corresponding values in the configuration file.
Usage: ora2pg [-dhpqv --estimate_cost --dump_as_html] [--option value] -a | --allow str: Specifies the list of objects that can be exported. The objects are separated by commas (,). -b | --basedir dir: Specifies the default export directory for storing exported SQL files. -c | --conf file: Specifies the path of the configuration file. -e | --exclude str: Specifies the list of objects that are excluded from the export. The objects are separated by commas (,). -i | --input file: Specifies the SQL file to be imported. You do not need to connect to Oracle when importing the file. -o | --out file: Specifies the path for storing the exported SQL file. The default value is the output.sql file in the current directory. -p | --plsql: Enables the conversion from PL/SQL code to PL/pgSQL code. -s | --source DSN: Specifies the data source of Oracle DBI. -t | --type export: Specifies the export type. This parameter will overwrite the export type (specified by TYPE) in the configuration file. -u | --user name: Specifies the username for connecting to Oracle. You can also use the ORA2PG_USER environment variable. -w | --password pwd: Specifies the user password for connecting to Oracle. You can also use the ORA2PG_PASSWD environment variable. --init_project NAME: Initializes a typical Ora2Pg project and generates a directory template. --view_as_table str: Exports views as tables. Use commas (,) to separate multiple views.
Configuring Ora2Pg
The ora2pg.conf file contains all configuration items, which can be used to customize migration operations. The following describes some common configuration items.
ORACLE_HOME: Specifies the environment variable ORACLE_HOME. The DBD:Oracle module uses this variable to search for the required Oracle database. The setting method is involved in dependency installation.
ORACLE_DSN: Specifies the data source name in the standard DBI DSN form. For example:
ORACLE_DSN dbi:Oracle:host=oradb_host.myhost.com;sid=DB_SID;port=1521
or
ORACLE_DSN dbi:Oracle:DB_SID
For the second method, you need to declare the system identifier (SID) in the $ORACLE_HOME/network/admin/tnsnames.ora file or the tnsnames.ora file in the directory specified by the environment variable TNS_ADMIN.
ORACLE_USER and ORACLE_PWD: Define the username and password for connecting to Oracle, respectively. Note that if possible, log in as the Oracle super administrator to avoid permission issues and ensure that nothing is missing.
PG_DSN: Specifies the name of the target database. The following uses openGauss as an example. The database to be connected is mydb with the IP address localhost and the port number 5432.
PG_DSN dbi:Pg:dbname=mydb;host=localhost;port=5432
PG_USER and PG_PWD: Specify the username and password for connecting to the target database, respectively. Note that the user must have the permission to remotely connect to openGauss as well as read and write permissions on the corresponding database. Specifically, the host where Ora2Pg runs and the user must be in the remote access whitelist of openGauss.
SCHEMA: Specifies the schema to be exported. As shown in the following, the objects associated to the APPS schema are extracted.
SCHEMA APPS
ORA_INITIAL_COMMAND: Sends an initial command to Oracle after the connection. For example, disable an access control policy before reading an object or set some session parameters.
TYPE: Specifies the type of the objects to be exported, including tables, views, sequences, indexes, foreign keys, constraints, functions, stored procedures, and others. The default value is TABLE. As shown in the following, ordinary tables and views are exported.
TYPE TABLE VIEW
For more details about the configuration items, visit the official website at the following link:
https://ora2pg.darold.net/documentation.html
Test the connection. After configuring the DSN of Oracle, run the following command to test the database connection:
ora2pg -t SHOW_VERSION -c config/ora2pg.conf
The version of Oracle will be displayed by running the preceding command.
Running Migration Scripts
The configuration is as follows. Connect to the target database as the system user.
ORACLE_HOME /opt/oracle/product/19c/dbhome_1 ORACLE_DSN dbi:Oracle:host=127.0.0.1;sid=ORCLCDB;port=1521 ORACLE_USER system ORACLE_PWD manager SCHEMA testuser PG_DSN dbi:Pg:dbname=mydb;host=127.0.0.1;port=5432 PG_USER testuser PG_PWD openGauss123
Modify the export type of export_schema.sh. In this migration, tables and functions are exported.
Run the export script and wait until the migration is complete. A DDL file of the corresponding type is generated in the schema and source subdirectories, and the command for exporting table data is provided at the end.
sh export_schema.sh
In addition, a migration report in HTML format is generated in the reports directory.
Before running the import script, perform the following operations:
Create a database in openGauss, create a user in the database, and set the owner of mydb to the user. (In import_all.sh, createuser and createdb of PostgreSQL are used to create users and databases.)
Create the environment variable in the bin directory of openGauss, so that the client tool gsql can be used.
Change psql in import_all.sh to gsql.
Add an option for executing the script when data is imported by a common user, and specify the user password to avoid frequent password input.
Run the import script. In the script, the testuser user is used to log in to the mydb database with the IP address 127.0.0.1 and the port number 5432. The -f option indicates that the check on whether the user and database need to be created is skipped.
sh import_all.sh -d mydb -o testuser –h 127.0.0.1 -p 5432 –f 1
After the script is executed, the system prompts you whether to import the object structures and data, as shown in the following figure. (In the preceding information, the -w option is added by manually modifying the import_all.sh script.)
For table indexes and constraints, you can import them after data is imported.
Log in to openGauss to view the migration result.
Disadvantages of Ora2Pg
Ora2Pg uses regular expressions and adopts text replacement to convert the PL/SQL syntax to the PL/pgSQL syntax. However, for design reasons, Ora2Pg supports only conversion of some syntaxes.
DDL statements are generated by concatenating character strings. However, this method does not fully support some syntaxes, such as the syntax for creating partitioned tables.
0 notes