I'm Top Oracle DBA

Database Configuration Assistant (DBCA) : Creating Databases 12c PDB on Linux7.6 (Advance)

Create Databases 12c PDB (Advance) with DBCA

After installing Oracle Database 12c software, We have to create a database with dbca command with GUI

Actually, you can create the database together, when you install the software, but I need to manage the necessary database files to the location that I prepared.

log in to oracle user then command as below.

# export DISPLAY=192.168.75.130:0.0
# dbca

https://dblabT2.localdomain:5500/em

How to check the port on which EM Express is configured?

There are two ways to find the HTTP/HTTPS port for EM Express and access EM Express by :
https://hostname:portnumber/em/

[oracle@labdbt2 ~]$ lsnrctl status DB12CT_LISTENER| grep HTTP
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=labdbT2.localdomain)(PORT=5500))(Security=(my_wallet_directory=/oracle/admin/db12ct/xdb_wallet))(Presentation=HTTP)(Session=RAW))

or from SQL*Plus:

SQL> select dbms_xdb_config.getHttpsPort() from dual;

DBMS_XDB_CONFIG.GETHTTPSPORT()
——————————
5500

SQL> select dbms_xdb_config.gethttpport () from dual;

DBMS_XDB_CONFIG.GETHTTPPORT()
—————————–
0

Database Configuration Assistant (DBCA): Creating Databases 12c PDB on Linux7.6 (Typical)

Create Databases 12c (Typical) with DBCA

After installing Oracle Database 12c software, We have to create a database with dbca command with GUI

Actually, you can create the database together, when you install the software, but I need to manage the necessary database file to the location that I prepared.

log in to oracle user then command as below.

# export DISPLAY=192.168.75.130:0.0
# dbca

Oracle recommends the password should be at least 8 characters, at least 1 uppercase character, 1 lowercase character and 1 digit [0-9]
Minimum 8,016MB of Fast Recovery area space

https://dblabT2.localdomain:5500/em

How to check the port on which EM Express is configured?

There are two ways to find the HTTP/HTTPS port for EM Express and access EM Express by :
https://hostname:portnumber/em/

[oracle@labdbt2 ~]$ lsnrctl status DB12CT_LISTENER| grep HTTP
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=labdbT2.localdomain)(PORT=5500))(Security=(my_wallet_directory=/oracle/admin/db12ct/xdb_wallet))(Presentation=HTTP)(Session=RAW))

or from SQL*Plus:

SQL> select dbms_xdb_config.getHttpsPort() from dual;

DBMS_XDB_CONFIG.GETHTTPSPORT()
——————————
5500

SQL> select dbms_xdb_config.gethttpport () from dual;

DBMS_XDB_CONFIG.GETHTTPPORT()
—————————–
0

Oracle Database 12c Release 2 (12.2) Installation On Oracle Linux 7.6 (OL7.6)

Unpack Files

12.2.0.1

unzip linuxx64_12201_database.zip

Host File

login as a root then, edit the host file “/etc/hosts”.

192.168.75.130 labdbT2.localdomain labdbT2

Oracle Installation Prerequisites
Perform either the Automatic Setup or the Manual Setup to complete the basic prerequisites. so I prefer Automatic Setup.

Automatic Setup
We can follow the instructions at http://public-yum.oracle.com to set up the yum repository for OL, then perform the following command.

# yum install oracle-rdbms-server-12cR2-preinstall -y

All necessary prerequisites will be performed automatically.

It is probably worth doing a full update as well, but this is not strictly speaking necessary.

# yum update

Create new groups and users.

I have group oinstall, dba and oper and oracle user before then, I used groupmod and usermod commands, if you don’t have them before You have to use groupadd and useradd command

groupmod -g 201 oinstall
groupmod -g 202 dba
groupmod -g 203 oper
groupadd -g 204 asmadmin
groupadd -g 206 asmdba
groupadd -g 205 asmoperusermod -u 202 -g oinstall -G dba,asmdba,oper oracle
passwd oracle

Create the directories in which the Oracle software will be installed.

mkdir -p /oracle/product/12.2.0/db
chown -R oracle:oinstall /oracle
chmod -R 775 /oracle

Login as root and issue the following command.

xhost +192.168.75.130

Log in as the oracle user and add the following lines at the end of the “.bash_profile” file.

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIRORACLE_HOSTNAME=dblabT2.localdomain; export ORACLE_HOSTNAME
ORACLE_UNQNAME=DB12C; export ORACLE_UNQNAME
ORACLE_BASE=/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db; export ORACLE_HOME
ORACLE_SID=DB12C; export ORACLE_SIDPATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATHLD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

Create the directories oraInventory

# mkdir -p /oracle/oraInventory
# chown -R oracle:oinstall /oracle/oraInventory
# chmod -R 775 /oracle/oraInventory

Installation
Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable.

export DISPLAY=192.168.75.130:0.0

Start the Oracle Universal Installer by following the command in the database directory.

./runInstaller

I think that enough for test machine

You have to be a root before running this script.

Database Configuration Assistant (DBCA) : Creating Databases 11g on Linux7.6

Create Databases 11g with DBCA

After installing Oracle Database 11g software, We have to create a database with dbca command with GUI

Actually, you can create the database together, when you install the software, but I need to manage the necessary database files to the location that I prepared.

log in to oracle user then command as below.

# export DISPLAY=192.168.75.128:0.0
# dbca

Template

  • General Purpose or Transaction Processing for Database type is OLTP (Many concurrent users perform numerous transactions that require rapid access to data. Availability, speed, concurrency, and recoverability are key issues.)
  • Custom Database  (This template allows you the maximum flexibility in defining a database because you can change any of the settings for the database being created.)
  • Data Warehouse for Database type is OLAP (complex queries that process large volumes of data. Response time, accuracy, and availability are key issues.)

Oracle Database 11g Release 2 (11.2) Installation On Oracle Linux 7.6 (OL7.6)

Unpack Files

11.2.0.1

unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip

Host File

login as a root then, edit the host file “/etc/hosts”.

192.168.75.128 labdbT1.localdomain labdbT1

Oracle Installation Prerequisites
Perform either the Automatic Setup or the Manual Setup to complete the basic prerequisites. so I prefer Automatic Setup.

Automatic Setup
We can follow the instructions at http://public-yum.oracle.com to set up the yum repository for OL, then perform the following command.

# yum install oracle-rdbms-server-11gR2-preinstall

All necessary prerequisites will be performed automatically.

It is probably worth doing a full update as well, but this is not strictly speaking necessary.

# yum update

Create new groups and users.

I have group oinstall, dba and oper and oracle user before then, I used groupmod and usermod commands, if you don’t have them before You have to use groupadd and useradd command

groupmod -g 201 oinstall
groupmod -g 202 dba
groupmod -g 203 oper
groupadd -g 204 asmadmin
groupadd -g 206 asmdba
groupadd -g 205 asmoperusermod -u 202 -g oinstall -G dba,asmdba,oper oracle
passwd oracle

Create the directories in which the Oracle software will be installed.

mkdir -p /home/oracle/product/11.2.0/db
chown -R oracle:oinstall /home/oracle
chmod -R 775 /home/oracle

Login as root and issue the following command.

xhost +192.168.75.128

Log in as the oracle user and add the following lines at the end of the “.bash_profile” file.

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIRORACLE_HOSTNAME=dblabT1.localdomain; export ORACLE_HOSTNAME
ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME
ORACLE_BASE=/home/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db; export ORACLE_HOME
ORACLE_SID=DB11G; export ORACLE_SIDPATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATHLD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

Create the directories oraInventory

# mkdir -p /home/oraInventory
# chown -R oracle:oinstall /home/oraInventory
# chmod -R 775 /home/oraInventory

Installation
Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable.

export DISPLAY=192.168.75.128:0.0

Start the Oracle Universal Installer by following the command in the database directory.

./runInstaller

Note

As error above

  • oracle base location
  • oraInventory location

Oracle, don’t advise about the location they have to separate for security, This is a Test machine so I don’t worry about these. If you install it for Production, You don’t have to do like me, it is worst.

Oracle Linux 7.6 (OL7.6) Installation

Oracle Linux 7 Installation

