Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.43 KB | None | 0 0
  1. Sve moguce sifre:
  2. VIRTUALKA: administrator / Passw0rd$
  3. ORACLE ADMIN USERS: sys, system / Manager1
  4. HOST LOGIN: administrator / Passw0rd$ ili mozda Passw0rd
  5. Global DB name: orcl/Manager1
  6.  
  7. Ulaz u bazu: https://localhost:1158/em
  8. User:sys Pass: Manager1 SYSDBA
  9.  
  10.  
  11.  
  12. ISHOD 6
  13. 1. – korisniku test1 dati admin privilegije da se moze prijaviti u Ent.Manager (Vjezba 2, stranica 8)
  14. 1. Pritisnite Setup u desnom-gornjem kutu na Database Home stranici.
  15. 2. Pritisnite na Administrators tab u lijevom izborniku. Prikazat će se lista Administratora.
  16. Pritisnite Create za dodavanje upravljačkih prava postojećem database korisniku . Stranica
  17. Create Administrator Properties će se prikazati.
  18. 3. U ovom karaku će mo dodijeliti prava administratiora OEM-a postojećem HR korisniku.
  19. Unesite vijednosti: Name: HR Email: ostavite prazan
  20. Napomena: Možete pritisnuti flashlight ikonu nakon polja Name za odabir nekog postojećeg
  21. database korinika kroz pop-up prozor. Pritisnite Review.
  22. 4. Create Administrator: Review page će se pojaviti. Pritisnite Finish.
  23. 5. Novo pridodani korisnik OEM-a će se pojaviti na Administrators stranici.
  24.  
  25. 2. – U Ent. Manager pohrani kao preferred credentials za Oracle instancu kor. Ime i pass za ORACLE korisnike „sys“ i „system“ i za WINDOWS korisnika „Administrator“. Provjeri da je ispravno (Vjezba 2, stranica 15)
  26. Možete postaviti preferiranog korisnika za pristup Enterprise Manageru koji će se automatski
  27. koristiti za prijavu za obavljanje upravljačkih poslova na instanci kao što su backup i recovery.
  28. Radi sigurnosti, Oracle preferira spremanja vjerodajnice u šifriranom modu. Možete postaviti
  29. željenu vjerodajnice Enterprise Manager-a obavljanjem sljedećih koraka:
  30. 1. Pritisni Preferences na vrhu početne stranice.
  31. 2. Pojavit će se stranica Preferences. Pritisnite Preferred Credentials u lijevom tabu.
  32. 3. Pojavit će se stranica Preferred Credentials. Pritisnte ikonu Set Credentials za the Database
  33. Instance Target Type.
  34. 4. Pojavit će se stranica Database Preferred Credentials page. Unesite tražene username i
  35. password za pristup kao tip usera normal, SYSDBA usera i serverskog usera. Pritisnite Test.
  36. 5. Dobit će te poruku o uspješnosti testa i vaše vjerodajnice su verificirane. Pritisnite Apply za
  37. spremanje preferiranih vjerodajnica.
  38.  
  39. 3. – Kreiraj blackout s parametrima: (Vjezba 2, stranica 11)
  40. a) Name: Poslovi odrzavanja
  41. b) Comments: Spustanje baze radi odrzavanja
  42. c) Reason: DB: Database Cloud Backup
  43. d) Omogućite izvršavanje job-ova za vrijeme blackouta
  44. e) Target je Oracle database instance orcl
  45. f) Blackout se postavlja jednokratno, pocinje sa sutrasnjim datumom u 10 sati prije podne i traje 5 sati
  46. Kad planirate spuštanje bazu podataka zbog održavanja, možete naznačiti da ne želite da
  47. OBAVIJESTI o tome bude poslana administratorima OEM-a, tako da definirate Blackout razdoblje. To
  48. će vam omogućiti vam da se suspendira praćenje rada baze od strane OEM agenta kako bi se
  49. obavljati i druge operacije održavanja. Možete odrediti vrijeme Blackout-a kroz Enterprise Manager
  50. izvođenjem sljedećih koraka:
  51. 1. Pritisnite Setup u desnom-gornjem kutu na Database Home stranici, i pritisnite Blackouts u
  52. lijevom tabu.
  53. 4. Kada se pojavi Blackouts stranica pritisnite Create za pokretanje Create Blackout wizarda.
  54. Unesite naziv vašeg blackout-a u za to predviđeno polje. Možete i dodati komentar, no to polje
  55. nije obavezno za unos. Odaberite razlog za definirani BLACKOUT, npr DB Database Patch…
  56. Odaberite Database Instancu u drop-down izborniku od dostupnih Targeta. Pritisnite NEXT.
  57. 3. Pojavit će se Create Blackout: Schedule page. Unesite početno vrijeme kada planirate
  58. blackout, ili odaberite immediately ako želite odmah spustiti odabranu instancu. Odaberite
  59. vrijeme trajanja ili postavite indefinite, ili unesite vrijeme do kada će trajati vaš blackout. Za
  60. Repeating prihvatite predloženu vrijednost "Do Not Repeat" ili odaberite frekvenciju
  61. ponavljanja. Pritisnite Next.
  62. 4. Pojavit će se Create Blackout: Review page. Provjerite unesene podatke i ako je sve
  63. uneseno točno pritisnite Finish. Možete se i vratiti ukoliko želite promijeniti neke postavke
  64. vašeg BLACKOUT-a.
  65. 5. Kada je BLACKOUT kreiran dobit će te potvrdnu poruku.
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73. ISHOD 7
  74. 1. – Konfiguriraj Local Service Naming pomocu Oracle Net Manager s parametrima:
  75. a) Net Service Name: testorcl
  76. b) TCP/IP (Internet protocol)
  77. c) Host Name: localhost
  78. d) Port Number: 1521
  79. e) Service Name: orcl
  80. Testiraj konfig. tako da se prijavis u bazu kao korisnik system. Kod izlaska sacuvaj promjene.
  81. (Vjezba 3, stranica 6)
  82.  
  83. Configuring Local Naming Using Net Manager
  84. You must configure a client machine so it can connect to an Oracle database. You must first install Oracle
  85. Database client software, which includes Oracle Net software. Once you have installed Oracle Net, you can use
  86. Oracle Net Manager to configure a net service name using the local naming method as follows:
  87. 1. On UNIX or Linux, invoke Oracle Net Manager by entering netmgrat the command line.
  88. The Welcome window appears. On Windows invoke Oracle Net Manager by
  89. Start Menu->Programs->Oracle->OraDb11g_home1->Configuration and Migration Tools->Net Manager
  90. 2. Expand Local and select Service Naming. Click the (plus) + on the left hand side of the page.
  91. 3. Click Edit > Create.
  92. 4. The Net Service Welcome window appears. Enter a net service name. Click Next.
  93. 5. Select the protocol to use to connect to your database. You can accept the default TCP/IP (Internet
  94. Protocol). The database listener must be configured to use the same network protocol. Click Next
  95. 6. Enter the host name of the database machine. Click Next.
  96. 7. Enter the database service name. In addition, select a Connection Type, either Shared or Dedicated. If
  97. you are not unsure or would like to use the default database connection type, select Database Default.
  98. Click Next.
  99. 8. The last window of the wizard enables you to test the connection using the information you entered.
  100. Click Test.
  101. 9. By default, the user named SCOTT is used for the test. If this account is locked as shown in the example,
  102. you can change the default login by clicking Change Login and entering a different username and password.
  103. Click Change Login.
  104. 10. Enter a username and password to test the connection. You can use system with the password of oracle.
  105. Click OK.
  106. 11. Click Test.
  107. The wizard tells you if the connection test succeed or not. Click Close. Click Finish.
  108. The new service appears under the Service Naming folder. You can view or modify the configuration for the
  109. highlighted service under Service Identification and Address Configuration.
  110. Save your changes and exit out of Oracle Net Manager window by clicking File -> Save Network
  111. Configuration and then File -> Exit.
  112.  
  113. 2. – Pronađi i ispisi nazive redo log datoteka orcl baze i direktorija u kojem se nalaze (Vjezba 5, stranica 2-7)
  114. …stranica 7 => …Return to the Server page by clicking
  115. the database link at the top of the page.
  116. 5. Click Redo Log Groups on the Server page to access the Redo Log Groups
  117. property page. The Redo Log Groups page shows the attributes of the redo log
  118. groups for your database.
  119.  
  120. 3. – Kreiraj tablespace tstest u bazi orcl i dodajte mu datoteku tstest01.dbf velicine 5MB. Omogucite autoextend za tu datoteku s inkrementom od 300KB. (Vjezba 5, stranica 9)
  121. In this section you will learn how to create a new tablespace for your database.
  122. Perform the steps listed below to create the FSDATAtablespace. This tablespace
  123. will be used to store
  124. the tables of your database. Repeat these steps to create the FSINDEX tablespace
  125. which will be used for storage of the indexes in your database.
  126. 1. Click Tablespaces on the Server page to access the Tablespaces property page.
  127. Click Create.
  128. 2. The Create Tablespace page appears. Enter FSDATA in the Name field. Select
  129. Locally Managed under the Extent Management heading. Select Permanent
  130. under the Type heading. Select Read Write under the Status heading. Click Add in
  131. the Datafiles region of the page.
  132. 3. The Add Datafile page appears. Enter a file name in the File Name field on the
  133. Add Datafiles page. Accept the defaults for the File Directory and File Size or enter
  134. new values. Select the option Reuse Existing File. Select Automatically extend
  135. datafile when full (AUTOEXTEND) and specify an amount in the Increment field
  136. by which you want to extend the datafile each time it fills. Click Continue.
  137. 4. You are returned to the Create Tablespace General page. Click the Storage tab.
  138. 5. The Storage page appears. Accept all of the defaults on the Storage page. Click
  139. OK to create your tablespace.
  140. 6. You are returned to the Tablespaces page where you receive a confirmation of
  141. the creation of the tablespace. You can view your new tablespace in the Results
  142. region.
  143. 7. Repeat steps 2 through 6 to create the FSINDEX tablespace. This tablespace will
  144. be used to store the indexes in your database. Return to the Server page by clicking
  145. the database link at the top of the page.
  146.  
  147. 4. – Pronađite i napisite velicinu undo tablespace u bazi orcl i koliki je undo retention. (Vjezba 5, stranica 2)
  148. Using the Undo Advisor The undo tablespace is set to auto-extend by default when
  149. you use DBCA to configure your database. If your undo tablespace is not auto-
  150. extensible, you may need to extend the tablespace. You can use the undo advisor to
  151. obtain advise on the undo tablespace size. You can access the undo advisor as
  152. follows:
  153. 1. Click Automatic Undo Management in the Database Configuration region
  154. to access the Automatic Undo Management page.
  155. 2. The Automatic Undo Management page is displayed. Scroll down the page
  156. to the Undo Advisor section. Click on the Analysis Time Period drop-down
  157. menu and select Last One Day. Click Run Analysis.
  158. 3. The Analysis Results are displayed. Click Show Graph to view a graphical
  159. representation.
  160. 4. The tablespace size required to meet your specifications is displayed in the
  161. Analysis section as well as a graphical representation of this information.
  162.  
  163. ISHOD 8
  164. 1. – Kreirajte pomocu Enterprise Managera korisnika u orcl bazi sa sljedecim parametrima:
  165. a) Username: orausr1
  166. b) Password: 2daydba
  167. c) Profile: ispit
  168. d) Default tablespace: ts1
  169. e) Temporary Tablespace: temp
  170. f) Status: unlocked
  171. (Vjezba 6, stranica 1 )
  172. Follow the steps below to create the FSOWNER user:
  173. 1. Log in to Enterprise Manager Database Console by opening your browser and specifying the SYS username
  174. and password.
  175. Click Login.
  176. 2. Navigate to the Server page. Click Users in the Security section.
  177. 3. The Users property page appears. Click Create.
  178. 4. The Create User General page appears. Enter the following values in the fields:
  179. Username: FSOWNER
  180. Password: FSOWNER
  181. Default tablespace: FSDATA
  182. Temporary tablespace: TEMP
  183. Status: Unlocked
  184. Click OK.
  185. 5. The Users property page is displayed with an Update message confirming the creation of your user.
  186. You can also see the new user by scrolling down the page. Click the Database link to return to the Server page.
  187.  
  188.  
  189. 2. – Kreirajte pomocu Enterprise Managera korisnika u orcl bazi sa sljedecim parametrima:
  190. a) osobni_broj number(6)
  191. b) ime varchar2(30)
  192. c) prezime varchar2(30)
  193. d) datum_rodj date
  194. e) mjesto_rodj varchar2(30)
  195. f) post_broj number (5)
  196. g) ulica varchar2(40)
  197. h) kucni_broj number(4)
  198. (Vjezba 7, stranica 8)
  199. Creating a New Table
  200. In this section you will create three new tables for your database: EMPLOYEES, CUSTOMERS, and ORDERS.
  201. 1. Click Create on the Tables property page.
  202. 2. The Create Table: Table Organization page appears. Select Standard, Heap Organized and click Continue.
  203. 3. The Create Table page appears. Enter employees in the Name field. Enter fsowner in the Schema field.
  204. Enter fsdata in the Tablespace field. Define the columns as follows and click Add 5 Table Columns.
  205. Name: EMPLOYEE_ID, Data Type: NUMBER, Size: 6
  206. Name: FIRST_NAME, Data Type: VARCHAR2, Size: 20
  207. Name: LAST_NAME, Data Type: VARCHAR2, Size: 25
  208. Name: EMAIL_ADDRESS, Data Type: VARCHAR2, Size: 25
  209. Name: PHONE_NUMBER, Data Type: VARCHAR2, Size: 20
  210. 4. Enter the remaining columns as follows:
  211. HIRE_DATE DATE
  212. JOB_ID VARCHAR2(10)
  213. SALARY NUMBER(8)
  214. MANAGER_ID NUMBER(6)
  215. Click Constraints.
  216. 5. The Constraints page appears. Select PRIMARY from the drop‐down list and click Add.
  217. 6. The Add PRIMARY Constraint page appears. Enter emp_id_pkin the Name field. Select EMPLOYEE_ID in the
  218. Available Columns list. Click Move to select it. Click Continue.
  219. 7. The Create Table page appears. Click OK.
  220. 8. The Tables page appears with an Update message indicating your table has been created.
  221. 9. Repeat steps 2 through 8 to create the CUSTOMERS and ORDERS tables in the FSOWNER schema as defined
  222. below. Name the primary key for the Customers table, CUST_ID_PK, and for the Orders table, ORD_PK_ID.
  223.  
  224.  
  225.  
  226. 3. – Dodijeli korisniku Oracle baze orausr1 neogranicenu kvotu diskovnog prostora u tablespace ts3
  227. (Vjezba 6 , stranica 5)
  228. Changing User Attributes
  229. In this section you will learn how to change user attributes. The FSOWNER user will create objects in the
  230. database and needs to have quota on the FSDATA tablespace to create objects in it.
  231. Perform the steps listed below to enable the FSOWNER user to create objects in the FSDATA tablespace:
  232. 1. Click Users in the Security section on the Server page to access the Users property page. Select FSOWNER in
  233. the results list and click Edit.
  234. 2. The Edit User General page is displayed. Click Quotas to display the Quotas page.
  235. 3. Select Unlimited from the Quota drop‐down menu for the FSDATA tablespace. Click Apply.
  236. 4. The Edit User page appears with an Update message confirming your change. Note the quota value of ‐1
  237. indicating Unlimited.
  238. Click the Users link to return to the Users property page.
  239.  
  240. 4. – Kreirajte pogled nad tablicom osobe u shemi test2 u bazi sa sljedecom select naredbom:
  241. select ime, prezime from osobe where post_broj=10000(Vjezba 7, stranica 26 )
  242.  
  243. Creating a New View
  244. Perform the steps listed below to create a new view:
  245. 1. Click Create on the Views property page.
  246. 2. Enter the following information and click OK.
  247. View name: CLERK10_ORDS
  248. Schema: FSOWNER
  249. Query text:
  250. SELECT order_id, customer_id, order_total FROM orders WHERE sales_clerk_id = 10
  251. 3. The Views page is displayed confirming the creation of your view.
  252. Click the Database Instance link to return to the Schema page.
  253.  
  254. ISHOD 9
  255. 1. – U Oracle bazi konfigurirajte flash recovery area velicine 1GB koji se nalazi u direktoriju c:\Oracle\fast_recovery_area
  256. (Vjezba 8, stranica 2)
  257.  
  258. 1. At the operating system prompt, increase the size for the backup and recovery areas. Execute the
  259. following commands:
  260. sqlplus system/oracle
  261. alter system set db_recovery_file_dest_size=8G scope=both;
  262. exit
  263.  
  264. 2. At the operating system prompt, create a directory for the flash recovery area. Execute the following
  265. commands:
  266. cd $ORACLE_BASE
  267. mkdir flash_rec_area
  268. 3. Log in to Enterprise Manager Database Console by opening your browser and specifying the SYS
  269. username and password as SYSDBA. Click Login.
  270. 4. Click Availability on your Oracle Database Home page.
  271. 5. Select Recovery Settings in the Backup/Recovery Settings section. You can use the Recovery
  272. Settings page to configure the settings for the recovery utility, including the Flash Recovery Area.
  273. 6. The Recovery Settings page appears. Scroll to the Flash Recovery section. If the flash recovery area
  274. is not enabled for your database, configure the flash recovery area by entering the following values in
  275. the appropriate fields:
  276. Flash Recovery Area Location: <directory you created in step 1>
  277. Flash Recovery Area Size: 8 GB
  278. 7. Scroll up to the top of the window. Check ARCHIVELOG Mode to configure ARCHIVELOG
  279. mode for your database. Click Apply.
  280. 8. The Verify Flash Recovery Area Location: Specify Host Credentials window appears. Enter the host
  281. credentials to ensure appropriate access has been granted. Click Continue.
  282. 9. A message confirming your changes is displayed. To complete the configuration of ARCHIVELOG
  283. mode, the database instance must be shut down. Click Yes to shut down the instance and restart it.
  284. 10.The Restart Database:Specify Host and Target Database Credentials page is displayed. Enter your
  285. host credentials and database credentials. Click OK.
  286. 11.The Restart Database:Confirmation page is displayed. Click Yes to shut down the instance and restart
  287. it.
  288. 12.The Restart Database:Activity Information page is displayed. Click Refresh to log in to Enterprise
  289. Manager Database Control and log back into Enterprise Manager once the database has been
  290. restarted.
  291. 2. – Postavite backup postavke za bazu sa sljedecim vrijednostima parametara:
  292. a) Parallelism:2
  293. b) Disk Backup Location: flash recovery podrucje
  294. c) Disk Backup type: Image Copy
  295. d) Automatically backup control file i server parameter file
  296. e) Retain backups: 20 dana
  297. (Vjezba 8, stranica 8)
  298. You can configure a number of settings and policies that determine how backups are stored, which data is
  299. backed up, how backups perform, and how long backups are retained before being purged from the
  300. recovery area. You can also configure features to improve backup performance.
  301. 12.The Restart Database:Activity Information page is displayed. Click Refresh to log in to Enterprise
  302. Manager Database Control and log back into Enterprise Manager once the database has been
  303. restarted.
  304. 1.Click Availability on your Oracle Database Home page.
  305. 2.Select Backup Settings in the Backup/Recovery Setup section.
  306. 3.Scroll to the Host Credentials region on the Backup Settings page. Enter the operating system
  307. username and password. Scroll up to the Disk Settings section.
  308. 4.Accept the value of 1 in the Parallelism field. The Disk Backup Location field is set to null so that the
  309. flash recovery area will be used for backups. Select Backup Set for Disk Backup Type. Click Test
  310. Disk Backup.
  311. 5.A message is displayed indicating the disk settings backup test was successful. Now you will
  312. configure backup policy settings. Click Policy to access the Policy page.
  313. 6.Select Automatically backup the control file and server parameter file (SPFILE) with every
  314. backup and database structural change. Select Optimize the whole database backup by
  315. skipping unchanged files such as read-only and offline datafiles that have been backed up.
  316. Select Enable block change tracking for faster incremental backups. Enter a file name for the
  317. Block Change Tracking file. Then scroll down to the Retention Policy section.
  318. 7.Select Retain backups that are necessary for a recovery to any time within the specified number
  319. of days (point-in-time recovery) and accept the default of 31 days. Under the Archivelog Deletion
  320. Policy, select Delete archivelogs after it has specified number of backups and accept the default
  321. of 1 backup. Click OK. You are returned to the Availability page.
  322.  
  323. 3. – Pronadji u bazi vrijednosti za db_unique_name i dbid i napisite ih
  324. (Vjezba 8, stranica 11)
  325. 1.Click the Server tab. Click Initialization Parameters in the Database Configuration region.
  326. 2.The Current property page appears. Enter db_unique_name in the Name field and click Go.
  327. 3.The resulting page displays a row with db_unique_name in the Name column, and the
  328. db_unique_name value for your database in the Value column.
  329. Record this value so that you will have it should you need it in the future for a recovery operation.
  330. Click the Database Instance link to return to the Server page.
  331. Perform the steps below to determine your DBID:
  332. 1.Click Control Files in the Storage region of the Server page.
  333. 2.The Control Files property page appears. Select the Advanced property page.
  334. 3.The Database ID field contains the DBID value. (Note: Your machine will have a different value).
  335. Record this value so that you will have it should you need it in the future for a recovery operation.
  336. Click the Database Instance link to return to the Server page.
  337.  
  338. 4. – Omogucite row movement za tablicu bonus kojoj je vlasnik korisnik test2
  339. (Vjezba 8, stranica 27)
  340. You must enable row movement on a table in order to perform a flashback table operation on the table. In
  341. this section you enable row movement on the HR.EMPLOYEES table.
  342. 1.Click the Schema tab.
  343. 2.Select Tables in the Database Objects section.
  344. 3.The Tables page appears. Enter HR in the Schema field and REGIONS in the Object Name field.
  345. Click Go.
  346. 4.The REGIONS table is displayed in the Results section. Click Edit.
  347. 5.The Edit Table page appears. Click the Options tab.
  348. 6.Select Yes from the Enable Row Movement list. Click Apply.
  349. 7.You receive a message indicating your table has been successfully modified. Click the Tables
  350. breadcrumb.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement