Ok

En poursuivant votre navigation sur ce site, vous acceptez l'utilisation de cookies. Ces derniers assurent le bon fonctionnement de nos services. En savoir plus.

Expertise en SGBDR - Page 38

  • Modification de structure avec ajout de colonne et FK.

    alter table bref.FA_FAISCEAU add LOT_CHEMISE VARCHAR2(25 BYTE) CONSTRAINT FK13_FA_FAISCEAU REFERENCES bref.FA_CHEMISE (LOT);
    alter table bref.FA_FAISCEAU add LOT_FILTRE_EVENT VARCHAR2(25 BYTE) CONSTRAINT FK14_FA_FAISCEAU REFERENCES bref.FA_FILTRE_EVENT (LOT);

  • Lancement de pgAdmin4

    (pgadmin4) titi@serveur:~/home-global/virtualenv/myVE/lib/python2.7/site-packages/pgadmin4/pgadmin4/lib/python2.7$ 
    cd /home/titi/home-global/virtualenv/myVE/lib/python2.7/site-packages/pgadmin4/


    (pgadmin4) titi@serveur:~/home-global/virtualenv/myVE/lib/python2.7/site-packages/pgadmin4$ python pgAdmin4.py
    pgAdmin 4 - Application Initialisation
    ======================================


    The configuration database - '/home/titi/.pgadmin/pgadmin4.db' does not exist.
    Entering initial setup mode...
    NOTE: Configuring authentication for SERVER mode.


    Enter the email address and password to use for the initial pgAdmin user account:

    Email address: josselin_joly@hotmail.com
    Password:
    Retype password: 

    The configuration database has been created at /home/titi/.pgadmin/pgadmin4.db
    Starting pgAdmin 4. Please navigate to http://localhost:5050 in your browser.

     

    Aide : https://stackoverflow.com/questions/41260004/error-trying-to-run-pgadmin4

  • .pgpass

    Utilisation du .pgpass :

    https://newfivefour.com/postgresql-pgpass-password-file.html

     

    attention l'utilisation du .pgpass ne fonctionne pas avec une connexion LDAP :

    psql: FATAL:  authentification LDAP échouée pour l'utilisateur « titi»

     

     

     

  • Redéfinir les droits après une restauration de schéma

    Après une restauration de schéma il faut redéfinir les droits des autres rôles et utilisateurs qui pointent vers ce schéma.

     

    Exemple concret :

     

    1 - je restaure le schéma TOTO. Il faut alors :

    2 - select 'grant select on '||owner||'.'||table_name|| ' to ROLE_SELECT_TOTO; ' from dba_tables where owner='TOTO';

    3- grant ROLE_SELECT_TOTO to <username>;

  • oratab -> dbhome

    Tout est dans le titre...

     

    Si vous ne paramétrez pas correctement votre oratab , la commande dbhome $ORACLE_SID retourne de la merde !

  • Prochaine sortie

    Qui m'aime me suive! contact en commentaire !

     

    http://www.lemaspuyricard.fr/index.php/blog/user-page

  • Suppression d'object sys

    Il se peut que vous ayez créé sans le vouloir des objets dans le schéma sys.

     

    Pour les supprimer faites comme cela :

     


    select 'drop procedure '||object_name||' ;' from dba_objects
    where
    to_date(created) ='19/10/17' and
     object_type='PROCEDURE'
    and owner='SYS';

  • Créer une base de dev

    1-export des schémas :

    expdp system/********* directory=DUMPDIR dumpfile=content.dat logfile=content.log schemas=sche1,sche2,sch3 ... content=METADATA_ONLY exclude=statistics

    2- import du ddl dans le fichier sql.dat (lisible au format txt)

    impdp directory=DUMPDIR sqlfile=sql.dat logfile=sql.log dumpfile=content.dat