Oracle 11g automatic Installation and configuration

Source: Internet
Author: User
Tags readable sqlplus

Automatically delete log script files:

Link: http://pan.baidu.com/s/1mg0EnQo Password: 4uit


Preparing for the database before installation

[Email protected] ~]# Vim/etc/sysconfig/network-scripts/ifcfg-eth0 #配置IP地址DEVICE =eth0hwaddr=00:0c:29:59:6e:bftype =ethernetonboot=yesbootproto=noipaddr=172.16.2.20netmask=255.255.0.0gateway=172.16.1.1dns1=202.106.0.20[[email Protected] ~]# Vim/etc/sysconfig/networknetworking=yeshostname=db[[email protected] ~]# vim/etc/hosts #添加域名解析127.0.0 .1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localho St6 localhost6.localdomain6172.16.2.20 Db[[email protected] ~] #reboot #重启系统


First step: Unzip and install the database

[[Email protected] ~] #tar-jxpvf/home/ora11.2.0.3.8_cluster.tgj-c/#解压oracle数据库到根目录, large C Specify file extract directory


Step Two: Configure database parameters

[[email protected] ~]# su - oracle                           # Switch to Oracle User [[email protected] ~]$ sqlplus /  as sysdba                    #进入oracle数据库SQL *plus : release 11.2.0.3.0 production on wed nov 18 15:40:15  2015copyright  (c)  1982, 2011, oracle.  all rights reserved. Connected to an idle instance. sql> create pfile from spfile;    #创建pfile文件 (the Pfile file is convenient for computer-readable, i.e. 0 and 1), You will need to create this file file created the first time you enter the database. sql> startup               #启动数据库 , if the following prompt (need to reserve memory space for the operating system, do not allow the database exclusive memory), modify the Initgnnt.ora file, as follows  &Nbsp;          ora-00845: memory_target not  supported on this systemsql> !                      #返回到oracle用户 [[email protected] ~]$  vim /opt/ora11/product/11.2/dbs/initgnnt.ora                   #修改initgnnt. Ora profile (size depends on physical memory, must not be equal to physical memory) ..... ..... ..... ..... ..... ..... ..... ...... *.memory_max_target=8g*.memory_target=8g ..... .....???????????????????. ..... ..... ..... ..... ..... ..... ..... ...... *.sga_max_size=8g ..... .....???????????????????. .................................................................. [[email protected] ~] $sqlplus  / as sysdba             #再次进入oracle数据库      sql> create spfile from& nbsp;p file;                                           #创建spfile文件 (The role of the SPFile file is to read the contents of the Pfile file and update the modified content, that is, to update the contents of the Initgnnt.ora configuration file to make the computer readable) SQL > startup                           #数据库打开成功ORACLE  instance started. total system global area 8551575552 bytesfixed size     2245480 bytesvariable size 5066722456 bytesdatabase buffers 3472883712  Bytesredo buffers    9723904 bytesdatabase mounted. database opened. sql>select status  from v$instance;           #查看数据库状态, showing ' open ' stands for normal status------------OPEN 


Step three: Listen to the database

