Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> ฐานข้อมูล

คู่มือขั้นตอน: การติดตั้งและกำหนดค่า Oracle APEX กับ ORDS

โพสต์นี้อธิบาย Oracle® Application Express (APEX) และ Oracle REST Data Services (ORDS) รวมถึงขั้นตอนการติดตั้ง APEX และติดตั้งและกำหนดค่า ORDS โดยทั่วไป ผู้ดูแลฐานข้อมูล (DBA) เป็นผู้ทำทั้งสองงานนี้

APEX

Oracle พัฒนา APEX เป็นแพลตฟอร์มสภาพแวดล้อมการพัฒนาซอฟต์แวร์แบบเว็บเบส ต้นทุนต่ำ ที่รันบนฐานข้อมูล Oracle คุณสามารถปรับใช้ APEX ได้ทุกที่ ซึ่งช่วยให้นักพัฒนาสร้าง Enterprise Apps ที่ปลอดภัยและ Scalable พร้อมคุณลักษณะต่างๆ

ORDS

ORDS เป็นแอปพลิเคชัน berbasis Java ช่วยให้นักพัฒนาที่มีทักษะ SQL และฐานข้อมูล พัฒนา REST APIs สำหรับ Oracle Database คุณสามารถปรับใช้ ORDS บน Web และ Application Servers รวมถึง WebLogic®, Tomcat® และ Glassfish® ตามภาพต่อไปนี้:

คู่มือขั้นตอน: การติดตั้งและกำหนดค่า Oracle APEX กับ ORDS

แหล่งที่มารูปภาพ: https://www.oracle.com/technetwork/developer-tools/apex/application-express/apex-arch-1876607.png

ติดตั้งและกำหนดค่า

คุณสามารถติดตั้งและกำหนดค่า APEX และ ORDS โดยใช้วิธีต่อไปนี้:

  • ติดตั้ง APEX และ ORDS และกำหนดค่า ORDS
  • ติดตั้ง APEX และกำหนดค่า Web Listener: Embedded PL/SQL Gateway
  • ติดตั้ง APEX และกำหนดค่า Legacy Web Listener: Oracle HTTP Server

สำหรับโพสต์นี้ ผมเลือกตัวเลือกแรก ซึ่ง Oracle แนะนำ: ติดตั้ง APEX และ ORDS และกำหนดค่า ORDS

ติดตั้ง APEX

หมายเหตุ: คุณต้องติดตั้ง APEX บน Database Server Node

ติดตั้ง Apex Executable และสร้าง Tablespace และ Schema โดยใช้ขั้นตอนต่อไปนี้:

  1. ดาวน์โหลดและแตกไฟล์ซอฟต์แวร์ APEX ไปที่ /u01/app/oradi/Apex.
 $unzip apex_19.2_en.zip SQL> create tablespace apex_data datafile '+DMLCKI_DATA1/dmlcki/datafile/apex_data01.dbf' size 4000M; Tablespace created. $pwd /u01/app/oradi/Apex sqlplus "/as sysdba" SQL> @apexins.sql apex_data apex_data TEMP /i/ apex_data - Tablespace to hold Apex Schema and its files TEMP - Temporary Tablespace /i/ - It is image directory 
  1. เปลี่ยนรหัสผ่าน Administrator
 SQL> @apxchpwd.sql 
  1. สร้าง APEX_LISTENER และ APEX_REST_PUBLIC_USER
 SQL> @apex_rest_config.sql 

ติดตั้งและกำหนดค่า ORDS

