Using target database control file instead of recovery catalogĬhannel ORA_DISK_1: SID=29 device type=DISKĬhannel ORA_DISK_1: starting archived log backup setĬhannel ORA_DISK_1: specifying archived log(s) in backup set All rights reserved.Ĭonnected to target database: CDB1 (DBID=797615285) SQL> SELECT output FROM all_scheduler_job_run_details WHERE job_name = 'JOB$_338' They also save you from having to use the DBMS_SCHEDULER.GET_FILE procedure to return the stdout/stderr from external jobs, as shown below. These are extremely useful for diagnosing problems during job runs, especially in dynamically created script jobs. The most important change to the scheduler views is the addition of the following columns to the _SCHEDULER_JOB_RUN_DETAILS views. The JOB_ACTION can specify an in-line backup script, or a full path to a backup script on the database server file system.ĬONN Create a job with an RMAN script defined in-line, The JOB_TYPE of BACKUP_SCRIPT runs the specified job as an RMAN script, without having to manually shell out to the operating system to run RMAN. These examples use an in-line definition of the SQL*Plus script in the JOB_ACTION parameter, but we could just as easily have used a pre-written script on the database server's file system.The database connection credential is associated with the job using the SET_ATTRIBUTE procedure, by specifying the CONNECT_CREDENTIAL_NAME attribute.When you create the credential for the database connection, you need to supply the relevant "tnsnames.ora" entry or you will have connection problems, especially on multitenant environments.The credential supplied in the CREATE_JOB command is the OS user that will run SQL*Plus, not the database connection credential.There are a few things to notice about these examples. Set the credential used for SQL*Plus to The credential supplied is the OS user that should using a credential, rather than an explicit connect. Create a job with a SQL*Plus script defined in-line, Notice the service is included in the username. To counter that, the SQL*Plus connection can be put into a credential itself, as shown in the following example.ĬONN Create a credential so SQL*Plus connects The previous script required an explicit connect, which is not very secure. Notice the explicit database connection in the script. The JOB_TYPE of SQL_SCRIPT runs the specified job as a SQL*Plus script, which means you get access to all the SQL*Plus functionality without having to manually shell out to the operating system and initiate SQL*Plus.ĬONN Create a job with a SQL*Plus script defined in-line, Notice the use of the credential, which indicates which OS user the script should run as, and provides authentication. L_job_name := DBMS_SCHEDULER.generate_job_name ĭBMS_OUTPUT.put_line('JOB_NAME=' || l_job_name) On UNIX/Linux servers the script is run using "sh", unless the first line of the script indicates a specific shell using a shebang, for example "#!/bin/bash".ĬONN Create a job with a shell script defined in-line. On Windows servers the script is run using "cmd.exe". It can also be used to run an existing script by specifying the full file system path to the script in the JOB_ACTION parameter. The JOB_TYPE of EXTERNAL_SCRIPT is similar to an EXECUTABLE job, except that it allows you to build a script on the fly and run it as the JOB_ACTION, as if it were an existing shell script. With these in place, we can look at the three new job scripts. correct OS user on the database server. The following permissions are necessary to allow the "TEST" user to run the examples in this article.Īll the examples use the following credential to allow them to authenticate to the OS user that runs the job.ĬONN Create a credential so script is run as the They will also need credentials to access an OS user. As a result, they require the CREATE JOB and CREATE EXTERNAL JOB privileges. They don't provide anything that was not already possible, but they reduce the likelihood of mistakes and make task-specific schedules much clearer.Īll three of the new script jobs are essentially external jobs for running shell scripts, SQL*Plus or RMAN. Script jobs are all about improving the ease of use of the Oracle Scheduler. DBMS_CREDENTIAL : Persist Database and OS Credentials in Oracle Database 12c Release 1 (12.1).Data Guard Database Rolling Upgrade Support. In Oracle Database 12c Release 1, the scheduler has added more functionality, with a focus on ease of use. The Oracle scheduler ( DBMS_SCHEDULER) has been enhanced with each release since it was introduced in Oracle 10g Release 1. Home » Articles » 12c » Here Scheduler (DBMS_SCHEDULER) Enhancements in Oracle Database 12c Release 1 (12.1)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |