Thursday 16 February 2017

Configuring Oracle HTTP Server in a WebLogic Server Domain

Configuring Oracle HTTP Server in a WebLogic Server Domain
After you have installed Oracle HTTP Server, you can extend an existing Infrastructure domain with Oracle HTTP Server.
If you have not created the Oracle Fusion Middleware Infrastructure domain, you can create it at the same time as Oracle HTTP Server.However, in Selecting Advanced Configurations, ensure that you select System Components too.
  • Stopping the Administration Server
    Before starting the configuration wizard, it is important to shut down the Administration Server. This prevents any configuration locks, saves, or activations from occurring during the configuration of the domain.
  • Starting the Configuration Wizard
    Start the Configuration Wizard to begin configuring a domain.
  • Navigating the Configuration Wizard Screens to Extend the Domain
    Use the Configuration Wizard to extend an existing Infrastructure domain with an Oracle HTTP Server instance.
  • Starting the Servers
    After configuration is complete, you can use tools to manage your domain.
Stopping the Administration Server
Before starting the configuration wizard, it is important to shut down the Administration Server. This prevents any configuration locks, saves, or activations from occurring during the configuration of the domain.
To stop the Administration Server, go to the Domain_Home/Bin directory.
·         On UNIX operating systems:

./stopWebLogic.sh
  • On Windows operating systems:

stopWebLogic.cmd
You may be prompted for the login credentials of the Administrator user you provided when you configured the Oracle Fusion Middleware Infrastructure domain.
Starting the Configuration Wizard
Start the Configuration Wizard to begin configuring a domain.
To start the Configuration Wizard:
  1. Go to the bin directory:
(UNIX) ORACLE_HOME/oracle_common/common/bin
(Windows) ORACLE_HOME\oracle_common\common\bin
where ORACLE_HOME is your 12c (12.2.1.2) Oracle home.
  1. Launch the Configuration Wizard:
(UNIX) ./config.sh
(Windows) config.cmd
Navigating the Configuration Wizard Screens to Extend the Domain
Use the Configuration Wizard to extend an existing Infrastructure domain with an Oracle HTTP Server instance.
The following sections step through the Configuration Wizard:
  • Selecting the Domain Type and Domain Home Location
    You must specify the domain to be updated with Oracle HTTP Server.
  • Selecting the Configuration Template for Oracle HTTP Server
    Use the Templates screen to select the template you require.
  • Specifying the Database Configuration Type
    Use the Database Configuration type screen to specify details about the database and database schema.
  • Specifying JDBC Component Schema Information
    Use the JDBC Component Schema screen to verify or specify details about the database schemas.
  • Testing the JDBC Connections
    Use the JDBC Component Schema Test screen to test the data source connections.
  • Selecting Advanced Configuration
    Use the Advanced Configuration screen to complete the domain configuration.
  • Specifying the Oracle HTTP Server Details
    Use the OHS Server screen to configure the Oracle HTTP Server instance in the domain.
  • Assigning System Components to Machines
    Use the Assign System Components to Machines screen to assign Oracle HTTP Server system components to the machine that you defined when you configured the initial Fusion Middleware Infrastructure domain..
  • Reviewing Your Configuration Specifications and Configuring the Domain
    The Configuration Summary screen has detailed configuration information for the domain you are about to extend.
  • Writing Down Your Domain Home and Administration Server URL
    The End of Configuration screen shows information about the domain you just configured.
Selecting the Domain Type and Domain Home Location
You must specify the domain to be updated with Oracle HTTP Server.
To specify the Domain type and Domain home directory:
  1. On the Configuration Type screen, select Update an existing domain.
  2. In the Domain Location field, select the Domain home location specified while configuring the Infrastructure domain.
Selecting the Configuration Template for Oracle HTTP Server
Use the Templates screen to select the template you require.
On the Templates screen, make sure Update Domain Using Product Templates is selected, then select one of the following templates:
  • For a Full-JRF configuration, select Oracle HTTP Server (Collocated) - 12.2.1.2.0 [ohs].
  • For a Restricted-JRF configuration, select Oracle HTTP Server (Restricted JRF) - 12.2.1.2.0 [ohs].
Specifying the Database Configuration Type
Use the Database Configuration type screen to specify details about the database and database schema.
On the Database Configuration type screen, all fields are pre-populated, because you already configured the domain to reference the Fusion Middleware schemas that are required for the Infrastructure domain. Verify and ensure that credentials in all the fields are the same that you have provided while configuring Oracle Fusion Middleware Infrastructure.
Verify the database connection information, then select Get RCU Configuration. The following output in the Connection Result Log indicates that the operation succeeded:
Connecting to the database server...OK
Retrieving schema data from database server...OK
Binding local schema components with retrieved data...OK

