Zum Inhalt springen
  • Von: DOAG Online
  • RedStack
  • 27.10.2017

RedStack Magazin Ausgabe 5/2017 jetzt online!

RedStack Magazin Ausgabe 5/2017 zum Thema NextGen Community steht ab sofort zum Download bereit.

Diese Ausgabe widmet sich dem Thema NextGen Community. Lesen Sie spannende Beiträge zum Thema von Tobias Deml, Dominik Notzon und vielen mehr. Weiterhin erhalten Sie in dieser Ausgabe Informationen zum Thema Datenbank und Entwicklung sowie Tipps & Tricks.

Zum Download

 

Listings, die in der Print-Ausgabe nicht mehr abgedruckt werden konnten:

 

Diaw
Listing 8 - 19

[root@standbyserver1 ~]# grep kerberos /etc/services

kerberos        88/tcp          kerberos5 krb5  # Kerberos v5

kerberos        88/udp          kerberos5 krb5  # Kerberos v5

kerberos-adm    749/tcp                         # Kerberos `kadmin' (v5)

kerberos-adm    749/udp                         # kerberos administration

kerberos-iv     750/udp         kerberos4 kerberos-sec kdc loadav

kerberos-iv     750/tcp         kerberos4 kerberos-sec kdc rfile

kerberos_master 751/udp         pump            # Kerberos authentication

kerberos_master 751/tcp         pump            # Kerberos authentication

[root@standbyserver1 ~]#

Listing 8

---

[root@standbyserver1 ~]# grep kerberos /etc/services

kerberos        88/tcp          kerberos5 krb5  # Kerberos v5

kerberos        88/udp          kerberos5 krb5  # Kerberos v5

kerberos-adm    749/tcp                         # Kerberos `kadmin' (v5)

kerberos-adm    749/udp                         # kerberos administration

kerberos-iv     750/udp         kerberos4 kerberos-sec kdc loadav

kerberos-iv     750/tcp         kerberos4 kerberos-sec kdc rfile

kerberos_master 751/udp         pump            # Kerberos authentication

kerberos_master 751/tcp         pump            # Kerberos authentication

[root@standbyserver1 ~]#

Listing 9

---

SQLNET.KERBEROS5_KEYTAB=/u01/app/kerberos/keytab

SQLNET.KERBEROS5_CONF=/u01/app/kerberos/krb5.conf

SQLNET.KERBEROS5_CONF_MIT=TRUE

SQLNET.AUTHENTICATION_KERBEROS5_SERVICE=oracle  

SQLNET.AUTHENTICATION_SERVICES=(BEQ,KERBEROS5)

Listing 9

---

SQLNET.KERBEROS5_KEYTAB=/u01/app/kerberos/keytab

SQLNET.KERBEROS5_CONF=/u01/app/kerberos/krb5.conf

SQLNET.KERBEROS5_CONF_MIT=TRUE

SQLNET.AUTHENTICATION_KERBEROS5_SERVICE=oracle  

SQLNET.AUTHENTICATION_SERVICES=(BEQ,KERBEROS5)

Listing 10

---

SQLNET.KERBEROS5_CC_NAME=c:\kerberos\cc

SQLNET.AUTHENTICATION_SERVICES= (beq,kerberos5)

SQLNET.KERBEROS5_CONF =c:\kerberos\krb5.conf

SQLNET.KERBEROS5_CONF_MIT = true

Listing 11

---

C:\Users\activediroracle>okinit

 

Kerberos Utilities for 64-bit Windows: Version 12.2.0.1.0 - Production on 03-JUN-2017 07:47:07

 

Configuration file : c:\kerberos\krb5.conf.

Password for activediroracle@SUMADOMAIN.COM:

Listing 12

---

C:\Users\activediroracle>oklist

 

Kerberos Utilities for 64-bit Windows: Version 12.2.0.1.0 - Production on 03-JUN-2017 07:50:24

 

Copyright (c) 1996, 2016 Oracle.  All rights reserved.

 

Configuration file : c:\kerberos\krb5.conf.

Ticket cache: FILE:c:\kerberos\cc

Default principal: activediroracle@SUMADOMAIN.COM

 

Valid starting     Expires            Service principal

06/03/17 07:47:29  06/03/17 17:47:29  krbtgt/SUMADOMAIN.COM@SUMADOMAIN.COM

        renew until 06/04/17 07:47:07

Listing 13

---

C:\Users\activediroracle>oklist

 

Kerberos Utilities for 64-bit Windows: Version 12.2.0.1.0 - Production on 03-JUN-2017 07:50:24

 

Copyright (c) 1996, 2016 Oracle.  All rights reserved.

 

Configuration file : c:\kerberos\krb5.conf.

Ticket cache: FILE:c:\kerberos\cc

Default principal: activediroracle@SUMADOMAIN.COM

 

Valid starting     Expires            Service principal

06/03/17 07:47:29  06/03/17 17:47:29  krbtgt/SUMADOMAIN.COM@SUMADOMAIN.COM

        renew until 06/04/17 07:47:07

Listing 14

---

SQLNET.KERBEROS5_CC_NAME= OSMSFT://

SQLNET.AUTHENTICATION_SERVICES= (beq,kerberos5)

SQLNET.KERBEROS5_CONF =c:\kerberos\krb5.conf

SQLNET.KERBEROS5_CONF_MIT = true

Listing 15

---

C:\Users\activediroracle> C:\app\oracle\product\12.2.0\client_1\bin\oklist

 

Kerberos Utilities for 64-bit Windows: Version 12.2.0.1.0 –

 

Configuration file : c:\kerberos\krb5.conf.

oklist: Unknown credential cache type resolving ccache OSMSFT://.

Listing 16

---

