What do you do? Best practices

Hi all

As always when I come to this point in PL/SQL and the database development I ask myself what to do. So I ask you guys and girls what do you do when you come to the same point I did.

Here's a few example

COM_TO_DO_STATUS table with values

1. OPEN

2 SOCKETS

3. CLOSE

1 question. Here, I have two options, I can create table like this and FK in my table of master or I can do in the columns of the table main varchar2 (5) status with the constraint checking on these values. What do you do?!

With this I know something, if I need to add new status in a case, I need to insert data into another I need to modify the check constraint, but bear in mind these data or value will affect my business logic (sometimes I need to hardcode them in my store of procedures).

Lets say now, I name PKG is COM_TO_DO_PKG and procedure

for the first case of superior signature is p_send_to_status (p_to_do_id p_status_id number, number)

for the second case of superior signature is p_send_to_status (p_to_do_id number, p_status_id in varcahr2)

2. question. Now I have also two options here, I can create 3 constants in this pkg

c_status_open_taks number (1) 1 default constant

c_status_taken_taks number (1) default constant 2

c_status_close_taks number (1) default constant 3

or for the second case

c_status_open_taks varchar2 (5) default constant 'OPEN '.

c_status_taken_taks varchar2 (5) default constant "TAKEN."

c_status_close_taks varchar2 (5) default constant "CLOSE."

with this I'm not avoiding to a certain level of hard coding in the stored procedure, for example

the call to this procedure will be like COM_TO_DO_PKG. P_SEND_TO_STATUS (some id, COM_TO_DO_PKG. C_STATUS_CLOSE_TAKS);

lets say as if I get IF the declaration code will be as IF L_STATUS = COM_TO_DO_PKG. C_STATUS_OPEN_TASK THEN...

BUT if I need to hardcode the opinion, I can't use this constants so is there any point with this approach. What do you do?!

3. question. In this example, I only have 3 value, what happens if you have more like 15 or 20. What do you do?!

4. question. Sometimes business logic will change, so I need to add an additional value. In this case what will be the best approach?

OK guys thanks for your time and sharing of experience.

PS Sorry if my English is not better.

Thank you.

The "scope" of the solution depends on the magnitude of the problem.

One of the best "solutions" I used is a combination of techniques:

1 put the data in a table owned by a GLOBAL user research

2 making this READ ONLY table

3 grant privileges to users/roles that needs a direct access table

4. create GLOBAL SYS_CONTEXT features

5. implement a start trigger that load the global context information

6 implement the specific maintenance features for maintaining the table of primary research and the global context

7 create views, if necessary, use the values of the global context

The strategy above allows you to use almost ANY combination of what you are already thinking but provides the reach OVERALL, necessary to allow access to multiple applications/patterns to the same set of 'constant '.

Steps 1-6 above are used to restrict changes to the table to a user/schema/code carefully controlled to ensure that the framework is in harmony with the data in the table.

In other words, you cannot allow any user to manually manipulate the data of lookup table.

Once the foregoing contains you can use one or all, suggestions that others do.

COM_TO_DO_STATUS table with values

1. OPEN

2 SOCKETS

3. CLOSE

1 question. Here, I have two options, I can create table like this and FK in my table of master or I can do in the columns of the table main varchar2 (5) status with the constraint checking on these values. What do you do?!

None of those.

You use a table with a key substitution based on a sequence:

create table COM_TO_DO_STATUS (batch NUMBER generated always as identity, status VARCHAR2 (15))

Other tables use the batch column. One possible exception is in a data warehouse when there are use cases to denormalize the data (e.g. tables ready of the report). For these cases the real value of the SITUATION could be used.

Lets say now, I name PKG is COM_TO_DO_PKG and procedure

for the first case of superior signature is p_send_to_status (p_to_do_id p_status_id number, number)

for the second case of superior signature is p_send_to_status (p_to_do_id number, p_status_id in varcahr2)

Once again-, neither of those. This p_status_id is NOT just a number. It's worth a SPECIFIC column in the status table.

If it should be defined in this way

p_send_to_status (p_to_do_id number, p_status_id in COM_TO_DO_STATUS. BATCH TYPE %)

This makes it clear to developers EXACTLY what value is supposed to be. Even if Oracle will not, indeed cannot apply this rule, it helps to document.

