Modeling PET 2015 Rev. 0.925 Start interrogating the PGPS well test database with SQL 2 What do you need to run SQL scripts? 1. Verify you have SQL Client installed 2. Verify your SQL Client runs 3. Verify that your SQL Client communicates with the PGPS database 4. Verify your scripts run and get data from PGPS
Modeling PET 2015 Rev. 0.925 Start interrogating the PGPS well test database with SQL Verify that your SQL Client is installed This is how you know you have SQL installed If you don’t have it, ask ICT to install it for you
Modeling PET 2015 Rev. 0.925 Start interrogating the PGPS well test database with SQL Verify your SQL Client runs Double-click on “SQL Developer” A screen like this should show up
Modeling PET 2015 Rev. 0.925 Start interrogating the PGPS well test database with SQL Verify communication with the PGPS database It is possible when you start the first time your SQL Client you won’t have a connection to PGPS Right-click on “Connection” and click on “New Connection” Enter data in this screen as shown below: • Username : PTDATA_PDMS • Password : ptdata_user1 • Hostname: pww.oracle.ep.petronas.com.my • Port: 1521 • Service name: pgpsprod Test and Save Your are done!
Modeling PET 2015 Rev. 0.925 Start interrogating the PGPS well test database with SQL Run your first SQL script Your first script will show you the names of the fields that are available in PGPS Click on the “SQL” icon on the menu bar and select “PGPS” This is your script window. Type your script here: SELECT DISTINCT(op_sub_area_code) FROM rv_pwel_result ORDER BY op_sub_area_code Enter this script in your script window: Hit the play button
Modeling PET 2015 Rev. 0.925 Start interrogating the PGPS well test database with SQL Viewing your results This is your output window. You will get your results here
Modeling PET 2015 Rev. 0.925 Start interrogating the PGPS well test database with SQL Explanation of the first script SELECT DISTINCT(op_sub_area_code) FROM rv_pwel_result ORDER BY op_sub_area_code This is for the field table Sort alphabetically by field
Modeling PET 2015 Rev. 0.925 Start interrogating the PGPS well test database with SQL Explanation of your second SQL script SELECT code, max(production_day) FROM rv_pwel_result WHERE code like 'TMBG%' GROUP by code ORDER by code Will show the well name Latest date of the test Code for the field Example: Find the date of the latest well test in all strings in Tembungo table script