C:\Users\activediroracle> C:\app\oracle\product\12.2.0\client_1\bin\sqlplus /@PROD

 

SQL*Plus: Release 12.2.0.1.0 Production on Sat Jun 3 15:42:56 2017

 

ERROR:

ORA-12641: Authentication service failed to initialize

Listing 17

---

C:\Users\activediroracle> C:\app\oacle\product\11.2.0\client_1\bin\oklist

 

Kerberos Utilities for 64-bit Windows: Version 11.2.0.4.0 - Production on 03-JUN-2017 15:33:39

 

Copyright (c) 1996, 2010 Oracle.  All rights reserved.

 

Ticket cache: win2kcc

Default principal: activediroracle@SUMADOMAIN.COM

 

   Valid Starting           Expires            Principal

03-Jun-2017 14:44:15  04-Jun-2017 00:44:15  krbtgt/SUMADOMAIN.COM@SUMADOMAIN.COM        renew until 10-Jun-2017 14:44:15

03-Jun-2017 15:26:06  04-Jun-2017 00:44:15  oracle/standbyserver1.localdomain@SUMADOMAIN.COM    renew until 10-Jun-2017 14:44:15

03-Jun-2017 14:44:32  04-Jun-2017 00:44:15  LDAP/bourdjoloff.sumadomain.com/sumadomain.com@SUMADOMAIN.COM       renew until 10-Jun-2017 14:44:15

03-Jun-2017 14:44:15  04-Jun-2017 00:44:15  host/djoloffclient.sumadomain.com@SUMADOMAIN.COM    renew until 10-Jun-2017 14:44:15

Listing 18

---

C:\Users\activediroracle> C:\app\oacle\product\11.2.0\client_1\bin\sqlplus.exe /@PROD

 

SQL*Plus: Release 11.2.0.4.0 Production on Sat Jun 3 15:44:26 2017

 

Connected to:

Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

 

SQL> show user

USER is "ACTIVEDIRORACLE@SUMADOMAIN.COM"

Listing 19

 

Beetz

Listing 4

CREATE OR REPLACE PROCEDURE pr_expdp (

    p_dir_name   VARCHAR2

) AS

 

  -- Job Handle

    l_job_handle     NUMBER;

    l_job_handle_2   NUMBER;

 

  -- Job Status

    l_job_status     user_datapump_jobs.state%type;

    l_job_status_2   user_datapump_jobs.state%type;

 

 

  -- Single Quote

    quote            VARCHAR2(1) := chr(39);

    v_query_str      VARCHAR2(1000);

    v_scn            NUMBER;

    le               ku$_logentry;  -- For WIP and error messages

    js               ku$_jobstatus; -- The job status from get_status

    jd               ku$_jobdesc;   -- The job description from get_status

    sts              ku$_status;   -- The status object returned by get_status

    file_name        VARCHAR2(32);

    log_name         VARCHAR2(32);

BEGIN

    file_name := 'FULL.dmp';

    log_name := 'FULL.log';

    v_query_str := 'select CURRENT_SCN from v$database' ;

    EXECUTE IMMEDIATE v_query_str INTO

        v_scn;

    dbms_output.put_line(

        v_scn

    );

    l_job_handle := dbms_datapump.open(

        operation => 'EXPORT',

        job_mode  => 'FULL',

        job_name  => 'FULL_JOB_999'

        );

    dbms_datapump.add_file(

        handle      => l_job_handle,

        filename    => log_name,

        reusefile   => 1,

        directory   => p_dir_name,

        filetype    => dbms_datapump.ku$_file_type_log_file

    );

 

    dbms_datapump.add_file(

        handle      => l_job_handle,

        filename    => file_name,

        reusefile   => 1,

        directory   => p_dir_name,

        filetype    => dbms_datapump.ku$_file_type_dump_file

    );

 

    dbms_datapump.set_parameter(

        l_job_handle,

    'FLASHBACK_SCN',v_scn);

  -- Einschraenkung auf das zu kopierende Schema

    dbms_datapump.metadata_filter(

        handle => l_job_handle,

        name   => 'NAME_EXPR',

        value  =>   ' not in (''SOE'') ',

        object_type => 'SCHEMA'

    );

    file_name := 'SOE.dmp';

    log_name := 'SOE.log';

 

 

  -- Erstellen eines Import-Jobs

    l_job_handle_2 := dbms_datapump.open(

       operation =>  'EXPORT',

       job_mode  =>  'SCHEMA',

       job_name  =>  'SOE_JOB_999'

     );

  -- Um konsistent zu kopieren,wird die aktuelle

  -- System Change Number ermittelt und geesetzt

    dbms_datapump.set_parameter(

        l_job_handle_2,

    'FLASHBACK_SCN',v_scn);

 

    dbms_datapump.add_file(

        handle      => l_job_handle_2,

        filename    => log_name,

        reusefile   => 1,

        directory   => p_dir_name,

        filetype    => dbms_datapump.ku$_file_type_log_file

    );

 

    dbms_datapump.add_file(

        handle      => l_job_handle_2,

        filename    => file_name,

        reusefile   => 1,

        directory   => p_dir_name,

        filetype    => dbms_datapump.ku$_file_type_dump_file

    );

 

 

  -- Einschraenkung auf das zu kopierende Schema

    dbms_datapump.metadata_filter(

        l_job_handle_2,

        'SCHEMA_EXPR',

           ' IN (''SOE'') '

    );

    dbms_datapump.start_job(

        l_job_handle

    );

    dbms_datapump.detach(

        l_job_handle

    );

   

    dbms_datapump.start_job(

        l_job_handle_2

    );

    dbms_datapump.detach(

        l_job_handle_2

    );   

 

END;



Keydana

PDF Grundlagen