프린트 하기

OS환경 : Oracle Linux6.8(64bit)


DB 환경 : Oracle Database 12.2.0.1


방법 : 


0. oracle 계정 .bash_profile 설정

1. DB 설치파일 unzip 

2. yum install oracle-database-server-12cR2-preinstall -y

3. db_install.rsp 파일 수정

4. ./runInstaller 실행

5. root.sh 실행

6. netca.rsp 파일 수정

7. netca 실행

8. dbca.rsp 파일수정

9. dbca 

10. 리스너, tns 파일 수정

11. 리스너 재기동

12. pdb 접속


0. oracle 계정 .bash_profile 설정

su - oracle

vi .bash_profile

export TMP=/app/tmp;

export TMPDIR=$TMP;

export ORACLE_HOSTNAME=oracle50;

export ORACLE_UNQNAME=ORCL;

export ORACLE_BASE=/app/oracle;

export DB_HOME=$ORACLE_BASE/product/12.2.0/db_1;

export ORACLE_HOME=$DB_HOME;

export ORACLE_SID=orcl;

export PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin:$PATH;

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;

export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;

export DISPLAY=192.168.137.1:0.0;


1. DB 설치파일 unzip 

unzip DB.unzip


2. yum install oracle-database-server-12cR2-preinstall -y

yum install oracle-database-server-12cR2-preinstall -y

passwd oracle

oracle

oracle


3. db_install.rsp 파일 수정 

vi /app/media/database/response/db_install.rsp

 

4. ./runInstaller 실행

./runInstaller -waitforcompletion -showProgress -silent -responseFile /app/media/database/response/db_install.rsp


[oracle@oracle database]$ ./runInstaller -waitforcompletion -showProgress -silent -responseFile /app/media/database/install.rsp 

Starting Oracle Universal Installer...


Checking Temp space: must be greater than 500 MB.   Actual 40569 MB    Passed

Checking swap space: must be greater than 150 MB.   Actual 9999 MB    Passed

Preparing to launch Oracle Universal Installer from /app/tmp/OraInstall2018-05-08_10-18-41PM. Please wait ...You can find the log of this install session at:

 /app/oraInventory/logs/installActions2018-05-08_10-18-41PM.log


Prepare in progress.

..................................................   8% Done.


Prepare successful.


Copy files in progress.

..................................................   17% Done.

..................................................   22% Done.

..................................................   27% Done.

..................................................   32% Done.

..................................................   40% Done.

..................................................   45% Done.

..................................................   50% Done.

..................................................   55% Done.

..................................................   60% Done.

..................................................   65% Done.

..................................................   70% Done.

..................................................   75% Done.

..................................................   80% Done.

....................

Copy files successful.


Link binaries in progress.

..........

Link binaries successful.


Setup files in progress.

..............................

Setup files successful.


Setup Inventory in progress.


Setup Inventory successful.


Finish Setup successful.

The installation of Oracle Database 12c was successful.

Please check '/app/oraInventory/logs/silentInstall2018-05-08_10-18-41PM.log' for more details.


Setup Oracle Base in progress.


Setup Oracle Base successful.

..................................................   95% Done.


As a root user, execute the following script(s):

1. /app/oracle/product/12.2.0/db_1/root.sh




..................................................   100% Done.


5. root.sh 실행

[oracle@oracle database]$ su -

Password: 

[root@oracle ~]# /app/oracle/product/12.2.0/db_1/root.sh

Check /app/oracle/product/12.2.0/db_1/install/root_oracle50_2018-05-08_22-32-53-087392106.log for the output of root script


6. netca.rsp 파일 수정

vi /app/media/database/response/netca.rsp


7. netca 실행

[oracle@oracle response]$ netca /silent /responseFile /app/media/database/response/netca.rsp 


Parsing command line arguments:

    Parameter "silent" = true

    Parameter "responsefile" = /app/media/database/response/netca.rsp

Done parsing command line arguments.

Oracle Net Services Configuration:

Profile configuration complete.

Oracle Net Listener Startup:

    Running Listener Control: 

      /app/oracle/product/12.2.0/db_1/bin/lsnrctl start LISTENER

    Listener Control complete.

    Listener started successfully.

Listener configuration complete.

Oracle Net Services configuration successful. The exit code is 0

[oracle@oracle response]$ lsnrctl status


LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 08-MAY-2018 22:36:41


Copyright (c) 1991, 2016, Oracle.  All rights reserved.


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle)(PORT=1521)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production

Start Date                08-MAY-2018 22:36:37

Uptime                    0 days 0 hr. 0 min. 4 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /app/oracle/product/12.2.0/db_1/network/admin/listener.ora

