Environment configuration and installation
1) Add a user group and log on as the root user.
Groupadd orainstall
Groupadd oradba
Groupadd oraworkflow
Useradd ora-G orainstall, oradba
You can use different usernames and groups as needed.2) switch to the root user
VI/etc/sysctl. conf
Then add the last row
Kernel. shmmax = 261986254
The value of this parameter must be smaller than or equal to the value of physical memory, otherwise the setting will not take effect. It indicates the maximum size of a single shared memory segment, which is generally set to half of the physical memory.
If this step is omitted, the last step of installation, or the ORA-27123: Unable to attach to shared memory segment error is reported when dbca creates the database.
3) add environment variables to. bash_profile
Log On with the ora user and add the following content to the file:
# Oracle
Export ld_assume_kernel = 2.4.1
Export oracle_base =/home/ora/ora9
Export ORACLE_HOME =/home/ora/ora9/Oracle
Export ora_nls33 = $ ORACLE_HOME/ocommon/NLS/admin/Data
# Nouse
Export oracle_sid = linuxdb
Export oracle_term = xterm
Export tns_admin = $ ORACLE_HOME/Network/admin
Export nls_lang = american_america.us7ascii
# Lib, Class
LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/usr/lib
LD_LIBRARY_PATH = $ LD_LIBRARY_PATH:/usr/local/lib
Export LD_LIBRARY_PATH
Export Path = $ path: $ ORACLE_HOME/bin
Classpath = $ classpath: $ ORACLE_HOME/JRE: $ ORACLE_HOME/jlib: $ ORACLE_HOME/rdbms/jlib
Classpath = $ classpath: $ ORACLE_HOME/Network/jlib
Export classpath
After modifying. bash_profile, log on again, or source. bash_profile, the environment variable configured above takes effect.
4) decompress the file
In Windows, share the Oracle folder that stores the installation files, set the sharing permission to readable and writable, and then execute the following command:
Mount-T smbfs-O username = Cl, password = Chenli, IP = 192.168.1.100-l // Chenli/Oracle/home/ora/setup
Command explanation:
In the preceding command, username = Cl, password = Chenli indicates that Cl is a Windows user, and Chenli indicates the password of Cl.
In IP = 192.168.1.100, 192.168.1.100 is the IP address of the Windows host.
// In Chenli/Oracle, Chenli is the host name of the Windows host, and Oracle is a shared folder.
/Home/ora/setup is the directory path in Linux. It must exist. You can set different paths as needed.
Decompress the file and execute the following commands in sequence:
CD/home/ora/setup
Gunzip ship_9204_linux_disk1.cpio.gz
Gunzip ship_9204_linux_disk2.cpio.gz
Gunzip ship_9204_linux_disk3.cpio.gz
Cpio-idmv <ship_9204_linux_disk1.cpio
Cpio-idmv <ship_9204_linux_disk2.cpio
Cpio-idmv <ship_9204_linux_disk3.cpio
After execution, three directories, disk1, disk2, and disk3, are displayed.
5) Installation
Log on to the Linux GUI using the ora user
Go to the/home/ora/Setup/disk1 directory.
Run./runinstaller
Note: Sometimes the installation interface is garbled. The Simplified Chinese version of my Red Hat Linux 9 installation program is in English. You can run the following command to solve the problem:
Export lc_all = C
Export lang = C
Then execute./runinstaller, and there will be no garbled characters.
I encountered the following error when executing./runinstaller:
./Runinstaller: Line 58:./runinstaller: cannot execute binary file
Soon I thought about whether or not the software was installed incorrectly. When I checked that the file name was A64-bit, I downloaded it again and then installed it.
Therefore, when downloading the software, be sure to check whether the installed software matches your operating system.
Next, we will continue to choose "Next.
When the following window appears, enter the group oradba created earlier.
When the following window appears.
Follow the prompts to run the script orainstroot. Sh in the/tmp directory as the root user. The result is as follows:
[Root @ localhost TMP] #. /orainstroot. sh <br/> creating Oracle inventory pointer file (/etc/orainst. loc) <br/> changing groupname of/home/Oracle/ora9/orainventory to oradba. <br/> [root @ localhost TMP] #
The following window appears:
As prompted, use the root user to go to the corresponding directory and execute the script root. Sh. The result is as follows:
[Root @ localhost Oracle] #. /root. sh <br/> running oracle9 root. sh script... <br/>/nthe following environment variables are set: <br/> oracle_owner = Oracle <br/> ORACLE_HOME =/home/Oracle/ora9/Oracle </P> <p> enter the full pathname of the local bin directory: [/usr/local/bin]: <br/> copying dbhome to/usr/local/bin... <br/> copying oraenv to/usr/local/bin... <br/> copying coraenv to/usr/local/bin... </P> <p>/ncreating/etc/oratab file... <br/> adding Entry to/etc/oratab file... <br/> entries will be added to the/etc/oratab file as needed by <br/> Database Configuration assistant when a database is created <br/> finished running generic part of Root. sh script. <br/> now product-specific root actions will be saved med. <br/> [root @ localhost Oracle] #
Finally, set the password for sys, system, and so on.
Use Database
Log on to the host using the ora user
Run sqlplus "/As sysdba" to log on to the database as the system DBA.
Create a tablespace, create a user, and grant permissions to the user.1) create a tablespace.
Create tablespace devbase
Datafile '/home/ora/tbspace/devbase_20080121.dbf' size 500 m
Autoextend on
Next 100 m
Maxsize 1000 m;
Make sure that the/home/ora/tbspace directory exists and has the permission to store the tablespace files.
2) create a user
Create user Dev
Identified by dev123
Default tablespace devbase
Temporary tablespace temp;
Create a user Dev and check whether the password is dev123. The default tablespace is devbase.
Note: you cannot use Dev to log on to the database at this time, because the dev user does not have the create session, connect, and resource permissions, and cannot log on;
3) grant permissions to users
Grant resource, connect to Dev;
Grant create session to Dev;
Grant create table to Dev;
Grant create tablespace to Dev;
Grant create view to Dev;
Now you can log on with the dev user.
4) change the User Password
Log On with the Sys or system user and run the following SQL statement to modify the user password:
Alter user Dev identified by Chenli;
Finally, because of a small problem, modify ORACLE_HOME/Network/admin/tnsnames. ora: replace all the host values in the file with IP addresses. This reduces the host name => ip address resolution process during database logon. Sometimes, it will increase the login speed.
Create a development environment for normal Linux Users
Configure the environment variables and find the Oracle program in the search path.
Vi. bash_profile Add the following configuration
# Oracle
Export oracle_base =/home/ora/ora9
Export ORACLE_HOME =/home/ora/ora9/Oracle
Export oracle_sid = linuxdb
Export oracle_term = xterm# LD_LIBRARY_PATH
LD_LIBRARY_PATH = $ LD_LIBRARY_PATH:/usr/lib:/usr/local/lib: $ ORACLE_HOME/rdbms/demo
Path = $ path:/usr/bin:/usr/sbin:/usr/local/bin :.
Path = $ path: $ ORACLE_HOME/bin
Export path
Create the XR read and execute permissions for common users in all directories in the path $ ORACLE_HOME/bin, $ ORACLE_HOME/include, $ ORACLE_HOME/lib, in this way, the login user can use some el programs in the $ ORACLE_HOME/bin directory. it is also necessary to ensure that the header file and library file under ORACLE can be used during the development process.
1) create a seq object
Create sequence seq_staff_id
Minvalue 1
Max value 9999999
Start with 1
Increment by 1
Cache 20;
2) create a table
Create Table staff_info
(
Staff_id number (10 ),
Staff_name varchar2 (20 ),
ADDR varchar2 (200)
);
OK. A basic Oracle database can be used.