lets say as if I get IF the declaration code will be as IF L_STATUS = COM_TO_DO_PKG. C_STATUS_OPEN_TASK THEN...

BUT if I need to hardcode the opinion, I can't use this constants so is there any point with this approach. What do you do?!

Cake using contexts

http://docs.Oracle.com/CD/E11882_01/server.112/e41084/functions184.htm#SQLRF06117

SELECT SYS_CONTEXT ('YOUR_GLOBAL_CONTEXT', 'STATUS_OPEN_TASK')

FROM DUAL;

. . .

If l_status = SYS_CONTEXT ('YOUR_GLOBAL_CONTEXT', 'STATUS_OPEN_TASK')

You can use contexts in view definitions. But you must make sure that the frame has already been loaded - from where the trigger for starting a load at startup

3. question. In this example, I only have 3 value, what happens if you have more like 15 or 20. What do you do?!

With the help of context which is IRRELEVANT!

The table and the context are a copy of the data. And it is better to have ONE copy in a global context, only one copy for each user package.

4. question. Sometimes business logic will change, so I need to add an additional value. In this case what will be the best approach?

That is why this table feature and the search context must be owned/controlled by a GLOBAL user. You can't allow anyone do however the table and changes whenever they want to.

You can certainly have a context for each application, if you need it, but the table itself changes are Records made using PL/SQL procedures and processes so that they can maintain the global context at the same time.

Once you have started to use (whether or not global) contexts for this you won't be back.

https://docs.Oracle.com/database/121/DBSEG/app_context.htm#DBSEG011

An application context stores the user identification, which can be used to allow or prevent users from having access to the data in the database. You can create different types of application contexts depending on where you want to control access: the application, at the global level, or the customer.

Tags: Database