Successfully Done.
Specifying JDBC Component Schema Information
Use the JDBC Component Schema screen to verify or specify details about the database schemas.
Verify that the values populated on the JDBC Component Schema screen are correct for all schemas.
  • Configuring GridLink Data Sources with Oracle RAC
  • Configuring Multi Data Sources
Testing the JDBC Connections
Use the JDBC Component Schema Test screen to test the data source connections.
A green check mark in the Status column indicates a successful test. If you encounter any issues, see the error message in the Connection Result Log section of the screen, fix the problem, then try to test the connection again.
By default, the schema password for each schema component is the password you specified while creating your schemas. If you want different passwords for different schema components, manually edit them in the previous screen (JDBC Component Schema) by entering the password you want in the Schema Password column, against each row. After specifying the passwords, select the check box corresponding to the schemas that you changed the password in and test the connection again.
Selecting Advanced Configuration
Use the Advanced Configuration screen to complete the domain configuration.
On the Advanced Configuration screen, select:
  • System Components
Specifying the Oracle HTTP Server Details
Use the OHS Server screen to configure the Oracle HTTP Server instance in the domain.
In the Listen Address field, specify the IP address of the host on which the Oracle HTTP Server instance will reside. Do not use localhost. For more information, see Specifying the Listen Address in Oracle Fusion Middleware Creating WebLogic Domains Using the Configuration Wizard.
All of the remaining fields are pre-populated, but you can change the values as required. For example, verify that the default port numbers are not used by other services.
For more information about this screen, see OHS Server in Oracle Fusion Middleware Creating WebLogic Domains Using the Configuration Wizard .
Assigning System Components to Machines
Use the Assign System Components to Machines screen to assign Oracle HTTP Server system components to the machine that you defined when you configured the initial Fusion Middleware Infrastructure domain..
On the Assign System Components to Machines screen:
  1. In the Machine list box, select the machine (for example, infra_machine_1) to which you want to assign the Oracle HTTP Serverinstance.
  2. Assign the Oracle HTTP Server instance to the selected machine in one of the following ways:
·         Double-click ohs_1 in the System Components list box.
·         Select the ohs_1 in the System Components list box and click the right arrow.
Reviewing Your Configuration Specifications and Configuring the Domain
The Configuration Summary screen has detailed configuration information for the domain you are about to extend.
Review each item on the screen and verify that the information is correct. To make any changes, go back to a screen by clicking the Back button or selecting the screen in the navigation pane. Domain update does not start until you click Update.
Writing Down Your Domain Home and Administration Server URL
The End of Configuration screen shows information about the domain you just configured.
Make a note of the following items because you need them later:
  • Domain Location
  • Administration Server URL
You need the domain location to access scripts that start Node Manager and Administration Server, and you need the URL to access the Administration Server.
Click Finish to dismiss the Configuration Wizard.
Starting the Servers
After configuration is complete, you can use tools to manage your domain.
Follow the instructions in the following sections:
  • Starting Node Manager
  • Starting the Administration Server
  • Starting the Oracle HTTP Server Instance
Starting Node Manager
To start the per-domain Node Manager:
  1. Go to the DOMAIN_HOME/bin directory.
  2. Start the Node Manager.
