Author Topic: SQL PLus on mac connect oracle server via mac(client)  (Read 4794 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
SQL PLus on mac connect oracle server via mac(client)
« on: พฤศจิกายน 30, 2015, 02:57:05 PM »
SQL*Plus Command-line Quick Start for UNIX

Do the following steps to start SQL*Plus and connect to the default database:

Open a UNIX terminal.
At the command-line prompt, enter the SQL*Plus command in the form:
$> sqlplus
When prompted, enter your Oracle9i username and password. If you do not know your Oracle9i username and password, ask your Database Administrator.
SQL*Plus starts and connects to the default database.

Now you can start entering and executing SQL, PL/SQL and SQL*Plus statements and commands at the SQL> prompt.

Do the following to start SQL*Plus and connect to a specified database other than the default:

Start SQL*Plus and connect to the default database.
Use the CONNECT command to specify the Oracle Net database alias (@connect_identifier) of the database you want to connect to. To do this enter the CONNECT command in the form:
SQL> connect username/password@connect_identifier

To hide your password, enter the CONNECT command in the form:

SQL> connect username@connect_identifier

You will be prompted to enter your password.

Alternatively, to start SQL*Plus connected to a database other than the default, enter the SQL*Plus command in the form:
$> sqlplus username/password@connect_identifier

To hide your password, enter the SQL*Plus command in the form:

$> sqlplus username@connect_identifier

You will be prompted to enter your password.

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: SQL PLus on mac connect oracle server via mac(client)
« Reply #1 on: พฤศจิกายน 30, 2015, 03:01:40 PM »
ในกรณีที่ต้องการใช้งาน oracle client บน mac เพื่อต่อเข้าไปยัง oracle server
ผมแนะนำตัวนี้ครับ sqlplus
ใช้งานง่าย ผ่าน mac (os)

##ทำการ download program here ดูด้วยว่าใช้งานเป็น 32bit หรือ 64 bit นะครับ โหลดมาสองตัว basic + sqlplus
#http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html
64bit  for basic+sqlplus  Version 11.2.0.4.0 (64-bit)
 
Instant Client Package - Basic: All files required to run OCI, OCCI, and JDBC-OCI applications
 instantclient-basic-macos.x64-11.2.0.4.0.zip (62,794,903 bytes)

Instant Client Package - SQL*Plus: Additional libraries and executable for running SQL*Plus with Instant Client
 instantclient-sqlplus-macos.x64-11.2.0.4.0.zip (884,608 bytes)

Installation

1. Download the desired Instant Client ZIP files. All installations require the Basic or Basic Lite package.
2. Unzip the packages into a single directory such as "/opt/oracle/instantclient_11_2" that is accessible to your application.
3. Create the appropriate libclntsh.dylib and libocci.dylib links for the version of Instant Client. For example:
cd /opt/oracle/instantclient_11_2
ln -s libclntsh.dylib.11.1 libclntsh.dylib
ln -s libocci.dylib.11.1 libocci.dylib

4. Set the environment variable DYLD_LIBRARY_PATH to the directory created in Step 2, for example:
export DYLD_LIBRARY_PATH=/opt/oracle/instantclient_11_2:$DYLD_LIBRARY_PATH

5. To use supplied binaries such as SQL*Plus, update your PATH environment variable, for example:
export PATH=/opt/oracle/instantclient_11_2:$PATH

6. Start your application.
จัดการได้เลยครับ
#sqlplus USER/PASS@//server_ip:port/SID