Oracle study-oracle 11g OCM Exam (1)
System environment: RedHat EL64
Oracle:oracle 11gR2
Oracle 11g OCM Exam First, manual build library, reference document 650) this.width=650; "Src=" http://img.blog.csdn.net/20160408214710987?watermark/2/ Text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/center " Style= "Border:none;"/>. The reference person must be familiar with the document before it can complete the task within a specified time.
First, view the system environment
[email protected] ~]$ cat. Bash_profile
#. Bash_profileexport editor=viexport oracle_sid=prodexport Oracle_base=/u01/app/oracleexport ORACLE_HOME= $ORACLE _ Base/product/11.2.0/db_1export ld_library_path= $ORACLE _home/libexport path= $ORACLE _home/bin:/bin:/usr/bin:/usr/ Sbin:/usr/local/bin:/usr/x11r6/binumask 022
[[email protected] ~]$ ID Oracle
UID=300 (Oracle) gid=501 (oinstall) groups=501 (Oinstall), 502 (DBA)
2. Build database Pfile File
[Email protected] dbs]$ pwd
/u01/app/oracle/product/11.2.0/db_1/dbs
[[email protected] dbs]$ ls
hc_dbua3908922.dat init.bk inittest2.ora lkTEST2 orapwtest2
hc_prod.dat initdbua3908922.ora inittest.ora orapwDBUA3908922 SNAPCF_PROD.F
hc_test2.dat init.ora lkprod orapwprod Spfileprod.ora
hc_test.dat initprod.ora lktest orapwtest Spfiletest2.ora
[email protected] dbs]$ cat Init.ora |grep-v "^#" |grep-v "^$" >inittest1.ora
Edit Pfile File:
[email protected] dbs]$ cat Inittest1.ora
Db_name= ' test1 ' memory_target=300mprocesses = 150audit_file_dest= ' $ORACLE _base/admin/test1/adump ' audit_trail = ' db ' Db_block_size=8192db_domain= ' diagnostic_dest= $ORACLE _baseopen_cursors=300 remote_login_passwordfile= ' EXCLUSIVE ' undo_tablespace= ' UNDOTBS1 ' control_files = '/u01/app/oracle/oradata/test1/control01.ctl ' compatible = ' 11.2.0 '
Create the appropriate directory:
[Email protected] dbs]$ mkdir-p/u01/app/oracle/admin/test1/adump
[Email protected] dbs]$ mkdir-p/u01/app/oracle/oradata/test1
To create a Instance password file:
[Email protected] dbs]$ orapwd file=orapwtest1 password=oracle entries=3
To create a build library script:
Reference:
650) this.width=650; "Src=" http://img.blog.csdn.net/20160408215342983?watermark/2/text/ Ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/center "Style=" Border:none; "/>
[email protected] ~]$ cat Cr_db.sql
create database test1 user sys identified by oracle USER SYSTEM IDENTIFIED BY oracle LOGFILE GROUP 1 ('/ U01/app/oracle/oradata/test1/redo01a.log ') SIZE 100M BLOCKSIZE 512, GROUP 2 ('/u01/app/oracle/oradata/test1/redo02a.log ' ) SIZE 100M BLOCKSIZE 512 MAXLOGFILES 5 maxlogmembers 5 maxloghistory 1 maxdatafiles 100 CHARACTER SET zhs16gbk EXTENT MANAGEMENT LOCAL datafile '/u01/app/oracle/oradata/test1/system01.dbf ' SIZE 325M REUSE sysaux datafile '/u01/app/oracle/oradata/test1/sysaux01.dbf ' SIZE 325M REUSE default temporary&nBsp tablespace tempts1 tempfile '/u01/app/oracle/oradata/test1/ TEMP01.DBF ' size 20m reuse undo tablespace undotbs1 DATAFILE '/u01/app/oracle/oradata/test1/undotbs01.dbf ' SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
3, start instance to Nomount, run the Build library script:  
[[email protected "~]$ export oracle_sid=test1
[[email protected] ~]$ sqlplus '/as sysdba ' sql*plus: release 11.2.0.3.0 Production on Fri Apr 8 17:09:02 2016Copyright (c) 1982, 2011, oracle. all rights reserved. Connected to an idle instance.17:09:02 [email protected] test1>startup nomount;oracle instance started. total system global area 313159680 bytesfixed size 2227944 bytesvariable Size 218104088 bytesdatabase buffers 88080384 bytesredo buffers 4747264 bytes17:14: 17 [email protected] test1>select status from v$instance ; STATUS------------STARTED
17:15:15 [email protected] Test1 >@/home/oracle/cr_db.sql
database created.
4, after the library is completed, create a data dictionary by script
[[email protected] ~]$ Cat cr_dict.sql
@ /rdbms/admin/catalog.sql
conn system/oracle
@?/sqlplus/admin/pupbld.sql
17:31:44 [email protected] Test1>@/home/oracle/cr_dict.sql
5, build the library successfully, set the default Tablespace
19:24:34 [email protected] test1> Create tablespace users
< Strong>datafile '/u01/app/oracle/oradata/test1/users01.dbf ' size 100m;
tablespace created.
19:25:57 [email protected] Test1>alter database default Tablespace users;
database altered.
19:27:52 [email protected] test1> Select tablespace_name,file_id , file_name from Dba_data_files;
tablespace_name file_id file_name------------------------------ ---------- ------------ --------------------system 1 /u01/app/oracle/oradata/test1/system01.dbfSYSAUX 2 /u01/app/oracle/oradata/test1/ sysaux01.dbfundotbs1 3 / U01/app/oracle/oradata/test1/undotbs01.dbfusers 4 /u01/app/oracle/oradata/test1/users01.dbf4 rows selected.
6. Configure the network (tnsnames)
[email protected] admin]$ cat Tnsnames.ora
TEST1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = rh64) (PORT = 1521)) (Connect_data = (SERVER = Dedica TED) (service_name = test1)))
[Email protected] admin]$ lsnrctl status
lsnrctl for linux: version 11.2.0.3.0 - production on 08-apr-2016 19:33:50Copyright (c) 1991, 2011, oracle. all rights reserved. connecting to (description= (address= (protocol=tcp) (host=rh64) (port=1521)) status of the listener------------------------alias LISTENERVersion TNSLSNR for linux: version 11.2.0.3.0 - productionstart date 08-APR-2016 19:32:48Uptime 0 days 0 hr. 1 min. 2 sectrace level offSecurity ON: Local OS AuthenticationSNMP offlistener parameter file /u01/app/oracle/product/11.2.0/db_1/network/admin/ listener.oralistener log file /u01/app/oracle/ diag/tnslsnr/rh64/listener/alert/log.xmllistening endpoints summary... (DESCRIPTION= ( Address= (PROTOCOL=TCP) (host=rh64.cuug.cn) (port=1521)) (description= (address= (PROTOCOL=IPC) (KEY= EXTPROC1521)) Services summary ... service "Test1" has 1 instance (s) . instance "Test1", status Ready, has 1 handler (s) for this service ... The command completed successfully
To test your network connection:
[Email protected] admin]$ sqlplus System/[email protected]
Sql*plus:release 11.2.0.3.0 Production on Fri Apr 8 19:34:27 2016Copyright (c) 1982, +, Oracle. All rights reserved. Connected to:oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit productionwith The partitioning, OLAP, Data Mining and Real Application testing options
19:34:27 [email protected] test1>
-----At this point, the manual construction of the library is successful; If you have time, you can make a cold standby of the database.
----------OCM Exam Test Center practice, follow-up continue to launch ...
This article is from the "Tianya blog," Please make sure to keep this source http://tiany.blog.51cto.com/513694/1761930
Oracle study-oracle 11g OCM Exam (1)