·         On UNIX operating systems, using nohup and nm.out as an example output file:
·         nohup ./startNodeManager.sh > LOG_DIR/nm.out&
where LOG_DIR is the location of directory in which you want to store the log files.
·         On Windows operating systems:
·         startNodeManager.cmd
Note:
On Windows operating systems, Oracle recommends that you configure Node Manager to run as a startup service. This allows Node Manager to start up automatically each time the system is restarted.
Starting the Administration Server
To start the Administration Server, go to the DOMAIN_HOME/bin directory.
On UNIX operating systems, run:
./startWebLogic.sh
On Windows operating systems, run:
startWebLogic.cmd
If you selected Production Mode on the Domain Mode and JDK screen when you created the domain, you see a prompt for the Administrator user login credentials as provided on the Administrator Account screen.
You can verify that the Administration Server is up and running by accessing the Administration Server Console. The URL is provided on the Configuration Success screen, as described in “Writing Down Your Domain Home and Administration Server URL” in (http://administration_server_host:administration_server_port/console). The default Administration Server port number is 7001.
Note:
Make sure that the database hosting your product schemas is up and running and accessible by the Administration Server.
4.4.3 Starting the Oracle HTTP Server Instance
To start the Oracle HTTP Server instance:
  1. Log in to Oracle Fusion Middleware Control:
2.  http://administration_server_host:administration_server_port/em
The Administration Server host and port number were in the URL on the Configuration Success screen. The default Administration Server port number is 7001.
The login credentials were provided on the Administrator Account screen while installing.
  1. Click WebTier in the navigation panel on the left side.
  2. Select the Oracle HTTP Server instance you want to start (for example, ohs_1) and click Start Up from the top panel.



UNABLE TO LAUNCH REPORTS BUILDER

UNABLE TO LAUNCH REPORTS BUILDER


After installing and configuring Oracle Forms and Reports 12c, if you try to launch either Reports Builder (rwbuilder.bat) or Reports Converter (rwconverter.bat), both located in %ORACLE_HOME%\bin, you will most likely encounter the following error:
“Windows cannot find ‘\bin\rwbuilder.exe'” or “Windows cannot find ‘\bin\rwconverter.exe'”



The reason for the error is because the values for the DOMAIN_HOME and COMPONENT_NAME need to be filled out in both batch files. You may fix the error by completing these steps:
1.     Go to %ORACLE_HOME%\bin and make backups of both rwbuilder.bat and rwconverter.bat.
2.     Open up rwbuilder.bat in a text editor (Notepad, Wordpad, etc.)
3.     Look for $$domain_home$$ and $$component_name$$. Replace $$domain_home$$ with the full path to your domain home (Example: C:\Oracle\Middleware\user_projects\domains\FormsDomain) and $$component_name$$ with the name of your ReportsToolsComponent (Example: reptools1).

4.     Immediately before the line with “set DOMAIN_HOME=…”, insert the line: set ORACLE_HOME=<PATH_TO_ORACLE_HOME> where <PATH_TO_ORACLE_HOME> is the fully-written path to your Forms 12c Oracle home.
5.     Save and close the file.
6.     Repeat steps 2-5 for rwconverter.bat.
This is how the file looks before the changes are made:










This is how the file should look after the changes are made:










After making the changes above, Reports Builder and Reports Converter should open up normally.

Startup and Shutdown Databases

Startup and Shutdown Container Databases (CDB) and Pluggable Databases (PDB) in Oracle Database 12c Release 1 (12.1)
The multitenant option introduced in Oracle Database 12c allows a single container database (CDB) to host multiple separate pluggable databases (PDB). This article demonstrates how to startup and shutdown container databases (CDB) and pluggable databases (PDB).
Container Database (CDB)
Startup and shutdown of the container database is the same as it has always been for regular instances. The SQL*Plus STARTUP and SHUTDOWN commands are available when connected to the CDB as a privileged user. Some typical values are shown below.
STARTUP [NOMOUNT | MOUNT | RESTRICT | UPGRADE | FORCE | READ ONLY]
SHUTDOWN [IMMEDIATE | ABORT]
Pluggable Database (PDB)
Pluggable databases can be started and stopped using SQL*Plus commands or the ALTER PLUGGABLE DATABASE command.
SQL*Plus Commands
STARTUP FORCE;
STARTUP OPEN READ WRITE [RESTRICT];
STARTUP OPEN READ ONLY [RESTRICT];
STARTUP UPGRADE;
SHUTDOWN [IMMEDIATE];

Some examples are shown below.
STARTUP FORCE;
SHUTDOWN IMMEDIATE;

STARTUP OPEN READ WRITE RESTRICT;
SHUTDOWN;

STARTUP;
SHUTDOWN IMMEDIATE;
ALTER PLUGGABLE DATABASE
The ALTER PLUGGABLE DATABASE command can be used from the CDB or the PDB.
The following commands are available to open and close the current PDB when connected to the PDB as a privileged user.
ALTER PLUGGABLE DATABASE OPEN READ WRITE [RESTRICTED] [FORCE];
ALTER PLUGGABLE DATABASE OPEN READ ONLY [RESTRICTED] [FORCE];
ALTER PLUGGABLE DATABASE OPEN UPGRADE [RESTRICTED];
ALTER PLUGGABLE DATABASE CLOSE [IMMEDIATE];
Some examples are shown below.
ALTER PLUGGABLE DATABASE OPEN READ ONLY FORCE;
ALTER PLUGGABLE DATABASE CLOSE IMMEDIATE;

ALTER PLUGGABLE DATABASE OPEN READ WRITE;
ALTER PLUGGABLE DATABASE CLOSE IMMEDIATE;

The following commands are available to open and close one or more PDBs when connected to the CDB as a privileged user.
ALTER PLUGGABLE DATABASE <pdb-name-clause> OPEN READ WRITE [RESTRICTED] [FORCE];
ALTER PLUGGABLE DATABASE <pdb-name-clause> OPEN READ ONLY [RESTRICTED] [FORCE];
ALTER PLUGGABLE DATABASE <pdb-name-clause> OPEN UPGRADE [RESTRICTED];
ALTER PLUGGABLE DATABASE <pdb-name-clause> CLOSE [IMMEDIATE];
The<pdb-name-clause> clause can be any of the following:
  • One or more PDB names, specified as a comma-separated list.
  • The ALL keyword to indicate all PDBs.
  • The ALL EXPECT keywords, followed by one or more PDB names in a comma-separate list, to indicate a subset of PDBs.
Some examples are shown below.
ALTER PLUGGABLE DATABASE pdb1, pdb2 OPEN READ ONLY FORCE;
ALTER PLUGGABLE DATABASE pdb1, pdb2 CLOSE IMMEDIATE;

ALTER PLUGGABLE DATABASE ALL OPEN;
ALTER PLUGGABLE DATABASE ALL CLOSE IMMEDIATE;

ALTER PLUGGABLE DATABASE ALL EXCEPT pdb1 OPEN;
ALTER PLUGGABLE DATABASE ALL EXCEPT pdb1 CLOSE IMMEDIATE;
Pluggable Database (PDB) Automatic Startup
The 12.1.0.2 patchset has introduced the ability to preserve the startup state of PDBs, so you probably shouldn't be implementing a trigger in the manner discussed in this section.
Prior to 12.1.0.2, when the CDB is started, all PDBs remain in mounted mode. There is no default mechanism to automatically start them when the CDB is started. The way to achieve this is to use a system trigger on the CDB to start some or all of the PDBs.
CREATE OR REPLACE TRIGGER open_pdbs
  AFTER STARTUP ON DATABASE
BEGIN
   EXECUTE IMMEDIATE 'ALTER PLUGGABLE DATABASE ALL OPEN';
END open_pdbs;/
You can customise the trigger if you don't want all of your PDBs to start.
Preserve PDB Startup State (12.1.0.2 onward)
The 12.1.0.2 patchset introduced the ability to preserve the startup state of PDBs through a CDB restart. This is done using the ALTER PLUGGABLE DATABASE command.
We will start off by looking at the normal result of a CDB restart. Notice the PDBs are in READ WRITE mode before the restart, but in MOUNTED mode after it.
SELECT name, open_mode FROM v$pdbs;
NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
PDB1                           READ WRITE
PDB2                           READ WRITE
SQL>
SHUTDOWN IMMEDIATE;                   
STARTUP;

SELECT name, open_mode FROM v$pdbs;
NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
PDB1                           MOUNTED
PDB2                           MOUNTED

SQL>
Next, we open both pluggable databases, but only save the state of PDB1.
ALTER PLUGGABLE DATABASE pdb1 OPEN;
ALTER PLUGGABLE DATABASE pdb2 OPEN;
ALTER PLUGGABLE DATABASE pdb1 SAVE STATE;
The DBA_PDB_SAVED_STATES view displays information about the saved state of containers.
COLUMN con_name FORMAT A20
COLUMN instance_name FORMAT A20

SELECT con_name, instance_name, state FROM dba_pdb_saved_states;

CON_NAME             INSTANCE_NAME        STATE
-------------------- -------------------- --------------
PDB1                 cdb1                 OPEN

SQL>




Restarting the CDB now gives us a different result.
SELECT name, open_mode FROM v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
PDB1                           READ WRITE
PDB2                           READ WRITE

SQL>


SHUTDOWN IMMEDIATE;
STARTUP;


SELECT name, open_mode FROM v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
PDB1                           READ WRITE
PDB2                           MOUNTED

SQL>




The saved state can be discarded using the following statement.
ALTER PLUGGABLE DATABASE pdb1 DISCARD STATE;

COLUMN con_name FORMAT A20
COLUMN instance_name FORMAT A20

SELECT con_name, instance_name, state FROM dba_pdb_saved_states;

no rows selected

SQL>
  • The state is only saved and visible in the DBA_PDB_SAVED_STATES view if the container is in READ ONLY or READ WRITE mode. The ALTER PLUGGABLE DATABASE... SAVE STATE command does not error when run against a container In MOUNTED mode, but nothing is recorded, as this is the default state after a CDB restart.
  • Like other examples of the ALTER PLUGGABLE DATABASE command, PDBs can be identified individually, as a comma separated list, using the ALL or ALL EXPECT keywords.
  • The INSTANCES clause can be added when used in RAC environments. The clause can identify instances individually, as a comma separated list, using the ALL or ALL EXPECT keywords. Regardless of the INSTANCES clause, the SAVE/DISCARD STATE commands only affect the current instance.