How to install run Oracle on your Linux machine
Starting to install Oracle on RedHat can be quite easy, but if it is completely followed by Oracle's documents, it is not so easy. The fastest shortcut is the homepage of Tom Bisset: http://jordan.fortwayne.com/oracle. If you look at Tom's homepage, you will notice that he misses the JDBC installation. If you are ready to use JDBC (for cross-platform Oracle applications), you can add this option when you ask you to select the component (Components) when you install the screen. Of course, you should first install JDK. I personally use BlackDown JDK 1.1.7. (Translation: Red Hat) Then need to set the ClassPath environment variable of Oracle users, the best way is to add one sentence in the Oracle user directory .Bash_profile or .profile: ClassPath = / usr / lib / jdk / lib / class. Zip; Export ClassPath, if you only need to do the web applet, choose "JDK 1.1 JDBC Thin Driver" when you need to make a complete Java app, choose JDK 1.1 JDBC OCI Driver ". Also note: When the installer allows you to enter each password, if the password does not meet the specification, it will not warn. When I installed the first time, I added ".", This is allowed in Unix, Oracle is another code. The program tells me if the password is issued until the installation is over. At that time, I was a installation from my head. Another problem with the installer is to try to copy files in the directory that has not been established. It is necessary to install MKDIR -P /U01/App/Oracle/server.805/install before installation. This is all over. After the installation is successful, you must log in as root and run root.sh. I made the following changes to root.sh: • Changed from / usr / lbin from / usr / lbin · Increase environment variable log = / tmp / oracle-root.sh.log, such script run results I will record ROOT.SH, I want to run as a server, I must set Two_Task variables first; however, it is actually necessary to set up this variable if ROOT.SH is run from the machine installed in Oracle. Python and Oracle I have configured python (a powerful, fast-oriented scripting language) to test Oracle's programming interfaces and network interfaces. In Python, you want to even Oracle, you need DCORACLE modules for Digital Creation (author of the Zope Application Server). You only need to download the software and do it according to indication. If you are DCORACLE 1.1.0, use the setup-8.0.4 configuration, remove -lsocket, -lnsl, -lgen, -ld, -laio, and -lposix4 from the Oracle_libs variable, which are Solaris is dedicated. Note that the Python settings installed in RedHat 5.2 and 6.0, the config directory and the include directory are omitted, and the modules of the third party cannot be compiled. You must compile python yourself or download a suitable RPM.
Looking for Python's RPM, the best place to go is Oliver Andrich's Python & Linux home page. Just rpm -e --Nodeps Python, then rpm -i python, python-dev, and other RPM. After installing Python, I run the following basic query and access Oracle. [uche @Malesta uche] $ PythonPython 1.5.1 (# 1, SEP 3 1998, 22:51:17) [GCC 2.7.2.3] on Linux-i386copyright 1991-1995 stichting mathematisch centrum, Amsterdam >> IMPORT DCOracle >> > #connect to db. Scott / Tiger Are The Test Database UserName / Password >>> DBC = DCORACLE.CONNECT ("Scott / Tiger @ Sforza") #Sforza Is The Local OraclesRVER >>> C = dbc.cursor ()> >> C.EXECUTE ("Select * from Emp where Emp.deptno = 10") >>> Rows = C.FETCHALL () >>> Print Rows [(7782, 'Clark', 'Manager', 7839, DBIDATE '1981-06-09 00:00:00'), 2450.0, None, 10), (7839, 'KING', 'PRESIDENT', NONE, DBIDATE ('1981-11-17 00:00:00'), 5000.0, None, 10), (7934, 'Miller', 'Clerk', 7782, DBIDATE ('1982-01-23 00:00:00'), 1300.0, NONE, 10)] Development Workstation Configuration I am in the database server Compilation of Python and other programming interfaces on a machine. Initially, it seems that I have to install all Pro * C / C packages of Oracle. But I have to run the Oracle installer to that step, so I don't want to do that. So I found the smallest header file (include), object file (Object) and library file (library): $ oracle_home / lib / * $ oracle_home / rdbms / h * $ Oracle_Home / RDBMS / LIB / * There is oracle_home for / usr / local / oracle. Note that these files have not allowed you to embed the SQL statement directly in the C program, only after the full installation of Pro * C / C is available. If you want to use Java, you have to add $ oracle_home / jdbc / lib / *; pay attention to add this directory to the ClassPath variable. JDBC is connected to test JDBC connections, I made a small program, showing all employee names in the test library in a listbox. The following program 1 is a Java Applet called JDBC, and the program 2 is an HTML hyperbocity that calls the Java program.
If your JDBC is already installed, copy the program 1 to JDBCTEST.JAVA, copy the program 2 to jdbctest.html, then: javac jdbctest.javaappletViewer JDBCTEST.html You can see the results yourself: Program 1: / * Applet what reads in several rows from a remote Oracle Database and presents the in a listbox. * / Import java.sql. *; Import java.awt. *; Import java.applet. *; Import java.lang. *; Public class JDBCTest extends Applet {// Single-select ListBoxprivate List employee_list = new List (5, false) public void init () {setLayout (new BorderLayout ()); try {// Set up the Oracle JDBC driverDriverManager.registerDriver (new oracle. jdbc.driver.OracleDriver ()); // Connect to an Oracle database on machine sforza, using username // "scott" and password "tiger" Connection DB_conn = DriverManager.getConnection ( "jdbc: oracle: thin: @sforza: 1521 : ORCL "," Scott "," Tiger "); // Connection DB_CONN = DriverManager.getConnection (" JDBC: Oracle: Thin: Scott / Tiger @ Sforza: 1521: ORCL "); // Create a jdbc statement ObjectStatement Statement_obj = DB_CONN.CREATESTATEMENT (); // Execute a query to get the employee name from the test DBResultSet results = statement_obj.executeQuery ( "select ENAME fromEMP"); // Populate the list box with all the employee nameswhile (results.next ()) {employee_list.add (results.getString (1));}} catch (SQLException e) {throw new runtimeException ("SQL Exception" E.GetMessage ());} add (employee_list);}}} 程序 2: < HTML>
Oracle JDBC Driver Test title> head> Oracle JDBC Driver Test h1>