1. choose from the DVD “Install Oracle Linux 7.6”

2. select the default language and keyboard, then click the “Continue” button

3. Click the “INSTALLATION DESTINATION”

3.1  Click “Local Standard Disks” then I choose “Automatically configure partitioning” in Other Storage Options, If you want to manage on your own, you can choose the other choice. then click the “Done”

4. Click the “SOFTWARE SELECTION”

4.1 I chose for GUI Console

         -Base Environment > Server with GUI

-Add-Ons for Selected Environment > Compatibility Libraries

-Add-Ons for Selected Environment > Development Tools

click the “Done”

5. Everything is done, it’s already to installation. Click the “Begin Installation”

6. Click the “ROOT PASSWORD” and identified the root password, then click “Done”

7. Click the “USER CREATION” and identified the root password, then click “Done”

8. When Install is completed, it show “Complete!” then click the “Reboot”

9. After Reboot, On the sign-in screen, click on the user you want to log in as.

-I have to check the Licensing as below.

10. Accept the Languages, keyboard, privacy, and Other Accounts and are ready to go.

Network Setting

Applications > System Tools > Settings

-Click the “Network” then click OFF > ON and click the button beside “ON”

-If you want to connect automatically, You can choose like the pictures below.

-I like to choose “Automatic DHCP” and a litter setting more. if you want to manual config you can choose “Manual”

– Config Network in case (Auto DHCP)

SELinux

If the OS is to be used for an Oracle installation, it is easier if Secure Linux (SELinux) is disabled or switched to permissive. To do this edit the “/etc/selinux/config” file, making sure the SELINUX flag is set as follows.

SELINUX=permissive

Firewall

# systemctl stop firewalld
# systemctl disable firewalld

SSH

# systemctl start sshd.service
# systemctl enable sshd.service

Prepare to Install Oracle SW

The installation documentation says the following packages are necessary for the cloud control installation(13c). If you have performed the database installation as described in one of the above articles, most of these prerequisites will already have been met.

yum install make -y
yum install binutils -y
yum install gcc -y
yum install libaio -y
yum install glibc-common -y
yum install libstdc++ -y
yum install libXtst -y
yum install sysstat -y
yum install glibc -y
yum install glibc-devel -y
yum install glibc-devel.i686 -y

Oracle Installation Prerequisites (11,12c,18c)

Perform either the Automatic Setup or the Manual Setup to complete the basic prerequisites. The Additional Setup is required for all installations.

Automatic Setup
To perform all your prerequisite setup, issue the following command.

# yum install oracle-rdbms-server-12cR1-preinstall -y
# yum install oracle-rdbms-server-11gR2-preinstall -y
# yum install oracle-database-preinstall-18c -y

Earlier versions of Oracle Linux required manual setup of the Yum repository by following the instructions at http://public-yum.oracle.com.

It is probably worth doing a full update as well, but this is not strictly speaking necessary.

# yum update -y

Reconfig OEM11g DBConsole Manually for Oracle Database

Recreate the repository to reset the OC4J Application Server(11g)

Prepare yourself

  • You must know the password for users SYS, DBSNMP, SYSMAN
  • You must know ORACLE_SID, port listener, hostname
  • If you have .menuscript after login oracle, You have to check .menuscript to identify the parameter ORACLE_HOSTNAME(if your server make for DR or RAC, You have to identify virtual DNS for ORACLE_HOSTNAME, if not DR or RAC, you have to identify your hostname)
Error :

OC4J Configuration issue. /oracle11/product/11.2.0.3/oc4j/j2ee/OC4J_DBConsole_SCORPIO00B_prim1124 not found.