Similar Questions

  • What is Microsoft's best practices and utilities available for conversions P2V and V2V for Hyper-V, without using SCVMM?

    As a Partner of MS we recommend Hyper-V as the platform of choice virtualation for our SME customers. What does Microsoft recomemend and are available for P2V and V2V for Hyper-V conversions without using SCVMM most SMEs do not have access to

    concerning

    David

    Hi David,
    I advise you to post this question using the link below.
    TechNet is for the professionals of the company and the server, so I don't know that anyone in this community will have some information about this.
    http://social.technet.Microsoft.com/search/en-us/?refinement=112&query=P2V%20and%20V2V%20conversions
    B Eddie

  • What would be the best practice to have several e-mail addresses of receipt forms distributed respondes?


    Hi all. I am currently using Acrobat 9 standard, and next year I'm going to switch to the standard Acrobat XI. I'm incharged to create forms pdf for different departments in my company. Each Department must follow responses signed these files through their own e-mail address. How can I achieve this instead of all having to come back to me? Thank you very much.

    What preferences? I was talking about the parameters of the Submit button in your file. It has nothing to do with the preferences of the application.

  • What is the new 'best practice' for suncing VM in Vsphere 4.0

    I'm using my DC as the source of time used to an external time source... which is always recommended?

    I have all the Windows virtual computer.

    fix.  Windows time service is set to automatic and started by default and the synchronization of comment tools is not.

  • What is the best practice to merge both vMware vSphere environments?

    We recently bought another company that also manages vMware 4.

    They have a 4-node cluster and we have a 3 a node. Each is managed by its own vcentre.

    What would be the best practice to migrate all the guests and the hosts on the server main vCentre.

    Thank you

    Lance

    I choose one of the vCenters, unplug and remove hosts from the other and connect them to those elected. Configure the cluster after that (all in the same or keep the separation of the group, which I think is the best)

    You can also use related modes.

    Marcelo Soares

    VMWare Certified Professional 310/410

    Master virtualization technology

    Globant Argentina

    Review the allocation of points for "useful" or "right" answers.

  • Canvas campaign best practices

    Hello my dear modern marketing. I wonder if you might be able to help out me. I'm hosting a Webinar this week on best practices of campaign canvas and even though I have a decent amount of material for the webinar, I'm sure there are a few other tricks, tips and best practices that you discovered that I have not taken into account. This webinar is for my marketing here at Intel security managers but I want to keep it generic enough so that it will apply to all the B2B marketing specialists who create campaigns in Eloqua. In this way, I can share it on Topliners for all to view/take advantage.

    So, what advice, tips, and best practices you have to share?

    Marking: Eytan Abrahams, freejung Michael Seto-Oracle, Kristin Farwell-Oracle mcalnan Mike McKinnon, schwartzrw, dliloia, hwhitehead, hdurante, jennifer.igartua first to us.

    P. S.

    PRICE!  Everyone who responds with a good tip or best practices, will win the #1 Prize and be entered in a drawing for the Grand Prize!

    Notes:

    Price #1 = un super hug

    Grand Prize = a Cross pen super-cool Oracle Cloud Marketing!

    Sterling Bailey-Oracle - huh, my answers were not useful? I got there first, so for that I am ready to plan this embrace.

  • Best practices for adding form fillable form designer EULA & forcing acceptance by the user

    What are created the best practices for adding a license agreement end user to a form with LiveCycle Designer. and to force the user to signify the acceptance of the EULA before access inside the form?

    Time, I have the kludged with a series of four message boxes (which is necessary because my LICENSE agreement, like most) is too long to fit in a single messageBox).  3 first message boxes have OK/Cancel buttons.  If the user clicks OK, she gets the following message EULA box; If she clicks cancel the form closes.  The last post (fourth) area a Yes/No buttons with the corresponding behavior.  It seems that the work (I think?), but it's ugly.  Is there an "easy way" to do it with a single drop-down dialog box "I agree" and "I refuse" custom buttons?

    I've seen references to Tools like this but they are marked as obsolete or abandoned due to security or other unspecified concerns.

    Best, Blake

    Another way might be, keep the form pages hidden at the beginning and only display a single page that has text box that contains the EULA with accept and refuse to scroll buttons. IF someone refuses, you can keep the rest of the hidden form or display message boxes to force acceptance of the EULA.

    If anyone agrees, you can simply hide the EULA page, and display form pages.

    I hope that used here too scripting required to reach it either.

  • Best practices of size font

    When determining the size of the basic content in a web page fonts, what is now considered best practices with regard to the definition of the font sizes in the CSS stylesheet?    Wouldn't be a specific size (e.g. 12 pt), or a percentage or em?  Just curious as to what is a common practice today because I remodel a previous website.  TKS.

    You can set pretty much your policy as you seem. If it is too small, your viewer increases just the size in their browser.

    For this reason, make sure that you stay away from the heights of css layout text containers. That can quickly cause enlarged extend beyond the container and blow out the design of the text (text goes out of its container) and the readability (text fields overlap) of your site.

    PT is a measure of printing, do not use it. Online you should use em (default is usually 16 pixels per 1 EM) or rem (although DW cannot support as currently in Design view). CSS units

  • 10 GB NIC redundancy-Best Practice

    Hi all

    I have now deployed successfully to the 5 different poles of vSphere using 4 x 1 GB network adapters on all servers to ESX/ESXi hosts. I used 2 active/passive NIC in vSwitch0 vMotion and network management traffic (or Service Console for ESX) and used 2 active/active NIC in vSwitch1 for VM traffic as shown below. The uplinks are using 802. 1 q trunks in redundant Cisco switches.

    We are now moving to 10 GB networks. I have the opportunity to use this same design of map NETWORK 4 (using the HP Flex 10 vNIC or cards Cisco Palo) or go with a simpler model of map NETWORK 2. What is the recommended best practice to separate VMkernel Port and port VM group traffic among the physical network interface cards? Any suggestions or links to published documents would be greatly appreciated of VMware.

    Thank you!

    ScreenHunter_01 Mar. 04 14.32.jpg

    Take a look at my post here.  https://www.myciscocommunity.com/message/63033#63033

    Can help you with your design questions.  There is also a generic 'best practice' guide for 10G networks & VMware environments.

    As Cisco I obviously partial to the Palo adapter.  Unlike the Flex-10 option you set up not a bandwidth 'max' virtual NETWORK card, rather, you set a guarantee min. for each virtual host NIC given that you can create multiple network cards virtual with Palo, you can create one for VMotion, VM data, IP storage, etc. and define your QoS guarantees quickly & easily while offering redundancy with the recovery of host-transparent fabric.

    Let us know if you have specific questions about a deployment.

    Kind regards

    Robert

  • Best practices MD3000i

    Hi group.

    I expect to get an idea of what would be the best practices for a MD3000i.  Here is a little history on our purchase.

    MD3000i with two controllers, 15-600 GB SAS 15 k RPM

    3 servers Dell R710 with built in 4 network cards, all the iscsi capable unloading.  Each server is dual core quad, 24 GB of ram each.

    We will only be endearing vsphere esx 4.0 to the San.

    We will moderate a general mix of virtual machines windows.  One of these virtual machines will be sql 2008 which should be light to medium capacity.  Two virtual servers will be citrix xen application servers.  The rest will be your garden variety domain controllers, point sharing, web servers, print servers.

    Basically, I think I know what I want to do, but am looking for validation or advice on what I could not have thougth.  I've never used the MD3000i before and besides, iscsi.  We have always been EMC fiber channel.

    So, I thought that a disk is a hot spare, leaving 14 left.  This is where I need a little advice.

    Is it wise to scratch the other disks in raid 10 for better overall performance?  Is - this 1 raid group or should I think about maybe 2 raid groups (disk 6 and 8 disk)?  RAID 10 will leave us with 4.2 TB of usable space, and it's more than enough for our needs.

    Then the next question is the lun size matter?  I see no valid reason to carve up LUN more than are really necessary.  On our EMC clarions we LUNS in all directions, but it is useful, as migrate us them and resize them all the time.  That was before provisioning and we also have no vmware servers attached to EMC for general sql clustering.

    The only other thing that I think would be good is to have a piece of storage dedicated to backups.  We investigate vizioncore for vm backups and I'd like to store backups here as well.

    Any notice or advice appreciated!

    Thanks in advance.

    To see LUN sizing:

    Best practices in designing LUN

    For the number of virtual disk on the storage, I suggest you keep at least 2 different RAID group with the other fixed disk.

    This because I assume that you have 2 controllers and MD3000i each VD can be 'active' on a single controller.

    So at least 2 different VD you can improve the performance by simpe together different controllers as a preferred owner.

    For more information on the MD3000i, see also:

    http://www.delltechcenter.com/page/VMware ESX4.0andPowerVault MD3000i

    André

  • Best practices for iscsi - esx4

    I am trying to determine what a good or best practice would be for this situation.  We have a Server Blade esx4 so in vmware, it is already connected to our system of back-end storage.  I want to know is this:

    Can I install the iscsi initiator on the side of the OS (software) to connect and make a second drive (d:\) in this way I can push the disc, etc.  and also still available for failover, etc...

    Or is there a different way or advised to do this.

    Thank you

    Yes, you are right.

    Create a new data store (if that's what you want to do). Present this data store for all your hosts in your Cluster. Add a new disk to the virtual machine, specify the size of the drive, and then choose where you want the VMDK to be stored. You want to store this particular VMDK on the new data store that you just introduced.

    Your .vmx file will know where to find this VMDK at startup.

    Once the data store is visible to all the hosts, then he will be protected by HA (if you have HA as a feature under license)

  • Computer configuration virtual for SRM - files from memory Swap file/Virtual - best practice replication?

    Hello, I am very new to the model DR VMWare and have a few persistent questinos.

    What is the recommended best practice re: virtual computers invited windows and virtual memory files.  I think it would be unnecessary to replicate these changing data on the DR site.  I have several virtual machines with 6-8gig memory and I'm just wondering how can I isolate the ESX memory swap files and virtual memory in Windows feedback, so they get not replicated on the Dr site as often as changing os/data.  If it's even necessary to replicate.

    We use vspere vcenter 4.1 related modes, RS 4.1 the two on-site Cellera NX4 ReplicatorV2.

    I wonder if I can install the files of pages to be in a condition NOT replicated file system or a file system which is the only value replicates every 24 hours, or once a week.

    My reasoning here is.  Once the file is there, the operating system really cares about the changes in this file and dumps windows virtual memory on a restart, as well as the .vswp file.

    what I mean is built on a virtual disk full and placing the windows file on this virtual disk to Exchange.  This virtual disk could exist in a data store hosted on a celerra file system that does not get repeated as frequently as data/OS file systems.

    or am I completely off base here.

    I think that if you tried to reproduce these files and maintain a sync time minute 10, you would need a ton of bandwidth.

    any suggestions or recommendations or even pointers to Articles/items worth points = D.

    Thanks for your time.

    Given that the configuration is made at the level of the cluster and has no impact on the SRM, replication is not a factor.  Don't forget, not to replicate the LUNS with the swap, just files have a LUN configuration on the side of recovery as well and have this defined cluster Exchange files.  Also, on the virtual machine critical we define reservations memory so the pagefile is not a factor at all.

    Kind regards...

    Jamie

    If you found this information useful, please consider awarding points to 'Correct' or 'useful '.

    Remember, if it isn't one thing, it's your mother...

  • Best practices for backup service console configuration

    Hello

    When you install our ESX servers, I did what I thought was best practices and created a "backup" vswitch with a second service console. Two service consoles have IP addresses on the same subnet.

    They work very well for several weeks. But today, I had a problem connecting to the consoles of the virtual machines on one of our ESX host. After much troubleshooting, I found doc below...

    http://KB.VMware.com/selfservice/viewContent.do?language=en_US & externalId = 749640

    In point 8, it is said to make sure that you do not have 2 consoles of service on the same network. (Either by the way once I removed the backup vswitch I could access the consoles.)

    I so wanted to check this - should I not create these backup service consoles?

    TIA,

    H

    You don't have to second service console, just a second link to SC.

    Add a NIC to portgroup SC (it can be standby NIC), which would be enough.

    ---

    VMware vExpert 2009

    http://blog.vadmin.ru

  • best practices online redundant redologs

    DBS Oracle under Unix without ASM

    DBs some have oracle only available file system on the unix machine & have a single file redolog available online, I was wondering what would be the best practice them on redundant?

    I know that if I have multiple oracle file systems, I can extend their there. but with a single file system, I can create a redolog more and put it on the same file system.

    If you have a single file system or file systems normally makes no difference, but it is rather the disc behind the file systems that count. If two file systems are spread among the same disc which buy you two file systems. Oracle recommends that you multiplex online redo log files I know a shop that works with a single non-multiplied set of newspapers in restoration online and in 15 years they have never lost a. They use mirrored disks.

    It comes down to performance vs risk. What is the risk of losing a redo online newspapers verse how a load of performance having a cost fixed multiplex.

    HTH - Mark D Powell.

  • Measurement on the side time server? Best practices for the turn-based game

    Hello

    What would be the best practice for measuring time in a turn based game?

    I was looking at the timeout of the room, but to use that it would mean that, for each round, I put users in a new room?

    Is there a way where I can measure time serverside and keep users in the same room?

    If so, I could use php, otherwise, we would need java that allows to measure a time race.

    See you soon,.

    G

    Hello

    You can definitely use PHP or Java - we provide integration of server

    libraries for either. I don't know exactly what is the use case, so I can't

    comment on what makes the most sense, but if it is not information which must be

    totally secure, grading on the client can be a viable approach also.

    Nigel

  • Support/best practices to restore the application of planning between servers

    I have two servers with Hyperion Planning 9.3.1 (prod and dev) I want to copy the application called "BFS" Production of "NewBFS" - Dev server.

    As directed by our consultants, they said to do the following:

    1. backup the repository database that contains the application production BFS
    2 do a restore of the .bak file to "NewBFS" on the dev server database
    3. resync orphaned connections (from sql server connections and database connections)
    4 Ouvrezunesession planning via the default admin user ID
    5. go in the app's settings and change the URL
    6 enter the Shared Services URL
    7 manage the database
    8 check all the boxes and click Refresh
    9 go to SSP and resynchronize the native directory users

    However then try to connect in planning with something other than «admin", we receive an error «user xx is not configured...» »

    From my experience of db user tables are either still referencing production and/or do not have resynced correctly.

    If long story short... I can restore a planning application to another server, and if so what is the supported/best practices?

    Thank you

    JTS

    It is in the hyperion\planning\bin directory.

    Use :-updateusers.cmd serverName adminName password applicationName

    See you soon

    John
    http://John-Goodwin.blogspot.com/

Maybe you are looking for