### Example Installation Command Source: https://docs.oracle.com/iaas/management-agents/doc/install-management-agent-chapter.html A concrete example of the installation command, showing a sample response file path and a service identifier. ```bash sudo ./installer.sh /tmp/input.rsp mgmt_agent-oc1_phx-abc123 ``` -------------------------------- ### Example: Starting an Instance with ORADIM Source: https://docs.oracle.com/database/121/NTQRF/create.htm Example of starting an instance named 'puma' as an instance with a specified PFILE. ```bash C:\> oradim -STARTUP -SID puma -STARTTYPE inst -PFILE C:\app\username\admin\prod\pfile\init.ora ``` -------------------------------- ### Starting Oracle Universal Installer from Hard Disk Source: https://docs.oracle.com/database/121/AXCQI/toc.htm Navigates to the 'client' directory and executes the runInstaller script to start Oracle Universal Installer when installation files are on the hard disk. ```bash $ ./runInstaller ``` -------------------------------- ### srvctl start home Example Source: https://docs.oracle.com/database/121/RACAD/GUID-73982DB0-54BC-4A1F-BF27-CE4CF815C521.htm An example demonstrating how to use the srvctl start home command to start resources on a specific Oracle home, including state file and node specification. ```bash $ srvctl start home -oraclehome /u01/app/oracle/product/12.1.0/db_1 -statefile ~/state.txt -node node1 ``` -------------------------------- ### srvctl start database Example Source: https://docs.oracle.com/database/121/RACAD/GUID-4598F8BC-BCB5-4489-81A4-EA52EECA2E86.htm An example of using the srvctl start database command to start a database with a specific startup option. This demonstrates how to provide arguments like the database name and startup mode. ```bash $ srvctl start database -db crm -startoption "read only" ``` -------------------------------- ### Example Silent Installation Command Source: https://docs.oracle.com/database/121/CWWIN/crswin.htm An example of the command used to perform a silent installation of Oracle Grid Infrastructure, specifying the setup executable and the full path to the response file. ```bash E:\ setup.exe -silent -responseFile C:\users\oracle\installGrid.rsp ``` -------------------------------- ### Installer Log File Naming Convention Source: https://docs.oracle.com/database/121/AXDBI/app_ts.htm Example names for Oracle Universal Installer log files, indicating the installation start date and time. ```shell installActionsdate_time.log oraInstalldate_time.err oraInstalldate_time.out ``` -------------------------------- ### Start SQL*Plus Source: https://docs.oracle.com/database/121/SUTIL/GUID-89237236-4729-4E33-842D-D124A3C15B10.htm Connect to the database as the 'system' user to begin the demonstration. ```sql sqlplus system ``` -------------------------------- ### REST API Quick Start Example Source: https://docs.oracle.com/pls/topic/lookup?ID=apps-common&ctx=en%2Fcloud%2Fsaas%2Fapplications-common A basic example demonstrating how to make a simple request using Oracle REST APIs to view and manage data in Oracle Fusion Cloud Applications. This is useful for getting started with REST integrations. ```text GET /fscmRestApi/resources/11.13.18.05/purchaseOrders HTTP/1.1 Host: example.com Accept: application/json ``` -------------------------------- ### Example: Install Full Development Environment Source: https://docs.oracle.com/database/121/HTMIG/db_pluggable.htm Example of running apexins_con.sql with specific tablespace names and the virtual directory '/i/'. ```sql @apexins_con.sql SYSAUX SYSAUX TEMP /i/ ``` -------------------------------- ### Example of Translating a Geometric Segment Source: https://docs.oracle.com/database/121/SPATL/sdo_lrs-translate_measure.htm This example demonstrates how to use SDO_LRS.TRANSLATE_MEASURE to shift the start and end measures of a route geometry by 10 units. It requires joining with user_sdo_geom_metadata to get the dimension information. ```sql SELECT SDO_LRS.TRANSLATE_MEASURE(a.route_geometry, m.diminfo, 10) FROM lrs_routes a, user_sdo_geom_metadata m WHERE m.table_name = 'LRS_ROUTES' AND m.column_name = 'ROUTE_GEOMETRY' AND a.route_id = 1; SDO_LRS.TRANSLATE_MEASURE(A.ROUTE_GEOMETRY,M.DIMINFO,10)(SDO_GTYPE, SDO_SRID, SD -------------------------------------------------------------------------------- SDO_GEOMETRY(3302, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY( 2, 2, 10, 2, 4, 12, 8, 4, 18, 12, 4, 22, 12, 10, 28, 8, 10, 32, 5, 14, 37)) ``` -------------------------------- ### Example setup.exe Command for Oracle Restart Source: https://docs.oracle.com/database/121/NTDBI/oraclerestart.htm An example of executing the setup.exe command with a specific Oracle home path to update the node list for Oracle Restart. ```bash C:\app\oracle\product\12.1.0\grid> setup.exe -updateNodeList ORACLE_HOME=C:\app\oracle\product\12.1.0\grid CLUSTER_NODES= CRS=TRUE ``` -------------------------------- ### Show Configuration Example Source: https://docs.oracle.com/database/121/DGBKR/dgmgrl.htm Demonstrates how to use the SHOW CONFIGURATION command to verify the role of a database after conversion. ```bash DGMGRL> SHOW CONFIGURATION; Configuration - DRSolution Protection Mode: MaxPerformance Databases: North_Sales - Primary database South_Sales - Snapshot standby database Fast-Start Failover: DISABLED Configuration Status: SUCCESS ``` -------------------------------- ### Starting Oracle ASM Disk Stamping Tool Source: https://docs.oracle.com/database/121/NTQRF/tools.htm Use these commands to start the Oracle ASM Disk Stamping Tool and its GUI version. Refer to the Oracle Grid Infrastructure Installation Guide for more information. ```bash C:\> asmtool C:\> asmtool -add C:\> asmtool -addprefix C:\> asmtool -list C:\> asmtool -delete ``` ```bash C:\> asmtoolg ``` -------------------------------- ### Example Installation of Full Development Environment Source: https://docs.oracle.com/database/121/HTMIG/db_pluggable.htm Example of running apexins.sql with specific tablespace names and the virtual image directory '/i/'. ```sql @apexins.sql SYSAUX SYSAUX TEMP /i/ ``` -------------------------------- ### Create Cube Materialized View with Default Options Source: https://docs.oracle.com/database/121/ARPLS/d_cube.htm Creates a cube materialized view using default options. This is a basic example for getting started. ```sql SET serverout ON format wrapped DECLARE salesaw varchar2(30); BEGIN salesaw := dbms_cube.create_mview('SH', 'CAL_MONTH_SALES_MV'); END; / ``` -------------------------------- ### Start, Mount, and Open Database Instance Source: https://docs.oracle.com/database/121/CNCPT/startup.htm The STARTUP command initiates an instance, mounts the database, and then opens it, making it available for users. This sequence shows the initial startup and subsequent restart after a shutdown. ```sql SQL> STARTUP ORACLE instance started. Total System Global Area 468729856 bytes Fixed Size 1333556 bytes Variable Size 440403660 bytes Database Buffers 16777216 bytes Redo Buffers 10215424 bytes Database mounted. Database opened. ``` ```sql SQL> SHUTDOWN IMMEDIATE ``` ```sql SQL> STARTUP Oracle instance started. . . ``` -------------------------------- ### Start Configuration Wizard Source: https://docs.oracle.com/database/121/CWADD/GUID-1AF2D413-D25C-4B22-9BBC-3B81AB4D1C56.htm Launch the Configuration Wizard to begin the multi-node setup process. Ensure Oracle Grid Infrastructure software is installed and consistent across all target nodes. ```bash $ Oracle_home/crs/config/config.sh ``` -------------------------------- ### Get Local Node Name Source: https://docs.oracle.com/database/121/CWADD/GUID-D0B8A417-B906-461F-A27E-45A7FCB49A4D.htm Use this command to retrieve the name of the local node where the command is executed. No specific setup is required beyond having Oracle Clusterware installed and running. ```bash crsctl get nodename ``` ```text node2 ``` -------------------------------- ### Example: Install Runtime Environment Source: https://docs.oracle.com/database/121/HTMIG/db_pluggable.htm Example of executing apxrtins_con.sql with specified tablespace names and the virtual directory '/i/'. ```sql @apxrtins_con.sql SYSAUX SYSAUX TEMP /i/ ``` -------------------------------- ### Starting Oracle Universal Installer from Installation Media Source: https://docs.oracle.com/database/121/AXCQI/toc.htm Executes the runInstaller script to start the Oracle Universal Installer from a specified directory path on the installation media. ```bash $ /directory_path/runInstaller ``` -------------------------------- ### Starting a Job Source: https://docs.oracle.com/database/121/SUTIL/GUID-635F8AE6-A0AC-4BC0-BE31-0F9A649EF636.htm This example shows how to initiate the START_JOB command from the Import prompt. ```sql Import> START_JOB ``` -------------------------------- ### Error 10019: ORACLE_HOME Not Set for Cache Agent Source: https://docs.oracle.com/database/121/TTERR/error.htm The cache agent failed to start because ORACLE_HOME is not set in the user environment. Set the ORACLE_HOME environment variable as described in the Installation Guide. ```text | An attempt was made to start the cache agent for a database, but `ORACLE_HOME` was not set in the user environment. Ensure that the `ORACLE_HOME` environment variable is set properly, as described in "Environment variables" in the Oracle TimesTen In-Memory Database Installation Guide. ``` -------------------------------- ### Start Oracle Universal Installer Source: https://docs.oracle.com/database/121/APPCW/ch4.htm Run the setup.exe executable from the Oracle Universal Installer directory to begin the installation process. ```bash D:\Disk1\setup.exe ``` -------------------------------- ### Get Help for Oracle Universal Installer Source: https://docs.oracle.com/database/121/NTCLI/advance.htm Run setup.exe with the -help option to display available command-line options for Oracle Universal Installer. ```bash DRIVE_LETTER:\setup.exe_location setup -help ``` -------------------------------- ### Start Oracle Universal Installer Source: https://docs.oracle.com/database/121/TDPRC/install_rac.htm Use this command to start Oracle Universal Installer (OUI) from the staging area or installation media. ```bash cd /staging_area/clusterware/Disk1 ./runInstaller ``` -------------------------------- ### Example Installation of Runtime Environment Source: https://docs.oracle.com/database/121/HTMIG/db_pluggable.htm Example of running apxrtins.sql with specific tablespace names and the virtual image directory '/i/'. ```sql @apxrtins.sql SYSAUX SYSAUX TEMP /i/ ``` -------------------------------- ### Start POSIX Installer Source: https://docs.oracle.com/database/121/DFSIG/oracle-database-installation-and-deinstallation.htm Command to start the POSIX installer for managing file systems. ```bash /START-POSIX-INSTALLATION ``` -------------------------------- ### SQL Translation Example Setup Source: https://docs.oracle.com/database/121/DRDAA/jdbc_api_ref.htm Demonstrates the setup for SQL translation, including granting privileges, creating tables, and registering SQL translations. ```sql conn system/manager; grant create sql translation profile to HR; conn HR/hr; drop table sample_tab; create table sample_tab (c1 number, c2 varchar2(100)); insert into sample_tab values (1, 'A'); insert into sample_tab values (1, 'A'); insert into sample_tab values (1, 'A'); commit; exec dbms_sql_translator.drop_profile('FOO'); exec dbms_sql_translator.create_profile('FOO'); exec dbms_sql_translator.register_sql_translation('FOO','select row of select c1, c2 from sample_tab where c1=:b1 and c2=:b2','select c1, c2 from sample_tab where c1=:b1 and c2=:b2'); ``` -------------------------------- ### OracleTransaction Example: Insert and Transaction Handling Source: https://docs.oracle.com/database/121/ODPNT/OracleTransactionClass.htm Demonstrates starting a transaction, inserting records, and handling commit or rollback based on potential constraint violations. Ensure database setup is completed before running. ```C# // Database Setup, if you have not done so yet. /* connect scott/tiger@oracle DROP TABLE MyTable; CREATE TABLE MyTable (MyColumn NUMBER); --CREATE TABLE MyTable (MyColumn NUMBER PRIMARY KEY); */ // C# using System; using System.Data; using Oracle.DataAccess.Client; class OracleTransactionSample { static void Main() { // Drop & Create MyTable as indicated Database Setup, at beginning // This sample starts a transaction and inserts two records with the same // value for MyColumn into MyTable. // If MyColumn is not a primary key, the transaction will commit. // If MyColumn is a primary key, the second insert will violate the // unique constraint and the transaction will rollback. string constr = "User Id=scott;Password=tiger;Data Source=oracle"; OracleConnection con = new OracleConnection(constr); con.Open(); OracleCommand cmd = con.CreateCommand(); // Check the number of rows in MyTable before transaction cmd.CommandText = "SELECT COUNT(*) FROM MyTable"; int myTableCount = int.Parse(cmd.ExecuteScalar().ToString()); // Print the number of rows in MyTable Console.WriteLine("myTableCount = " + myTableCount); // Start a transaction OracleTransaction txn = con.BeginTransaction( IsolationLevel.ReadCommitted); try { // Insert the same row twice into MyTable cmd.CommandText = "INSERT INTO MyTable VALUES (1)"; cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery(); // This may throw an exception txn.Commit(); } catch (Exception e) { // Print the exception message Console.WriteLine("e.Message = " + e.Message); // Rollback the transaction txn.Rollback(); } // Check the number of rows in MyTable after transaction cmd.CommandText = "SELECT COUNT(*) FROM MyTable"; myTableCount = int.Parse(cmd.ExecuteScalar().ToString()); // Prints the number of rows // If MyColumn is not a PRIMARY KEY, the value should increase by two. // If MyColumn is a PRIMARY KEY, the value should remain same. Console.WriteLine("myTableCount = " + myTableCount); txn.Dispose(); cmd.Dispose(); con.Close(); con.Dispose(); } } ``` -------------------------------- ### Start Oracle Universal Installer Source: https://docs.oracle.com/database/121/AXDBI/rev_precon_db.htm Run this command to start Oracle Universal Installer to check the contents and directory location of an Oracle Database installation. ```shell $ORACLE_HOME/oui/bin/runInstaller ``` -------------------------------- ### Example: Creating Multiple Disk Partitions Source: https://docs.oracle.com/database/121/NTDBI/oraclerestart.htm Demonstrates creating primary and extended/logical partitions on Disk 5 with specified sizes. This example illustrates how to manage partition limits. ```bash DISKPART> select disk 5 DISKPART> create partition primary size=500 DISKPART> ... DISKPART> create partition extended DISKPART> create partition logical size=800 DISKPART> ... DISKPART> create partition logical size=500 ``` -------------------------------- ### Example: Creating an Instance with ORADIM Source: https://docs.oracle.com/database/121/NTQRF/create.htm Example of creating an instance named 'prod' with automatic startup and a specified PFILE. ```bash C:\> oradim -NEW -SID prod -STARTMODE auto -PFILE C:\app\username\admin\prod\pfile\init.ora ``` -------------------------------- ### Example RPM Installation Output Source: https://docs.oracle.com/iaas/management-agents/doc/install-management-agent-chapter.html This is an example of the output you might see when the management agent RPM is installed. It shows the progress and checks performed during the installation. ```text Preparing... ################################# [100%] Checking pre-requisites Checking if any previous agent service exists Checking if OS has systemd or initd Checking available disk space for agent install Checking if /opt/oracle/mgmt_agent directory exists Checking if 'mgmt_agent' user exists 'mgmt_agent' user already exists, the agent will proceed installation without creating a new one. Checking Java version JAVA_HOME is not set. Trying default path Java version: 1.8.0_281 found at /usr/bin/java Updating / installing... 1:oracle.mgmt_agent-################################# [100%] Executing install Unpacking software zip Copying files to destination dir (/opt/oracle/mgmt_agent) Initializing software from template Creating 'mgmt_agent' daemon Agent Install Logs: /opt/oracle/mgmt_agent/installer-logs/installer-log-0 Setup agent using input response file (run as any user with 'sudo' privileges) Usage:sudo /opt/oracle/mgmt_agent/agent_inst/bin/setup.sh opts=[RESPONSE_FILE] Agent install successful ``` -------------------------------- ### Example: Setting up directories and transferring a file Source: https://docs.oracle.com/database/121/ARPLS/d_ftran.htm This example demonstrates creating directory objects, granting necessary privileges, and then using the PUT_FILE procedure to transfer a file between databases. Ensure the user has read privileges on the source directory and write privileges on the destination directory. ```SQL CREATE OR REPLACE DIRECTORY df AS '+datafile' ; GRANT WRITE ON DIRECTORY df TO "user"; CREATE OR REPLACE DIRECTORY ft1 AS '+datafile/ft1' ; GRANT READ,WRITE ON DIRECTORY ft1 TO "user"; CREATE OR REPLACE DIRECTORY ft1_1 AS '+datafile/ft1/ft1_1' ; ``` ```SQL CONNECT user; Enter password: password -- - put a1.dat to a4.dat (using dbs2 dblink) -- - level 2 sub dir to parent dir -- - user has read privs on ft1_1 at dbs1 and write on df in dbs2 BEGIN DBMS_FILE_TRANSFER.PUT_FILE ( 'ft1_1' , 'a2.dat' , 'df' , 'a4.dat' , 'dbs2' ) ; END ; ```