(prim1124) /oracle11/product/11.2.0.3/bin $cd $ORACLE_HOME/bin
(prim1124) /oracle11/product/11.2.0.3/bin $./emctl start dbconsole
Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name.
(prim1124) /oracle11/product/11.2.0.3/bin $env |grep ORA
ORACLE_BASE=/oracle11
ORACLE_HOME=/oracle11/product/11.2.0.3
ORACLE_SID=prim1124
PS1=($ORACLE_SID) $PWD $
(prim1124) /oracle11/product/11.2.0.3/bin $export ORACLE_UNQNAME=prim1124
(prim1124) /oracle11/product/11.2.0.3/bin $
(prim1124) /oracle11/product/11.2.0.3/bin $./emctl start dbconsole
OC4J Configuration issue. /oracle11/product/11.2.0.3/oc4j/j2ee/OC4J_DBConsole_SCORPIO00B_prim1124 not found.
(prim1124) /oracle11/product/11.2.0.3/bin $./emctl status dbconsole
OC4J Configuration issue. /oracle11/product/11.2.0.3/oc4j/j2ee/OC4J_DBConsole_SCORPIO00B_prim1124 not found.
(prim1124) /oracle11/product/11.2.0.3/bin $sqlplus sysman/oracleSQL*Plus: Release 11.2.0.3.0 Production on Tue Feb25 10:16:05 2012Copyright (c) 1982, 2011, Oracle. All rights reserved.Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> conn system/oracle
Connected.

SQL> exit

(prim1124) /oracle11/product/11.2.0.3/bin $emca -repos create

STARTED EMCA at Feb 25, 2012 10:19:00 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle. All rights reserved.Enter the following information:
Database SID: prim1124
Listener port number: 1523
Password for SYS user: xxxxxxxx
Password for SYSMAN user: xxxxxxxx

Do you wish to continue? [yes(Y)/no(N)]: yes
Feb 25, 2012 10:19:46 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /oracle11/cfgtoollogs/emca/prim1124/emca_2012_02_25_10_19_00.log.
Feb 25, 2012 10:19:46 AM oracle.sysman.emcp.DatabaseChecks performReposChecks
SEVERE: Dbcontrol Repository already exists. Fix the error(s) and run EM Configuration Assistant again in standalone mode.
(prim1124) /oracle11/product/11.2.0.3/bin $emca -config dbcontrol db -repos recreate

STARTED EMCA at Feb 25, 2012 10:21:24 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle. All rights reserved.

Enter the following information:
Database SID: prim1124
Listener port number: 1523
Listener ORACLE_HOME [ /oracle11/product/11.2.0.3 ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
—————————————————————–

You have specified the following settings

Database ORACLE_HOME ……………. /oracle11/product/11.2.0.3

Local hostname ……………. SCORPIO00B
Listener ORACLE_HOME ……………. /oracle11/product/11.2.0.3
Listener port number ……………. 1523
Database SID ……………. prim1124
Email address for notifications ……………
Outgoing Mail (SMTP) server for notifications ……………

—————————————————————–
———————————————————————-
WARNING : While repository is dropped the database will be put in quiesce mode.
———————————————————————-
Do you wish to continue? [yes(Y)/no(N)]: yes
Feb 25, 2012 10:21:46 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /oracle11/cfgtoollogs/emca/prim1124/emca_2012_02_25_10_19_00.log.
Feb 25, 2012 10:21:46 AM oracle.sysman.emcp.ParamsManager checkListenerStatusForDBControl
WARNING: ORA-12541: TNS:no listener

Feb 25, 2012 10:21:46 AM oracle.sysman.emcp.EMConfig perform
SEVERE:

Database connection through listener failed. Fix the error and run EM Configuration Assistant again.

Some of the possible reasons may be:

1) Listener port 1523 provided is incorrect. Provide the correct port.
2) Listener is not up. Start the Listener.
3) Database service prim1124 is not registered with listener. Register the database service.
4) Listener is up on physical host and ORACLE_HOSTNAME environment variable is set to virtual host. Unset ORACLE_HOSTNAME environment variable.
5) Listener is up on virtual host. Set environment variable ORACLE_HOSTNAME=<virtual host>.
6) /etc/hosts does not have correct entry for hostname.