Listener Log File         /app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle)(PORT=1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

The listener supports no services

The command completed successfully


8. dbca.rsp 파일수정

vi /app/media/database/response/dbca.rsp


9. dbca 

dbca -silent -createDatabase -responseFile /app/media/database/response/dbca.rsp 


[oracle@oracle response]$ dbca -silent -createDatabase -responseFile /app/media/database/response/dbca.rsp 

[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.

   CAUSE: 

a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].

b.The password entered is a keyword that Oracle does not recommend to be used as password

   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.

[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.

   CAUSE: 

a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].

b.The password entered is a keyword that Oracle does not recommend to be used as password

   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.

[WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.

   CAUSE: 

a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].

b.The password entered is a keyword that Oracle does not recommend to be used as password

   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.

Copying database files

1% complete

13% complete

25% complete

Creating and starting Oracle instance

26% complete

30% complete

31% complete

35% complete

38% complete

39% complete

41% complete

Completing Database Creation

42% complete

43% complete

44% complete

46% complete

49% complete

50% complete

Creating Pluggable Databases

55% complete

75% complete

Executing Post Configuration Actions

100% complete

Look at the log file "/app/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.


[oracle@oracle ~]$ sqlplus / as sysdba


SQL*Plus: Release 12.2.0.1.0 Production on Tue May 8 23:03:44 2018


Copyright (c) 1982, 2016, Oracle.  All rights reserved.



Connected to:

Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production


SQL> select instance_name, status, version from v$instance;


INSTANCE_NAME STATUS       VERSION

---------------- ------------ -----------------

orcl OPEN       12.2.0.1.0




SQL> select name, open_mode from v$pdbs;


NAME      OPEN_MODE

-------------------- ----------

PDB$SEED      READ ONLY

PDB01      READ WRITE



10. 리스너, tns 파일 수정

[oracle@oracle ~]$ cat /app/oracle/product/12.2.0/db_1/network/admin/listener.ora 

# listener.ora Network Configuration File: /app/oracle/product/12.2.0/db_1/network/admin/listener.ora

# Generated by Oracle configuration tools.


LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = oracle50)(PORT = 1521))

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

    )

  )


SID_LIST_LISTENER =

  (SID_LIST =

    (SID_DESC =

      (SID_NAME = pdb01)

      (ORACLE_HOME = /app/oracle/product/12.2.0/db_1)

    )

  )


vi tnsnames.ora

[oracle@oracle ~]$ cat /app/oracle/product/12.2.0/db_1/network/admin/tnsnames.ora 

# tnsnames.ora Network Configuration File: /app/oracle/product/12.2.0/db_1/network/admin/tnsnames.ora

# Generated by Oracle configuration tools.


LISTENER_ORCL =

  (ADDRESS = (PROTOCOL = TCP)(HOST = oracle50)(PORT = 1521))



ORCL =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = oracle50)(PORT = 1521))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = orcl)

    )

  )


PDB01 =

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = TCP)(HOST = oracle50)(PORT = 1521))

    )

    (CONNECT_DATA =

      (SERVICE_NAME = pdb01)

    )

  )


11. 리스너 재기동

vi listener.ora[oracle@oracle ~]$ lsnrctl stop


LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 08-MAY-2018 23:17:00


Copyright (c) 1991, 2016, Oracle.  All rights reserved.


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle50)(PORT=1521)))

The command completed successfully

[oracle@oracle50 ~]$ lsnrctl start


LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 08-MAY-2018 23:17:02


Copyright (c) 1991, 2016, Oracle.  All rights reserved.


Starting /app/oracle/product/12.2.0/db_1/bin/tnslsnr: please wait...


TNSLSNR for Linux: Version 12.2.0.1.0 - Production

System parameter file is /app/oracle/product/12.2.0/db_1/network/admin/listener.ora

Log messages written to /app/oracle/diag/tnslsnr/oracle50/listener/alert/log.xml

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle50)(PORT=1521)))

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle)(PORT=1521)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production

Start Date                08-MAY-2018 23:17:02

Uptime                    0 days 0 hr. 0 min. 5 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /app/oracle/product/12.2.0/db_1/network/admin/listener.ora

Listener Log File         /app/oracle/diag/tnslsnr/oracle50/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle)(PORT=1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Services Summary...

Service "pdb01" has 1 instance(s).

  Instance "pdb01", status UNKNOWN, has 1 handler(s) for this service...

The command completed successfully



12. pdb 접속

[oracle@oracle ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Tue May 8 23:16:42 2018


Copyright (c) 1982, 2016, Oracle.  All rights reserved.



Connected to:

Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production


SYS@orcl> conn sys/oracle@oracle50:1521/pdb01 as sysdba

Connected.




+

dbca 또는 pfile 생성 후 수동 db 생성가능

CREATE DATABASE "ORCL"

LOGFILE

 GROUP 1 ('/oracle/app/oracle/oradata/newdb/redo01.log') SIZE 20M,

 GROUP 2 ('/oracle/app/oracle/oradata/newdb/redo02.log') SIZE 20M,

 GROUP 3 ('/oracle/app/oracle/oradata/newdb/redo03.log') SIZE 20M

DATAFILE '/oracle/app/oracle/oradata/newdb/system01.dbf' SIZE 700M  eXTENT MANAGEMENT LOCAL

SYSAUX DATAFILE '/oracle/app/oracle/oradata/newdb/sysaux01.dbf' SIZE 500M

DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/oracle/app/oracle/oradata/newdb/temp01.dbf' SIZE 2000M

UNDO TABLESPACE "UNDOTBS1" DATAFILE '/oracle/app/oracle/oradata/newdb/undotbs01.dbf' SIZE 300M AUTOEXTEND ON NEXT  100M MAXSIZE 1000M

CHARACTER SET KO16MSWIN949;