sql>!lsnrctl status  or [[email protected] ~]$ lsnrctl status                  #监听数据库, if prompted below, Please modify the Listener.ora and Tnsnames.ora files lsnrctl for linux: version 11.2.0.3.0 - production  on 18-NOV-2015 17:46:36Copyright  (c)  1991, 2011, oracle.  all  rights reserved. connecting to  (description= (address= (PROTOCOL=IPC) (key=extproc1521)) tns-12541: tns:no  Listener tns-12560: tns:protocol adapter error  tns-00511: no listener    Linux Error: 111: Connection refusedConnecting to  (DESCRIPTION = (address= (protocol=tcp) (HOST=DBI) (port=1521))) Tns-12545: connect failed because target  host or object does not exist tns-12560: tns:protocol adapter  error&nBsp; tns-00515: connect failed because target host or object does  not exist   Linux Error: 111: Connection refusedSQL>!      #返回到oracle用户     [[email protected] admin]$ vim  Listener.ora # listener.ora network configuration file: /opt/ora11/product/11.2/ Network/admin/listener.ora# generated by oracle configuration tools .......................................................................................... listener =   (description_list =     (description =        (address =  (PROTOCOL = IPC) (key = extproc1521))         (address =  (protocol = tcp) (host = db) (port =  1521))       #将HOST改为db     )   ) [[email protected] admin]$ vim tnsnames.ora #  tnsnames.ora network configuration file: /opt/ora11/product/11.2/network/admin/ Tnsnames.ora# generated by oracle configuration tools. gnnt =   (description =     (address =  (PROTOCOL =  TCP) (host = db) (port = 1521))         #将HOST改为db       (connect_data =       (server = dedicated)         (service_name = gnnt)     )   ) sql>! lsnrctl status    #最后一行显示The  command completed successfully, representing a successful listener Lsnrctl  for Linux: Version 11.2.0.3.0 - Production on 18-NOV-2015  17:28:52copyright  (c)  1991, 2011, oracle.  aLl rights reserved. connecting to  (description= (address= (PROTOCOL=IPC) (key=extproc1521)) status of the  LISTENER------------------------alias                      LISTENERVersion                    tnslsnr for linux:  Version 11.2.0.3.0 - ProductionStart Date                 18-NOV-2015 12:41:04Uptime                     0 days  4 hr. 47 min. 47 secTrace Level                offsecurity                  on: local os authenticationsnmp                        offlistener parameter file   /opt/ora11/product/11.2/network/admin/ listener.oralistener log file         /opt/ora11/diag/ tnslsnr/db/listener/alert/log.xmllistening endpoints summary...   (DESCRIPTION= (ADDRESS= ( PROTOCOL=IPC) (key=extproc1521))    (description= (address= (protocol=tcp) (host=db)) Services  summary ... service  "Plsextproc"  has 1 instance (s) .  instance  "PLSExtProc",  status  unknown, has 1 handler (s)  for this service ... service  "Gnnt"  has 2 instance (s) .  instance  "Gnnt", status  Unknown, has 1 handLer (s)  for this service...  Instance  "Gnnt",  status ready, has  1 handler (s)  for this service ... service  "Gnntxdb"  has 1 instance (s) .  instance  "Gnnt", status  Ready, has 1 handler (s)  for this service ... The command completed successfully


Fourth step: Add the Automatic delete log file script

[[email protected] ~] #su  - oracle[[email protected]] $CP  /media/linux/ deletearchivelogs.sh /media/linux/rman_cmd /home/oracle     #/media/linux/ Represents a directory on a USB flash drive, where the pasted position is/home/oracle[[email protected]] $chmod   +x  /home/oracle/ deletearchivelogs.sh  #给deletearchivelogs. sh file add executable permission [[email protected]]$ ll /home/ Oracle Total usage  8-rwxr-xr-x 1 root root 439 11 month  18 16:44  Deletearchivelogs.sh-rwxr-xr-x 1 root root 118 11 Month  18 16:44 rman_cmd[[ Email protected]] $vim  /home/oracle/deletearchivelogs.sh    #修改IP地址为本地IP地址/SBIN/IP  add show dev bond0 | grep -iq  ' 172.16.2.20 '  [[email  Protected] ~] #crontab  -e         #添加自动删除日志脚本, if a scheduled task fails to save, The time is not synchronized, just synchronize time can 0 5 * * * /home/oracle/deletearchivelogs.sh  > /dev/null  2>&1[[email protected] home]#  crontab -l       #查看计划执行任务0  5 * * *  /home/ Oracle/deletearchivelogs.sh > /dev/null 2>&1


Fifth step: Close the database

[Email protected] ~]# su-oracle #切换到oracle用户 [[email protected] ~]$ Sqlplus/as SYSDBA #进入oracle数据库SQL > Shutdown immediate; #关闭数据库Database closed. Database dismounted. ORACLE instance shut down.


Add:

1. Use history to view previously used commands.

2, if you find that the database will be restarted at intervals, this time only need to turn off the Bmc-watchdog server

[[Email protected] ~] #chkconfig Bmc-watcgdog off

This article is from the "top of the Purple Forbidden" blog, please make sure to keep this source http://1343138116.blog.51cto.com/6124664/1714417

Oracle 11g automatic Installation and configuration

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.