1 Install Oracle 10g on HP UNIX, this does not explain, install directly.
Create group OINSTALL,DBA, user Oracle[Email protected] ~]# Groupadd Oinstall[[email protected] ~]# Groupadd DBA[Email protected] ~]# useradd-d/home/oracle-g oinstall-g dba OracleSet the Oracle user password[Email protected] ~]# passwd OracleChanging password for user Oracle.New UNIX Password:Bad Password:it are based on a dictionary wordRetype new UNIX Password:Passwd:all authentication tokens updated successfully.Tips:[[email protected] ~]# ID Oracleuid=500 (Oracle) gid=500 (oinstall) groups=500 (Oinstall), 501 (DBA)If it is a non-virtual machine installation, note the user and group IDs, and when creating groups with the same name on other machines, be sure to confirm that the group ID and user ID are the same.Modifying the initialization parameters file for an Oracle user[Email protected] ~]# Vi/home/oracle/.bash_profileAdd the following content:Export Tmp=/tmpExport tmpdir= $TMPExport oracle_base=/opt/ora10gExport Oracle_home= $ORACLE _base/product/10.2.0/db_1Export ORACLE_SID=RACDB1Export Oracle_term=xtermExport Path=/usr/sbin: $PATHExport path= $ORACLE _home/bin: $PATHExport ld_library_path= $ORACLE _home/bin:/bin:/usr/bin:/usr/local/bin:/usr/x11r6/bin/export CLASSPATH= $ORACLE _ HOME/JRE: $ORACLE _home/jlib: $ORACLE _home/rdbms/jlibUlimit-u 16384-n 65536Umask 022Note here that the name of the ORACLE_SID is the same as the SID that was specified when the database was created (note case), or you will have to re-export ORACLE_SID every time you want to enter ORACLE via native login.To create the/opt/ora10g directory, be aware of the permissions of the directory owner or Oracle user[Email protected] ~]# mkdir/opt/ora10gSince this directory is primarily operated by Oracle users, we have changed its owner to Oracle[Email protected] ~]# chown oracle.oinstall/opt/ora10gConfiguring Kernel Parameters[Email protected] ~]# vi/etc/sysctl.confAdd or modify the following contentKernel.shmall = 2097152Kernel.shmmax = 536870912Kernel.shmmni = 4096Kernel.sem = 250 32000 100 128Fs.file-max = 65536Net.ipv4.ip_local_port_range = 1024 65000Net.core.rmem_default = 1048576Net.core.rmem_max = 1048576Net.core.wmem_default = 262144Net.core.wmem_max = 262144Tip, there is usually only one item in the above parameter that needs our change, namely Kernel.shmmax, which is recommended to be set to half of physical memory and then:[Email protected] server]# sysctl-pLet the settings take effectImprove shell limits for Oracle usersSet the number of files used by Oracle permissions[Email protected] ~]# vi/etc/security/limits.confAdd the following content Oracle soft Nproc 2047 Oracle Hard Nproc 16384 Oracle Soft Nofile 1024 Oracle hard Nofile 65536 Modify security restrictions [[email protected] ~]# vi/etc/pam.d/login added: session required /lib/security/pam_limits.so Configuring the Hangcheck Timer [[email protected] ~]# vi/etc/rc.local added: modprobe Hangcheck-timer hangcheck-tick=30 hangcheck_margin=180
2 You need to install 4 different instances on the same machine, create an instance with DBCA, note the character set selection ZHS16GBK, the date and region default to American
One thing to note here is that the location of the db file is placed by default in the Oracle_home directory, which is assigned to a separate location, and we typically create a oradata directory under the root directory.
All DBF data files, including SYSTEM01.DBF, are placed in this directory. Then, according to different instances, establish different sub-directories, facilitate the management of disk space and physical backup
34 instances after the establishment, to manually modify the Listener.ora file, four instances of the monitoring are added, after the addition of restart monitoring.
LISTENER = (Description_list = (DESCRIPTION = (Address_list = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.1 68.0.101) (PORT = 1521)) (Address_list = (ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC)))) )
Sid_list_listener = (Sid_list = (Sid_desc = (Sid_name = pl***tproc) (Oracle_home =/OPT/ORACLE/PRODUCT/9 .2) (program = Extproc)) (Sid_desc = (Global_dbname = ora9) (Oracle_home =/opt/oracle/product/ 9.2) (sid_name = ora9)) (Sid_desc = (Global_dbname = B3) (Oracle_home =/opt/oracle/product/9.2 ) (Sid_name = B3)))
4 Export Oracle_sid, sqlplus/as SYSDBA connect to different instances to launch the instance respectively.
5 EXPDP A library from other databases, FTP or SCP DMP files to local, then execute IMPDP, import the database.
To create a logical directory, the command does not create a real directory in the operating system, preferably created by an administrator such as system.
Create directory dpdata1 as ' D:\test\dump ';
Second, view the Management Manager directory (and see if the operating system exists, because Oracle does not care if the directory exists, and if it does not exist, an error occurs)
SELECT * from Dba_directories;
Third, give the Scott user permissions to operate in the specified directory, preferably by a system administrator.
Grant Read,write on directory dpdata1 to Scott;
Iv. Export of data
1) According to the user guide
EXPDP scott/[email protected] Schemas=scott dumpfile=expdp.dmp directory=dpdata1;
2) Parallel Process parallel
EXPDP scott/[email protected] directory=dpdata1 dumpfile=scott3.dmp parallel=40 job_name=scott3
3) According to the table name guide
EXPDP scott/[email protected] tables=emp,dept dumpfile=expdp.dmp directory=dpdata1;
4) Guided by query criteria
EXPDP scott/[email protected] directory=dpdata1 dumpfile=expdp.dmp tables=emp query= ' WHERE deptno=20 ';
5) According to the Table space Guide
EXPDP System/manager directory=dpdata1 dumpfile=tablespace.dmp tablespaces=temp,example;
6) Guide the entire database
EXPDP System/manager directory=dpdata1 dumpfile=full.dmp full=y;
Five, restore data
1) leads to the specified user
IMPDP Scott/tiger directory=dpdata1 dumpfile=expdp.dmp Schemas=scott;
2) Change the owner of the table
IMPDP system/manager directory=dpdata1 dumpfile=expdp.dmp tables=scott.dept remap_schema=scott:system;
3) Import Table space
IMPDP System/manager directory=dpdata1 dumpfile=tablespace.dmp tablespaces=example;
4) Import the database
impdb System/manager directory=dump_dir dumpfile=full.dmp full=y;