• RE: SCHEMA

    You are right. One of the main advantages of having a schema is for security reasons.

    There are different rights that you can grant on objects to each user.

    That is a lot of work to keep track of who can do what in the database.

    An easy way to handle this is to put some of the tables and other objects

    inside a schema and then grant rights on the schema ( and the things inside the schema will automatically receive the same rights )

    Example: Lets say you want to donate certain items in your home.

    Instead of having to put labels in each of them saying that it is free,

    just put all of them inside a box and have one big label that says

    "Free". So the big box is the schema.

    Without this big box you would have to do a lot of work having to

    label each item as "Free".

    Makes sense ?

    The following command gives exclusive rights to Danny to

    visit the schema. Just one sentence and you don't have to bother

    what Danny can do with the objects inside the schema. Why? Because you already gave the righst to the "SCHEMA" when you created it ( assuming you did ).

    ALTER USER Danny WITH DEFAULT_SCHEMA=HumanResources