ใช้ขั้นตอนต่อไปนี้เพื่อติดตั้งและกำหนดค่า ORDS:

  1. ดาวน์โหลด ORDS รุ่นล่าสุดไปที่ /u01/app/oradi/ORDS
  2. แตกไฟล์ที่ดาวน์โหลดไปยังไดเรกทอรีที่คุณเลือก
  3. คัดลอกไดเรกทอรี Images /u01/app/oradi/Apex/apex/images จากไฟล์ Zip ของซอฟต์แวร์ APEX ไปยังตำแหน่งที่คุณวางแผนจะติดตั้ง ORDS
 [oradi@diatmlckidb01 apex]$ cp -rp images /u01/app/oradi/ORDS/ [oradi@diatmlckidb01 apex]$ pwd /u01/app/oradi/Apex/apex [oradi@diatmlckidb01 apex]$ cd /u01/app/oradi/ORDS/ [oradi@diatmlckidb01 ORDS]$ ls -lrt drwxr-xr-x 32 oradi oinstall 4096 Nov 6 14:21 images -rw-r--r-- 1 oradi oinstall 63211594 Nov 27 20:14 ords-19.2.0.199.1647.zip 
  1. Oracle แนะนำให้คุณใช้ Java รุ่นล่าสุดสำหรับ ORDS ดาวน์โหลด JDK Version 8 จาก Patch File p30437878_180231_LINUX.zip และแตกไฟล์
  1. สำรองโฟลเดอร์ jdk ที่มีอยู่ และคัดลอก jdk1.8.0_231 ไป ORACLE_HOME/
 [oradi@diatmlckidb01 clone]$ cd /u01/app/oradi/DMLCKI/db/tech_st/11.2.0/ [oradi@diatmlckidb01 11.2.0]$ mv jdk jdk_old [oradi@diatmlckidb01 11.2.0]$ cd [oradi@diatmlckidb01 ~]$ cd clone/ [oradi@diatmlckidb01 clone]$ cp -rp jdk1.8.0_231 $ORACLE_HOME/ [oradi@diatmlckidb01 clone]$ cd $ORACLE_HOME/ [oradi@diatmlckidb01 11.2.0]$ mv jdk1.8.0_231 jdk [oradi@diatmlckidb01 11.2.0]$ java -version java version "1.8.0_231" Java(TM) SE Runtime Environment (build 1.8.0_231-b33) Java HotSpot(TM) Server VM (build 25.231-b33, mixed mode) 
  1. รันคำสั่งต่อไปนี้เพื่อทำ Setup และ Configuration ให้เสร็จสมบูรณ์:
 [oradi@diatmlckidb01 ORDS]$ java -Dorg.eclipse.jetty.server.Request.maxFormContentSize=3000000 -jar ords.war This Oracle REST Data Services instance has not yet been configured. Please complete the following prompts Enter the location to store configuration data: /u01/app/oradi/ORDS/params Enter the name of the database server [localhost]:diatmlckidb01. Enter the database listen port [1521]:1522 Enter 1 to specify the database service name, or 2 to specify the database SID [1]: Enter the database service name:DMLCKI Enter the database password for ORDS_PUBLIC_USER: Confirm password: Requires to login with administrator privileges to verify Oracle REST Data Services schema. Enter the administrator username:sys Enter the database password for SYS AS SYSDBA: Confirm password: Retrieving information. Enter the default tablespace for ORDS_PUBLIC_USER [SYSAUX]: Enter **1** if you want to use PL/SQL Gateway or **2** to skip this step. If you are using Oracle Application Express or migrating from mod_plsql then you must enter **1**: Enter the database password for APEX_PUBLIC_USER: Confirm password: Enter **1** to specify passwords for Application Express RESTful Services database users (APEX_LISTENER, APEX_REST_PUBLIC_USER) or **2** to skip this step: Enter the database password for APEX_LISTENER: Confirm password: Enter the database password for APEX_REST_PUBLIC_USER: Confirm password: Nov 28, 2019 6:38:12 AM Installing Oracle REST Data Services version 19.2.0.r1991647 ... Log file written to /home/oradi/ords_install_core_2019-11-28_063812_00625.log ... Verified database prerequisites ... Created Oracle REST Data Services proxy user ... Created Oracle REST Data Services schema ... Granted privileges to Oracle REST Data Services ... Created Oracle REST Data Services database objects ... Log file written to /home/oradi/ords_install_datamodel_2019-11-28_063822_00076.log ... Log file written to /home/oradi/ords_install_apex_2019-11-28_063823_00607.log Complete installation for Oracle REST Data Services version 19.2.0.r1991647. Elapsed time: 00:00:12.537. 

คุณควรสามารถเข้าถึง URL สำหรับ APEX https://localhost:8080/apex/apex_admin จากเว็บเบราว์เซอร์ของคุณได้

สรุป

APEX เครื่องมือของ Oracle สำหรับการพัฒนาแอปพลิเคชันฐานข้อมูลและเว็บ แทนที่ Legacy Oracle Forms Applications แล้ว Oracle APEX เป็นตัวเลือกที่ดีกว่าเพราะมันสร้างแอปพลิเคชันได้อย่างรวดเร็ว ต้นทุนต่ำ และช่วยให้ DBA ตอบสนองความต้องการของลูกค้าของคุณ

ORDS ให้การเข้าถึงฐานข้อมูลโดยตรงผ่าน HTTP หรือ HTTPS Request ดังนั้นคุณจึงสามารถแก้ไขข้อมูลสำหรับแอปพลิเคชันที่มีอยู่ได้อย่างง่ายดาย นักพัฒนาซอฟต์แวร์เพียงแค่เรียก Web Service เพื่อโต้ตอบกับฐานข้อมูล

ใช้แท็บ Feedback เพื่อแสดงความคิดเห็นหรือถามคำถาม คุณยังสามารถแชทได้ทันทีเพื่อเริ่มการสนทนา

เรียนรู้เพิ่มเติมเกี่ยวกับ Databases