Refer to the log file at /oracle11/cfgtoollogs/emca/prim1124/emca_2012_02_25_10_21_24.log for more details.
Could not complete the configuration. Refer to the log file at /oracle11/cfgtoollogs/emca/prim1124/emca_2012_02_25_10_21_24.log for more details.
(prim1124) /oracle11/product/11.2.0.3/bin $view /oracle11/cfgtoollogs/emca/prim1124/emca_2012_02_25_10_21_24.log
(prim1124) /oracle11/product/11.2.0.3/bin $env |grep ORA
ORACLE_BASE=/oracle11
ORACLE_HOME=/oracle11/product/11.2.0.3
ORACLE_SID=prim1124
ORACLE_UNQNAME=prim1124
PS1=($ORACLE_SID) $PWD $
(prim1124) /oracle11/product/11.2.0.3/bin $env |grep HOST
(prim1124) /oracle11/product/11.2.0.3/bin $hostname
SCORPIO00B
(prim1124) /oracle11/product/11.2.0.3/bin $export ORACLE_HOSTNAME=SCORPIO00B

***If Your Database is DR or RAC then You have 1 virtual IP and 2public IP so You have to use Virtual IP  such as ORACLE_HOSTNAME=SCORPIO00 ***

(prim1124) /oracle11/product/11.2.0.3/bin $emca -config dbcontrol db -repos recreate

STARTED EMCA at Feb 25, 2012 10:23:00 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle. All rights reserved.

Enter the following information:
Database SID: prim1124
Listener port number: 1523
Listener ORACLE_HOME [ /oracle11/product/11.2.0.3 ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
—————————————————————–

You have specified the following settings

Database ORACLE_HOME ……………. /oracle11/product/11.2.0.3

Local hostname ……………. SCORPIO00B
Listener ORACLE_HOME ……………. /oracle11/product/11.2.0.3
Listener port number ……………. 1523
Database SID ……………. prim1124
Email address for notifications ……………
Outgoing Mail (SMTP) server for notifications ……………

—————————————————————–
———————————————————————-
WARNING : While repository is dropped the database will be put in quiesce mode.
———————————————————————-
Do you wish to continue? [yes(Y)/no(N)]: yes
Feb 25, 2012 10:23:19 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /oracle11/cfgtoollogs/emca/prim1124/emca_2012_02_25_10_22_59.log.
Feb 25, 201210:23:19 AM oracle.sysman.emcp.ParamsManager checkListenerStatusForDBControl

WARNING: ORA-12541: TNS:no listener

Feb 25, 2012 10:23:19 AM oracle.sysman.emcp.EMConfig perform
SEVERE:

Database connection through listener failed. Fix the error and run EM Configuration Assistant again.

Some of the possible reasons may be:

1) Listener port 1523 provided is incorrect. Provide the correct port.
2) Listener is not up. Start the Listener.
3) Database service prim1124 is not registered with listener. Register the database service.
4) Listener is up on physical host and ORACLE_HOSTNAME environment variable is set to virtual host. Unset ORACLE_HOSTNAME environment variable.
5) Listener is up on virtual host. Set environment variable ORACLE_HOSTNAME=<virtual host>.
6) /etc/hosts does not have correct entry for hostname.

Refer to the log file at /oracle11/cfgtoollogs/emca/prim1124/emca_2012_02_25_10_22_59.log for more details.
Could not complete the configuration. Refer to the log file at /oracle11/cfgtoollogs/emca/prim1124/emca_2012_02_25_10_22_59.log for more details.
(prim1124) /oracle11/product/11.2.0.3/bin $ps -ef |grep tns
oracle 21129 1 0 Feb 05 ? 5:31 /oracle11/product/11.2.0.3/bin/tnslsnr LISTENER_prim1124 -inherit
oracle 26224 26968 0 10:23:37 pts/1 0:00 grep tns
(prim1124) /oracle11/product/11.2.0.3/bin $lsnrctl status LISTENER_prim1124

LSNRCTL for Solaris: Version 11.2.0.3.0 – Production on Feb 25, 2012 10:23:56

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=SCORPIO00)(PORT=1523)))
STATUS of the LISTENER
————————
Alias LISTENER_prim1124
Version TNSLSNR for Solaris: Version 11.2.0.3.0 – Production
Start Date 05-Feb-2012 09:19:49
Uptime 20 days 1 hr. 4 min. 7 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle11/product/11.2.0.3/network/admin/listener.ora
Listener Log File /oracle11/diag/tnslsnr/SCORPIO00B/listener_prim1124/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.xx.0.1xx)(PORT=1523)))
Services Summary…
Service “prim1124” has 1 instance(s).
Instance “prim1124”, status UNKNOWN, has 1 handler(s) for this service…
The command completed successfully
(prim1124) /oracle11/product/11.2.0.3/bin $export ORACLE_HOSTNAME=SCORPIO00
(prim1124) /oracle11/product/11.2.0.3/bin $emca -config dbcontrol db -repos recreate

