linux安装oracle笔记

linux安装oracle

1.增大swap空间,内存大于8G后swap跟内存同等大小即可
    mkdir /home/swap
    cd /home/swap
    dd if=/dev/zero of=swapfile bs=1G count=31
    mkswap swapfile
    swapon swapfile #增加到swap分区(31G + 31G = 62G)
    #设置开机自动添加swapfile
    vi /etc/fstab:
    /home/swap/swapfile                                  swap    defaults        0 0
    
2.关闭防火墙和SeLinux
    ntsysv/chkconfig
    service iptables stop
    
    /usr/sbin/sestatus -v
    setenforce
    
3.安装依赖包
    #检查依赖包安装情况
    rpm -q binutils compat-libstdc++-33 compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc glibc-common glibc-devel glibc-devel glibc-headers ksh libaio libaio libaio-devel libaio-devel libgcc libgcc libstdc++ libstdc++ libstdc++-devel make sysstat
    未安装的就手动安装上

4.设置系统参数
    #如果系统是oracle linux的话,多半都已经帮你预设了
    vi /etc/security/limits.conf:
    oracle soft nproc 2047
    oracle hard nproc 16384
    oracle soft nofile 1024
    oracle hard nofile 65536
    *   -   core            10240
    *   -   data            unlimited
    *   -   fsize           unlimited
    *   -   memlock         unlimited
    *   -   nofile          1048500
    *   -   rss             unlimited
    *   -   stack           unlimited
    *   -   cpu             unlimited
    *   -   nproc           unlimited
    *   -   as              unlimited
    *   -   maxlogins       100
    *   -   maxsyslogins    1000
    *   -   priority        unlimited
    *   -   locks           unlimited
    *   -   sigpending      unlimited
    *   -   msgqueue        unlimited
    
    vi /etc/pam.d/login:
    session    required     pam_limits.so
    session    required     /lib/security/pam_limits.so
    
    vi /etc/sysctl.conf:
    fs.file-max = 6815744
    fs.aio-max-nr = 1048576
    kernel.shmall = 2097152
    kernel.shmmax = 2147483648
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    net.ipv4.ip_local_port_range = 9000 65500
    net.core.rmem_default = 4194304
    net.core.rmem_max = 4194304
    net.core.wmem_default = 262144
    net.core.wmem_max = 1048576
    #修改sysctl.conf并使其立即生效
    sysctl -p

5.创建用户组和用户
    groupadd oinstall
    groupadd dba
    
    useradd -g oinstall -G dba oracle
    passwd oracle #密码设置为Oracle123$

6.安装oracle
    export JAVA_HOME=/home/oracle/jdk
    export CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:$CLASSPATH
    export PATH=$JAVA_HOME/bin:$PATH

    SecureCRT会话选项->远程/X11->转发X11数据包(F)(强制鉴权不要选上!!)
    
    
    ./runInstaller
    dbca
    netca
    
    数据库账户密码:sys/eastcom

 

 

 

老库导新库,只导出用户的对象定义:

CREATE OR REPLACE DIRECTORY DATA_PUMP_DIR AS '/home/oracle/admin/ipnet/dpdump/';
GRANT READ, WRITE ON DIRECTORY DATA_PUMP_DIR to sys;
CREATE TABLESPACE FM
LOGGING
DATAFILE '/home/oradata/fm.dbf'
SIZE 30720M;

CREATE USER fm IDENTIFIED BY fm1234
DEFAULT TABLESPACE FM;

GRANT CONNECT, RESOURCE, CREATE ANY VIEW TO fm;

DROP USER fm CASCADE;
expdp \'/ as sysdba\' DIRECTORY=DATA_DUMP_DIR DUMPFILE=users.dump SCHEMAS=rm,fm,nhm CONTENT=METADATA_ONLY
impdp \'/ as sysdba\' DIRECTORY=DATA_DUMP_DIR DUMPFILE=users.dump SCHEMAS=rm,fm,nhm
posted @ 2015-01-22 13:42  lichmama  阅读(186)  评论(0编辑  收藏  举报