Step by Step Guide in Installing Linux and Oracle Server
Step by Step Guide in Installing Linux and Oracle Server
Part 1: Installing Oracle Enterprise Linux Part 2: Staging Oracle 11g Database Part 3: Installing and Configuring Oracle 11g System Part 4: Configuring Oracle 11g Listener File Part 5: Installing and Configuring Oracle 11g Database Instance Part 6: Running the Enterprise Management Website Part 7: Preparing the PL/SQL Server for Classroom Environment Part 8: Configuring Client Access for PL/SQL Server Part 9: Shutting Down Database Services Part 10: Starting-Up Database Services 02 21 30 36 41 52 55 59 67 68
: 5.5 : 11g
Page 1
PART 1: INSTALLING ORACLE ENTERPRISE LINUX 1. Be sure to make your DVD-ROM the first boot followed by your local hard drive. 2. On the initial screen, Press Enter.
Page 2
5. Be sure that English (English) is selected as a default language and press Next.
6. On the Keyboard Selection, make sure that U.S. English is selected and press Next.
Page 3
Page 4
8. Choose Custom Layout on the drop down menu and press Next.
9. Click the Free Partition and click New button to create a Boot Partition.
Note: 1. This installation guide assumes that you dont have a Windows operating system installed. If you plan to do dual booting of both OS (Windows and Linux), Install first the Windows OS. 2. If the hard disk has a Data or partitioned with any file system. It should be deleted either by Windows Disk management or Linux Installer. Prepared By: AJD Luistro (GES DEPT) Page 5
3. If deleting thru the Linux Installer use the Delete button to free the partition. 10. On the Add Partition dialog Box, choose /Boot on the Mount Point drop down menu. Type 2000 on the Size (MB) text box. All other settings should remain unchange. Click OK. Below is the settings after configuration:
11. Click the Free partition and click New button again. Choose Swap on the File System Type drop down menu. Type 3500 on the Size (MB) text box. All other settings should remain unchange. Click OK. Below is the settings after configuration:
Note: This installation guide assumes that your installed physical memory is 2GB or more.
Page 6
12. Click the Free partition and click New button again. Choose / on the Mount Point drop down menu. Click Fill to maximum allowable size radio button. All other settings should remain unchange. Click OK. Below is the settings after configuration:
Note: The final structure of your hard drive should be somewhat the same on the figure below:
13. Click Next. 14. It is a good practice to provide password for boot loader. Click Use Boot Loader Password and type oracle on the first text box and re-type oracle on the second text box and press OK. Click Next. Prepared By: AJD Luistro (GES DEPT) Page 7
Note: 1. If you have a Windows OS installed, it will appear over the Enterprise Linux OS. You may choose to make any OS the first boot once you power-on your PC. 2. Check which OS you want to load by Default. 15. Click Edit on Network Devices. On the Edit Interface dialog box, Click Manual Configuration and provide necessary IP and corresponding Subnet Mask. Unclick Enable IPV6 Support. All other settings should remain unchange. Click OK. Below is the settings after configuration:
16. Under Hostname, provide meaningful name like Server1.Oracle.com, Ora01.Oracle.com or DBAdmin1.Oracle.com. Provide appropriate Gateway and DNS Settings on the text boxes
Page 8
provided under Miscellaneous Settings. Then click Next. Below is the settings after configuration:
Note: 1. IP settings may change depending on your network configurations. 2. There should be different Hostname per PC. This is to assure that no two PC or Server has the same name. 3. Lastly, provide the domain name oracle.com. This will be used in the advance configuration of databases. 17. On Regional Settings, choose Asia/Manila on the drop down menu or just click Manila on the Map. Uncheck System Clock uses UTC. Then click Next.
Page 9
18. Provide root password on the text boxes provided. You may opt to have a different password instead of the oracle password. Then click Next.
Note: Do not forget the root password. 19. Click Customize Now and click Next.
Page 10
20. Follow the table below on what packages to completely install on your system and click Next if all required packages has been checked: Parent Folder Desktop Environments Applications Sub Folder GNOME Desktop Environment KDE (K Desktop Environment) Authoring and Publishing Editors Engineering and Scientific Games and Entertaining Graphical Internet Graphics Office Productivity Sound and Video Text Based Internet Development Libraries Development Tools GNOME Software Development Java Development KDE Software Development Legacy Software Development Ruby X Software Development DNS Name Server FTP Server Legacy Network Server Mail Server Task Complete Install Default Default Complete Install Default Do not Install Default Default Default Default Default Complete Install Complete Install Complete Install Complete Install Default Complete Install Default Default Default Default Complete Install Default Page 11
Development
Servers
Base System
MySQL Database Network Servers News Server PostgreSQL database Printing Support Server Configuration Tools Web Server Windows File Server Administration Tool Base Dialup Networking Support Java Legacy Software Support OpenFabrics Enterprise Dist. System Tools X Window
Default Complete Install Default Default Default Complete Install Complete Install Complete Install Complete Install Complete Install Default Complete Install Complete Install Default Complete Install Default Default Default Default
Page 12
Page 13
22. After all packages has been installed. Click Reboot. Wait for the system to restart. 23. On the Welcome Screen. Click Forward.
24. On the License Agreement Window, ensure Yes is selected and click Forward.
Page 14
25. On THE Firewall Window, choose Disabled on the drop down menu and click Forward. Click Yes to confirm the warning.
Page 15
26. Choose Disable on the SELinux Window and click Forward. Press Yes to confirm the settings.
Page 16
29. Click Forward on the Create User Window. Dont create a user at this time. Click Continue on the dialog box that will appear.
Page 17
Page 18
31. Click Finish on the Additional CDs Window. Note: Linux will restart once you press finish.
Page 19
32. After the restart, you should see a similar GUI Linux.
33. Finish.
Page 20
1. Login as root with a password of oracle or any password you provide during setup. 2. Launch the Terminal Window by right-clicking the Desktop and choosing Open Terminal on the context menu.
3. Test if we successfully install all necessary packages needed by Oracle 11g Database by running the following command: COPY and PASTE rpm -q compat-libstdc++-33 elfutils-libelf-devel glibcdevel-2.5 gcc gcc-c++ libaio-devel libstdc++-devel unixODBC unixODBC-devel sysstat binutils elfutils-libelf glibc glibc-common libaio libgcc libstdc++ make 4. Results should be like the figure below:
Page 21
Note: 1. There should be no package that is not installed on the report. 2. If the package is not installed, follow the steps below: a. Mount the OEL Installer b. Launch the Terminal Window and go to the following directory by typing: ># cd \media\<name of dvd-rom>\Server ># rpm -ivh <name of package not installed> c. Wait for the package to be installed. 5. Run the following command to create a group for oracle user: COPY and PASTE ># /usr/sbin/groupadd oinstall ># /usr/sbin/groupadd dba ># /usr/sbin/groupadd oper
6. Run the following command to join oracle user on the group created above: COPY and PASTE ># system-config-users
Page 22
7. Double-click oracle user, on the User Properties dialog box, click the Groups tab, and make sure that oracle is a member of the following group: oinstall dba oper Click Ok and close the User Manager window.
8. Go back to the Terminal Windows and issue the following command to change oracle password:
9. Type oracle as an initial password and press Enter. Re-type oracle to confirm the password.
Page 23
10. Edit oracle user profile by typing the following command: COPY and PASTE ># vim /home/oracle/.bash_profile
11. Edit the profile by deleting all texts under # User specific environment and startup programs:
Page 24
12. Copy the following text under # User specific environment and startup programs. COPY and PASTE umask 022 PATH=$PATH:$HOME/bin PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin LD_LIBRARY_PATH=/usr/lib:/usr/X11R6/lib ORACLE_BASE=/u01/app/oracle ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1 ORACLE_SID=orcl $ORACLE_HOME/jdk/jre/lib/i386/server: $ORACLE_HOME/rdbms/lib:$ORACLE_HOME/lib:$LD_LIBRARY_PATH PATH=$ORACLE_HOME/bin:$PATH export PATH export PATH LD_LIBRARY_PATH export ORACLE_BASE ORACLE_HOME ORACLE_SID
13. Make sure that you save the settings by issuing the following command on the console: a. Press ESC b. Type : (colon) c. Type wq and press Enter.
Page 25
14. On the Terminal Window, type the following one a time: COPY and PASTE ># mkdir -p /u01/app/oracle ># chown -R oracle:oinstall /u01/app ># chmod -R 775 /u01/app
15. Edit the Kernel Configuration file by editing the sysctl.conf. Type the following command: COPY and PASTE ># vim /etc/sysctl.conf
16. Edit the following kernel parameter: net.core.rmem_default = 4194304 net.core.rmem_max = 4194304 net.core.wmem_default = 1048576 net.core.wmem_max = 1048576 net.ipv4.ip_local_port_range = 1024 65500 You parameter configuration should like the figure below: Prepared By: AJD Luistro (GES DEPT) Page 26
Note: Follow the steps in number 13 to save the configuration file. 17. Make the kernel configuration permanent by issuing the following command on the Terminal Window: COPY and PASTE ># vim /etc/sysctl.conf
Page 27
18. Make the Oracle 11g Database installer path by issuing the following command: COPY and PASTE ># mkdir -p /stage/db11g/db/Disk1
Note: It is very important that we set this Directory since this is where the database installer files will be copied or staged. 19. Copy the content inside the Database folder (from OAI Tools DVD) and copy it to /stage/db11g/db/Disk1. Note: Dont copy the Database folder itself but the contents only. 20. Once the copying is finished, issue the following command so that oracle user will have the right to launch an executable file over Oracle Universal Installer: COPY and PASTE
Page 28
21. To test if the staging is set correctly, Log-off as root user and log-in as oracle user with a password of oracle. 22. Open a Terminal Window. 23. Test the installation of Oracle 11g system by launching the following command as oracle user. COPY and PASTE >$ cd /stage/db11g/db/Disk1 >$ ./runInstaller
24. If the following window appears, then you successfully stage the installation of Oracle 11g Database system.
25. Click Cancel since we are only testing if the Oracle Universal Installer will work. Note: If you are installing for Admin1 subject, this is the part that you will leave the staging because students will install the Oracle System themselves.
Page 29
1. Log-in as oracle with the password of oracle. 2. Open a Terminal Window. 3. Launch the Oracle Universal Installer by typing the following command: COPY and PASTE >$ cd /stage/db11g/db/Disk1 >$ ./runInstaller
4. On the Select Installation Method, uncheck Create Starter Database and click Next.
Note: We need to uncheck the Creation of Starter Database to make the configuration more seamless. Else, we will have problem launching the database application. 5. Click Next on the Specify Inventory Directory and Credentials window
Page 30
6. On the Product-Specific Prerequisite Checks, select the Not Executed and click Next.
Page 31
Note: if there are too many not executed statement. Try to troubleshoot what is lacking on your configuration. 7. On the Summary Page, click Install.
Page 32
8. Before the installation finishes, an Execute Configuration Script dialog appears that will let you run two important scripts.
9. Before running the script, you must launch a new Terminal Window and logon as root. Issue the following command: COPY and PASTE >$ su -
Note: Remember that you must be a root user to run the scripts above.
Page 33
10. Type the following on the terminal window or you can copy number 1 script on the window and press Enter: COPY and PASTE ># /u01/app/oraInventory/orainstRoot.sh
11. Run the second script by typing the script number 2 or by copying it and press Enter: COPY and PASTE ># /u01/app/oracle/product/11.1.0/db_1/root.sh
Page 34
12. Type exit on Terminal Window and close it. 13. Click OK on the Execute Configuration Script window. 14. On the End of Installation window, press Exit.
Page 35
1. Close all Terminal Window and Re-open a new Terminal Window. 2. Type netca and press Enter. 3. A new welcome screen for Oracle Net Configuration Assistant will appear. Ensure Listener Configuration is selected and click Next.
4. On Oracle Net Configuration Assistant: Listener Configuration, Listener screen click Next.
Note: Since this is our first Listener file. The only option is Add.
Page 36
5.
On Oracle Net Configuration Assistant: Listener Configuration, Listener Name screen, accept the default Listener name and click Next:
Note: Notice that the listener file is in all capital letter. Best Practice is not to edit the listener file to other name or font size. 6. Ensure that TCP is the Selected Protocol on the Oracle Net Configuration Assistant: Listener Configuration, Select Protocol screen and click Next.
Page 37
7. Ensure that Use the standard port number of 1521 is selected on the Oracle Net Configuration Assistant: Listener Configuration, TCP/IP Protocol and click NEXT.
8. On the Oracle Net Configuration Assistant: Listener Configuration, More Listener screen, ensure that No is selected and click Next.
Page 38
9. On the Oracle Net Configuration Assistant: Listener Configuration Done screen, click Next.
10. Click Finish on the Oracle Net Configuration Assistant: Welcome screen:
11. Go back to the Terminal Window where you launch the netca command. You must have a similar output as one on the figure below:
Page 39
Note: 1. You should receive a message that states a. Listener Control complete b. Listener started successfully c. Oracle Net Services Configuration successful. 2. If either of the messages fails, check the following: a. LAN Card settings (IP Address or TCP Configuration) b. LAN Card should be detected on installation of OS. c. Hostname configurations d. Or edit LISTENER file by launching netca again. 12. Dont logoff as an oracle user yet.
Page 40
1. Type dbca on your Terminal Window and press Enter. 2. On the Database Configuration Assistant: Welcome screen, click Next.
3. Ensure Create a Database is selected on the Database Configuration Assistant, Step 1 of 15: Operations screen and Click Next.
Page 41
4. Ensure that General Purpose or Transaction Processing is selected on Database Configuration Assistant, Step 2 of 15: Database Templates screen and Click Next
5. Type orcl.oracle.com on Global Database Name textbox and ensure orcl is automatically type on SID text box under Step 3 of 15: Database Identification window and then click Next.
Page 42
6. On Step 4 of 15: Management Options, ensure Configure Enterprise Manager is selected and click Next.
7. In Step 5 of 15: Database Credentials, select Use the Same Administrative Password for All Accounts and type for both text boxes oracle as password. Click Next.
Page 43
8. In Step 6 of 15: Storage Options, ensure that File System is selected and click Next.
9. In Step 7 of 15: Database File Locations screen, ensure that Use Database File Locations from Template is selected and click Next.
Page 44
10. In Step 8 of 15: Recovery Configuration window, confirm that Specify Flash recovery Area is selected and click Next.
11. In Step 9 of 15: Database Content window, select Sample Schemas and click Next.
Page 45
12. In Step 10 of 14: Initialization Parameters window, click Character Sets tab, and select Use Unicode (AL32UTF8) and click Next.
13. In Step 11 of 14: Security Settings window, confirm that Keep the enhanced 11g default security settings (recommended) is selected and click Next.
Page 46
14. In Step 12 of 14: Automatic Maintenance Task window, confirm that Enable Automatic Maintenance Task is selected and click Next.
Note: You may want to check Database file locations by clicking File Location Variables.
Page 47
16. In Step 14 of 14: Creation Operations window, ensure that Create Database is selected, select Save as Database Template and Select Generate Database Creation Scripts and click Finish.
17. On the Confirmation window, review what services or package that will be installed and click OK.
Page 48
Page 49
21. Before the Creation of Database finishes, another window will appear. Write down the URL for the Enterprise Manager website.
Page 50
22. Click Password Management button. 23. On the Password Management window, Find HR username. Uncheck its lock account and provide hr on the new password field and hr on the confirm password field. Click OK.
24. Click EXIT to close Database Configuration Assistant window. 25. Dont Logoff yet.
Page 51
SAMPLE
https://server1.oracle.com:1158/em
3.
4. Click or you can add an exception hyperlink 5. Click Add Exception button.
Page 52
7. Ensure that Permanently store this exception is selected and click Confirm Security Exception Button.
Page 53
8. The Enterprise Manager website should display similar on the figure below:
9. Login as sys with a password of oracle and connect as SYSDBA. You should see now the content of the Enterprise Manager just like the figure below:
Page 54
1. In preparation for this task, all scripts should be ready and mounted on your USB Drive 2. Go to the Scripts Folder by typing: SAMPLE [oracle@Server1 ~]$ cd /media/DISK1/Scripts/Setup1/
3. Login in sqlplus terminal as SYSDBA by typing: SAMPLE [oracle@Server1 ~]$ sqlplus / as sysdba
4. Run the Script for creating users ora1 to ora40: SAMPLE SQL> @setup1.sql
Note: Confirm that you are connected to a Database and not with an Idle Instance. 5. Verify in the Enterprise Manager if ora1 to ora80 has been created. 6. Type EXIT on SQLplus terminal SAMPLE SQL> Exit
7. Type cd .. on the Terminal Window to go back to Scripts folder. SAMPLE [oracle@Server1 Setup1]$ cd ..
Page 55
8. Verify in the Enterprise Manager if ora1 to ora80 has been created. 9. Repeat steps 6 to 7 10. Type cd setup3 on the Terminal Window: SAMPLE [oracle@Server1 Scripts]$ cd setup3
11. Login to SQLPlus Terminal by typing: SAMPLE [oracle@Server1 setup3]$ sqlplus / as sysdba
12. Run setup2 script to create users ora81 to ora120. SAMPLE SQL> @setup2.sql
13. Verify in the Enterprise Manager if ora81 to ora120 has been created. 14. Type EXIT in the SQLPlus Terminal 15. Re-login as sysdba in SQLPlus by typing: SAMPLE [oracle@Server1 setup3]$ sqlplus / as sysdba
16. Backup the Server Parameter File by typing the following sql commands: SAMPLE SQL> create pfile from spfile;
17. Exit in the SQLPlus Terminal Window. 18. Create an EMP_DIR folder in /home/oracle directory by typing: SAMPLE [oracle@Server1 setup3]$ mkdir -p /home/oracle/EMP_DIR Prepared By: AJD Luistro (GES DEPT) Page 56
19. Still inside the Script/Setup3 Directory. Copy the emp.dat file to /home/oracle/EMP_DIR SAMPLE [oracle@Server1 setup3]$cp emp.dat /home/oracle/EMP_DIR
SAMPLE
[oracle@Server1 setup3]$ sqlplus / as sysdba
21. Run the SQL script cre_dir.sql inside the SQLplus Terminal SAMPLE SQL> @cre_dir.sql
22. Repeat the script so that there will be no error. 23. Exit in the SQLPlus Terminal Window by typing Exit. 24. Copy UTL_FILE folder under Scripts/Setup3/PLSQL_PU_UTIL_FILE_DIR.zip_FILES folder to /home/oracle SAMPLE [oracle@Server1 setup3]$ cp -R PLSQL_PU_UTIL_FILE_DIR.zip_FILES/UTL_FILE /home/oracle
25. Still in setup3 directory, go to PLSQL_PU_UTIL_FILE_DIR.zip_FILES directory by typing: SAMPLE [oracle@Server1 setup3]$ cd PLSQL_PU_UTIL_FILE_DIR.zip_FILES
26. Login in the SQLPlus Terminal Window SAMPLE [oracle@Server1 PLSQL_PU_UTIL_FILE_DIR.zip_FILES]$ sqlplus / as sysdba
Page 57
28. Provide the path for oracle home: SAMPLE Enter value for oracle_home: $ORACLE_HOME
NOTE: $ORACLE_HOME should be type in capital letters. 29. Exit the SQLPlus Terminal Window 30. Go to the following directory to edit oracle initialization file called initorcl.ora located in /u01/app/oracle/product/11.1.0/db_1/dbs folder. SAMPLE [oracle@Server1 ~]$ cd /u01/app/oracle/product/11.1.0/db_1/dbs
31. Edit the initialization parameter file thru vim: SAMPLE [oracle@Server1 dbs]$ vim initorcl.ora
32. Go to the bottom of the page. Press I to edit the file. Just below *.undo_tablespace='UNDOTBS1', insert the following: SAMPLE *.undo_tablespace='UNDOTBS1' UTL_FILE_DIR=$ORACLE_HOME/UTL_FILE 33. Press ESC and Type : (colon). Then Type wq to save the changes and press Enter to exit.
Page 58
1. Install Oracle Client 11g on a computer that will participate in PL/SQL server access. 2. Launch the Oracle Client 11g Setup. Wait for the Terminal Window to finish configuring itself.
4. On the Select Installation Type window, select Administrator (679MB) and click Next.
Page 59
5. Accept all the default settings on the Install Location window and click Next.
Page 60
Page 61
Page 62
Page 63
13. Launch the SQL Developer Application by going to : Start Menu > All Programs > Oracle oraClient11g_home1 > Application Development.
Page 64
15. On the New / Select Database window, provide the following details: Fields Connection Name Username Password Role Connection Type Hostname Port SID Settings SQLDev01 ora1 ora1 default Basic 192.168.1.10 1521 orcl Remarks or any related name or any users created from the script same with username Servers IP Address Default Oracles Port Instance Name
Click Test. 16. Ensure that the Status is Successful and click Connect
Page 65
17. Once connected, run different select statements to test if the server responds.
Page 66
1. You must be logged as oracle user in order to perform Database Shutdown. 2. Open a terminal window and stop Enterprise Managers services. [oracle@Server1 ~]$ emctl stop dbconsole Note: If command is successful, by this time you cannot use the Oracle Website to administer the database. 3. Logon to SQLPlus by typing: [oracle@Server1 ~]$ sqlplus / as sysdba 4. Stop the database instance: SQL> shutdown immediate 5. Exit the SQLPlus environment 6. On the Terminal window, issue the following command to stop the Listener file. [oracle@Server1 ~]$ lsnrctl stop LISTENER 7. Shutdown the machine.
Page 67
1. Start the Machine and logon as oracle user. 2. Open a Terminal window and issue the following command: [oracle@Server1 ~]$ oracle start 3. Start the Listener file by typing the command: [oracle@Server1 ~]$ lsnrctl start LISTENER 4. Open the SQLPlus Terminal window by typing: [oracle@Server1 ~]$ sqlplus / as sysdba 5. Start the database by typing: SQL> startup 6. Exit the SQLPlus environment. 7. To enable your Enterprise Manager (EM), type: [oracle@Server1 ~]$ emctl start dbconsole 8. Run your brower and test if you can successfully login EM.
Page 68