STARTED EMCA at Feb 25, 2012 10:24:18 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle. All rights reserved.

Enter the following information:
Database SID: prim1124
Listener port number: 1523
Listener ORACLE_HOME [ /oracle11/product/11.2.0.3 ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
—————————————————————–

You have specified the following settings

Database ORACLE_HOME ……………. /oracle11/product/11.2.0.3

Local hostname ……………. SCORPIO00
Listener ORACLE_HOME ……………. /oracle11/product/11.2.0.3
Listener port number ……………. 1523
Database SID ……………. prim1124
Email address for notifications ……………
Outgoing Mail (SMTP) server for notifications ……………

—————————————————————–
———————————————————————-
WARNING : While repository is dropped the database will be put in quiesce mode.
———————————————————————-
Do you wish to continue? [yes(Y)/no(N)]: yes
Feb 25, 2012 10:24:35 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /oracle11/cfgtoollogs/emca/prim1124/emca_2012_02_25_10_24_18.log.
Feb 25, 2012 10:24:36 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) …
Feb 25, 2012 10:25:45 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Feb 25, 2012 10:25:45 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) …
Feb 25, 2012 10:30:08 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Feb 25, 2012 10:30:10 AM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) …
Feb 25, 2012 10:31:18 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Feb 25, 2012 10:31:19 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) …
Feb 25, 2012 10:31:27 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Feb 25, 2012 10:31:27 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) …
Feb 25, 2012 10:31:50 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Feb 25, 2012 10:31:50 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://SCORPIO00:5501/em <<<<<<<<<<<
Feb 25, 2012 10:31:52 AM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************ WARNING ************************

Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted. The encryption key has been placed in the file: /oracle11/product/11.2.0.3/SCORPIO00_prim1124/sysman/config/emkey.ora. Ensure this file is backed up as the encrypted data will become unusable if this file is lost.

***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Feb 25, 2012 10:31:52 AM

(prim1124) /oracle11/product/11.2.0.3/bin $cp /oracle11/product/11.2.0.3/SCORPIO00_prim1124/sysman/config/emkey.ora /oracle11/product/11.2.0.3/SCORPIO00_prim1124/sysman/config/emkey.ora_bak
(prim1124) /oracle11/product/11.2.0.3/bin $

then try to connect with the browser.

Oracle Flashback database and restore points

FLASHBACK DATABASE WITH GUARANTEED RESTORE POINT

ENVIRONMENT

Platform : Solaris 5.11
Server Name : Scorpio
DB Version : Oracle 11.2.0.4
DB Name : prim1124
DB_UNIQUE_NAME : prim1124
Flashback : enabled


PREPARE AND CONFIGURATION

  • Ensure db_recovery_file_dest is set
  • Ensure db_recovery_file_dest_size is set
  • Ensure db_flashback_retention_target in second

***Redo logfiles must be available for the entire time period spanned by the flashback logs. depend on db_flashback_retention_target ***

(prim1124) /home/oracle $mkdir -p /oradbs/archive/FRA_prim1124
(prim1124) /home/oracle $sqlplus “/as sysdba”SQL*Plus: Release 11.2.0.4.0 Production on Wed Sep 8 08:52:25 2012Copyright (c) 1982, 2011, Oracle. All rights reserved.Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL>
SQL> alter system set db_recovery_file_dest=’/oradbs/archive/FRA_prim1124′ scope=spfile;System altered.SQL> alter system set db_recovery_file_dest_size=300G scope=spfile;System altered.
SQL> show parameter recovery
NAME TYPE VALUE
———————————— ———– ——————————
db_recovery_file_dest string /oradbs/archive/FRA_prim1124
db_recovery_file_dest_size big integer 300G
recovery_parallelism integer 0
SQL>
SQL> shutdown immediate;
SQL> startup mount;
SQL> alter database open;
SQL> alter system set db_flashback_retention_target=2880;

