Upload
bryan-watson
View
221
Download
0
Tags:
Embed Size (px)
Citation preview
Setting up of an Oracle Database Setting up of an Oracle Database for testing purposesfor testing purposes
Quick guideline for ALICE Detectors
(http://alicedcs.web.cern.ch/AliceDCS/)
Svetozár Kapusta(CERN/Comenius University Bratislava)
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
OutlineOutline
This presentation: Contains many appendixes with technical details Available also on the ALICE DCS homepage (
http://alicedcs.web.cern.ch/AliceDCS/)
Get the Oracle Database server software Set up an Oracle server Get the Oracle Database client software Set up the Oracle client Configure PVSS to archive to the Oracle
Database (preliminary and in the appendix)
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
Get the Oracle Database server Get the Oracle Database server softwaresoftware
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
Server RequirementsServer RequirementsRAM: 1 GB minimumVirtual memory: 512 MBHard disk space: ~2.8 GBTemp disk space: 140 MBVideo adapter: 256 colorWindows version 4.0, 5.0, 5.1, 5.2 orLinux version x86 orOther OS (Mac OS X, Solaris, AIX5L, IBM...)
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
License Agreement
We (Oracle) grant you a nonexclusive, nontransferable limited license to use the programs only for the purpose of developing a single prototype of your application, and not for any other purpose.
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
DownloadingDownloading
~ 600MBTime for registration + download +
unziping ~ 1-2h
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
InstallingInstalling
No restart neededNo “full” uninstallation possible
Installation types:Basic ~1hAdvanced (Select: Installation Type, DB
Configuration, Management, File Storage, Backup and Recovery Options) ~1.3 h
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
http://www.oracle.com/technology/obe/2day_dba/install/install.htm
Basic InstallationBasic Installation
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
Security, Users, PrivilegesSecurity, Users, Privileges
Pick a good password for SYS, SYSTEM, DBSNMP and SYSTEM accounts and/or
restrict web access from outsideIf you need to use the database not only for
PVSS – grant only necessary privileges to users
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
Creating usersCreating users Connect to your database Type and run SQL query:
– CREATE USER "SPDUSER" PROFILE "DEFAULT" IDENTIFIED BY “USERPASS" DEFAULT TABLESPACE "USERS" TEMPORARY TABLESPACE "TEMP" ACCOUNT UNLOCK
– GRANT UNLIMITED TABLESPACE TO " SPDUSER“– GRANT "CONNECT" TO " SPDUSER“– GRANT "RESOURCE" TO " SPDUSER “– GRANT ALTER SESSION TO " SPDUSER “– GRANT CREATE MATERIALIZED VIEW TO " SPDUSER “– GRANT CREATE SYNONYM TO " SPDUSER “– GRANT CREATE TABLE TO " SPDUSER “– GRANT INSERT ANY TABLE TO " SPDUSER “– GRANT SELECT ANY DICTIONARY TO " SPDUSER “– GRANT SELECT ANY TABLE TO " SPDUSER “– GRANT UPDATE ANY TABLE TO " SPDUSER “
Or: http://localhost:5500/em
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
Get the Oracle Database client Get the Oracle Database client software and configure the clientsoftware and configure the client
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
Configuring the client 1Configuring the client 1
Download the basic and SQL *plus packages Unzip to a directory (c:\instantclient) SET User variable SQLPATH=c:\
instantclient SET User variable TNS_ADMIN=c:\
instantclient SET System variable PATH=c:\instantclient Copy tnsnames.ora to c:\instantclient
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
Configuring the client 2Configuring the client 2
Edit tnsnames.ora:
DCS006 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.39.6)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = DCSDEV.ALIDCS.CERN.CH) (INSTANCE_NAME = DCSDEV) (GLOBAL_NAME = DCSDEV.ALIDCS.CERN.CH) ) )
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
ConclusionsConclusions
Setting up of an Oracle Database for testing purposes is easy
We plan to start performance tests in the DCS lab with many clients
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
Slides not shownSlides not shown
The following slides were not shown in the presentation but were used in discussions afterwards
An Internal note will explain the topics described in these slides
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
Oracle TerminologyOracle Terminology
SchemaTableTablespaceIndexViewMaterialized viewSynonym
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
Configuring the DB server for Configuring the DB server for PVSS 1PVSS 1
New environment variable:ORACLE_HOME=your_oracle_home_pathCopy the file (PVSSOraExt.dll for win,
PVSSOraExt.so for linux) contained in the PVSS patch to your_orahome\BIN
Create directories archive_path\– alert– backup– event– history
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
Configuring the DB server for Configuring the DB server for PVSS 2PVSS 2
Edit tnsnames.ora in the orahome\NETWORK\ADMIN directory
your_connect_identifier = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = host)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = service_name) ) )
EXTPROC_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC)) ) (CONNECT_DATA = (SID = PLSExtProc) (PRESENTATION = RO) ) )
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
Configuring the DB server for Configuring the DB server for PVSS 3PVSS 3
Edit listener.ora in the orahome\NETWORK\ADMIN directory SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = orahome) (PROGRAM = extproc) (ENV="EXTPROC_DLLS=ANY") ) (SID_DESC = (GLOBAL_NAME = global_name) (ORACLE_HOME = orahome) (SID_NAME = sid_name) ) )
LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = host)(PORT = 1521)) ) (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC)) ) ) )
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
Configuring the client for PVSS 1Configuring the client for PVSS 1 Patch PVSS up to patch 45 Unzip rdbsetup from PVSS patch Edit rdb_arcsite.sql: begin -- lokal92@liwrk024 -- 1. ArchiveControl.CreateSite('dcsdev', 'dcs006', '192.168.39.6', 'd:\oracle10g\pvss\backup\'); -- 2. i := ArchiveControl.SetConfig('def_dbfile_path', 'C', 'd:\oracle10g\pvss\history\'); dbms_output.put_line('Setting Default Database File Path Returned: '||i); -- create standard groups i := ArchiveControl.CreateNewGroup('ALERT','ALERT', 'd:\oracle10g\pvss\alert\'); dbms_output.put_line('Anlage dynamisch ALERT: '||i); i := ArchiveControl.CreateNewGroup('EVENT', 'EVENT', 'd:\oracle10g\pvss\event\'); dbms_output.put_line('Anlage dynamisch EVENT: '||i); ArchiveControl.Init_Jobs; end; / commit;
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
Configuring the client for PVSS 2Configuring the client for PVSS 2 Run setup.bat
Create new PVSS project Kill all archive managers Append new manager (rdb archive manager)
with option –num 99, start mode manual
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
Configuring the client for PVSS 3Configuring the client for PVSS 3 Edit the config file:
useRDBArchive = 1
[ValueArchiveRDB] dbuser = "pvssa" dbtype = "oracle" db = "dcs006"
[ui] queryRDBdirect = 1 CtrlDLL = "CtrlRDBArchive.dll" CtrlDLL = "CtrlRDBCompr.dll"
[ctrl] queryRDBdirect = 1 CtrlDLL = "CtrlRDBArchive.dll" CtrlDLL = "CtrlRDBCompr.dll"
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
Configuring the client for PVSS 4Configuring the client for PVSS 4 Run the project Edit the internal datapoint _rdbarchive – Set the host, user and password as chosen
after running setup.bat
Restart PVSS
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
DB AccessDB Access
Web access for DB users and administrators (called Enterprise Manager Console)
Web access with own code (PHP-Apache)
C++ access based on ADO
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
PHP-Apache-Oracle10gPHP-Apache-Oracle10g <?php if ($c=OCILogon("scott", "tiger", "dcsconf")) {echo "Successfully connected to
Oracle.<br>"; $stmt=OCIParse($c, "select * from scott.dcs"); OCIExecute($stmt, OCI_DEFAULT); while (ocifetchinto($stmt, $row, OCI_BOTH)) { echo $row[0]." and ".$row['ID']." is the same<br>"; echo $row[1]." and ".$row['CISLO']." is the same<br>";} echo ocirowcount($stmt) . " rows<br />"; $committed = OCICommit($c); if (!$committed) {$error = OCIerror($c); echo 'Commit failed. Oracle reports: ' . $error['message'];} OCILogoff($c);} else { $err = OCIError(); echo "Oracle Connect Error " . $err[text]; } ?>
28.02.2005 ALICE DCS Workshop Svetozár Kapusta
C++ ADO Oracle10gC++ ADO Oracle10g connstring[]="Driver={Microsoft ODBC for Oracle};"; CREATEiNSTANCE(spCON,Connection); spCON->ConnectionString = connstring; spCON->Open("DSN=dcsconf","scott","tiger",0); CREATEiNSTANCE(svetest,Recordset) svetest->PutRefActiveConnection( spCON ); sprintf(a, "SELECT * FROM scott.dcs"); svetest->Open(a, vtMissing,adOpenKeyset,adLockOptimistic, -1); svetest->MoveFirst(); while(svetest->adoEOF == false) { ID=(unsigned long)RsITEM(svetest,"ID"); svetest->MoveNext();} svetest->Close();