how can i install sqlplus and execute some sql commands


 
Thread Tools Search this Thread
Operating Systems AIX how can i install sqlplus and execute some sql commands
# 1  
Old 11-05-2008
how can i install sqlplus and execute some sql commands

hi everybody,
i am Talip, a begginner at unix based systems and i have a problem (actually, we may think myself as the problem, in this situation).
i am not sure if this is the correct platform for my questions. if it is not please forgive me about this inappropriate mail.

what i have:
* an ibm P550 server
* an AIX os version 5300-07
* a CDE desktop manager
* an oracle database -already installed and running
* an ssh and x client connection to this server from an other machine
* html based enterprise manager interface

what i have to do:
* to execute some basic (but too many) sql statements; in order to create some new tablespaces on the existing database instance (name of the database is TTM)
* i have already have some .dmp files to import.

my questions are:
1. i am not sure about if there is an sqlplus like application has already installed, or not, on the machine. how can i check?
2. how can i install sqlserver by using the ssh or terminal connection? (assuming that the related files are copied in to the directory "/home/talip")
2.1 after the installation, how can i switch to the sqlplus, from the terminal connection?

thank you very much for your valuable responses,
Talip.
# 2  
Old 11-06-2008
Hi,
this question would better fit in "UNIX and Linux Applications", but anyway - to answer your questions (for Oracle-Versions 7.3 - 10.2):

1. Usually sqlplus is installed with database server software. It's the DBAs last resort tool and therefor I never saw an installation excluding it. In order to use it your user-environment has to be set up correctly:
a) The variables ORACLE_SID and ORACLE_HOME have to be defined. In your case you have to set ORACLE_SID = TTM. To determin the correct value for ORACLE_HOME have a look at the file /etc/oratab. There should be a line
Code:
TTM:/your/ORACLE_HOME/path:Y

in that file (maybe N instead of Y). Set ORACLE_HOME accordingly.
b) Adjust your resource limit to enable you to handle large files (database files usually are huge): ulimit -f unlimited .
c) Optional: Add $ORACLE_HOME:/bin to your PATH (or call the oracle-utilities using their full path).

2. Sorry I don't understand.

2.1. Given your environment is set up correctly (and the PATH variable includes $ORACLE_HOME:/bin) just type sqlplus . Then you have to enter username and password.

About your import task:
You have to find out how those files were created. If the tool used to create them was expdp use impdp to import, else imp (usage like sqlplus).

Stefan
# 3  
Old 12-02-2008
stefan,

thank you very much for your detailed help and expalanations...

talip.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to use for loop to execute multiple .sql files while using SQLPLUS for db connection.?

Hello , Im calling every single file inside my script like 1.sql,2.sql so on it looks so tedious. I want to replace with for loop where every file gets executed. When i use for loop im getting errorUnexpected EOF] , can anyone please help me out in this.. How i can use for loop to invoke my... (6 Replies)
Discussion started by: preethi87
6 Replies

2. Shell Programming and Scripting

How to execute 10 sql files from a folder through sqlplus in shell script?

I am new to shell scripting and i want to know how to execute the *.sql files from a folder through sqlplus in shell script and files should be execute in sequentially one by one while execution if any ORA error it has to exit from sqlplus session 1) scripts from external folder 2) logs has... (1 Reply)
Discussion started by: sreekanth Reddy
1 Replies

3. UNIX and Linux Applications

Execute Oracle pl/sql commands in a scrit using nohup

Good afternoon: I need your help please, Im new at Unix nd specially Unix applicationas like oracle and Ive got this problem: I was asked to execute the next script using nohup in order to not hang up the session because it was supposed to connect to the database and then insert about 2... (3 Replies)
Discussion started by: alexcol
3 Replies

4. Shell Programming and Scripting

sqlplus: cannot execute

Hi, This is the content in my .profile on a unix server, MAIL=/usr/mail/${LOGNAME:?} umask 027 #added by enRole Agent PATH=${PATH}:/opt/app/p1crm1c3/informatica/oracle/product/10.2.0 export PATH PATH=$PATH:/opt/app/p1crm1c3/informatica/oracle/product/10.2.0/network/admin/sqlnet.ora;export... (2 Replies)
Discussion started by: yohasini
2 Replies

5. UNIX and Linux Applications

how to execute multiple .sql scripts from within a shell script using sqlplus

using sqlplus I want to execute a .sql script that has dbms_output statments in rhe script. I want to write the dbms_output statements from .sql file to a log file. is this possible. thanks any help would be appreciated :wall: (1 Reply)
Discussion started by: TRS80
1 Replies

6. Shell Programming and Scripting

cant execute sqlplus from tcshell

Hi, I'm having issues with executing sqlplus (silent mode) through the tcsh. (trying to save a value into a parameter...) I assume that the issue is that there are new lines: I tried the followings and got those errors: set RESULT=`sqlplus -s USER/PASS@//localhost:1521/ABCD <<BLA select *... (3 Replies)
Discussion started by: fcbman
3 Replies

7. Shell Programming and Scripting

Execute multiple SQL scripts from single SQL Plus connection

Hi! I would like to do a single connection to sqlplus and execute some querys. Actually I do for every query one connection to database i.e echo 'select STATUS from v$instance; exit' > $SQL_FILE sqlplus user/pass@sid @$SQL_FILE > $SELECT_RESULT echo 'select VERSION from v$instance;... (6 Replies)
Discussion started by: guif
6 Replies

8. UNIX for Dummies Questions & Answers

Execute PL/SQL function from Unix script (.sql file)

Hi guys, I am new on here, I have a function in oracle that returns a specific value: create or replace PACKAGE BODY "CTC_ASDGET_SCHED" AS FUNCTION FN_ASDSCHEDULE_GET RETURN VARCHAR2 AS BEGIN DECLARE ASDSchedule varchar2(6); ASDComplete... (1 Reply)
Discussion started by: reptile
1 Replies

9. Shell Programming and Scripting

Can BASH execute commands on a remote server when the commands are embedded in shell

I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config. I am not sure if I can do this with BASH scripting. I have set up password less login by adding my public key to authorized_keys file, it works. I am a little... (1 Reply)
Discussion started by: bash_in_my_head
1 Replies

10. Programming

crontab ..sqlplus cannot execute

i have shell script. when i run in normail mode..it run ok but when i use crontab command to set that program run in certain time it give an error. error 'SQLPLUS cannot execute' what the problem.i already set all the correct path and use both root and normal id but still cannot execute properly. (1 Reply)
Discussion started by: zikronz
1 Replies
Login or Register to Ask a Question