DETERMINE WHETHER FLASHBACK IS ALREADY ENABLED

  • Check Flashback, It’s available or not if It isn’t, You have to set it.
SQL> select flashback_on from v$database;
FLASHBACK_ON

——————

YES

*****if Flashback isn’t enabling *****
SQL> alter database flashback on;

CREATING AND USING FLASHBACK RESTORE POINT

SQL> CREATE RESTORE POINT grp_prim1124 GUARANTEE FLASHBACK DATABASE;

Restore point created.

SQL> SELECT NAME, SCN, TIME, DATABASE_INCARNATION#, GUARANTEE_FLASHBACK_DATABASE, STORAGE_SIZE FROM V$RESTORE_POINT WHERE GUARANTEE_FLASHBACK_DATABASE=’YES’;

NAME
————————————————
SCN TIME DATABASE_INCARNATION# GUARANTEE STORAGE_SIZE
———- ———————————————— ——————— ——— ————
grp_prim1124
8919818891 08-SEP-12 04.23.41.000000000 PM 2 YES 104765658


Flashback database to guarantee restore point

  • Shut down the database and start the database in mount mode.
(prim1124) /home/oracle $sqlplus “/as sysdba”

SQL*Plus: Release 11.2.0.4.0 Production on Wed Sep 8 08:52:25 2012

Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>
SQL>shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL> startup mount;

ORACLE instance started.

Total System Global Area 938451800 bytes
Fixed Size 761024 bytes
Variable Size 29874796 bytes
Database Buffers 9660700 bytes
Redo Buffers 7542480 bytes
Database mounted.
SQL>
SQL> flashback database to RESTORE POINT grp_prim1124;

Flashback complete.

SQL> alter database open resetlogs;

Database altered.

DROP GUARANTEED RESTORE POINT

(prim1124) /home/oracle $sqlplus “/as sysdba”

SQL*Plus: Release 11.2.0.4.0 Production on Wed Sep 8 08:52:25 2012

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> SELECT NAME, SCN, TIME, DATABASE_INCARNATION#, GUARANTEE_FLASHBACK_DATABASE, STORAGE_SIZE FROM V$RESTORE_POINT WHERE GUARANTEE_FLASHBACK_DATABASE=’YES’;

NAME
——————————————-
SCN
———-
TIME
———————————————-
DATABASE_INCARNATION# GUA STORAGE_SIZE
——————— — ————
grp_prim1124
8919819034
08-SEP-12 04.23.53.000000000 PM
2 YES 104765658

SQL> drop RESTORE POINT grp_prim1124;

Restore point dropped.

MONITORING FLASHBACK

SQL> select estimated_flashback_size/1024/1024/1024 “EST_FLASHBACK_SIZE(GB)” from v$flashback_database_log;

Disaster Recovery – DR

Disaster Recovery (DR)

เป็น วิธีป้องกันและกู้คืน ข้อมูล เมื่อเกิดภัยพิบัติ ภัยธรรมชาติ และ เหตุการณ์ Unplaned เช่น น้ำท่วม ไฟไหม้ การประท้วง หากเกิด ภัยซึ่งเป็นปัญหาสำหรับ Database ที่มี ความสำคัญ ไม่สามารถ Downtime ได้ เรา ต้องมีแนวทางเพื่อป้องกันไม่ให้ มี การ Downtime ของระบบ เนื่องจาก มีการใช้งานของข้อมูลตลอดเวลา เพื่อ ให้เรา จัดการปัญหาเหล่านี้ จึงมี Feature ต่างๆ มาให้เรา เลือกใช้งาน และเราจะพูดถึงเพียงแค่ 3 วิธีคือ

  1. Data Guard
  2. Golden Gate
  3. RAC

***หากมีข้อเพิ่มเติม หรือผิดพลาด จุดไหน รบกวนแนะนำด้วยคะ ขอบคุณค่ะ***

***การใช้ ภาษาไทยคำ อังกฤษคำ ในบางข้อ จะสามารถทำให้ เข้าใจได้ง่ายขึ้น***

 

 

error: Content is protected !!